From adfac174fe40471bb719eab06db9e6f64a43e435 Mon Sep 17 00:00:00 2001 From: Michal Moskal Date: Thu, 19 Dec 2024 10:59:11 +0000 Subject: [PATCH] remove broken `from_grammar` method in `GrammarBuilder` --- parser/src/grammar_builder.rs | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/parser/src/grammar_builder.rs b/parser/src/grammar_builder.rs index a0e3e97..89c5a14 100644 --- a/parser/src/grammar_builder.rs +++ b/parser/src/grammar_builder.rs @@ -155,18 +155,6 @@ impl RegexBuilder { } impl GrammarBuilder { - pub fn from_grammar(grammar: TopLevelGrammar) -> (Self, NodeRef) { - assert!(grammar.grammars.len() == 1); - let mut builder = Self::new(); - builder.top_grammar = grammar; - builder.nodes = std::mem::take(&mut builder.top_grammar.grammars[0].nodes); - builder.next_grammar_id(); - let prev_root = builder.nodes[0].clone(); - builder.nodes[0] = builder.placeholder.clone(); - let prev_root = builder.add_node(prev_root); - (builder, prev_root) - } - pub fn new() -> Self { Self { top_grammar: TopLevelGrammar {