[cfe][InternalNodes] Add more internal nodes

This adds internal nodes for VariableStatement, VariableDeclaration, Let, and ForStatement. The prepares for separating Variable from InternalVariable and allows for the removal of Variable.asVariableDeclaration.

Change-Id: Ib0593f64b3d22ce99c187ab4af32c8dc8cbea6e9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/509980
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
This commit is contained in:
Johnni Winther
2026-06-09 05:27:48 -07:00
committed by dart-scoped@luci-project-accounts.iam.gserviceaccount.com
parent 90d89a0ca1
commit ac477b9233
10 changed files with 655 additions and 332 deletions
-2
View File
@@ -1482,8 +1482,6 @@ class VariableStatement extends Statement {
..parent = this;
}
/// Returns a possibly synthesized name for this variable, consistent with
/// the names used across all [toString] calls.
@override
String toString() {
return "VariableStatement(${toStringInternal()})";
-7
View File
@@ -71,7 +71,6 @@ abstract interface class IVariable implements TreeNode, Annotatable {
bool get hasIsWildcard;
bool get hasIsSuperInitializingFormal;
bool get hasIsErroneouslyInitialized;
Variable get asVariableDeclaration;
}
/// The root of the sealed hierarchy of non-type variables.
@@ -186,9 +185,6 @@ sealed class Variable extends VariableBase
@override
bool get isAssignable;
@override
Variable get asVariableDeclaration => this;
abstract String? name;
@override
@@ -646,9 +642,6 @@ class LegacyVariable extends TreeNode implements Variable, Annotatable {
throw new UnsupportedError("${this.runtimeType}.context=");
}
@override
Variable get asVariableDeclaration => this;
@override
Variable get variable => this;