From 6d4f0a7b69600853667b8251ef85173913b817df Mon Sep 17 00:00:00 2001 From: Matthew Butterick Date: Sat, 22 Jun 2019 17:00:52 -0700 Subject: [PATCH] changes --- beautiful-racket-demo/taco-victory-demo/main.rkt | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/beautiful-racket-demo/taco-victory-demo/main.rkt b/beautiful-racket-demo/taco-victory-demo/main.rkt index 831e069..aab7f69 100644 --- a/beautiful-racket-demo/taco-victory-demo/main.rkt +++ b/beautiful-racket-demo/taco-victory-demo/main.rkt @@ -1,11 +1,14 @@ #lang br/quicklang (require brag/support "grammar.rkt") -(provide (all-from-out br/quicklang) (all-defined-out)) +(provide taco-program taco-leaf + taco not-a-taco + show + #%module-begin) (module+ reader (provide read-syntax)) -(define (tokenize ip) +(define (tokenize-1 ip) (define lex (lexer ["#$" lexeme] @@ -25,10 +28,13 @@ (define (not-a-taco) 0) +(define (show pt) + (display (apply string pt))) + (define (read-syntax src ip) - (define token-thunk (λ () (tokenize ip))) - (define parse-tree (parse token-thunk)) + (define token-thunk (λ () (tokenize-1 ip))) + (define parse-tree (parse src token-thunk)) (strip-context (with-syntax ([PT parse-tree]) #'(module winner taco-victory-demo - (display (apply string PT)))))) \ No newline at end of file + (show PT))))) \ No newline at end of file