mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-19 17:23:02 +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:
@@ -118,8 +118,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]+
|
||||
|
||||
|
||||
Reference in New Issue
Block a user