Skip to content

Refactor the parser to consume token trees #39118

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

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

@jseyfried jseyfried force-pushed the token_tree_based_parser branch from 46f0203 to 9118f79 Compare January 17, 2017 08:17
@jseyfried jseyfried force-pushed the token_tree_based_parser branch from 9118f79 to 0b9e26f Compare January 17, 2017 21:10
@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
Collaborator

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
@bors bors merged commit 0b9e26f into rust-lang:master Jan 21, 2017
@jseyfried jseyfried deleted the token_tree_based_parser branch February 1, 2017 04:12
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants