improve `from/stop-before` and `from/to`

pull/6/head
Matthew Butterick 7 years ago
parent 9aad4b0f24
commit 9a5177f7e4

@ -104,15 +104,15 @@
(λ(stx) (λ(stx)
(syntax-case stx () (syntax-case stx ()
[(_ OPEN CLOSE) [(_ OPEN CLOSE)
;; (:seq any-string CLOSE any-string) pattern makes it non-greedy #'(:seq (from/stop-before OPEN CLOSE) CLOSE)])))
#'(:seq OPEN (complement (:seq any-string CLOSE any-string)) CLOSE)])))
(provide from/stop-before) (provide from/stop-before)
(define-lex-trans from/stop-before (define-lex-trans from/stop-before
(λ(stx) (λ(stx)
(syntax-case stx () (syntax-case stx ()
[(_ OPEN CLOSE) [(_ 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) (provide uc+lc)
(define-lex-trans uc+lc (define-lex-trans uc+lc

Loading…
Cancel
Save