Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(97)

Side by Side Diff: pkg/kernel/lib/text/ast_to_text.dart

Issue 2527253002: Print 'await' when for is async. (Closed)
Patch Set: Print 'await' when for is async. Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 library kernel.ast_to_text; 4 library kernel.ast_to_text;
5 5
6 import '../ast.dart'; 6 import '../ast.dart';
7 import '../import_table.dart'; 7 import '../import_table.dart';
8 import '../type_propagation/type_propagation.dart'; 8 import '../type_propagation/type_propagation.dart';
9 9
10 class Namer<T> { 10 class Namer<T> {
(...skipping 1130 matching lines...) Expand 10 before | Expand all | Expand 10 after
1141 writeExpression(node.condition); 1141 writeExpression(node.condition);
1142 } 1142 }
1143 writeComma(';'); 1143 writeComma(';');
1144 writeList(node.updates, writeExpression); 1144 writeList(node.updates, writeExpression);
1145 writeSymbol(')'); 1145 writeSymbol(')');
1146 writeBody(node.body); 1146 writeBody(node.body);
1147 } 1147 }
1148 1148
1149 visitForInStatement(ForInStatement node) { 1149 visitForInStatement(ForInStatement node) {
1150 writeIndentation(); 1150 writeIndentation();
1151 if (node.isAsync) {
1152 writeSpaced('await');
1153 }
1151 writeSpaced('for'); 1154 writeSpaced('for');
1152 writeSymbol('('); 1155 writeSymbol('(');
1153 writeVariableDeclaration(node.variable, useVarKeyword: true); 1156 writeVariableDeclaration(node.variable, useVarKeyword: true);
1154 writeSpaced('in'); 1157 writeSpaced('in');
1155 writeExpression(node.iterable); 1158 writeExpression(node.iterable);
1156 writeSymbol(')'); 1159 writeSymbol(')');
1157 writeBody(node.body); 1160 writeBody(node.body);
1158 } 1161 }
1159 1162
1160 visitSwitchStatement(SwitchStatement node) { 1163 visitSwitchStatement(SwitchStatement node) {
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after
1535 } 1538 }
1536 throw 'illegal ProcedureKind: $kind'; 1539 throw 'illegal ProcedureKind: $kind';
1537 } 1540 }
1538 1541
1539 class ExpressionPrinter { 1542 class ExpressionPrinter {
1540 final Printer writeer; 1543 final Printer writeer;
1541 final int minimumPrecedence; 1544 final int minimumPrecedence;
1542 1545
1543 ExpressionPrinter(this.writeer, this.minimumPrecedence); 1546 ExpressionPrinter(this.writeer, this.minimumPrecedence);
1544 } 1547 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698