style: Allow special forms to be scoped.
authorLudovic Courtès <ludo@gnu.org>
Mon, 3 Jan 2022 08:05:54 +0000 (09:05 +0100)
committerLudovic Courtès <ludo@gnu.org>
Mon, 10 Jan 2022 13:25:59 +0000 (14:25 +0100)
commit208a7aa17b101083bd9969fec9ca4e2dca37b3af
treec90838ec92ba5b0a5726055f065877d5394b9958
parent97d0055edb9a8b9b59ede254ce8ef1f255558802
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.
guix/scripts/style.scm
tests/style.scm