Update Dart.g to clarify the association of metadata and its target AST
Change-Id: I02a3e155aab73d638ddbc20485db9db3dcbe6c9f Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/365781 Reviewed-by: Chloe Stefantsova <cstefantsova@google.com> Commit-Queue: Erik Ernst <eernst@google.com>
This commit is contained in:
@@ -4,6 +4,12 @@
|
||||
|
||||
// CHANGES:
|
||||
//
|
||||
// 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
|
||||
// of `forLoopParts` where the iteration variable is an existing variable
|
||||
// in scope (this is not implemented, is inconsistent anyway).
|
||||
//
|
||||
// v0.42 Support updated augmented `extensionDeclaration`.
|
||||
//
|
||||
// v0.41 Add missing `enumEntry` update for augmentations.
|
||||
@@ -451,7 +457,7 @@ extensionTypeDeclaration
|
||||
;
|
||||
|
||||
representationDeclaration
|
||||
: ('.' identifierOrNew)? '(' metadata type identifier ')'
|
||||
: ('.' identifierOrNew)? '(' metadata typedIdentifier ')'
|
||||
;
|
||||
|
||||
|
||||
@@ -1197,7 +1203,7 @@ objectPattern
|
||||
;
|
||||
|
||||
patternVariableDeclaration
|
||||
: (FINAL | VAR) outerPattern '=' expression
|
||||
: outerPatternDeclarationPrefix '=' expression
|
||||
;
|
||||
|
||||
outerPattern
|
||||
@@ -1208,6 +1214,10 @@ outerPattern
|
||||
| objectPattern
|
||||
;
|
||||
|
||||
outerPatternDeclarationPrefix
|
||||
: (FINAL | VAR) outerPattern
|
||||
;
|
||||
|
||||
patternAssignment
|
||||
: outerPattern '=' expression
|
||||
;
|
||||
@@ -1275,12 +1285,15 @@ forStatement
|
||||
: AWAIT? FOR '(' forLoopParts ')' statement
|
||||
;
|
||||
|
||||
// TODO: Include `metadata` in the pattern form?
|
||||
forLoopParts
|
||||
: metadata declaredIdentifier IN expression
|
||||
| metadata identifier IN expression
|
||||
: forInLoopPrefix IN expression
|
||||
| forInitializerStatement expression? ';' expressionList?
|
||||
| metadata (FINAL | VAR) outerPattern IN expression
|
||||
;
|
||||
|
||||
forInLoopPrefix
|
||||
: metadata declaredIdentifier
|
||||
| metadata outerPatternDeclarationPrefix
|
||||
| identifier
|
||||
;
|
||||
|
||||
// The localVariableDeclaration cannot be CONST, but that can
|
||||
|
||||
@@ -4,6 +4,12 @@
|
||||
|
||||
// CHANGES:
|
||||
//
|
||||
// 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.
|
||||
@@ -457,7 +463,7 @@ extensionTypeDeclaration
|
||||
;
|
||||
|
||||
representationDeclaration
|
||||
: ('.' identifierOrNew)? '(' metadata type identifier ')'
|
||||
: ('.' identifierOrNew)? '(' metadata typedIdentifier ')'
|
||||
;
|
||||
|
||||
|
||||
@@ -1203,7 +1209,7 @@ objectPattern
|
||||
;
|
||||
|
||||
patternVariableDeclaration
|
||||
: (FINAL | VAR) outerPattern '=' expression
|
||||
: outerPatternDeclarationPrefix '=' expression
|
||||
;
|
||||
|
||||
outerPattern
|
||||
@@ -1214,6 +1220,10 @@ outerPattern
|
||||
| objectPattern
|
||||
;
|
||||
|
||||
outerPatternDeclarationPrefix
|
||||
: (FINAL | VAR) outerPattern
|
||||
;
|
||||
|
||||
patternAssignment
|
||||
: outerPattern '=' expression
|
||||
;
|
||||
@@ -1281,12 +1291,15 @@ forStatement
|
||||
: AWAIT? FOR '(' forLoopParts ')' statement
|
||||
;
|
||||
|
||||
// TODO: Include `metadata` in the pattern form?
|
||||
forLoopParts
|
||||
: metadata declaredIdentifier IN expression
|
||||
| metadata identifier IN expression
|
||||
: forInLoopPrefix IN expression
|
||||
| forInitializerStatement expression? ';' expressionList?
|
||||
| metadata (FINAL | VAR) outerPattern IN expression
|
||||
;
|
||||
|
||||
forInLoopPrefix
|
||||
: metadata declaredIdentifier
|
||||
| metadata outerPatternDeclarationPrefix
|
||||
| identifier
|
||||
;
|
||||
|
||||
// The localVariableDeclaration cannot be CONST, but that can
|
||||
|
||||
Reference in New Issue
Block a user