mirror of
https://codeberg.org/guix/guix.git
synced 2025-10-02 02:15:12 +00:00
read-print: Correctly support multiple same-named newline forms.
Previously (home-environment (services ...)) would not be considered a "newline form". This fixes it. * guix/read-print.scm (newline-form?): Use 'vhash-foldq*' instead of 'vhash-assq' and iterate over candidates. * tests/read-print.scm: Add test.
This commit is contained in:
parent
818220f1cc
commit
7a698da0d0
2 changed files with 8 additions and 4 deletions
|
@ -367,10 +367,9 @@ surrounding SYMBOL."
|
|||
(define (newline-form? symbol context)
|
||||
"Return true if parenthesized expressions starting with SYMBOL must be
|
||||
followed by a newline."
|
||||
(match (vhash-assq symbol %newline-forms)
|
||||
(#f #f)
|
||||
((_ . prefix)
|
||||
(prefix? prefix context))))
|
||||
(let ((matches (vhash-foldq* cons '() symbol %newline-forms)))
|
||||
(find (cut prefix? <> context)
|
||||
matches)))
|
||||
|
||||
(define (escaped-string str)
|
||||
"Return STR with backslashes and double quotes escaped. Everything else, in
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue