Skip to main content

collect_matching_tokens

Function collect_matching_tokens 

Source
pub fn collect_matching_tokens<F>(
    segment: &Segment,
    filter: &F,
    out: &mut Vec<(String, Span)>,
)
where F: Fn(&Segment) -> Option<(String, Span)>,
Expand description

Collect all leaf tokens from a CST that match a filter predicate. Used by CP rules in consistent mode to gather all tokens of a category.