mirror of
https://salsa.debian.org/dskoll/remind.git
synced 2026-05-16 04:20:10 +02:00
Better error-reporting.
This commit is contained in:
@@ -68,7 +68,7 @@
|
||||
as a REM statement, also. */
|
||||
#define E_CANT_MODIFY 45
|
||||
#define E_MKTIME_PROBLEM 46
|
||||
#define E_REDEF_FUNC 47
|
||||
#define E_REDEF_BUILTIN_FUNC 47
|
||||
#define E_CANTNEST_FDEF 48
|
||||
#define E_REP_FULSPEC 49
|
||||
#define E_YR_TWICE 50
|
||||
@@ -204,7 +204,7 @@ EXTERN char *ErrMsg[]
|
||||
/* E_PARSE_AS_REM */ "",
|
||||
/* E_CANT_MODIFY */ "Cannot modify system variable",
|
||||
/* E_MKTIME_PROBLEM */ "C library function can't represent date/time",
|
||||
/* E_REDEF_FUNC */ "Attempt to redefine built-in function",
|
||||
/* E_REDEF_BUILTIN_FUNC */ "Attempt to redefine built-in function",
|
||||
/* E_CANTNEST_FDEF */ "Can't nest function definition in expression",
|
||||
/* E_REP_FULSPEC */ "Must fully specify date to use repeat factor",
|
||||
/* E_YR_TWICE */ "Year specified twice",
|
||||
|
||||
+21
-14
@@ -117,16 +117,16 @@ int DoFrename(ParsePtr p)
|
||||
return r;
|
||||
}
|
||||
if (FindBuiltinFunc(DBufValue(&newbuf))) {
|
||||
Eprint("%s: `%s'", GetErr(E_REDEF_FUNC), DBufValue(&newbuf));
|
||||
Eprint("%s: `%s'", GetErr(E_REDEF_BUILTIN_FUNC), DBufValue(&newbuf));
|
||||
DBufFree(&oldbuf);
|
||||
DBufFree(&newbuf);
|
||||
return E_REDEF_FUNC;
|
||||
return E_REDEF_BUILTIN_FUNC;
|
||||
}
|
||||
if (FindBuiltinFunc(DBufValue(&oldbuf))) {
|
||||
Eprint("%s: `%s'", GetErr(E_REDEF_FUNC), DBufValue(&oldbuf));
|
||||
Eprint("%s: `%s'", GetErr(E_REDEF_BUILTIN_FUNC), DBufValue(&oldbuf));
|
||||
DBufFree(&oldbuf);
|
||||
DBufFree(&newbuf);
|
||||
return E_REDEF_FUNC;
|
||||
return E_REDEF_BUILTIN_FUNC;
|
||||
}
|
||||
RenameUserFunc(DBufValue(&oldbuf), DBufValue(&newbuf));
|
||||
DBufFree(&oldbuf);
|
||||
@@ -288,23 +288,29 @@ int DoFset(ParsePtr p)
|
||||
nonconst_debug(0, tr("Function definition considered non-constant because of context"));
|
||||
func->is_constant = 0;
|
||||
}
|
||||
StrnCpy(func->name, DBufValue(&buf), VAR_NAME_LEN);
|
||||
DBufFree(&buf);
|
||||
if (!Hush) {
|
||||
if (FindBuiltinFunc(func->name)) {
|
||||
if (warning_level("03.00.04")) {
|
||||
Eprint("%s: `%s'", GetErr(E_REDEF_FUNC), func->name);
|
||||
}
|
||||
}
|
||||
}
|
||||
func->node = NULL;
|
||||
func->nargs = 0;
|
||||
func->args = NULL;
|
||||
|
||||
StrnCpy(func->name, DBufValue(&buf), VAR_NAME_LEN);
|
||||
DBufFree(&buf);
|
||||
if (FindBuiltinFunc(func->name)) {
|
||||
if (!Hush) {
|
||||
if (warning_level("03.00.04")) {
|
||||
Eprint("%s: `%s'", GetErr(E_REDEF_BUILTIN_FUNC), func->name);
|
||||
}
|
||||
}
|
||||
DestroyUserFunc(func);
|
||||
return E_REDEF_BUILTIN_FUNC;
|
||||
}
|
||||
|
||||
/* Get the local variables */
|
||||
|
||||
c=ParseNonSpaceChar(p, &r, 1);
|
||||
if (r) return r;
|
||||
if (r) {
|
||||
DestroyUserFunc(func);
|
||||
return r;
|
||||
}
|
||||
if (c == ')') {
|
||||
(void) ParseNonSpaceChar(p, &r, 0);
|
||||
} else {
|
||||
@@ -726,6 +732,7 @@ int PushUserFuncs(ParsePtr p)
|
||||
if (!Hush) {
|
||||
if (warning_level("06.02.06")) {
|
||||
Eprint("%s: `%s'", GetErr(E_PUSH_BUILTIN_FUNC), name);
|
||||
FreshLine = 1;
|
||||
}
|
||||
}
|
||||
DBufFree(&buf);
|
||||
|
||||
Reference in New Issue
Block a user