]> git.saurik.com Git - bison.git/commit - src/reader.c
Don't miss %merge result type warnings just because the LHS types are
authorJoel E. Denny <jdenny@ces.clemson.edu>
Mon, 26 Jun 2006 04:45:24 +0000 (04:45 +0000)
committerJoel E. Denny <jdenny@ces.clemson.edu>
Mon, 26 Jun 2006 04:45:24 +0000 (04:45 +0000)
commit8ee5b53874f631bf6099e19fc6e13cbc47bc5fd8
treefea831cb15d8961d7e14fbbd3a64f39a70441ea7
parentad6b1efa2f5ba267158318b48bbda4a30221f905
Don't miss %merge result type warnings just because the LHS types are
declared after the %merge.
* src/reader.c (get_merge_function): Don't set the merger type yet.
(record_merge_function_type): New function for setting the merger type
and checking for clashes.
(grammar_current_rule_merge_set): Set the location of the %merge for
the current rule.
(packgram): Invoke record_merge_function_type for each rule now that
all symbol type declarations have been parsed.
* src/reader.h (merger_list.type_declaration_location): New member
storing the location of the first %merge from which the type for this
merging function was derived.
* src/symlist.h (symbol_list.merger_declaration_location): New member
storing the location of a rule's %merge, if any.
* tests/glr-regression.at (Missed %merge type warnings when LHS type is
declared later): New test to catch the error fixed by the above patch.
ChangeLog
src/reader.c
src/reader.h
src/symlist.h
tests/glr-regression.at