Skip to content

Commit

Permalink
Removed unused syntax from
Browse files Browse the repository at this point in the history
`recursively_mark_no_prototype`
  • Loading branch information
CGMossa committed Nov 29, 2023
1 parent ead14fa commit 23030b7
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/parsing/syntax_set.rs
Original file line number Diff line number Diff line change
Expand Up @@ -590,12 +590,12 @@ impl SyntaxSetBuilder {
}

let mut found_more_backref_includes = true;
for (syntax_index, syntax) in syntaxes.iter().enumerate() {
for (syntax_index, _syntax) in syntaxes.iter().enumerate() {
let mut no_prototype = HashSet::new();
let prototype = all_context_ids[syntax_index].get("prototype");
if let Some(prototype_id) = prototype {
// TODO: We could do this after parsing YAML, instead of here?
Self::recursively_mark_no_prototype(syntax, prototype_id, &all_context_ids[syntax_index], &all_contexts, &mut no_prototype);
Self::recursively_mark_no_prototype(prototype_id, &all_context_ids[syntax_index], &all_contexts, &mut no_prototype);
}

for context_id in all_context_ids[syntax_index].values() {
Expand Down Expand Up @@ -670,7 +670,6 @@ impl SyntaxSetBuilder {
/// Anything recursively included by the prototype shouldn't include the prototype.
/// This marks them as such.
fn recursively_mark_no_prototype(
_syntax: &SyntaxReference,
context_id: &ContextId,
syntax_context_ids: &HashMap<String, ContextId>,
all_contexts: &[Vec<Context>],
Expand All @@ -696,11 +695,11 @@ impl SyntaxSetBuilder {
match context_ref {
ContextReference::Inline(ref s) | ContextReference::Named(ref s) => {
if let Some(i) = syntax_context_ids.get(s) {
Self::recursively_mark_no_prototype(_syntax, i, syntax_context_ids, all_contexts, no_prototype);
Self::recursively_mark_no_prototype(i, syntax_context_ids, all_contexts, no_prototype);
}
},
ContextReference::Direct(ref id) => {
Self::recursively_mark_no_prototype(_syntax, id, syntax_context_ids, all_contexts, no_prototype);
Self::recursively_mark_no_prototype(id, syntax_context_ids, all_contexts, no_prototype);
},
_ => (),
}
Expand All @@ -711,11 +710,11 @@ impl SyntaxSetBuilder {
match reference {
ContextReference::Named(ref s) => {
if let Some(id) = syntax_context_ids.get(s) {
Self::recursively_mark_no_prototype(_syntax, id, syntax_context_ids, all_contexts, no_prototype);
Self::recursively_mark_no_prototype(id, syntax_context_ids, all_contexts, no_prototype);
}
},
ContextReference::Direct(ref id) => {
Self::recursively_mark_no_prototype(_syntax, id, syntax_context_ids, all_contexts, no_prototype);
Self::recursively_mark_no_prototype(id, syntax_context_ids, all_contexts, no_prototype);
},
_ => (),
}
Expand Down

0 comments on commit 23030b7

Please sign in to comment.