mirror of
https://salsa.debian.org/dskoll/remind.git
synced 2026-04-16 06:18:47 +02:00
Make error messages more consistent.
This commit is contained in:
@@ -204,7 +204,7 @@ EXTERN char *ErrMsg[]
|
||||
/* E_ERR_READING */ "Error reading",
|
||||
/* E_EXPECTING_EOL */ "Expecting end-of-line",
|
||||
/* E_BAD_HEBDATE */ "Invalid Hebrew date",
|
||||
/* E_IIF_ODD */ "IIF needs odd number of arguments",
|
||||
/* E_IIF_ODD */ "iif(): odd number of arguments required",
|
||||
/* E_MISS_ENDIF */ "Warning: Missing ENDIF",
|
||||
/* E_EXPECT_COMMA */ "Expecting comma",
|
||||
/* E_WD_TWICE */ "Weekday specified twice",
|
||||
|
||||
@@ -426,11 +426,11 @@ eval_builtin(expr_node *node, Value *locals, Value *ans, int *nonconst)
|
||||
|
||||
/* Check that we have the right number of argumens */
|
||||
if (node->num_kids < f->minargs) {
|
||||
Eprint("%s: %s", f->name, ErrMsg[E_2FEW_ARGS]);
|
||||
Eprint("%s(): %s", f->name, ErrMsg[E_2FEW_ARGS]);
|
||||
return E_2FEW_ARGS;
|
||||
}
|
||||
if (node->num_kids > f->maxargs && f->maxargs != NO_MAX) {
|
||||
Eprint("%s: %s", f->name, ErrMsg[E_2MANY_ARGS]);
|
||||
Eprint("%s(): %s", f->name, ErrMsg[E_2MANY_ARGS]);
|
||||
return E_2MANY_ARGS;
|
||||
}
|
||||
|
||||
@@ -628,12 +628,12 @@ eval_userfunc(expr_node *node, Value *locals, Value *ans, int *nonconst)
|
||||
/* Make sure we have the right number of arguments */
|
||||
if (node->num_kids < f->nargs) {
|
||||
DBG(fprintf(ErrFp, "%s(...) => %s\n", fname, ErrMsg[E_2FEW_ARGS]));
|
||||
Eprint("%s: %s", f->name, ErrMsg[E_2FEW_ARGS]);
|
||||
Eprint("%s(): %s", f->name, ErrMsg[E_2FEW_ARGS]);
|
||||
return E_2FEW_ARGS;
|
||||
}
|
||||
if (node->num_kids > f->nargs) {
|
||||
DBG(fprintf(ErrFp, "%s(...) => %s\n", fname, ErrMsg[E_2MANY_ARGS]));
|
||||
Eprint("%s: %s", f->name, ErrMsg[E_2MANY_ARGS]);
|
||||
Eprint("%s(): %s", f->name, ErrMsg[E_2MANY_ARGS]);
|
||||
return E_2MANY_ARGS;
|
||||
}
|
||||
|
||||
|
||||
@@ -1284,6 +1284,7 @@ static int FChoose(expr_node *node, Value *locals, Value *ans, int *nonconst)
|
||||
PUT(ErrMsg[E_BAD_TYPE]);
|
||||
OUT();
|
||||
}
|
||||
Eprint("choose(): %s", ErrMsg[E_BAD_TYPE]);
|
||||
return E_BAD_TYPE;
|
||||
}
|
||||
n = v.v.val;
|
||||
|
||||
@@ -5687,10 +5687,10 @@ set zxk max()
|
||||
fset dooby(x) 1
|
||||
set zxk dooby()
|
||||
dooby(...) => Not enough arguments
|
||||
../tests/test.rem(1118): dooby: Not enough arguments
|
||||
../tests/test.rem(1118): dooby(): Not enough arguments
|
||||
set zxk dooby(1, 2)
|
||||
dooby(...) => Too many arguments
|
||||
../tests/test.rem(1119): dooby: Too many arguments
|
||||
../tests/test.rem(1119): dooby(): Too many arguments
|
||||
set zxk dooby(1)
|
||||
Entering UserFN dooby(1)
|
||||
Leaving UserFN dooby(1) => 1
|
||||
|
||||
Reference in New Issue
Block a user