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

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

@ -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

Loading…
Cancel
Save