mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-12 05:43:03 +00:00
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.
This commit is contained in:
@@ -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}"]"|"$"
|
||||
|
||||
%%
|
||||
|
||||
Reference in New Issue
Block a user