pull/10/head
Matthew Butterick 8 years ago
parent 1f9b0db91d
commit d20c328d93

@ -2,19 +2,19 @@
(require "parser.rkt") (require "parser.rkt")
(define (read-syntax path port) (define (read-syntax path port)
(define parse-tree (parse path (tokenize port))) (define parse-tree (parse path (make-tokenizer port)))
(define module-datum `(module bf-mod bf-demo/expander (define module-datum `(module bf-mod bf-demo/expander
,parse-tree)) ,parse-tree))
(datum->syntax #f module-datum)) (datum->syntax #f module-datum))
(provide read-syntax) (provide read-syntax)
(require brag/support) (require brag/support)
(define (tokenize port) (define (make-tokenizer port)
(define (next-token) (define (next-token)
(define our-lexer (define bf-lexer
(lexer (lexer
[(eof) eof] [(eof) eof]
[(char-set "><-.,+[]") lexeme] [(char-set "><-.,+[]") lexeme]
[any-char (next-token)])) [any-char (next-token)]))
(our-lexer port)) (bf-lexer port))
next-token) next-token)

Loading…
Cancel
Save