From 601bdfabe277f58ffaa6280cbea06259edacef09 Mon Sep 17 00:00:00 2001 From: Akim Demaille Date: Tue, 5 May 2009 09:36:06 +0200 Subject: [PATCH] fix hexadecimal token number support. * src/scan-gram.l: Catch incorrect ids after hexadecimal numbers. --- ChangeLog | 5 +++++ src/scan-gram.l | 12 ++++++------ 2 files changed, 11 insertions(+), 6 deletions(-) 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; -- 2.45.2