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

Documentation discrepancy between parse and parse2 #1723

Open
cafce25 opened this issue Aug 22, 2024 · 0 comments
Open

Documentation discrepancy between parse and parse2 #1723

cafce25 opened this issue Aug 22, 2024 · 0 comments
Labels

Comments

@cafce25
Copy link

cafce25 commented Aug 22, 2024

Both functions are very similar, yet parse2 explicitly states

This function will check that the input is fully parsed. If there are any unparsed tokens at the end of the stream, an error is returned.

parse does behave the same way (it also errors if the input wasn't completely consumed) but instead of saying so it only notes

This is preferred over parsing a string because tokens are able to preserve information about where in the user’s code they were originally written (the “span” of the token), possibly allowing the compiler to produce better error messages.

As far as I can tell both sentences are equally relevant for both functions so I think both texts should be synchronized.

Alternatively the whole text could be collected under parse with parse2 just referring to parses documentation.

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

No branches or pull requests

2 participants