social.coop is one of the many independent Mastodon servers you can use to participate in the fediverse.
A Fediverse instance for people interested in cooperative and collective projects. If you are interested in joining our community, please apply at https://join.social.coop/registration-form.html.

Administered by:

Server stats:

459
active users

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

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.

Joshua Barretto

@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 :)