Skip to content

Branches give weird error messages #935

@DasLixou

Description

@DasLixou
fn inner<'src>() -> impl Parser<'src, &'src str, (), extra::Err<Rich<'src, char>>> {
    just("!")
        .then_ignore(choice((
            just("a").contextual().configure(|_cfg, cond| true),
            just("b").contextual().configure(|_cfg, cond| false),
        )))
        .ignored()
}
let p = inner();
let e = p.parse("!");
for e in e.into_errors() {
    println!("ERROR: {e}");
}

results in this:

ERROR: found end of input expected 'a', or something else

The something else doesn't make sense here as the other contextual is disabled.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions