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

Document the synom parser macros #91

Merged
merged 1 commit into from
Feb 8, 2017

Conversation

mystor
Copy link
Collaborator

@mystor mystor commented Feb 5, 2017

This documents the rest of the parser macros, fixing #87.

I did it all in one go, and I didn't read over it, so there may be some mistakes. Please point them out when you look over it.

@dtolnay
Copy link
Owner

dtolnay commented Feb 5, 2017

Awesome! I made it partway through and I will continue tomorrow.

One thing I realized i need to add myself is an overview of the whitespace-handling strategy. I think the way we do it is far better (for our use case) than nom's ws macro. In short: we have a small number of building-block parsers (punct, keyword, lit, doc comment) that all ignore leading whitespace. As long as every other parser is combinated out of only these building blocks, nothing else needs to worry about whitespace anywhere else. And it is great for compile time - the cost in compile time that we pay for correct whitespace handling is basically four function calls, one in each building-block parser, rather than pervasive match expressions checking for whitespace between every possible pair of tokens like ws would do.

@mystor mystor mentioned this pull request Feb 7, 2017
@dtolnay dtolnay merged commit fab3b8a into dtolnay:master Feb 8, 2017
@dtolnay dtolnay mentioned this pull request Feb 8, 2017
26 tasks
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

Successfully merging this pull request may close these issues.

2 participants