shift-extra actions do not have valid state_ids

This commit is contained in:
Phil Turnbull 2017-06-09 16:25:40 -04:00
parent 18ba6ebbd7
commit 577e43f653

View file

@ -151,7 +151,7 @@ bool ParseState::has_shift_action() const {
void ParseState::each_referenced_state(function<void(ParseStateId *)> fn) {
for (auto &entry : terminal_entries)
for (ParseAction &action : entry.second.actions)
if (action.type == ParseActionTypeShift || action.type == ParseActionTypeRecover)
if ((action.type == ParseActionTypeShift && !action.extra) || action.type == ParseActionTypeRecover)
fn(&action.state_index);
for (auto &entry : nonterminal_entries)
if (entry.second != (ParseStateId)(-1))