fix problem with define-eh-alternative-set related to lazy-require

This commit is contained in:
Ryan Culpepper 2013-05-04 04:33:36 -04:00
parent 22b9548ecb
commit 87921e914e

View File

@ -1082,23 +1082,26 @@ Conventions:
[(alt-expr ...) [(alt-expr ...)
(for/list ([alt (in-list eh-alts)]) (for/list ([alt (in-list eh-alts)])
(with-syntax ([repc-expr (with-syntax ([repc-expr
(match (eh-alternative-repc alt) ;; repc structs are prefab; recreate using prefab
['#f ;; quasiquote exprs to avoid moving constructors
#'(quote #f)] ;; to residual module
[(rep:once n u o) (syntax-case (eh-alternative-repc alt) ()
#`(rep:once (quote-syntax #,n) [#f
(quote-syntax #,u) #''#f]
(quote-syntax #,o))] [#s(rep:once n u o)
[(rep:optional n o d) #'`#s(rep:once ,(quote-syntax n)
#`(rep:optional (quote-syntax #,n) ,(quote-syntax u)
(quote-syntax #,o) ,(quote-syntax o))]
(quote-syntax #,d))] [#s(rep:optional n o d)
[(rep:bounds min max n u o) #'`#s(rep:optional ,(quote-syntax n)
#`(rep:bounds (quote #,min) ,(quote-syntax o)
(quote #,max) ,(quote-syntax d))]
(quote-syntax #,n) [#s(rep:bounds min max n u o)
(quote-syntax #,u) #'`#s(rep:bounds ,(quote min)
(quote-syntax #,o))])] ,(quote max)
,(quote-syntax n)
,(quote-syntax u)
,(quote-syntax o))])]
[attrs-expr [attrs-expr
#`(quote #,(eh-alternative-attrs alt))] #`(quote #,(eh-alternative-attrs alt))]
[parser-expr [parser-expr