From 507d5ad9f736fbf3a5e47d09a4b9aa6dcf838750 Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Tue, 10 May 2016 13:36:10 -0700 Subject: [PATCH] Include shift-extra actions alongside other actions in recovery states --- src/compiler/build_tables/build_parse_table.cc | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/compiler/build_tables/build_parse_table.cc b/src/compiler/build_tables/build_parse_table.cc index 15d97914..f59095df 100644 --- a/src/compiler/build_tables/build_parse_table.cc +++ b/src/compiler/build_tables/build_parse_table.cc @@ -64,19 +64,17 @@ class ParseTableBuilder { })); CompileError error = process_part_state_queue(); - if (error.type != TSCompileErrorTypeNone) { + if (error.type != TSCompileErrorTypeNone) return { parse_table, error }; - } add_out_of_context_parse_states(); + allow_any_conflict = true; process_part_state_queue(); allow_any_conflict = false; - for (ParseStateId state = 0; state < parse_table.states.size(); state++) { - add_shift_extra_actions(state); + for (ParseStateId state = 0; state < parse_table.states.size(); state++) add_reduce_extra_actions(state); - } mark_fragile_actions(); remove_duplicate_parse_states(); @@ -95,6 +93,7 @@ class ParseTableBuilder { add_reduce_actions(item_set, state_id); add_shift_actions(item_set, state_id); + add_shift_extra_actions(state_id); if (!conflicts.empty()) { return CompileError(TSCompileErrorTypeParseConflict,