]> git.saurik.com Git - bison.git/commitdiff
Do not allow identifiers that start with a negative number.
authorAlex Rozenman <rozenman@gmail.com>
Wed, 5 Jan 2011 13:47:25 +0000 (15:47 +0200)
committerAlex Rozenman <rozenman@gmail.com>
Wed, 5 Jan 2011 14:22:18 +0000 (16:22 +0200)
Reported by Paul Hilfinger as a side effect of named references
support at
<http://lists.gnu.org/archive/html/bug-bison/2011-01/msg00000.html>.
Suggested by Paul Eggert.
* src/scan-code.l ({letter}, {id}): Adjust lexical definitions.
* src/scan-gram.l ({letter}, {id}): Likewise.

ChangeLog
src/scan-code.l
src/scan-gram.l

index 8a273f9b5bbb67ee6b5ae2ca67abe940ffd851ce..a7d8a76427614e1297b105e1fc70db44a97bde06 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2011-01-05  Alex Rozenman  <rozenman@gmail.com>
+
+       Do not allow identifiers that start with a negative number.
+       Reported by Paul Hilfinger as a side effect of named references
+       support at
+       <http://lists.gnu.org/archive/html/bug-bison/2011-01/msg00000.html>.
+       Suggested by Paul Eggert.
+       * src/scan-code.l ({letter}, {id}): Adjust lexical definitions.
+       * src/scan-gram.l ({letter}, {id}): Likewise.
+
 2011-01-03  Joel E. Denny  <joeldenny@joeldenny.org>
 
        * ChangeLog (2011-01-02): improve description.
index 3603196c2117d42cf52ce9afc418e8317b72ac54..e3e6b6536e93417ce043d1a36537ed06070e57c4 100644 (file)
@@ -84,8 +84,8 @@ splice         (\\[ \f\t\v]*\n)*
 /* C style identifier. Must start with letter. Will be used for
    named symbol references. Shall be kept synchronized with
    scan-gram.l "letter" and "id". */
-letter   [-.abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_]
-id       {letter}({letter}|[0-9])*
+letter   [.abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_]
+id       -*(-|{letter}({letter}|[-0-9])*)
 ref      -?[0-9]+|{id}|"["{id}"]"|"$"
 
 %%
index d7606d928c1110e10599e1e5083e2fbdd2bed3b6..e1bda045d3d80213164549b2c0dc029326a70701 100644 (file)
@@ -103,8 +103,8 @@ static void unexpected_newline (boundary, char const *);
  /* Bracketed identifiers support. */
 %x SC_BRACKETED_ID SC_RETURN_BRACKETED_ID
 
-letter   [-.abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_]
-id       {letter}({letter}|[0-9])*
+letter   [.abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_]
+id       -*(-|{letter}({letter}|[-0-9])*)
 directive %{id}
 int      [0-9]+