scanner: bad character literals are errors

* src/scan-gram.l: These are errors, not warnings.
* tests/input.at: Adjust.
This commit is contained in:
Akim Demaille
2020-04-27 07:17:04 +02:00
parent 5f3cd49acc
commit 3262747c5b
2 changed files with 21 additions and 22 deletions

View File

@@ -566,15 +566,14 @@ eqopt ({sp}=)?
loc->start = token_start;
val->CHAR = last_string[0];
/* FIXME: Eventually, make these errors. */
if (last_string[0] == '\0')
{
complain (loc, Wother, _("empty character literal"));
complain (loc, complaint, _("empty character literal"));
/* '\0' seems dangerous even if we are about to complain. */
val->CHAR = '\'';
}
else if (last_string[1] != '\0')
complain (loc, Wother,
complain (loc, complaint,
_("extra characters in character literal"));
STRING_FREE;
BEGIN INITIAL;