-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Remove trivia tokens #76170
Remove trivia tokens #76170
Conversation
Builds on the #76166 This doesn't actually remove associated enum variants just yet, but, surprisingly, just never constructiong those variants works without any additional tweaks anywhere. |
I think the end result here would be something like crate fn tokenize_into_token_trees(
sess: &'a ParseSess,
source_file: Lrc<rustc_span::SourceFile>,
override_span: Option<Span>,
) -> (PResult<'a, TokenStream>, Vec<UnmatchedBrace>) Ie, |
Ready for review @petrochenkov! I've decided to leave overall code shape changes (fully privatising StringReader) to a follow up PR, to separate pure refactoring from changes to core data structures. |
Wait, tests fail locally... |
This `joint_to_prev` bit of state is no longer needed.
if !self.token.is_op() { | ||
is_joint = NonJoint; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I originally forgot this condition, and that failed some proc-macro tests. This is a bit weird -- I would expect this jointness censoring to happen at the proc_macro_srv layer, and not here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this check should be moved to proc macro server.
Also lexer should produce the jointness flag for the "delimited group" token trees as well (the match branches above). (Two of such flags, actually, for both the opening and the closing delimiter.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should I do this in this PR, or a separate one?
I've also rebased #75528 on top of this PR, seems to work
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should I do this in this PR, or a separate one?
Whichever is more convenient.
Ok, should be good to go now! |
@bors r+ |
📌 Commit fabd8a6 has been approved by |
☀️ Test successful - checks-actions, checks-azure |
r? @ghost