Spec parse null aware elements

Change-Id: Ib61fea3bec110c0a2c560c965912c51a1c4e22cf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/368569
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
This commit is contained in:
Erik Ernst
2024-05-31 09:12:01 +00:00
committed by Commit Queue
parent 3c85d3443a
commit b56843da32
2 changed files with 34 additions and 2 deletions
+14 -1
View File
@@ -4,6 +4,8 @@
// CHANGES:
//
// v0.44 Support null-aware elements.
//
// v0.43 Change rule structure such that the association of metadata
// with non-terminals can be explained in a simple and consistent way.
// The derivable terms do not change. Remove `metadata` from the kind
@@ -732,13 +734,24 @@ elements
;
element
: expressionElement
: nullAwareExpressionElement
| nullAwareMapElement
| expressionElement
| mapElement
| spreadElement
| ifElement
| forElement
;
nullAwareExpressionElement
: '?' expression
;
nullAwareMapElement
: '?' expression ':' '?'? expression
| expression ':' '?' expression
;
expressionElement
: expression
;
+20 -1
View File
@@ -10,6 +10,14 @@
// of `forLoopParts` where the iteration variable is an existing variable
// in scope (this is not implemented, is inconsistent anyway).
//
// v0.45 Support null-aware elements.
//
// v0.44 Change rule structure such that the association of metadata
// with non-terminals can be explained in a simple and consistent way.
// The derivable terms do not change. Remove `metadata` from the kind
// of `forLoopParts` where the iteration variable is an existing variable
// in scope (this is not implemented, is inconsistent anyway).
//
// v0.43 Support updated augmented `extensionDeclaration`.
//
// v0.42 Add missing `enumEntry` update for augmentations.
@@ -738,13 +746,24 @@ elements
;
element
: expressionElement
: nullAwareExpressionElement
| nullAwareMapElement
| expressionElement
| mapElement
| spreadElement
| ifElement
| forElement
;
nullAwareExpressionElement
: '?' expression
;
nullAwareMapElement
: '?' expression ':' '?'? expression
| expression ':' '?' expression
;
expressionElement
: expression
;