currently crying inconsolably at my parser as I try to get it to give me a proper error message in one very particular case and instead it just says something completely nonsensical.
who wrote this shit
nevermind fixed it
legit took me a minute to figure out that this error is, indeed, correct.
And I'm kind of annoyed that I think I have to add very special-case errors just to give more useful messages for weird corner cases like this.
every time I do this kind of work, I light some incense at my little @ekuber altar.
Anyway, this seems better.
@zkat Have you tried pre-parsing as token trees? That would make it easier to point at the entire braced group rather than just the opening brace, and fits the intuition users are likely to have more.
@jsbarretto see in theory, this might be the smart thing to do but...
A. I'm not sure I could get quite the nice kinds of errors I'm trying to get here, if I were to do it that way,
B. That... is not something I think parser combinators are very good at doing. They tend to be very "do everything in one pass with composable bits that each yield a full value", and I'm using winnow (and I like parser combinators)
@zkat I also like parser combinators! Winnow is probably a bit too rigid for this, yes. There are other parser combinators that can do it (*cough* mine) but that's understandable in that case. I'm confident that it would allow for a nicer error in this case though :)
@zkat Is your code public?
If not can I ask which tools you used for your parser and these nice error messages?
@tant winnow + miette (rust). The repo is over at https://github.com/kdl-org/kdl-rs although the error recovery stuff is in a PR right now
@zkat I feel this deeply
Ah, the quintessential developer experience.
WHY WHY WHY DOESN'T
IT
WORK
MY SOUL IS LEAVING MY BO—oh, yeah, okay, that was it
@d2718 is this what they mean by DX