[functional-tests/regex] reorder definition of rx

This commit is contained in:
Joe Thornber 2017-08-29 13:24:11 +01:00
parent 761c655035
commit 14d1751022
1 changed files with 8 additions and 8 deletions

View File

@ -326,6 +326,14 @@
;;-----------------------------------------------------------
;; 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 ")"
(define group
(bracket (p:lit "(")
@ -356,14 +364,6 @@
(define simple-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)*
(define hotpatch-rx
(let ((patched #f))