Skip to content

Commit 06e54c8

Browse files
chloestefantsovaCommit Queue
authored andcommitted
[cfe] Make VariableDeclaration an abstract interface
The concrete implementation is named `VariableStatement`. The change is needed as a transition step to the new encoding for variables in Kernel. Part of #61572 Change-Id: Ib333f28e9998f2e758a18e4ad4b0a3cf4d642013 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/456620 Reviewed-by: Johnni Winther <[email protected]> Reviewed-by: Alexander Markov <[email protected]> Commit-Queue: Chloe Stefantsova <[email protected]>
1 parent 1c0c66f commit 06e54c8

File tree

11 files changed

+275
-130
lines changed

11 files changed

+275
-130
lines changed

pkg/front_end/lib/src/kernel/internal_ast.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -853,7 +853,7 @@ class ReturnStatementImpl extends ReturnStatement {
853853
}
854854

855855
/// Front end specific implementation of [VariableDeclaration].
856-
class VariableDeclarationImpl extends VariableDeclaration {
856+
class VariableDeclarationImpl extends VariableStatement {
857857
final bool forSyntheticToken;
858858

859859
/// Determine whether the given [VariableDeclarationImpl] had an implicit

pkg/front_end/test/incremental_suite.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2212,7 +2212,7 @@ class Strategy extends EquivalenceStrategy {
22122212
}
22132213

22142214
@override
2215-
bool checkVariableDeclaration_binaryOffsetNoTag(
2215+
bool checkVariableStatement_binaryOffsetNoTag(
22162216
EquivalenceVisitor visitor,
22172217
VariableDeclaration node,
22182218
VariableDeclaration other,

pkg/front_end/test/spell_checking_list_common.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -823,6 +823,7 @@ deliberately
823823
delimited
824824
delimiter
825825
delimiters
826+
deliver
826827
delta
827828
demote
828829
demoted

pkg/front_end/test/testing/suite.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1705,7 +1705,7 @@ class Strategy extends EquivalenceStrategy {
17051705
}
17061706

17071707
@override
1708-
bool checkVariableDeclaration_binaryOffsetNoTag(
1708+
bool checkVariableStatement_binaryOffsetNoTag(
17091709
EquivalenceVisitor visitor,
17101710
VariableDeclaration node,
17111711
VariableDeclaration other,

pkg/front_end/tool/ast_model.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ const Map<String?, Map<String, FieldRule?>> _fieldRuleMap = {
141141
'FunctionType': {'typeParameters': FieldRule(isDeclaration: true)},
142142
'TypeParameterType': {'parameter': FieldRule(isDeclaration: false)},
143143
'StructuralParameterType': {'parameter': FieldRule(isDeclaration: false)},
144-
'VariableDeclaration': {'_name': FieldRule(name: 'name')},
144+
'VariableStatement': {'_name': FieldRule(name: 'name')},
145145
'AssignedVariablePattern': {'variable': FieldRule(isDeclaration: false)},
146146
'InvalidPattern': {'declaredVariables': FieldRule(isDeclaration: true)},
147147
'OrPattern': {'orPatternJointVariables': FieldRule(isDeclaration: false)},

0 commit comments

Comments
 (0)