Function arithmetic_parser::grammars::ensure_no_overlap

source ·
pub fn ensure_no_overlap<'a, T>(
    parser: impl FnMut(InputSpan<'a>) -> NomResult<'a, T>,
) -> impl FnMut(InputSpan<'a>) -> NomResult<'a, T>
Expand description

Ensures that the child parser does not consume a part of a larger expression by rejecting if the part following the input is an alphanumeric char or _.

For example, float parses -Inf, which can lead to parser failure if it’s a part of a larger expression (e.g., -Infer(2, 3)).