Simplify several non-terminals to use regex-like grammar operators
Follow-up to SDK issue #51744. Change-Id: Ic713ed5adf99bed49f1e93a70817650d5f0c3c46 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/295545 Reviewed-by: William Hesse <whesse@google.com> Commit-Queue: Erik Ernst <eernst@google.com>
This commit is contained in:
@@ -3,6 +3,11 @@
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
// CHANGES:
|
||||
//
|
||||
// v0.33 This commit does not change the derived language at all. It just
|
||||
// changes several rules to use the regexp-like grammar operators to simplify
|
||||
// onParts, recordLiteralNoConst, functionTypeTails, and functionType.
|
||||
//
|
||||
// v0.32 Remove unused non-terminal `patterns`.
|
||||
//
|
||||
// v0.31 Inline `identifierNotFUNCTION` into `identifier`. Replace all
|
||||
@@ -673,7 +678,7 @@ recordLiteralNoConst
|
||||
: '(' ')'
|
||||
| '(' expression ',' ')'
|
||||
| '(' label expression ','? ')'
|
||||
| '(' recordField ',' recordField (',' recordField)* ','? ')'
|
||||
| '(' recordField (',' recordField)+ ','? ')'
|
||||
;
|
||||
|
||||
recordField
|
||||
@@ -1139,7 +1144,7 @@ recordPattern
|
||||
;
|
||||
|
||||
patternFields
|
||||
: patternField ( ',' patternField )* ','?
|
||||
: patternField (',' patternField)* ','?
|
||||
;
|
||||
|
||||
patternField
|
||||
@@ -1464,13 +1469,11 @@ functionTypeTail
|
||||
;
|
||||
|
||||
functionTypeTails
|
||||
: functionTypeTail '?'? functionTypeTails
|
||||
| functionTypeTail
|
||||
: (functionTypeTail '?'?)* functionTypeTail
|
||||
;
|
||||
|
||||
functionType
|
||||
: functionTypeTails
|
||||
| typeNotFunction functionTypeTails
|
||||
: typeNotFunction? functionTypeTails
|
||||
;
|
||||
|
||||
parameterTypeList
|
||||
|
||||
Reference in New Issue
Block a user