fix hexadecimal token number support.

* src/scan-gram.l: Catch incorrect ids after hexadecimal numbers.
This commit is contained in:
Akim Demaille
2009-05-05 09:36:06 +02:00
parent d19123e612
commit 601bdfabe2
2 changed files with 11 additions and 6 deletions

View File

@@ -208,12 +208,6 @@ splice (\\[ \f\t\v]*\n)*
complain_at (*loc, _("invalid directive: %s"), quote (yytext));
}
/* Identifiers may not start with a digit. Yet, don't silently
accept "1FOO" as "1 FOO". */
{int}{id} {
complain_at (*loc, _("invalid identifier: %s"), quote (yytext));
}
"=" return EQUAL;
"|" return PIPE;
";" return SEMICOLON;
@@ -235,6 +229,12 @@ splice (\\[ \f\t\v]*\n)*
return INT;
}
/* Identifiers may not start with a digit. Yet, don't silently
accept "1FOO" as "1 FOO". */
{int}{id} {
complain_at (*loc, _("invalid identifier: %s"), quote (yytext));
}
/* Characters. We don't check there is only one. */
"'" STRING_GROW; token_start = loc->start; BEGIN SC_ESCAPED_CHARACTER;