fix context for `#%module-begin' form in a submodule
This commit is contained in:
parent
4a0adb6a74
commit
8c2c84f74f
|
@ -798,6 +798,7 @@
|
||||||
(test 10 values x-from-submodule-out)
|
(test 10 values x-from-submodule-out)
|
||||||
|
|
||||||
;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
;; check `syntax-local-submodules' in compile and expand modes
|
||||||
|
|
||||||
(let ([e '(module x racket/base
|
(let ([e '(module x racket/base
|
||||||
(require (for-syntax racket/base))
|
(require (for-syntax racket/base))
|
||||||
|
@ -817,6 +818,21 @@
|
||||||
(eval (expand e))
|
(eval (expand e))
|
||||||
(test '(m) dynamic-require ''x 'x)))
|
(test '(m) dynamic-require ''x 'x)))
|
||||||
|
|
||||||
|
;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
;; check context on `#%module-begin' for a subform
|
||||||
|
|
||||||
|
(module check-submodule-module-begin '#%kernel
|
||||||
|
(module mb racket/base
|
||||||
|
(require (for-syntax racket/base))
|
||||||
|
(provide (except-out (all-from-out racket/base) #%module-begin)
|
||||||
|
(rename-out [module-begin #%module-begin]))
|
||||||
|
(define-syntax (module-begin stx)
|
||||||
|
#`(#%module-begin #,(datum->syntax stx ;; should have initial imports
|
||||||
|
'(provide (all-defined-out))))))
|
||||||
|
(module n (submod ".." mb)
|
||||||
|
(void)
|
||||||
|
(void)))
|
||||||
|
|
||||||
;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
|
||||||
(report-errs)
|
(report-errs)
|
||||||
|
|
|
@ -7154,7 +7154,7 @@ static Scheme_Object *do_module(Scheme_Object *form, Scheme_Comp_Env *env,
|
||||||
check_mb = 1;
|
check_mb = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
fm = scheme_datum_to_syntax(fm, form, form, 0, 2);
|
fm = scheme_datum_to_syntax(fm, form, mb_ctx, 0, 2);
|
||||||
|
|
||||||
if (check_mb) {
|
if (check_mb) {
|
||||||
SCHEME_EXPAND_OBSERVE_TAG(rec[drec].observer, fm);
|
SCHEME_EXPAND_OBSERVE_TAG(rec[drec].observer, fm);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user