summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2011-02-18 10:53:18 +0100
committerNoah Lavine <nlavine@haverford.edu>2011-09-05 21:50:58 -0400
commitc8c3c419bb94bb2b2f641ae58704f0851a6c03d1 (patch)
treed31f24ac7f44e24c9a237eecccaff7d3d2fe4e99
parent42e66235ad6119d5b374933c0c451d66d5873982 (diff)
downloadguile-c8c3c419bb94bb2b2f641ae58704f0851a6c03d1.tar.gz
peg: cg-peg-any does not use cggl
* module/ice-9/peg.scm (cg-peg-any): Don't use cggl.
-rw-r--r--module/ice-9/peg.scm9
1 files changed, 5 insertions, 4 deletions
diff --git a/module/ice-9/peg.scm b/module/ice-9/peg.scm
index 041636d0c..555ad854f 100644
--- a/module/ice-9/peg.scm
+++ b/module/ice-9/peg.scm
@@ -152,10 +152,11 @@ return EXP."
;; Generates code for matching any character.
;; E.g.: (cg-peg-any syntax 'body)
(define (cg-peg-any for-syntax accum)
- (cggl for-syntax #'str #'strlen #'at
- (cggr for-syntax accum
- 'cg-peg-any #`(substring str at (+ at 1))
- #`(+ at 1))))
+ #`(lambda (str len pos)
+ (and (< pos len)
+ #,(cggr for-syntax accum
+ 'cg-peg-any #`(substring str pos (+ pos 1))
+ #`(+ pos 1)))))
;; Generates code for matching a range of characters between start and end.
;; E.g.: (cg-range syntax #\a #\z 'body)