mirror of
https://salsa.debian.org/dskoll/remind.git
synced 2026-04-16 06:18:47 +02:00
Diagnose bad YYYY-MM-DD constants in REM command.
This commit is contained in:
@@ -233,6 +233,7 @@ void FindNumericToken(char const *s, Token *t)
|
||||
int mult = 1, hour, min;
|
||||
char const *s_orig = s;
|
||||
int ampm = 0;
|
||||
int r;
|
||||
|
||||
t->type = T_Illegal;
|
||||
t->val = 0;
|
||||
@@ -243,7 +244,8 @@ void FindNumericToken(char const *s, Token *t)
|
||||
if (*s == '-' || *s == '/') {
|
||||
char const *p = s_orig;
|
||||
int dse, tim;
|
||||
if (ParseLiteralDate(&p, &dse, &tim) == OK) {
|
||||
r = ParseLiteralDate(&p, &dse, &tim);
|
||||
if (r == OK) {
|
||||
if (*p) return;
|
||||
if (tim == NO_TIME) {
|
||||
t->type = T_Date;
|
||||
@@ -252,7 +254,9 @@ void FindNumericToken(char const *s, Token *t)
|
||||
}
|
||||
t->type = T_DateTime;
|
||||
t->val = MINUTES_PER_DAY * dse + tim;
|
||||
}
|
||||
} else {
|
||||
Wprint("%s: `%s'", ErrMsg[r], s_orig);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -5699,8 +5699,17 @@ set zxk dooby(1)
|
||||
Entering UserFN dooby(1)
|
||||
Leaving UserFN dooby(1) => 1
|
||||
|
||||
REM 1 Jan 1873 MSG hehah
|
||||
REM 1 Jan 1873 MSG This should fail
|
||||
../tests/test.rem(1122): Number `1873' is not recognized as a year or a day number
|
||||
REM 1873-12-11 MSG Also bad.
|
||||
../tests/test.rem(1123): Bad date specification: `1873-12-11'
|
||||
../tests/test.rem(1123): Missing REM type; assuming MSG
|
||||
../tests/test.rem(1123): Trig = Saturday, 16 February, 1991
|
||||
../tests/test.rem(1123): Function `subst_ampm' defined at ../tests/test.rem:931 should take 1 argument, but actually takes 7
|
||||
../tests/test.rem(1123): Function `subst_ampm' defined at ../tests/test.rem:931 should take 1 argument, but actually takes 7
|
||||
1873-12-11 MSG Also bad.
|
||||
|
||||
|
||||
# Don't want Remind to queue reminders
|
||||
EXIT
|
||||
|
||||
|
||||
@@ -1119,7 +1119,9 @@ set zxk dooby()
|
||||
set zxk dooby(1, 2)
|
||||
set zxk dooby(1)
|
||||
|
||||
REM 1 Jan 1873 MSG hehah
|
||||
REM 1 Jan 1873 MSG This should fail
|
||||
REM 1873-12-11 MSG Also bad.
|
||||
|
||||
# Don't want Remind to queue reminders
|
||||
EXIT
|
||||
|
||||
|
||||
Reference in New Issue
Block a user