Make a local OMIT that doesn't specify a weekday name into a syntax error.

This commit is contained in:
Dianne Skoll
2024-03-03 14:51:53 -05:00
parent f4cce54b70
commit 0d55e04284
8 changed files with 27 additions and 6 deletions

View File

@@ -680,7 +680,7 @@ static int ParseLocalOmit(ParsePtr s, Trigger *t)
default:
if (t->localomit == NO_WD) {
Wprint("Warning: OMIT clause used in REM command, but no weekdays omitted");
return E_EXPECTING_WEEKDAY;
}
PushToken(DBufValue(&buf), s);
DBufFree(&buf);

View File

@@ -121,6 +121,8 @@
#define E_STRING_TOO_LONG 101
#define E_TIME_TWICE 102
#define E_DURATION_NO_AT 103
#define E_EXPECTING_WEEKDAY 104
#ifdef MK_GLOBALS
#undef EXTERN
#define EXTERN
@@ -241,7 +243,8 @@ EXTERN char *ErrMsg[]
"No files matching *.rem",
"String too long",
"Time specified twice",
"Cannot specify DURATION without specifying AT"
"Cannot specify DURATION without specifying AT",
"Expecting weekday name"
}
#endif /* MK_GLOBALS */
;

View File

@@ -245,7 +245,8 @@ EXTERN char *ErrMsg[] =
"No files matching *.rem",
"String too long",
"Time specified twice",
"Cannot specify DURATION without specifying AT"
"Cannot specify DURATION without specifying AT".
"Odotettu viikonpäivän nimi"
};
#endif /* MK_GLOBALS */

View File

@@ -219,7 +219,8 @@ EXTERN char *ErrMsg[] =
"No files matching *.rem",
"String too long",
"Time specified twice",
"Cannot specify DURATION without specifying AT"
"Cannot specify DURATION without specifying AT",
"Nom du jour de la semaine attendu",
};
#endif /* MK_GLOBALS */

View File

@@ -235,7 +235,8 @@ EXTERN char *ErrMsg[] =
"No files matching *.rem",
"String too long",
"Time specified twice",
"Cannot specify DURATION without specifying AT"
"Cannot specify DURATION without specifying AT",
"Oczekiwana nazwa dnia tygodnia"
};
#endif /* MK_GLOBALS */

View File

@@ -244,7 +244,8 @@ EXTERN char *ErrMsg[] =
"No files matching *.rem",
"String too long",
"Time specified twice",
"Cannot specify DURATION without specifying AT"
"Cannot specify DURATION without specifying AT",
"Esperando nome do dia da semana",
};
#endif /* MK_GLOBALS */

View File

@@ -4880,6 +4880,14 @@ set pqxya 1+2)
1 + 2 => 3
../tests/test.rem(911): Expecting end-of-line
# Should result in an error
REM Tue OMIT 2024-01-01 MSG Wookie
../tests/test.rem(914): Expecting weekday name
# No error
REM Tue OMIT Wed 2024-01-01 MSG Blort
../tests/test.rem(917): Trig = Tuesday, 2 January, 2024
# Don't want Remind to queue reminders
EXIT

View File

@@ -910,6 +910,12 @@ set a 7 * "Cabbage! "
# Should result in errors
set pqxya 1+2)
# Should result in an error
REM Tue OMIT 2024-01-01 MSG Wookie
# No error
REM Tue OMIT Wed 2024-01-01 MSG Blort
# Don't want Remind to queue reminders
EXIT