mirror of
https://git.savannah.gnu.org/git/guix.git
synced 2026-04-06 21:20:33 +02:00
read-print: Define forms for which \n, \t, etc. are not escaped.
Previously, the pretty-printer would unconditionally leave everything but double-quotes and backslashes unescaped when rendering a string. With this change, the previous behavior only applies to forms listed in %NATURAL-WHITESPACE-STRING-FORMS. * guix/read-print.scm (%natural-whitespace-string-forms): New variable. (printed-string): New procedure. (pretty-print-with-comments): Use it instead of 'escaped-string'. * tests/read-print.scm: Add test.
This commit is contained in:
@@ -186,6 +186,9 @@ expressions."
|
||||
(lambda _
|
||||
xyz))))")
|
||||
|
||||
(test-pretty-print "\
|
||||
(string-append \"a\\tb\" \"\\n\")")
|
||||
|
||||
(test-pretty-print "\
|
||||
(description \"abcdefghijkl
|
||||
mnopqrstuvwxyz.\")"
|
||||
|
||||
Reference in New Issue
Block a user