pull/21/head
Matthew Butterick 6 years ago
parent e88e9b164e
commit 5f98d03dab

@ -8,7 +8,7 @@
(for/list ([tok (in-port read-char ip)]) (for/list ([tok (in-port read-char ip)])
tok)) tok))
(define (parse toks) (define (parse src toks)
(define parse-tree-datum (parse-to-datum toks)) (define parse-tree-datum (parse-to-datum toks))
(for/list ([leaf (in-list (cdr parse-tree-datum))]) (for/list ([leaf (in-list (cdr parse-tree-datum))])
(integer->char (integer->char
@ -17,11 +17,15 @@
#:when (equal? val '(taco))) #:when (equal? val '(taco)))
(expt 2 power))))) (expt 2 power)))))
(define (read-syntax src ip) (define (read-syntax src ip)
(define toks (tokenize ip)) (define toks (tokenize ip))
(define parse-tree (parse toks)) (define parse-tree (parse src toks))
(strip-context (strip-context
(with-syntax ([PT parse-tree]) (with-syntax ([PT parse-tree])
#'(module untaco racket #'(module tacogram-mod tacogram-demo
(display (list->string 'PT)))))) PT))))
(define-macro (mb PT)
#'(#%module-begin
(display (list->string 'PT))))
(provide (rename-out [mb #%module-begin]))
Loading…
Cancel
Save