mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-09 13:30:26 +02:00
peg: hygiene in cg-range
* module/ice-9/peg.scm (cg-range): Use cggl-syn and cggr-syn.
This commit is contained in:
parent
febe6dadab
commit
8b52357e88
1 changed files with 8 additions and 8 deletions
|
@ -224,14 +224,14 @@
|
|||
(strlen (syntax strlen))
|
||||
(at (syntax at))
|
||||
(c (syntax c)))
|
||||
(datum->syntax for-syntax
|
||||
(cggl for-syntax str strlen at
|
||||
`(let ((,c (string-ref ,str ,at)))
|
||||
(if (and
|
||||
(char>=? ,c ,start)
|
||||
(char<=? ,c ,end))
|
||||
,(cggr for-syntax accum 'cg-range `(string ,c) `(+ ,at 1))
|
||||
#f))))))
|
||||
(cggl-syn for-syntax str strlen at
|
||||
#`(let ((#,c (string-ref #,str #,at)))
|
||||
(if (and
|
||||
(char>=? #,c #,start)
|
||||
(char<=? #,c #,end))
|
||||
#,(cggr-syn for-syntax accum 'cg-range
|
||||
#`(string #,c) #`(+ #,at 1))
|
||||
#f)))))
|
||||
|
||||
;; Filters the accum argument to peg-sexp-compile for buildings like string
|
||||
;; literals (since we don't want to tag them with their name if we're doing an
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue