in crates/core/src/models/source_code_unit.rs [309:337]
fn add_rules_to_stack(
&mut self, next_rules_by_scope: &HashMap<String, Vec<InstantiatedRule>>,
current_match_range: Range, rules_store: &mut RuleStore,
stack: &mut VecDeque<(CGPattern, InstantiatedRule)>,
) {
for (scope_level, rules) in next_rules_by_scope {
// Scope level is not "Parent", "ParentIterative", "Global", "Directory", or "DirectoryRecursive"
if ![
PARENT,
PARENT_ITERATIVE,
GLOBAL,
DIRECTORY,
DIRECTORY_RECURSIVE,
]
.contains(&scope_level.as_str())
{
for rule in rules {
let scope_query = self.get_scope_query(
scope_level,
*current_match_range.start_byte(),
*current_match_range.end_byte(),
rules_store,
);
// Add Method and Class scoped rules to the queue
stack.push_front((scope_query, rule.clone()));
}
}
}
}