-
-
Notifications
You must be signed in to change notification settings - Fork 111
Parse macro invocations containing $ #96
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
Conversation
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.
Could you rebase on the latest so there is no conflict?
|
||
_non_delim_token: $ => choice( | ||
$._non_special_token, | ||
'$' |
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.
do we need other characters here? This is needed just for '$'?
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 believe $
is the only character we need to add here. _non_special_token
is analogous to the first branch of the MacroMatch
construction in the reference, which allows any token other than $
and delimiters.
Sorry, I've been away from github for a few months. I'll take a look at this and see if I can rebase & address comments soon. |
Metavariables can only occur in macro transcribers, so matching them in invocations makes little sense. Instead, match $ and an identifier separately.
Allows deduplicating _common_token and _non_special_token
e3ad491
to
ae4bf74
Compare
Rebased to resolve merge conflicts. Removed special handling of metavariables ( |
This looks good! I guess this can unblock your other PRs now! |
Thanks for merging! I'll work on rebasing #93. |
Closes #95.
Adds a set of productions for general delimited token trees. These productions do not attempt to find
macro_rules!
-specific features like repetitions, and consider$
to be a normal token. For backwards compatibility, use of the new productions aliases them totoken_tree
.Blocks draft #93, which adds similar productions; #93 could be rebased on top of this if relevant.