From 9a5177f7e4c666621379a91986895022d6515ea3 Mon Sep 17 00:00:00 2001 From: Matthew Butterick Date: Mon, 21 May 2018 19:43:27 -0700 Subject: [PATCH] improve `from/stop-before` and `from/to` --- brag/brag/support.rkt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/brag/brag/support.rkt b/brag/brag/support.rkt index 232fbf4..1af6ddf 100755 --- a/brag/brag/support.rkt +++ b/brag/brag/support.rkt @@ -104,15 +104,15 @@ (λ(stx) (syntax-case stx () [(_ OPEN CLOSE) - ;; (:seq any-string CLOSE any-string) pattern makes it non-greedy - #'(:seq OPEN (complement (:seq any-string CLOSE any-string)) CLOSE)]))) + #'(:seq (from/stop-before OPEN CLOSE) CLOSE)]))) (provide from/stop-before) (define-lex-trans from/stop-before (λ(stx) (syntax-case stx () [(_ OPEN CLOSE) - #'(:seq OPEN (:* (:~ CLOSE)))]))) + ;; (:seq any-string CLOSE any-string) pattern makes it non-greedy + #'(:seq OPEN (complement (:seq any-string CLOSE any-string)))]))) (provide uc+lc) (define-lex-trans uc+lc