mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 20:33: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:
10
ChangeLog
10
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.
|
||||
|
||||
@@ -85,8 +85,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}"]"|"$"
|
||||
|
||||
%%
|
||||
|
||||
@@ -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