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

IPv4 example does not consume entire input #3

Closed
rokups opened this issue Dec 2, 2020 · 3 comments
Closed

IPv4 example does not consume entire input #3

rokups opened this issue Dec 2, 2020 · 3 comments

Comments

@rokups
Copy link

rokups commented Dec 2, 2020

IPv4 parsing example happily accepts "192.168.1.1x00" and "x00" bit is happily ignored. Should it not report an error?

@foonathan
Copy link
Owner

"should" is relative.

The code as written does not consume entire input that is correct, but this is not a bug in the library: unless you tell it, it does not consume the entire input.

However, the example implementation should probably do that? I'll fix it.

@rokups
Copy link
Author

rokups commented Dec 2, 2020

If that is out of scope of example, a comment indicating the behavior would suffice to clear the confusion. Thanks 👍

(library looks amazing!)

@foonathan
Copy link
Owner

No, I just forgot :D The example was originally meant to illustrate dsl::times so kept very minimal. It's just a matter of adding a + dsl::eof at the end.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants