-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Amend macro future proofing RFC #733
Conversation
It seems like the RFC is incomplete: FIRST needs to be spelled out. |
@cmr, I would like to clarify something: |
852f861
to
ad390bd
Compare
ad390bd
to
38ff99a
Compare
Okay, updated my PR. |
@vadimcn Yes, your understanding is correct. |
Could this help solve #773? |
4. Find `S`, the set of possible successors of `t`: | ||
1. If `TAIL(M)` is empty, set `S = F`, | ||
2. Else, `S = LEADERS(TAIL(M))`. | ||
5. If `t` is a simple NT, check that `S` is a subset of `FOLLOW(t)`. |
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.
what is the distinction between simple and complex non-terminal? I do not see that in the "Terminology" section.
Update: Sorry, I see the definition for "simple", up above.
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 just used the original @cmr's definitions of 'simple' and complex'. I'll add a clarification as you asked above.
Looks like some rebasings have disappeared some of the comments I previously made. Will re-review, but @pnkfelix's and @nikomatsakis's comments are on-point. |
Did not read yet, but +1 for allowing repetition after a metavariable. The inability to do
is a serious limitation with fancy recursive macros. And it should be completely un-problematic in the case of |
Renamed `LEADERS` to `FIRST`
@cmr, @nikomatsakis: ping |
ping @pnkfelix |
While this is still open, could we also add |
Okay, so I finally got a chance to go through this in some detail. (I had not really read this RFC carefully enough in the past, so I got caught up in relatively minor issues in its presentation that are not an issue with this PR in particular; hopefully I will have a chance in the near future, while this is fresh in my mind, to try to put up a PR with some revisions to the text to help clarify it.)
|
Also |
cc #1209 |
@vadimcn have you given any thought to the feedback I wrote above? (I know I promised to write up more later, so I cannot claim that I am not without blame w.r.t. the radio silence here.) Anyway, let me know if you think you'll be able to address the issues above. If you won't have the time, I can try to take on this RFC myself (i.e. try to figure out what are the edits that I want, and put my my own PR with them...) |
@pnkfelix: sorry this slipped through the cracks of my attention. I'll take another look tonight. |
@pnkfelix: indeed, NT matching an empty string seems to be a problem. I've updated the PR to address this. |
What's the status here? |
So I managed to spend ages working on the more invasive macro future-proofing amendment #1384 but I failed to incorporate the suggestions from this RFC in that effort. Sorry about that, I don't know how I overlooked it. Update 1: Oh wait, no, I did put |
Okay, #1384 handles repetitions in the manner that I think this PR was asking for: macro_rules! foo { ($a:expr $( , $b:expr ),*) => {} } compiles fine on Nightly today (but is rejected by Stable right now, of course). So, given that we now handle sequence repetitions, and that Semi is in Thank you for your patience, @vadimcn |
Proposed changes:
(rendered)