From 076a27be4a46068bf9d621b75c590be2df0f6b3f Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Sun, 27 Apr 2014 22:02:55 -0700 Subject: [PATCH] Fix compile error on gcc --- src/compiler/build_tables/follow_sets.cc | 1 - src/compiler/build_tables/item_set_closure.cc | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/compiler/build_tables/follow_sets.cc b/src/compiler/build_tables/follow_sets.cc index be7c29ed..a9439e1f 100644 --- a/src/compiler/build_tables/follow_sets.cc +++ b/src/compiler/build_tables/follow_sets.cc @@ -24,7 +24,6 @@ namespace tree_sitter { result.insert({ symbol, following_terminals }); } } - return result; } } diff --git a/src/compiler/build_tables/item_set_closure.cc b/src/compiler/build_tables/item_set_closure.cc index e47b7cad..d9a71ab9 100644 --- a/src/compiler/build_tables/item_set_closure.cc +++ b/src/compiler/build_tables/item_set_closure.cc @@ -26,7 +26,8 @@ namespace tree_sitter { const ISymbol &non_terminal = pair.first; const set &terminals = pair.second; for (const auto &terminal : terminals) { - items_to_add.push_back(ParseItem(non_terminal, grammar.rule(non_terminal), 0, terminal)); + ParseItem next_item(non_terminal, grammar.rule(non_terminal), 0, terminal); + items_to_add.push_back(next_item); } } }