From: Akim Demaille Date: Tue, 5 May 2009 07:36:06 +0000 (+0200) Subject: fix hexadecimal token number support. X-Git-Tag: v2.5_rc1~239 X-Git-Url: https://git.saurik.com/bison.git/commitdiff_plain/601bdfabe277f58ffaa6280cbea06259edacef09?ds=inline;hp=d19123e612529ad3670b91f0764b7c9122789ae8 fix hexadecimal token number support. * src/scan-gram.l: Catch incorrect ids after hexadecimal numbers. --- diff --git a/ChangeLog b/ChangeLog index ba901d60..cac83fd3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-05-05 Akim Demaille + + fix hexadecimal token number support. + * src/scan-gram.l: Catch incorrect ids after hexadecimal numbers. + 2009-05-05 Akim Demaille tests: check token numbers. diff --git a/src/scan-gram.l b/src/scan-gram.l index a22cafdc..c8c9771c 100644 --- a/src/scan-gram.l +++ b/src/scan-gram.l @@ -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;