fixed context and fixed source location for dup defns

svn: r1199
This commit is contained in:
Matthew Flatt 2005-11-01 20:14:09 +00:00
parent e46ea7dbb2
commit 8cfcbf1b98
2 changed files with 9 additions and 7 deletions

View File

@ -1256,7 +1256,9 @@ scheme_add_compilation_frame(Scheme_Object *vals, Scheme_Comp_Env *env, int flag
Scheme_Comp_Env *scheme_no_defines(Scheme_Comp_Env *env)
{
if (scheme_is_toplevel(env))
if (scheme_is_toplevel(env)
|| scheme_is_module_env(env)
|| scheme_is_module_begin_env(env))
return scheme_new_compilation_frame(0, 0, env, NULL);
else
return env;

View File

@ -3780,19 +3780,19 @@ static Scheme_Object *do_module_begin(Scheme_Object *form, Scheme_Comp_Env *env,
/* Check that it's not yet defined: */
if (scheme_lookup_in_table(env->genv->toplevel, (const char *)name)) {
scheme_wrong_syntax("module", name, e, "duplicate definition for identifier");
scheme_wrong_syntax("module", orig_name, e, "duplicate definition for identifier");
return NULL;
}
/* Not required: */
if (scheme_hash_get(required, name)) {
scheme_wrong_syntax("module", name, e, "identifier is already imported");
scheme_wrong_syntax("module", orig_name, e, "identifier is already imported");
return NULL;
}
/* Not syntax: */
if (scheme_lookup_in_table(env->genv->syntax, (const char *)name)) {
scheme_wrong_syntax("module", name, e, "duplicate definition for identifier");
scheme_wrong_syntax("module", orig_name, e, "duplicate definition for identifier");
return NULL;
}
@ -3847,7 +3847,7 @@ static Scheme_Object *do_module_begin(Scheme_Object *form, Scheme_Comp_Env *env,
name = scheme_tl_id_sym(oenv->genv, name, 2);
if (scheme_lookup_in_table(oenv->genv->syntax, (const char *)name)) {
scheme_wrong_syntax("module", name, e,
scheme_wrong_syntax("module", orig_name, e,
(for_stx
? "duplicate for-syntax definition for identifier"
: "duplicate definition for identifier"));
@ -3856,7 +3856,7 @@ static Scheme_Object *do_module_begin(Scheme_Object *form, Scheme_Comp_Env *env,
/* Check that it's not yet defined: */
if (scheme_lookup_in_table(oenv->genv->toplevel, (const char *)name)) {
scheme_wrong_syntax("module", name, e,
scheme_wrong_syntax("module", orig_name, e,
(for_stx
? "duplicate for-syntax definition for identifier"
: "duplicate definition for identifier"));
@ -3865,7 +3865,7 @@ static Scheme_Object *do_module_begin(Scheme_Object *form, Scheme_Comp_Env *env,
/* Not required: */
if (scheme_hash_get(for_stx ? et_required : required, name)) {
scheme_wrong_syntax("module", name, e,
scheme_wrong_syntax("module", orig_name, e,
(for_stx
? "identifier is already imported for syntax"
: "identifier is already imported"));