From 3347a86c0dc0e51d30c2173474c4e049a07553e5 Mon Sep 17 00:00:00 2001 From: Matthew Butterick Date: Sat, 28 Jan 2017 10:21:36 -0800 Subject: [PATCH] update reader & tokenizer --- beautiful-racket-demo/jsonic-demo/reader.rkt | 2 +- beautiful-racket-demo/jsonic-demo/tokenizer.rkt | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/beautiful-racket-demo/jsonic-demo/reader.rkt b/beautiful-racket-demo/jsonic-demo/reader.rkt index 1e755f5..5088631 100644 --- a/beautiful-racket-demo/jsonic-demo/reader.rkt +++ b/beautiful-racket-demo/jsonic-demo/reader.rkt @@ -2,7 +2,7 @@ (require "tokenizer.rkt" "parser.rkt") (define (read-syntax path port) - (define parse-tree (parse path (tokenize port))) + (define parse-tree (parse path (make-tokenizer port))) (define module-datum `(module jsonic-module jsonic-demo/expander ,parse-tree)) (datum->syntax #f module-datum)) diff --git a/beautiful-racket-demo/jsonic-demo/tokenizer.rkt b/beautiful-racket-demo/jsonic-demo/tokenizer.rkt index d8d3a4f..2565599 100644 --- a/beautiful-racket-demo/jsonic-demo/tokenizer.rkt +++ b/beautiful-racket-demo/jsonic-demo/tokenizer.rkt @@ -1,15 +1,15 @@ #lang br/quicklang (require brag/support) -(define (tokenize port) +(define (make-tokenizer port) (define (next-token) - (define our-lexer + (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)])) - (our-lexer port)) + (jsonic-lexer port)) next-token) -(provide tokenize) \ No newline at end of file +(provide make-tokenizer) \ No newline at end of file