Fix some error messages.

This commit is contained in:
Dianne Skoll
2024-06-03 17:59:11 -04:00
parent ee179ee2f5
commit 0e010b56ec
2 changed files with 19 additions and 0 deletions
+13
View File
@@ -1652,6 +1652,10 @@ static int parse_expr_token_aux(DynamicBuffer *buf, char const **in)
}
if (!ISID(c) && c != '$') {
if (!c) {
Eprint("%s", ErrMsg[E_EOLN]);
return E_EOLN;
}
Eprint("%s `%c'", ErrMsg[E_ILLEGAL_CHAR], c);
return E_ILLEGAL_CHAR;
}
@@ -1887,6 +1891,10 @@ static int set_constant_value(expr_node *atom)
char const *s = DBufValue(&ExprBuf);
atom->u.value.type = ERR_TYPE;
if (!*s) {
Eprint("%s", ErrMsg[E_EOLN]);
return E_EOLN;
}
ampm = 0;
if (*s == '\"') { /* It's a literal string "*/
len = strlen(s)-1;
@@ -2085,6 +2093,11 @@ static expr_node *parse_atom(char const **e, int *r, Var *locals, int level)
/* Check that it's a valid ID or constant */
s = DBufValue(&ExprBuf);
if (!*s) {
Eprint("%s", ErrMsg[E_EOLN]);
*r = E_EOLN;
return NULL;
}
if (!ISID(*s) &&
*s != '%' &&
*s != '$' &&