|
|
@ -9,8 +9,8 @@
|
|
|
|
token
|
|
|
|
token
|
|
|
|
[struct-out exn:fail:parsing]
|
|
|
|
[struct-out exn:fail:parsing]
|
|
|
|
apply-tokenizer
|
|
|
|
apply-tokenizer
|
|
|
|
trim-delimiters
|
|
|
|
trim-ends
|
|
|
|
delimited-by)
|
|
|
|
between)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(struct token-struct (type val offset line column span skip?)
|
|
|
|
(struct token-struct (type val offset line column span skip?)
|
|
|
@ -50,10 +50,10 @@
|
|
|
|
(for/list ([token (in-producer token-producer eof)])
|
|
|
|
(for/list ([token (in-producer token-producer eof)])
|
|
|
|
token))
|
|
|
|
token))
|
|
|
|
|
|
|
|
|
|
|
|
(define (trim-delimiters left lexeme right)
|
|
|
|
(define (trim-ends left lexeme right)
|
|
|
|
(string-trim (string-trim lexeme left #:right? #f) right #:left? #f))
|
|
|
|
(string-trim (string-trim lexeme left #:right? #f) right #:left? #f))
|
|
|
|
|
|
|
|
|
|
|
|
(define-lex-trans delimited-by
|
|
|
|
(define-lex-trans between
|
|
|
|
(λ(stx)
|
|
|
|
(λ(stx)
|
|
|
|
(syntax-case stx ()
|
|
|
|
(syntax-case stx ()
|
|
|
|
[(_ OPEN CLOSE)
|
|
|
|
[(_ OPEN CLOSE)
|
|
|
|