]> git.saurik.com Git - bison.git/blobdiff - src/scan-code.l
Do not allow identifiers that start with a negative number.
[bison.git] / src / scan-code.l
index 6cda417da8f5aa9dc3034edca2f2c53d7bd16f19..e3e6b6536e93417ce043d1a36537ed06070e57c4 100644 (file)
@@ -1,7 +1,6 @@
 /* Bison Action Scanner                             -*- C -*-
 
-   Copyright (C) 2006, 2007, 2008, 2009, 2010 Free Software
-   Foundation, Inc.
+   Copyright (C) 2006-2011 Free Software Foundation, Inc.
 
    This file is part of Bison, the GNU Compiler Compiler.
 
@@ -85,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}"]"|"$"
 
 %%