Move state_id check into each_referenced_state
This commit is contained in:
parent
6897530c47
commit
18ba6ebbd7
2 changed files with 3 additions and 3 deletions
|
|
@ -394,8 +394,7 @@ class ParseTableBuilder {
|
|||
} else {
|
||||
ParseState &state = *iter;
|
||||
state.each_referenced_state([&new_state_ids](ParseStateId *state_index) {
|
||||
if (*state_index != (ParseStateId)(-1))
|
||||
*state_index = new_state_ids[*state_index];
|
||||
*state_index = new_state_ids[*state_index];
|
||||
});
|
||||
++iter;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -154,7 +154,8 @@ void ParseState::each_referenced_state(function<void(ParseStateId *)> fn) {
|
|||
if (action.type == ParseActionTypeShift || action.type == ParseActionTypeRecover)
|
||||
fn(&action.state_index);
|
||||
for (auto &entry : nonterminal_entries)
|
||||
fn(&entry.second);
|
||||
if (entry.second != (ParseStateId)(-1))
|
||||
fn(&entry.second);
|
||||
}
|
||||
|
||||
bool ParseState::operator==(const ParseState &other) const {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue