@@ -242,7 +242,7 @@ class VariableGet extends Expression {
242242
243243 @override
244244 void toTextInternal (AstPrinter printer) {
245- printer.write (printer.getVariableName (variable));
245+ printer.write (printer.getVariableDeclarationName (variable));
246246 if (promotedType != null ) {
247247 printer.write ('{' );
248248 printer.writeType (promotedType! );
@@ -301,7 +301,7 @@ class VariableSet extends Expression {
301301
302302 @override
303303 void toTextInternal (AstPrinter printer) {
304- printer.write (printer.getVariableName (variable));
304+ printer.write (printer.getVariableDeclarationName (variable));
305305 printer.write (' = ' );
306306 printer.writeExpression (value);
307307 }
@@ -2211,7 +2211,7 @@ class LocalFunctionInvocation extends InvocationExpression {
22112211
22122212 @override
22132213 void toTextInternal (AstPrinter printer) {
2214- printer.write (printer.getVariableName (variable));
2214+ printer.write (printer.getVariableDeclarationName (variable));
22152215 printer.writeArguments (arguments);
22162216 }
22172217}
@@ -4764,10 +4764,13 @@ class Let extends Expression {
47644764 }
47654765}
47664766
4767- class BlockExpression extends Expression {
4767+ class BlockExpression extends Expression implements ScopeProvider {
47684768 Block body;
47694769 Expression value;
47704770
4771+ @override
4772+ Scope ? scope;
4773+
47714774 BlockExpression (this .body, this .value) {
47724775 body.parent = this ;
47734776 value.parent = this ;
@@ -5101,3 +5104,112 @@ class TypedefTearOff extends Expression {
51015104 printer.write (")" );
51025105 }
51035106}
5107+
5108+ /// [VariableRead] nodes are the replacement for the VariableGet nodes.
5109+ ///
5110+ /// Despite of the name, [VariableRead] can't read [TypeVariable] s,
5111+ /// which are also [Variable] s.
5112+ class VariableRead extends Expression {
5113+ final ExpressionVariable variable;
5114+
5115+ VariableRead ({required this .variable});
5116+
5117+ @override
5118+ R accept <R >(ExpressionVisitor <R > v) {
5119+ // TODO(cstefantsova): Implement accept.
5120+ throw UnimplementedError ();
5121+ }
5122+
5123+ @override
5124+ R accept1 <R , A >(ExpressionVisitor1 <R , A > v, A arg) {
5125+ // TODO(cstefantsova): Implement accept1.
5126+ throw UnimplementedError ();
5127+ }
5128+
5129+ @override
5130+ DartType getStaticTypeInternal (StaticTypeContext context) {
5131+ // TODO(cstefantsova): Implement getStaticTypeInternal.
5132+ throw UnimplementedError ();
5133+ }
5134+
5135+ @override
5136+ void transformChildren (Transformer v) {
5137+ // TODO(cstefantsova): Implement transformChildren.
5138+ }
5139+
5140+ @override
5141+ void transformOrRemoveChildren (RemovingTransformer v) {
5142+ // TODO(cstefantsova): Implement transformOrRemoveChildren.
5143+ }
5144+
5145+ @override
5146+ void visitChildren (Visitor v) {
5147+ // TODO(cstefantsova): Implement visitChildren.
5148+ }
5149+
5150+ @override
5151+ String toString () {
5152+ return "VariableRead(${toStringInternal ()})" ;
5153+ }
5154+
5155+ @override
5156+ void toTextInternal (AstPrinter printer) {
5157+ printer.write (printer.getVariableName (variable));
5158+ }
5159+ }
5160+
5161+ /// [VariableWrite] nodes are the replacement for the VariableSet nodes.
5162+ ///
5163+ /// Despite of the name, [VariableWrite] can't write into
5164+ /// [TypeVariable] s, which are also [Variable] s.
5165+ class VariableWrite extends Expression {
5166+ final ExpressionVariable variable;
5167+ final Expression value;
5168+
5169+ VariableWrite ({required this .variable, required this .value});
5170+
5171+ @override
5172+ R accept <R >(ExpressionVisitor <R > v) {
5173+ // TODO(cstefantsova): Implement accept.
5174+ throw UnimplementedError ();
5175+ }
5176+
5177+ @override
5178+ R accept1 <R , A >(ExpressionVisitor1 <R , A > v, A arg) {
5179+ // TODO(cstefantsova): Implement accept1.
5180+ throw UnimplementedError ();
5181+ }
5182+
5183+ @override
5184+ DartType getStaticTypeInternal (StaticTypeContext context) {
5185+ // TODO(cstefantsova): Implement getStaticTypeInternal.
5186+ throw UnimplementedError ();
5187+ }
5188+
5189+ @override
5190+ void transformChildren (Transformer v) {
5191+ // TODO(cstefantsova): Implement transformChildren.
5192+ }
5193+
5194+ @override
5195+ void transformOrRemoveChildren (RemovingTransformer v) {
5196+ // TODO(cstefantsova): Implement transformOrRemoveChildren.
5197+ }
5198+
5199+ @override
5200+ void visitChildren (Visitor v) {
5201+ // TODO(cstefantsova): Implement visitChildren.
5202+ }
5203+
5204+ @override
5205+ String toString () {
5206+ return "VariableWrite(${toStringInternal ()})" ;
5207+ }
5208+
5209+ @override
5210+ void toTextInternal (AstPrinter printer) {
5211+ printer.write (printer.getVariableName (variable));
5212+ printer.write (' = ' );
5213+ printer.writeExpression (value);
5214+ }
5215+ }
0 commit comments