mirror of
https://codeberg.org/guix/guix.git
synced 2025-10-02 02:15:12 +00:00
style: Allow special forms to be scoped.
* guix/scripts/style.scm (vhashq): Add clause for 'lst, and change default clause. (%special-forms): Add context for 'add-after and 'add-before. Add 'replace. (prefix?, special-form-lead): New procedures. (special-form?): Remove. (pretty-print-with-comments): Add 'context' to the threaded state. Adjust 'print-sequence' and adjust 'loop' calls accordingly. * tests/style.scm: Add tests for 'replace.
This commit is contained in:
parent
97d0055edb
commit
208a7aa17b
2 changed files with 73 additions and 27 deletions
|
@ -453,6 +453,18 @@ mnopqrstuvwxyz.\")"
|
|||
\"abcdefghijklmnopqrstuvwxyz\")"
|
||||
#:max-width 33)
|
||||
|
||||
(test-pretty-print "\
|
||||
(modify-phases %standard-phases
|
||||
(replace 'build
|
||||
;; Nicely indented in 'modify-phases' context.
|
||||
(lambda _
|
||||
#t)))")
|
||||
|
||||
(test-pretty-print "\
|
||||
(modify-inputs inputs
|
||||
;; Regular indentation for 'replace' here.
|
||||
(replace \"gmp\" gmp))")
|
||||
|
||||
(test-end)
|
||||
|
||||
;; Local Variables:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue