racket/package: fix package-begin
This commit is contained in:
parent
78f2ab8fa1
commit
328c3d3276
|
@ -201,9 +201,13 @@
|
||||||
(find-ids #'(id ...) values)]
|
(find-ids #'(id ...) values)]
|
||||||
[(#:all-defined-except (id ...))
|
[(#:all-defined-except (id ...))
|
||||||
(find-ids #'(id ...) not)]))
|
(find-ids #'(id ...) not)]))
|
||||||
#`(define-syntax id (package (quote-syntax star-id)
|
(cond
|
||||||
(quote-syntax #,(map car mapping))
|
[(not (syntax-e #'id))
|
||||||
(quote-syntax #,(map cdr mapping)))))]))
|
#'(begin)]
|
||||||
|
[else
|
||||||
|
#`(define-syntax id (package (quote-syntax star-id)
|
||||||
|
(quote-syntax #,(map car mapping))
|
||||||
|
(quote-syntax #,(map cdr mapping))))]))]))
|
||||||
|
|
||||||
(define-for-syntax (do-open-package stx def-stxes)
|
(define-for-syntax (do-open-package stx def-stxes)
|
||||||
(check-definition-context stx)
|
(check-definition-context stx)
|
||||||
|
@ -244,11 +248,11 @@
|
||||||
(syntax-case stx ()
|
(syntax-case stx ()
|
||||||
[(_ form ...)
|
[(_ form ...)
|
||||||
#`(drive-top-level
|
#`(drive-top-level
|
||||||
(accumulate-package #f #f #f #,stx
|
(accumulate-package #f id id #f #,stx
|
||||||
#f
|
(#:only ())
|
||||||
()
|
()
|
||||||
#,((make-syntax-introducer)
|
#,((make-syntax-introducer)
|
||||||
#'(form ...))))])))
|
#'(form ...))))])))
|
||||||
|
|
||||||
(define-for-syntax (check-definition-context stx)
|
(define-for-syntax (check-definition-context stx)
|
||||||
(when (eq? 'expression (syntax-local-context))
|
(when (eq? 'expression (syntax-local-context))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user