bison-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] fix hexadecimal token number support.


From: Akim Demaille
Subject: [PATCH] fix hexadecimal token number support.
Date: Tue, 5 May 2009 09:36:06 +0200

        * 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 ba901d6..cac83fd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2009-05-05  Akim Demaille  <address@hidden>
 
+       fix hexadecimal token number support.
+       * src/scan-gram.l: Catch incorrect ids after hexadecimal numbers.
+
+2009-05-05  Akim Demaille  <address@hidden>
+
        tests: check token numbers.
        * tests/input.at (Numbered tokens): New.
 
diff --git a/src/scan-gram.l b/src/scan-gram.l
index a22cafd..c8c9771 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;
 
-- 
1.6.2.2





reply via email to

[Prev in Thread] Current Thread [Next in Thread]