Skip to content

Commit

Permalink
remove broken from_grammar method in GrammarBuilder
Browse files Browse the repository at this point in the history
  • Loading branch information
mmoskal committed Dec 19, 2024
1 parent 276dd71 commit adfac17
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions parser/src/grammar_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit adfac17

Please sign in to comment.