mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-13 23:20:32 +02:00
docstrings in syntax-rules
* module/ice-9/psyntax.scm (syntax-rules): Allow a docstring between the literals and the first clause.
This commit is contained in:
parent
e9729cbb2c
commit
44d65b23ce
1 changed files with 10 additions and 0 deletions
|
@ -2607,6 +2607,16 @@
|
||||||
((_ (k ...) ((keyword . pattern) template) ...)
|
((_ (k ...) ((keyword . pattern) template) ...)
|
||||||
#'(lambda (x)
|
#'(lambda (x)
|
||||||
;; embed patterns as procedure metadata
|
;; embed patterns as procedure metadata
|
||||||
|
#((macro-type . syntax-rules)
|
||||||
|
(patterns pattern ...))
|
||||||
|
(syntax-case x (k ...)
|
||||||
|
((dummy . pattern) #'template)
|
||||||
|
...)))
|
||||||
|
((_ (k ...) docstring ((keyword . pattern) template) ...)
|
||||||
|
(string? (syntax->datum #'docstring))
|
||||||
|
#'(lambda (x)
|
||||||
|
;; the same, but allow a docstring
|
||||||
|
docstring
|
||||||
#((macro-type . syntax-rules)
|
#((macro-type . syntax-rules)
|
||||||
(patterns pattern ...))
|
(patterns pattern ...))
|
||||||
(syntax-case x (k ...)
|
(syntax-case x (k ...)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue