Tweak warning wording; add tests.

This commit is contained in:
Dianne Skoll
2025-05-24 23:09:57 -04:00
parent 09caa8988a
commit 5035deaff1
3 changed files with 7 additions and 2 deletions

View File

@@ -600,7 +600,7 @@ int SetVar(char const *str, Value const *val, int nonconst_expr)
if (DebugFlag & DB_UNUSED_VARS) {
v = FindVar(str, 0);
if (v && !(v->used_since_set)) {
Eprint(tr("Variable %s re-SET without being used (original SET was at %s:%d)"), str, v->filename, v->lineno);
Eprint(tr("`%s' re-SET without being used (previous SET: %s:%d)"), str, v->filename, v->lineno);
}
}

View File

@@ -738,6 +738,9 @@ set c "What"
if c
set d "Told ya!"
endif
set x 44
set x 45
EOF
# Make sure all the include files are ok

View File

@@ -24978,7 +24978,6 @@ TRANSLATE "Undefined %s function: `%s'" ""
TRANSLATE "Unmatched PUSH-OMIT-CONTEXT at %s(%d)" ""
TRANSLATE "Unrecognized command; interpreting as REM" ""
TRANSLATE "User function `%s' defined in non-constant context makes expression non-constant" ""
TRANSLATE "Variable %s re-SET without being used (original SET was at %s:%d)" ""
TRANSLATE "Variable assignment considered non-constant because of context" ""
TRANSLATE "Warning: Function name `%s...' truncated to `%s'" ""
TRANSLATE "Warning: OMIT is ignored if you use OMITFUNC" ""
@@ -24995,6 +24994,7 @@ TRANSLATE "Warning: Variable name `%.*s...' truncated to `%.*s'" ""
TRANSLATE "You have OMITted everything! The space-time continuum is at risk." ""
TRANSLATE "\\x00 is not a valid escape sequence" ""
TRANSLATE "`%%%c' substitution sequence should not be used without an AT clause" ""
TRANSLATE "`%s' re-SET without being used (previous SET: %s:%d)" ""
TRANSLATE "did you mean" ""
TRANSLATE "here" ""
TRANSLATE "psmoon() is deprecated; use SPECIAL MOON instead." ""
@@ -38716,7 +38716,9 @@ utctolocal(2050-03-13@05:00) => 2050-03-13@00:00
utctolocal(2050-11-06@04:00) => 2050-11-06@00:00
utctolocal(2050-11-06@07:00) => 2050-11-06@02:00
No reminders.
-stdin-(9): `x' re-SET without being used (previous SET: -stdin-:8)
The following variables were set, but not subsequently used:
b - defined at -stdin-:2
x - defined at -stdin-:9
d - defined at -stdin-:5
No reminders.