Always mark reduce actions as fragile when they're discarded due to precedence

This commit is contained in:
Max Brunsfeld 2015-12-06 14:09:24 -08:00
parent 738c49abc8
commit 26dad87299

View file

@ -172,13 +172,15 @@ class ParseTableBuilder {
break;
case ConflictTypeResolved: {
if (resolution.first)
if (resolution.first) {
if (old_action.type == ParseActionTypeReduce)
parse_table.fragile_productions.insert(old_action.production);
return &parse_table.set_action(state_id, lookahead, new_action);
if (old_action.type == ParseActionTypeReduce)
parse_table.fragile_productions.insert(old_action.production);
if (new_action.type == ParseActionTypeReduce)
parse_table.fragile_productions.insert(new_action.production);
break;
} else {
if (new_action.type == ParseActionTypeReduce)
parse_table.fragile_productions.insert(new_action.production);
break;
}
}
case ConflictTypeUnresolved: {