Function blarse::process_rule

source ·
pub fn process_rule(
    rule: impl Fn(Vec<Token<'_>, Global>) -> Option<Vec<Token<'_>, Global>>,
    body: &mut Vec<Token<'_>, Global>
)
Expand description

Processes a rule across a vector of tokens. Starting from the first token, iteratively applies the rule on a single token. If that application returns None, continues applying the rule on the token and the next, then the next, and so on until the function returns Some or there are no tokens left to process. This process is explained more thoroughly with examples in the readme.