-
Notifications
You must be signed in to change notification settings - Fork 96
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
Throw stream errors #323
Comments
You would return an error if the stream can no longer be used to retrieve more tokens. If you have a specific error token the I would assume that the stream may still be used, just that one token was an error so you would return |
Not always. Unfinished string can break all following lexing
That the only solution I found. I created my own token parser, but is it idiomatic way to handle such errors in combine? |
Yes, I think so at least. What would be the alternative? |
Throw error from stream (maybe). It gives more guarentees that invalid input won't be skipped. Otherwise I have to be sure that every parsing action is based on my own token parser |
I suppose you could instead use a parser which inspects the error being returned and recovers if you deem it to be a recoverable error |
I have stream of tokens. Token is enum like:
StreamOnce::uncons
documentation:Returns Err if no element could be retrieved.
How I can throw error when I have
Token::Error
?The text was updated successfully, but these errors were encountered: