1
0
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:
Ludovic Courtès
2023-03-07 11:31:12 +01:00
parent 11f6bdc547
commit 0a37921d85
2 changed files with 17 additions and 1 deletions

View File

@@ -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