Remove duplicate parse actions
This has only come up for out-of-context states, but it seems possible now that there could be duplicate actions for any state, because of the possibility of multiple actions with different precedence or associativity that are otherwise the same
This commit is contained in:
parent
b68f7212c8
commit
b733b0cc81
1 changed files with 13 additions and 0 deletions
|
|
@ -230,6 +230,19 @@ class ParseTableBuilder {
|
|||
action.associativity = rules::AssociativityNone;
|
||||
}
|
||||
}
|
||||
|
||||
for (auto i = entry.second.begin(); i != entry.second.end();) {
|
||||
bool erased = false;
|
||||
for (auto j = entry.second.begin(); j != i; j++) {
|
||||
if (*j == *i) {
|
||||
entry.second.erase(i);
|
||||
erased = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!erased)
|
||||
++i;
|
||||
}
|
||||
}
|
||||
|
||||
if (!symbols_with_multiple_actions.empty()) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue