Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

select! when returning an error gives an empty expected #504

Open
ManicMarrc opened this issue Aug 20, 2023 · 1 comment
Open

select! when returning an error gives an empty expected #504

ManicMarrc opened this issue Aug 20, 2023 · 1 comment

Comments

@ManicMarrc
Copy link

Whenever the select! parser returns an ExpectedFound error, it makes the expected field empty.
I think this has to do with tokens that contains values like:

enum Token {
    Integer(u64),
    ...
}
@zesterer
Copy link
Owner

Yep, this is because chumsky has no way of understanding what select! is trying to expect. Right now, an empty expected field should be interpreted as 'something else'. If you want to give it a particular value, I recommend using .labelled(...), which allows you to annotate parser patterns with explicit labels and have them appear in the expected list (for example, 'expected expression').

In the future we're planning to add more ways to automatically produce better error information.

@zesterer zesterer mentioned this issue Oct 10, 2023
34 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants