update fragment specifiers/allow spaces in metavariable declarations #49
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I came across a Rust project with macros that put a space after the colon in a macro metavariable declaration (e.g.
$var: literal
) and noticed the fragment specifier didn't get thevariable.other.metavariable.specifier.rust
scope. Additionally,pat_param
isn't in the list sopat
would get the scope but not_param
. Plus Rust 2024 edition is adding anexpr_2021
fragment specifier for backward compatibility with macros written for 2021 edition.pat_param
specifier from 2021 editionexpr_2021
specifier from 2024 edition: https://doc.rust-lang.org/edition-guide/rust-2024/macro-fragment-specifiers.htmlexpr
macro fragment specifier for Rust 2024 rust-lang/rust#123742 (comment)\b
) at the end of the specifier[A-Za-z0-9_]
with\w
:
in metavariable declarations