From 83128f00e9149f3c1bcd4450eb0ed3620a37149c Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Thu, 16 Mar 2023 22:18:52 +0100 Subject: read-print: 'read-with-comments' reads comments within gexps. Fixes . Reported by Maxim Cournoyer . * guix/read-print.scm (read-with-comments): Special-case #~, #$, and #+. * tests/read-print.scm: Add two tests. --- tests/read-print.scm | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'tests/read-print.scm') diff --git a/tests/read-print.scm b/tests/read-print.scm index 952b3e6585..f4627e076a 100644 --- a/tests/read-print.scm +++ b/tests/read-print.scm @@ -231,6 +231,21 @@ mnopqrstuvwxyz.\")" ;; Regular indentation for 'replace' here. (replace \"gmp\" gmp))") +(test-pretty-print "\ +#~(modify-phases phases + (add-after 'whatever 'something-else + (lambda _ + ;; This comment appears inside a gexp. + 42)))") + +(test-pretty-print "\ +#~(list #$@(list coreutils ;yup + grep) ;margin comment + #+sed + + ;; Line comment. + #$grep)") + (test-pretty-print "\ (package ;; Here 'sha256', 'base32', and 'arguments' must be -- cgit v1.2.3