fix error messages that should say 'identifier' instead of 'variable'

svn: r11235
This commit is contained in:
Matthew Flatt 2008-08-14 02:41:41 +00:00
parent 27249014f2
commit cfaeedc910
2 changed files with 11 additions and 11 deletions

View File

@ -2458,7 +2458,7 @@ scheme_lookup_binding(Scheme_Object *find_id, Scheme_Comp_Env *env, int flags,
if (!val) { if (!val) {
scheme_wrong_syntax(scheme_compile_stx_string, NULL, find_id, scheme_wrong_syntax(scheme_compile_stx_string, NULL, find_id,
"variable used out of context"); "identifier used out of context");
return NULL; return NULL;
} }
@ -2506,7 +2506,7 @@ scheme_lookup_binding(Scheme_Object *find_id, Scheme_Comp_Env *env, int flags,
modidx = NULL; modidx = NULL;
modname = NULL; modname = NULL;
genv = env->genv; genv = env->genv;
/* So we can distinguish between unbound variables in a module /* So we can distinguish between unbound identifiers in a module
and references to top-level definitions: */ and references to top-level definitions: */
module_self_reference = 1; module_self_reference = 1;
} else { } else {
@ -2535,12 +2535,12 @@ scheme_lookup_binding(Scheme_Object *find_id, Scheme_Comp_Env *env, int flags,
modname = NULL; modname = NULL;
if (genv->module && genv->disallow_unbound) { if (genv->module && genv->disallow_unbound) {
/* Free variable. Maybe don't continue. */ /* Free identifier. Maybe don't continue. */
if (flags & (SCHEME_SETTING | SCHEME_REFERENCING)) { if (flags & (SCHEME_SETTING | SCHEME_REFERENCING)) {
scheme_wrong_syntax(((flags & SCHEME_SETTING) scheme_wrong_syntax(((flags & SCHEME_SETTING)
? scheme_set_stx_string ? scheme_set_stx_string
: scheme_var_ref_string), : scheme_var_ref_string),
NULL, src_find_id, "unbound variable in module"); NULL, src_find_id, "unbound identifier in module");
return NULL; return NULL;
} }
if (flags & SCHEME_NULL_FOR_UNBOUND) if (flags & SCHEME_NULL_FOR_UNBOUND)
@ -2595,18 +2595,18 @@ scheme_lookup_binding(Scheme_Object *find_id, Scheme_Comp_Env *env, int flags,
if (modname && (flags & SCHEME_SETTING)) { if (modname && (flags & SCHEME_SETTING)) {
if (SAME_OBJ(src_find_id, find_id) || SAME_OBJ(SCHEME_STX_SYM(src_find_id), find_id)) if (SAME_OBJ(src_find_id, find_id) || SAME_OBJ(SCHEME_STX_SYM(src_find_id), find_id))
find_id = NULL; find_id = NULL;
scheme_wrong_syntax(scheme_set_stx_string, find_id, src_find_id, "cannot mutate module-required variable"); scheme_wrong_syntax(scheme_set_stx_string, find_id, src_find_id, "cannot mutate module-required identifier");
return NULL; return NULL;
} }
if (!modname && (flags & (SCHEME_SETTING | SCHEME_REFERENCING)) if (!modname && (flags & (SCHEME_SETTING | SCHEME_REFERENCING))
&& (genv->module && genv->disallow_unbound)) { && (genv->module && genv->disallow_unbound)) {
/* Check for set! of unbound variable: */ /* Check for set! of unbound identifier: */
if (!scheme_lookup_in_table(genv->toplevel, (const char *)find_global_id)) { if (!scheme_lookup_in_table(genv->toplevel, (const char *)find_global_id)) {
scheme_wrong_syntax(((flags & SCHEME_SETTING) scheme_wrong_syntax(((flags & SCHEME_SETTING)
? scheme_set_stx_string ? scheme_set_stx_string
: scheme_var_ref_string), : scheme_var_ref_string),
NULL, src_find_id, "unbound variable in module"); NULL, src_find_id, "unbound identifier in module");
return NULL; return NULL;
} }
} }

View File

@ -5995,18 +5995,18 @@ static Scheme_Object *check_top(const char *when, Scheme_Object *form, Scheme_Co
if (bad || !scheme_lookup_in_table(env->genv->toplevel, (const char *)SCHEME_STX_SYM(c))) { if (bad || !scheme_lookup_in_table(env->genv->toplevel, (const char *)SCHEME_STX_SYM(c))) {
GC_CAN_IGNORE const char *reason; GC_CAN_IGNORE const char *reason;
if (env->genv->phase == 1) { if (env->genv->phase == 1) {
reason = "unbound variable in module (transformer environment)"; reason = "unbound identifier in module (transformer environment)";
/* Check in the run-time environment */ /* Check in the run-time environment */
if (scheme_lookup_in_table(env->genv->template_env->toplevel, (const char *)SCHEME_STX_SYM(c))) { if (scheme_lookup_in_table(env->genv->template_env->toplevel, (const char *)SCHEME_STX_SYM(c))) {
reason = ("unbound variable in module (in the transformer environment, which does" reason = ("unbound identifier in module (in the transformer environment, which does"
" not include the run-time definition)"); " not include the run-time definition)");
} else if (env->genv->template_env->syntax } else if (env->genv->template_env->syntax
&& scheme_lookup_in_table(env->genv->template_env->syntax, (const char *)SCHEME_STX_SYM(c))) { && scheme_lookup_in_table(env->genv->template_env->syntax, (const char *)SCHEME_STX_SYM(c))) {
reason = ("unbound variable in module (in the transformer environment, which does" reason = ("unbound identifier in module (in the transformer environment, which does"
" not include the macro definition that is visible to run-time expressions)"); " not include the macro definition that is visible to run-time expressions)");
} }
} else } else
reason = "unbound variable in module"; reason = "unbound identifier in module";
scheme_wrong_syntax(when, NULL, c, reason); scheme_wrong_syntax(when, NULL, c, reason);
} }
} }