Improve diagnostic message.

This commit is contained in:
Dianne Skoll
2025-05-21 12:27:08 -04:00
parent 43d0066780
commit af5854d0c6
2 changed files with 6 additions and 6 deletions

View File

@@ -900,7 +900,7 @@ evaluate_expr_node(expr_node *node, Value *locals, Value *ans, int *nonconst)
case N_BUILTIN_FUNC:
/* Built-in function? Evaluate and note non-constant where applicable */
if (!node->u.builtin_func->is_constant) {
nonconst_debug(*nonconst, tr("Non-constant builtin function `%s' makes expression non-constant"), node->u.builtin_func->name);
nonconst_debug(*nonconst, tr("Non-constant built-in function `%s' makes expression non-constant"), node->u.builtin_func->name);
*nonconst = 1;
}
return eval_builtin(node, locals, ans, nonconst);

View File

@@ -16403,7 +16403,7 @@ wkdaynum("cabbage") => Type mismatch
DEBUG +n
DEBUG -x
IF today() > '1990-01-01'
../tests/test.rem(1515): Non-constant builtin function `today' makes expression non-constant
../tests/test.rem(1515): Non-constant built-in function `today' makes expression non-constant
SET a 1
../tests/test.rem(1516): Variable assignment considered non-constant because of context
ELSE
@@ -16412,14 +16412,14 @@ ENDIF
SET a 1
SET a version()
SET a today()
../tests/test.rem(1522): Non-constant builtin function `today' makes expression non-constant
../tests/test.rem(1522): Non-constant built-in function `today' makes expression non-constant
set b a
../tests/test.rem(1523): Global variable `a' makes expression non-constant
FUNSET f g
fset f(x) today() + x
fset g(x) f(x) + 13
set a g(3)
../tests/test.rem(1527): Non-constant builtin function `today' makes expression non-constant
../tests/test.rem(1527): Non-constant built-in function `today' makes expression non-constant
FSET o(x) iif(x != 0, 0, 0)
REM OMITFUNC o MSG foo
@@ -16429,7 +16429,7 @@ REM SCANFROM -7 MSG foo
../tests/test.rem(1531): Relative SCANFROM counts as a non-constant expression
REM MSG [g(3)]
../tests/test.rem(1533): Non-constant builtin function `today' makes expression non-constant
../tests/test.rem(1533): Non-constant built-in function `today' makes expression non-constant
1991-03-04
DEBUG -n
@@ -24821,7 +24821,7 @@ TRANSLATE "Invalid translation: Both original and translated must have the same
TRANSLATE "Missing REM type; assuming MSG" ""
TRANSLATE "No Adar A in %d" ""
TRANSLATE "No substition function `%s' defined" ""
TRANSLATE "Non-constant builtin function `%s' makes expression non-constant" ""
TRANSLATE "Non-constant built-in function `%s' makes expression non-constant" ""
TRANSLATE "Not setting $OnceFile: Already processed a reminder with a ONCE clause" ""
TRANSLATE "OMIT: UNTIL not allowed; did you mean THROUGH?" ""
TRANSLATE "OMITFUNC counts as a non-constant expression" ""