]> git.saurik.com Git - bison.git/commit - src/reader.h
Fix a longstanding bug uncovered by bro-0.9a9/src/parse.y, which I
authorPaul Eggert <eggert@cs.ucla.edu>
Mon, 30 Jan 2006 07:26:00 +0000 (07:26 +0000)
committerPaul Eggert <eggert@cs.ucla.edu>
Mon, 30 Jan 2006 07:26:00 +0000 (07:26 +0000)
commit6b7022680ea084a5d63e73614e40647f2d0dcce9
tree1c038ec4e3c9cfccb46424aa3d9d383e117de0b9
parentd40ba6c2725f98cbbf8991f55023dd2e392efec9
Fix a longstanding bug uncovered by bro-0.9a9/src/parse.y, which I
got from <http://bro-ids.org/download.html>.  The bug is that
when two actions appeared in succession, the second one was
scanned before the first one was added to the grammar rule
as a midrule action.  Bison then output the incorrect warning
"parse.y:905.17-906.36: warning: unused value: $3".
* src/parse-gram.y (BRACED_CODE, action): These are no longer
associated with a value.
(rhs): Don't invoke grammar_current_rule_action_append.
(action): Invoke it here instead.
* src/reader.c (grammar_midrule_action): Now extern.
(grammar_current_rule_action_append): Don't invoke
grammar_midrule_action; that is now the scanner's job.
* src/reader.h (last_string, last_braced_code_loc):
(grammar_midrule_action): New decls.
* src/scan-gram.l (last_string): Now extern, sigh.
(last_braced_code_loc): New extern variable.
(<INITIAL>"{"): Invoke grammar_midrule_action if the current
rule already has an action.
(<SC_BRACED_CODE>"}"): Set last_braced_code_loc before returning.
* tests/input.at (AT_CHECK_UNUSED_VALUES):
Add some tests to check that the above changes fixed the bug.
ChangeLog
src/parse-gram.y
src/reader.c
src/reader.h
src/scan-gram.l
tests/input.at