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.
beautiful-racket/beautiful-racket-demo/jsonic-demo/tokenizer.rkt

15 lines
389 B
Racket

#lang br/quicklang
(require brag/support)
(define (make-tokenizer port)
(define (next-token)
(define jsonic-lexer
(lexer
[(eof) eof]
[(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)