-
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
Parse subslice patterns #1500
Parse subslice patterns #1500
Conversation
This adds a new I'm not sure what to do with the text in |
That wasn't too bad! |
There's also |
@@ -58,6 +58,12 @@ const PAT_RECOVERY_SET: TokenSet = | |||
fn atom_pat(p: &mut Parser, recovery_set: TokenSet) -> Option<CompletedMarker> { | |||
let la0 = p.nth(0); | |||
let la1 = p.nth(1); | |||
if la0 == IDENT && la1 == 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.
Hm, I think this would allow x..
anywhere where patterns are allowed, and not only inside slices. I think we need to adjust slice_pat
instead.
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.
Ahh you're right of course. I inlined pat_list()
to slice_pat()
and made the adjustment there. Seeing as pat_list()
now only had one caller, I inlined it there and deleted it.
This was a valuable learning exercise! I'll update the issue and take another crack at it. |
cc #1479