You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
14 lines
370 B
Racket
14 lines
370 B
Racket
#lang br/quicklang
|
|
(require brag/support)
|
|
|
|
(define (make-tokenizer port)
|
|
(define (next-token)
|
|
(define jsonic-lexer
|
|
(lexer
|
|
[(from/to "//" "\n") (next-token)]
|
|
[(from/to "@$" "$@")
|
|
(token 'SEXP-TOK (trim-ends "@$" lexeme "$@"))]
|
|
[any-char (token 'CHAR-TOK lexeme)]))
|
|
(jsonic-lexer port))
|
|
next-token)
|
|
(provide make-tokenizer) |