Move state_id check into each_referenced_state

This commit is contained in:
Phil Turnbull 2017-06-09 16:13:17 -04:00
parent 6897530c47
commit 18ba6ebbd7
2 changed files with 3 additions and 3 deletions

View file

@ -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 {