fix `syntax-local-module-exports' for submodules in expand mode

This commit is contained in:
Matthew Flatt 2013-02-13 08:25:25 -07:00
parent 8c2c84f74f
commit c6eb82524b
2 changed files with 9 additions and 3 deletions

View File

@ -798,7 +798,8 @@
(test 10 values x-from-submodule-out)
;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; check `syntax-local-submodules' in compile and expand modes
;; check `syntax-local-submodules' (and `syntax-local-module-exports'
;; for submodules) in compile and expand modes
(let ([e '(module x racket/base
(require (for-syntax racket/base))
@ -806,6 +807,7 @@
(module m racket/base)
(define-syntax (m stx)
(syntax-local-module-exports ''m) ; should succeed
#`(quote #,(syntax-local-submodules)))
(define x (m))

View File

@ -10966,8 +10966,12 @@ static int check_is_submodule(Scheme_Object *modname, Scheme_Object *_genv)
l = genv->module->pre_submodules;
if (l) {
while (!SCHEME_NULLP(l)) {
if (!SCHEME_SYMBOLP(SCHEME_CAR(l))) {
n = scheme_resolved_module_path_value(((Scheme_Module *)SCHEME_CAR(l))->modname);
n = SCHEME_CAR(l);
if (SCHEME_SYMBOLP(n)) {
if (SAME_OBJ(n, modname))
return 1;
} else {
n = scheme_resolved_module_path_value(((Scheme_Module *)n)->modname);
while (SCHEME_PAIRP(SCHEME_CDR(n))) {
n = SCHEME_CDR(n);
}