[functional-tests/regex] reorder definition of rx
This commit is contained in:
parent
761c655035
commit
14d1751022
@ -326,6 +326,14 @@
|
|||||||
;;-----------------------------------------------------------
|
;;-----------------------------------------------------------
|
||||||
;; Higher level combinators, these build a symbolic rx
|
;; Higher level combinators, these build a symbolic rx
|
||||||
|
|
||||||
|
;; There's mutual recursion here which would send the combinators into an
|
||||||
|
;; infinite loop whilst they are being built (not during parsing). So we hot
|
||||||
|
;; patch rx, making it available for construction, and then redefine it on
|
||||||
|
;; first use.
|
||||||
|
(define rx
|
||||||
|
(indirect-lambda ()
|
||||||
|
(p:error-m "rx not bound")))
|
||||||
|
|
||||||
;; group := "(" rx ")"
|
;; group := "(" rx ")"
|
||||||
(define group
|
(define group
|
||||||
(bracket (p:lit "(")
|
(bracket (p:lit "(")
|
||||||
@ -356,14 +364,6 @@
|
|||||||
(define simple-rx
|
(define simple-rx
|
||||||
(p:lift combine (p:many+ basic-rx)))
|
(p:lift combine (p:many+ basic-rx)))
|
||||||
|
|
||||||
;; There's mutual recursion here which would send the combinators into an
|
|
||||||
;; infinite loop whilst they are being built (not during parsing). So we hot
|
|
||||||
;; patch rx, making it available for construction, and then redefine it on
|
|
||||||
;; first use.
|
|
||||||
(define rx
|
|
||||||
(indirect-lambda ()
|
|
||||||
(p:error-m "rx not bound")))
|
|
||||||
|
|
||||||
;; rx := simple-rx ("|" simple-rx)*
|
;; rx := simple-rx ("|" simple-rx)*
|
||||||
(define hotpatch-rx
|
(define hotpatch-rx
|
||||||
(let ((patched #f))
|
(let ((patched #f))
|
||||||
|
Loading…
Reference in New Issue
Block a user