Easy to introduce parsing bug #241
Unanswered
JaapWijnen
asked this question in
Q&A
Replies: 1 comment
-
Hi @JaapWijnen! This is more a behavior of Swift, and we do document when to call the Another idea would be for the Because it's not technically a bug with the library, though, I'm going to convert to a discussion, where any improvements to documentation, error messaging, or the library design can be discussed. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Was packaging a parser implemented as a closure into a struct type and somehow my parser stopped working. Found the issue which is very easy to step into, maybe there's an opportunity for a better warning somehow? Situation:
Two exactly the same parsers, once as a closure, once as a struct:
When running a test, the closure works, but the struct fails with an error
This is due to not properly passing along the parse input in the struct's
parse(..)
implementation where I forgot the ampersand & (marked by a comment in the code above). Took me a while to find the error 😅I couldn't think of a way too catch passing these values erroneously but thought I'd share for when others run into a similar issue or for when someone does think of a potential fix!
Beta Was this translation helpful? Give feedback.
All reactions