From 14d1751022285d302152bfc2eee13b423dc1b35b Mon Sep 17 00:00:00 2001 From: Joe Thornber Date: Tue, 29 Aug 2017 13:24:11 +0100 Subject: [PATCH] [functional-tests/regex] reorder definition of rx --- functional-tests/regex.scm | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/functional-tests/regex.scm b/functional-tests/regex.scm index 59f085c..72cc3be 100644 --- a/functional-tests/regex.scm +++ b/functional-tests/regex.scm @@ -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))