Skip to main content

find_all_in_scope

Function find_all_in_scope 

Source
pub fn find_all_in_scope<'a, F>(
    expression: &'a Expression,
    predicate: F,
    bfs: bool,
) -> Vec<&'a Expression>
where F: Fn(&Expression) -> bool,
Expand description

Find all expressions matching the predicate within this scope.

This does NOT traverse into subscopes.

§Arguments

  • expression - The root expression
  • predicate - Function that returns true for matching expressions
  • bfs - If true, uses breadth-first search; otherwise depth-first

§Returns

A vector of matching expressions