-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
syntax: Unify macro and attribute arguments in AST #66935
Conversation
TODO (not in this PR):
|
Oh, this PR also basically implements "macro constants" in terms of representation (except they are still an error during parsing). |
@bors try @rust-timer queue |
Awaiting bors try build completion |
⌛ Trying commit eadf48aec3e87d05c7101a92612ad094c4e0ea92 with merge 6858a2a7cb74e10251ba66cd547b555717bfaff2... |
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.
Looks good; some minor nits is all I have.
☀️ Try build successful - checks-azure |
Queued 6858a2a7cb74e10251ba66cd547b555717bfaff2 with parent 4007d4e, future comparison URL. |
Finished benchmarking try commit 6858a2a7cb74e10251ba66cd547b555717bfaff2, comparison URL. |
A very slight performance improvement. |
Also remove a couple of redundant `visit_mac` asserts
eadf48a
to
498737c
Compare
Updated. |
Thanks! @bors r+ |
📌 Commit 498737c has been approved by |
syntax: Unify macro and attribute arguments in AST The unified form (`ast::MacArgs`) represents parsed arguments instead of an unstructured token stream that was previously used for attributes. It also tracks some spans and delimiter kinds better for fn-like macros and macro definitions. I've been talking about implementing this with @nnethercote in rust-lang#65750 (comment). The parsed representation is closer to `MetaItem` and requires less token juggling during conversions, so it potentially may be faster. r? @Centril
syntax: Unify macro and attribute arguments in AST The unified form (`ast::MacArgs`) represents parsed arguments instead of an unstructured token stream that was previously used for attributes. It also tracks some spans and delimiter kinds better for fn-like macros and macro definitions. I've been talking about implementing this with @nnethercote in rust-lang#65750 (comment). The parsed representation is closer to `MetaItem` and requires less token juggling during conversions, so it potentially may be faster. r? @Centril
Rollup of 6 pull requests Successful merges: - #66148 (Show the sign for signed ops on `exact_div`) - #66651 (Add `enclosing scope` parameter to `rustc_on_unimplemented`) - #66904 (Adding docs for keyword match, move) - #66935 (syntax: Unify macro and attribute arguments in AST) - #66941 (Remove `ord` lang item) - #66967 (Remove hack for top-level or-patterns in match checking) Failed merges: r? @ghost
Rustup Included rustups: - rust-lang/rust#66935 (syntax: Unify macro and attribute arguments in AST) - rust-lang/rust#66941 (Remove `ord` lang item) Fixes? #2597 changelog: none
The unified form (
ast::MacArgs
) represents parsed arguments instead of an unstructured token stream that was previously used for attributes.It also tracks some spans and delimiter kinds better for fn-like macros and macro definitions.
I've been talking about implementing this with @nnethercote in #65750 (comment).
The parsed representation is closer to
MetaItem
and requires less token juggling during conversions, so it potentially may be faster.r? @Centril