Skip to content

Commit 0566b16

Browse files
eernstgCommit Queue
authored andcommitted
Update Dart.g & Dart.g4 to match newest version of spec
Change-Id: I10a0527577439cb9ea1d94d60b31703995d7f6b9 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/397905 Commit-Queue: Erik Ernst <[email protected]> Auto-Submit: Erik Ernst <[email protected]> Reviewed-by: Chloe Stefantsova <[email protected]> Commit-Queue: Chloe Stefantsova <[email protected]>
1 parent 37b03ee commit 0566b16

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

tools/spec_parser/Dart.g

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -683,7 +683,6 @@ primary
683683
| '(' expression ')'
684684
| constructorTearoff
685685
| switchExpression
686-
| staticMemberShorthand
687686
;
688687

689688
constructorInvocation
@@ -800,8 +799,12 @@ switchExpressionCase
800799
;
801800

802801
staticMemberShorthand
803-
: '.' identifierOrNew selector*
804-
| CONST '.' identifierOrNew selector*
802+
: staticMemberShorthandHead selector*
803+
;
804+
805+
staticMemberShorthandHead
806+
: '.' identifierOrNew
807+
| CONST '.' identifierOrNew arguments
805808
;
806809

807810
throwExpression
@@ -1037,6 +1040,7 @@ awaitExpression
10371040
postfixExpression
10381041
: assignableExpression postfixOperator
10391042
| primary selector*
1043+
| staticMemberShorthand
10401044
;
10411045

10421046
postfixOperator

tools/spec_parser/dart_spec_parser/Dart.g4

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -689,7 +689,6 @@ primary
689689
| '(' expression ')'
690690
| constructorTearoff
691691
| switchExpression
692-
| staticMemberShorthand
693692
;
694693

695694
constructorInvocation
@@ -806,8 +805,12 @@ switchExpressionCase
806805
;
807806

808807
staticMemberShorthand
809-
: '.' identifierOrNew selector*
810-
| CONST '.' identifierOrNew selector*
808+
: staticMemberShorthandHead selector*
809+
;
810+
811+
staticMemberShorthandHead
812+
: '.' identifierOrNew
813+
| CONST '.' identifierOrNew arguments
811814
;
812815

813816
throwExpression
@@ -1043,6 +1046,7 @@ awaitExpression
10431046
postfixExpression
10441047
: assignableExpression postfixOperator
10451048
| primary selector*
1049+
| staticMemberShorthand
10461050
;
10471051

10481052
postfixOperator

0 commit comments

Comments
 (0)