dev-srcloc
Matthew Butterick 8 years ago
parent 71ace522c6
commit 960c721e30

@ -25,15 +25,15 @@
[(from/to "@$" "$@") [(from/to "@$" "$@")
(token 'SEXP-TOK (trim-ends "@$" lexeme "$@") (token 'SEXP-TOK (trim-ends "@$" lexeme "$@")
#:line (line lexeme-start) #:line (line lexeme-start)
#:column (+ (column lexeme-start) 2) #:column (+ (col lexeme-start) 2)
#:position (+ (position lexeme-start) 2) #:position (+ (pos lexeme-start) 2)
#:span (- (span lexeme-start lexeme-end) 4))] #:span (- (span lexeme-start lexeme-end) 4))]
[any-char (token 'CHAR-TOK lexeme [any-char (token 'CHAR-TOK lexeme
#:line (line lexeme-start) #:line (line lexeme-start)
#:column (column lexeme-start) #:column (col lexeme-start)
#:position (position lexeme-start) #:position (pos lexeme-start)
#:span (- (position lexeme-end) #:span (- (pos lexeme-end)
(position lexeme-start)))])) (pos lexeme-start)))]))
(our-lexer port)) (our-lexer port))
next-token) next-token)
(provide tokenize) (provide tokenize)
@ -44,7 +44,7 @@
(check-equal? (check-equal?
(apply-tokenizer tokenize "@$ (+ 6 7) $@") (apply-tokenizer tokenize "@$ (+ 6 7) $@")
(list (token 'SEXP-TOK " (+ 6 7) " (list (token 'SEXP-TOK " (+ 6 7) "
#:line 1 #:line 11
#:column 2 #:column 2
#:position 3 #:position 3
#:span 9))) #:span 9)))

Loading…
Cancel
Save