From 87921e914ec1c4584857e63b4bbd01c692d16d3b Mon Sep 17 00:00:00 2001 From: Ryan Culpepper Date: Sat, 4 May 2013 04:33:36 -0400 Subject: [PATCH] fix problem with define-eh-alternative-set related to lazy-require --- collects/syntax/parse/private/parse.rkt | 37 +++++++++++++------------ 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/collects/syntax/parse/private/parse.rkt b/collects/syntax/parse/private/parse.rkt index baf436f7a4..5cb4cd6f0a 100644 --- a/collects/syntax/parse/private/parse.rkt +++ b/collects/syntax/parse/private/parse.rkt @@ -1082,23 +1082,26 @@ Conventions: [(alt-expr ...) (for/list ([alt (in-list eh-alts)]) (with-syntax ([repc-expr - (match (eh-alternative-repc alt) - ['#f - #'(quote #f)] - [(rep:once n u o) - #`(rep:once (quote-syntax #,n) - (quote-syntax #,u) - (quote-syntax #,o))] - [(rep:optional n o d) - #`(rep:optional (quote-syntax #,n) - (quote-syntax #,o) - (quote-syntax #,d))] - [(rep:bounds min max n u o) - #`(rep:bounds (quote #,min) - (quote #,max) - (quote-syntax #,n) - (quote-syntax #,u) - (quote-syntax #,o))])] + ;; repc structs are prefab; recreate using prefab + ;; quasiquote exprs to avoid moving constructors + ;; to residual module + (syntax-case (eh-alternative-repc alt) () + [#f + #''#f] + [#s(rep:once n u o) + #'`#s(rep:once ,(quote-syntax n) + ,(quote-syntax u) + ,(quote-syntax o))] + [#s(rep:optional n o d) + #'`#s(rep:optional ,(quote-syntax n) + ,(quote-syntax o) + ,(quote-syntax d))] + [#s(rep:bounds min max n u o) + #'`#s(rep:bounds ,(quote min) + ,(quote max) + ,(quote-syntax n) + ,(quote-syntax u) + ,(quote-syntax o))])] [attrs-expr #`(quote #,(eh-alternative-attrs alt))] [parser-expr