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

Diagnostics for metadata parsing is pretty bad! #30

Open
2 tasks
ErichDonGubler opened this issue Oct 24, 2023 · 1 comment
Open
2 tasks

Diagnostics for metadata parsing is pretty bad! #30

ErichDonGubler opened this issue Oct 24, 2023 · 1 comment
Labels
A-parsing-metadata A-webgpu-cts bug Something isn't working help wanted Extra attention is needed

Comments

@ErichDonGubler
Copy link
Owner

ErichDonGubler commented Oct 24, 2023

Right now, diagnostics are pretty bad. TODO: show examples, they're pretty easy to make, like with parens, empty intermittents, etc.

Current leads to fix this:

  • I don't know how to force chumsky to say, "Actually, you should report issues you have with the inner property or subtest parsers, and not just bail with an error trying to parse another top-level test as a last resort." a la nom::prelude::cut.
  • We might be able to get around this with multiple passes to parsing. I'm not sure what the performance ramifications of this are, but it might make parsing easier to reason about, and provide this as a benefit. We'd have to do some thinking about how to keep diagnostic spans aligned between parsing passes, too.
@ErichDonGubler ErichDonGubler added bug Something isn't working help wanted Extra attention is needed A-parsing-metadata A-webgpu-cts labels Oct 24, 2023
@ErichDonGubler ErichDonGubler self-assigned this Oct 24, 2023
@ErichDonGubler
Copy link
Owner Author

ErichDonGubler commented Oct 24, 2023

A relevant chumsky upstream discussion: zesterer/chumsky#522

GitHub
Let's say that I have this parser: it either parses a function definition or an expression. let fn_ = keyword("fn").padded() .ignore_then(ident_) .then(args) .then(fn_body); choice(( fn_, expr, )) ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-parsing-metadata A-webgpu-cts bug Something isn't working help wanted Extra attention is needed
Projects
Development

No branches or pull requests

1 participant