mirror of
https://git.savannah.gnu.org/git/guix.git
synced 2026-04-06 21:20:33 +02:00
read-print: Correctly handle comments that follow a list head.
Fixes <https://issues.guix.gnu.org/61013>. Reported by Maxim Cournoyer <maxim.cournoyer@gmail.com>. * guix/read-print.scm (pretty-print-with-comments)[starts-with-line-comment?]: New procedure. Use it when printing a list. * tests/read-print.scm: Add two tests.
This commit is contained in:
@@ -210,6 +210,15 @@ mnopqrstuvwxyz.\")"
|
||||
\"abcdefghijklmnopqrstuvwxyz\")"
|
||||
#:max-width 33)
|
||||
|
||||
(test-pretty-print "\
|
||||
(list ;margin comment
|
||||
a b c)")
|
||||
|
||||
(test-pretty-print "\
|
||||
(list
|
||||
;; This is a line comment immediately following the list head.
|
||||
#:test-flags #~(list \"-m\" \"not external and not samples\"))")
|
||||
|
||||
(test-pretty-print "\
|
||||
(modify-phases %standard-phases
|
||||
(replace 'build
|
||||
|
||||
Reference in New Issue
Block a user