pull/6/head
Matthew Butterick 7 years ago
parent 3d6f36ecb1
commit ef846d113e

@ -89,19 +89,18 @@
(provide rules (provide rules
(except-out (all-from-out racket/base) #%module-begin) (except-out (all-from-out racket/base) #%module-begin)
(rename-out [my-module-begin #%module-begin]) (rename-out [my-module-begin #%module-begin]))
#%top-interaction #%top #%app #%datum)
(define-syntax (my-module-begin module-stx) (define-syntax (my-module-begin module-stx)
(syntax-case module-stx () (syntax-case module-stx ()
[(_ RULES-STX) [(_ RULES-STX)
(with-syntax ([RULES-STX (for/fold ([stx #'RULES-STX]) (with-syntax ([RULES-STX (for/fold ([stx #'RULES-STX])
([id (in-list '(parse parse-to-datum parse-tree make-rule-parser all-token-types))]) ([sym (in-list '(parse parse-to-datum parse-tree make-rule-parser all-token-types))])
(syntax-property stx id (syntax-local-introduce (replace-context module-stx (datum->syntax #f id)))))]) (syntax-property stx sym (syntax-local-introduce (replace-context module-stx (datum->syntax #f sym)))))])
#`(#%module-begin #'(#%module-begin
RULES-STX (provide (all-defined-out))
(provide (all-defined-out))))])) RULES-STX))]))
(define-syntax (rules rules-stx) (define-syntax (rules rules-stx)

Loading…
Cancel
Save