Make error messages more consistent.
All checks were successful
Remind unit tests / tests (push) Successful in 28s

This commit is contained in:
Dianne Skoll
2024-09-03 10:53:45 -04:00
parent 097bf92bea
commit 5d7f55c8d5
3 changed files with 3 additions and 3 deletions

View File

@@ -2026,7 +2026,7 @@ static int make_atom(expr_node *atom, Var *locals)
/* System Variable */
if (*(s) == '$' && isalpha(*(s+1))) {
if (!FindSysVar(s+1)) {
Eprint("`%s': %s", s, ErrMsg[E_NOSUCH_VAR]);
Eprint("%s: `%s'", ErrMsg[E_NOSUCH_VAR], s);
return E_NOSUCH_VAR;
}
if (strlen(s+1) < SHORT_NAME_BUF) {

View File

@@ -572,7 +572,7 @@ int GetVarValue(char const *str, Value *val)
v=FindVar(str, 0);
if (!v) {
Eprint("%s: %s", ErrMsg[E_NOSUCH_VAR], str);
Eprint("%s: `%s'", ErrMsg[E_NOSUCH_VAR], str);
return E_NOSUCH_VAR;
}
return CopyValue(val, &v->v);

View File

@@ -1007,7 +1007,7 @@ a049 => 21
substr(21, 2) => Type mismatch
../tests/test.rem(326): substr(): Type mismatch
set a051 substr(a050, 2, 6)
../tests/test.rem(327): Undefined variable: a050
../tests/test.rem(327): Undefined variable: `a050'
a050 => Undefined variable
set a052 time(1+2, 3+4)
1 + 2 => 3