normalize module rename info to vector in ".zo" format

This is related to the receent repairs for submodules and
`variable-reference->namespace'.

Merge to v5.3
(cherry picked from commit 5a1bc5ad40)
This commit is contained in:
Matthew Flatt 2012-07-24 07:07:38 -05:00 committed by Ryan Culpepper
parent 07dd4500f5
commit 7b32c83cbd
4 changed files with 12 additions and 9 deletions

View File

@ -124,7 +124,7 @@
[max-let-depth exact-nonnegative-integer?]
[dummy toplevel?]
[lang-info (or/c #f (vector/c module-path? symbol? any/c))]
[internal-context (or/c #f #t stx? (listof stx?))]
[internal-context (or/c #f #t stx? (vectorof stx?))]
[pre-submodules (listof mod?)]
[post-submodules (listof mod?)]))

View File

@ -173,7 +173,7 @@ structures that are produced by @racket[zo-parse] and consumed by
[max-let-depth exact-nonnegative-integer?]
[dummy toplevel?]
[lang-info (or/c #f (vector/c module-path? symbol? any/c))]
[internal-context (or/c #f #t stx? (listof stx?))]
[internal-context (or/c #f #t stx? (vectorof stx?))]
[pre-submodules (listof mod?)]
[post-submodules (listof mod?)])]{
Represents a @racket[module] declaration.

View File

@ -1173,11 +1173,6 @@ static Scheme_Object *read_resolve_prefix(Scheme_Object *obj)
return (Scheme_Object *)rp;
}
XFORM_NONGCING static Scheme_Object *wrap_mod_stx(Scheme_Object *stx)
{
return (stx ? stx : scheme_false);
}
static Scheme_Object *write_module(Scheme_Object *obj)
{
Scheme_Module *m = (Scheme_Module *)obj;
@ -1323,7 +1318,12 @@ static Scheme_Object *write_module(Scheme_Object *obj)
l = cons(scheme_make_integer(m->max_let_depth), l);
l = cons(wrap_mod_stx(m->rn_stx), l);
v = m->rn_stx;
if (!v)
v = scheme_false;
else if (SCHEME_PAIRP(v))
v = scheme_list_to_vector(v);
l = cons(v, l);
/* previously recorded "functional?" info: */
l = cons(scheme_false, l);

View File

@ -6196,7 +6196,10 @@ static Scheme_Object *do_module_execute(Scheme_Object *data, Scheme_Env *genv,
if (m->rn_stx && !SAME_OBJ(scheme_true, m->rn_stx)) {
/* Delay the shift: */
Scheme_Object *v;
v = scheme_make_pair(m->rn_stx, (Scheme_Object *)midx);
v = m->rn_stx;
if (SCHEME_PAIRP(v))
v = scheme_list_to_vector(v);
v = scheme_make_pair(v, (Scheme_Object *)midx);
m->rn_stx = v;
}
}