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))
|
(strlen (syntax strlen))
|
||||||
(at (syntax at))
|
(at (syntax at))
|
||||||
(c (syntax c)))
|
(c (syntax c)))
|
||||||
(datum->syntax for-syntax
|
(cggl-syn for-syntax str strlen at
|
||||||
(cggl for-syntax str strlen at
|
#`(let ((#,c (string-ref #,str #,at)))
|
||||||
`(let ((,c (string-ref ,str ,at)))
|
(if (and
|
||||||
(if (and
|
(char>=? #,c #,start)
|
||||||
(char>=? ,c ,start)
|
(char<=? #,c #,end))
|
||||||
(char<=? ,c ,end))
|
#,(cggr-syn for-syntax accum 'cg-range
|
||||||
,(cggr for-syntax accum 'cg-range `(string ,c) `(+ ,at 1))
|
#`(string #,c) #`(+ #,at 1))
|
||||||
#f))))))
|
#f)))))
|
||||||
|
|
||||||
;; Filters the accum argument to peg-sexp-compile for buildings like string
|
;; 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
|
;; 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