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

Refactor the parser to consume token trees #39118

Merged
merged 8 commits into from
Jan 21, 2017

Conversation

jseyfried
Copy link
Contributor

@jseyfried jseyfried commented Jan 17, 2017

This is groundwork for efficiently parsing attribute proc macro invocations, bang macro invocations, and TokenStream-based attributes and fragment matchers.

This improves parsing performance by 8-15% and expansion performance by 0-5% on a sampling of the compiler's crates.

r? @nrc

@nrc
Copy link
Member

nrc commented Jan 18, 2017

This looks great. I'm a little concerned about the commit removing the lookahead buffer - is that because we never use lookahead now?

@nrc
Copy link
Member

nrc commented Jan 18, 2017

Oh, right, you can look ahead in the Tok stream without it, I guess?

@nrc
Copy link
Member

nrc commented Jan 18, 2017

@bors: r

@bors
Copy link
Contributor

bors commented Jan 18, 2017

📌 Commit 0b9e26f has been approved by nrc

@jseyfried
Copy link
Contributor Author

Yeah, we look ahead in parser.tts directly.

alexcrichton added a commit to alexcrichton/rust that referenced this pull request Jan 20, 2017
…r=nrc

Refactor the parser to consume token trees

This is groundwork for efficiently parsing attribute proc macro invocations, bang macro invocations, and `TokenStream`-based attributes and fragment matchers.

This improves parsing performance by 8-15% and expansion performance by 0-5% on a sampling of the compiler's crates.

r? @nrc
bors added a commit that referenced this pull request Jan 20, 2017
bors added a commit that referenced this pull request Jan 21, 2017
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.

3 participants