More helpful error if someone uses '...' around a TIME constant.

This commit is contained in:
Dianne Skoll
2024-09-13 12:46:38 -04:00
parent 8453e17c6c
commit 631e721a96

View File

@@ -1905,7 +1905,11 @@ static int set_constant_value(expr_node *atom)
} else if (*s == '\'') { /* It's a literal date */
s++;
if ((r=ParseLiteralDate(&s, &dse, &tim)) != 0) {
Eprint("%s: %s", ErrMsg[r], DBufValue(&ExprBuf));
if (*s == ':' || *s == '.' || *s == TimeSep) {
Eprint("%s: %s:\n\t(If you meant a TIME constant, leave out the single quotes.)", ErrMsg[r], DBufValue(&ExprBuf));
} else {
Eprint("%s: %s", ErrMsg[r], DBufValue(&ExprBuf));
}
return r;
}
if (*s != '\'') {