From f065eb04806aa75dbb1b0ed2a4c8ea170aaf0214 Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Thu, 17 Dec 2015 15:45:47 -0800 Subject: [PATCH] Remove unused parameter to LexConflictManager --- spec/compiler/build_tables/lex_conflict_manager_spec.cc | 8 +------- src/compiler/build_tables/build_lex_table.cc | 1 - src/compiler/build_tables/lex_conflict_manager.cc | 3 --- src/compiler/build_tables/lex_conflict_manager.h | 3 --- 4 files changed, 1 insertion(+), 14 deletions(-) diff --git a/spec/compiler/build_tables/lex_conflict_manager_spec.cc b/spec/compiler/build_tables/lex_conflict_manager_spec.cc index 975912ea..b95129d9 100644 --- a/spec/compiler/build_tables/lex_conflict_manager_spec.cc +++ b/spec/compiler/build_tables/lex_conflict_manager_spec.cc @@ -9,13 +9,7 @@ using namespace build_tables; START_TEST describe("LexConflictManager::resolve(new_action, old_action)", []() { - LexicalGrammar lexical_grammar{{ - Variable("other_token", VariableTypeNamed, pattern("[a-b]")), - Variable("lookahead_token", VariableTypeNamed, pattern("[c-d]")) - }, {}}; - - LexConflictManager conflict_manager(lexical_grammar); - + LexConflictManager conflict_manager; bool update; Symbol sym1(0, true); Symbol sym2(1, true); diff --git a/src/compiler/build_tables/build_lex_table.cc b/src/compiler/build_tables/build_lex_table.cc index 1dca5e91..c3fc22b3 100644 --- a/src/compiler/build_tables/build_lex_table.cc +++ b/src/compiler/build_tables/build_lex_table.cc @@ -41,7 +41,6 @@ class LexTableBuilder { public: LexTableBuilder(ParseTable *parse_table, const LexicalGrammar &lex_grammar) : lex_grammar(lex_grammar), - conflict_manager(lex_grammar), parse_table(parse_table) { for (const rule_ptr &rule : lex_grammar.separators) separator_rules.push_back(rules::Repeat::build(rule)); diff --git a/src/compiler/build_tables/lex_conflict_manager.cc b/src/compiler/build_tables/lex_conflict_manager.cc index dbc8b42a..b9493dfb 100644 --- a/src/compiler/build_tables/lex_conflict_manager.cc +++ b/src/compiler/build_tables/lex_conflict_manager.cc @@ -6,9 +6,6 @@ namespace tree_sitter { namespace build_tables { -LexConflictManager::LexConflictManager(const LexicalGrammar &grammar) - : grammar(grammar) {} - bool LexConflictManager::resolve(const LexAction &new_action, const LexAction &old_action) { if (new_action.type < old_action.type) diff --git a/src/compiler/build_tables/lex_conflict_manager.h b/src/compiler/build_tables/lex_conflict_manager.h index a73048b4..dd09d779 100644 --- a/src/compiler/build_tables/lex_conflict_manager.h +++ b/src/compiler/build_tables/lex_conflict_manager.h @@ -13,10 +13,7 @@ class LexAction; namespace build_tables { class LexConflictManager { - const LexicalGrammar grammar; - public: - explicit LexConflictManager(const LexicalGrammar &); bool resolve(const LexAction &, const LexAction &); std::set fragile_tokens;