From b7e0cb1fc63d6c01b437010176f68326b9b4cb92 Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Mon, 26 Oct 2015 17:19:04 -0700 Subject: [PATCH] Revert 'Add reduce-extra actions for all symbols' It only makes sense to add reduce-extra actions for those symbols that have actions in the state the will be reduced to --- src/compiler/build_tables/build_parse_table.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/compiler/build_tables/build_parse_table.cc b/src/compiler/build_tables/build_parse_table.cc index 40d786ca..2a5738a9 100644 --- a/src/compiler/build_tables/build_parse_table.cc +++ b/src/compiler/build_tables/build_parse_table.cc @@ -171,8 +171,8 @@ class ParseTableBuilder { if (action.type == ParseActionTypeShift) { size_t dest_state_id = action.state_index; ParseAction reduce_extra = ParseAction::ReduceExtra(ubiquitous_symbol); - for (const auto &symbol : parse_table.symbols) - add_action(dest_state_id, symbol, reduce_extra, item_set); + for (const auto &pair : state.actions) + add_action(dest_state_id, pair.first, reduce_extra, item_set); } } }