Skip to content

Commit 50019ba

Browse files
committed
Add both variants of half open range patterns to the grammar
This is prompted by #9779, but it is not actually a prerequisite of making that one happen as this commit doesn't change the generated code on the r-a side.
1 parent 074b255 commit 50019ba

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

rust.ungram

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -603,7 +603,12 @@ WildcardPat =
603603
'_'
604604

605605
RangePat =
606-
start:Pat op:('..' | '..=') end:Pat
606+
// 1..
607+
start:Pat op:('..' | '..=')
608+
// 1..2
609+
| start:Pat op:('..' | '..=') end:Pat
610+
// ..2
611+
| op:('..' | '..=') end:Pat
607612

608613
RefPat =
609614
'&' 'mut'? Pat

0 commit comments

Comments
 (0)