Function chumsky::recovery::nested_delimiters
source · [−]pub fn nested_delimiters<I: PartialEq, F, const N: usize>(
start: I,
end: I,
others: [(I, I); N],
fallback: F
) -> NestedDelimiters<I, F, N>
Expand description
A recovery strategy that searches for a start and end delimiter, respecting nesting.
It is possible to specify additional delimiter pairs that are valid in the pattern’s context for better errors. For
example, you might want to also specify [('[', ']'), ('{', '}')]
when recovering a parenthesised expression as
this can aid in detecting delimiter mismatches.
A function that generates a fallback output on recovery is also required.