[functional-tests/regex] tweak definition of rx
This commit is contained in:
parent
c049ec6f39
commit
87b3556d36
@ -367,13 +367,11 @@
|
|||||||
|
|
||||||
;; rx := simple-rx ("|" simple-rx)*
|
;; rx := simple-rx ("|" simple-rx)*
|
||||||
(define (rx)
|
(define (rx)
|
||||||
(define (combine rs)
|
(p:lift2 (lambda (r rs)
|
||||||
(fold-left alt (car rs) (cdr rs)))
|
(fold-left alt r rs))
|
||||||
|
(simple-rx)
|
||||||
(p:parse-m (p:<- r (simple-rx))
|
(p:many* (p:>> (p:lit "|")
|
||||||
(p:<- rest (p:many* (p:>> (p:lit "|")
|
(simple-rx)))))
|
||||||
(simple-rx))))
|
|
||||||
(p:pure (combine (cons r rest)))))
|
|
||||||
|
|
||||||
;;-----------------------------------------------------------------------
|
;;-----------------------------------------------------------------------
|
||||||
;; The top level routine, parses the regex string and compiles it into a
|
;; The top level routine, parses the regex string and compiles it into a
|
||||||
|
Loading…
x
Reference in New Issue
Block a user