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

Side by Side Diff: pkg/front_end/lib/src/fasta/type_inference/type_inference_listener.dart

Issue 2962583002: Add type inference for break and continue statements. (Closed)
Patch Set: Created 3 years, 5 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
OLDNEW
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2017, 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.md file. 3 // BSD-style license that can be found in the LICENSE.md file.
4 4
5 import 'package:front_end/src/fasta/type_inference/type_inference_engine.dart'; 5 import 'package:front_end/src/fasta/type_inference/type_inference_engine.dart';
6 import 'package:kernel/ast.dart'; 6 import 'package:kernel/ast.dart';
7 7
8 /// Base class for [TypeInferenceListener] that defines the API for debugging. 8 /// Base class for [TypeInferenceListener] that defines the API for debugging.
9 /// 9 ///
10 /// By default no debug info is printed. To enable debug printing, mix in 10 /// By default no debug info is printed. To enable debug printing, mix in
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 void blockEnter(Block statement) => debugStatementEnter('block', statement); 102 void blockEnter(Block statement) => debugStatementEnter('block', statement);
103 103
104 void blockExit(Block statement) => debugStatementExit('block', statement); 104 void blockExit(Block statement) => debugStatementExit('block', statement);
105 105
106 bool boolLiteralEnter(BoolLiteral expression, DartType typeContext) => 106 bool boolLiteralEnter(BoolLiteral expression, DartType typeContext) =>
107 debugExpressionEnter("boolLiteral", expression, typeContext); 107 debugExpressionEnter("boolLiteral", expression, typeContext);
108 108
109 void boolLiteralExit(BoolLiteral expression, DartType inferredType) => 109 void boolLiteralExit(BoolLiteral expression, DartType inferredType) =>
110 debugExpressionExit("boolLiteral", expression, inferredType); 110 debugExpressionExit("boolLiteral", expression, inferredType);
111 111
112 void breakStatementEnter(BreakStatement statement) =>
113 debugStatementEnter('breakStatement', statement);
114
115 void breakStatementExit(BreakStatement statement) =>
116 debugStatementExit('breakStatement', statement);
117
112 bool cascadeExpressionEnter(Let expression, DartType typeContext) => 118 bool cascadeExpressionEnter(Let expression, DartType typeContext) =>
113 debugExpressionEnter("cascade", expression, typeContext); 119 debugExpressionEnter("cascade", expression, typeContext);
114 120
115 void cascadeExpressionExit(Let expression, DartType inferredType) => 121 void cascadeExpressionExit(Let expression, DartType inferredType) =>
116 debugExpressionExit("cascade", expression, inferredType); 122 debugExpressionExit("cascade", expression, inferredType);
117 123
118 bool conditionalExpressionEnter( 124 bool conditionalExpressionEnter(
119 ConditionalExpression expression, DartType typeContext) => 125 ConditionalExpression expression, DartType typeContext) =>
120 debugExpressionEnter("conditionalExpression", expression, typeContext); 126 debugExpressionEnter("conditionalExpression", expression, typeContext);
121 127
122 void conditionalExpressionExit( 128 void conditionalExpressionExit(
123 ConditionalExpression expression, DartType inferredType) => 129 ConditionalExpression expression, DartType inferredType) =>
124 debugExpressionExit("conditionalExpression", expression, inferredType); 130 debugExpressionExit("conditionalExpression", expression, inferredType);
125 131
126 bool constructorInvocationEnter( 132 bool constructorInvocationEnter(
127 InvocationExpression expression, DartType typeContext) => 133 InvocationExpression expression, DartType typeContext) =>
128 debugExpressionEnter("constructorInvocation", expression, typeContext); 134 debugExpressionEnter("constructorInvocation", expression, typeContext);
129 135
130 void constructorInvocationExit( 136 void constructorInvocationExit(
131 InvocationExpression expression, DartType inferredType) => 137 InvocationExpression expression, DartType inferredType) =>
132 debugExpressionExit("constructorInvocation", expression, inferredType); 138 debugExpressionExit("constructorInvocation", expression, inferredType);
133 139
140 void continueSwitchStatementEnter(ContinueSwitchStatement statement) =>
141 debugStatementEnter('continueSwitchStatement', statement);
142
143 void continueSwitchStatementExit(ContinueSwitchStatement statement) =>
144 debugStatementExit('continueSwitchStatement', statement);
145
134 void doStatementEnter(DoStatement statement) => 146 void doStatementEnter(DoStatement statement) =>
135 debugStatementEnter("doStatement", statement); 147 debugStatementEnter("doStatement", statement);
136 148
137 void doStatementExit(DoStatement statement) => 149 void doStatementExit(DoStatement statement) =>
138 debugStatementExit("doStatement", statement); 150 debugStatementExit("doStatement", statement);
139 151
140 bool doubleLiteralEnter(DoubleLiteral expression, DartType typeContext) => 152 bool doubleLiteralEnter(DoubleLiteral expression, DartType typeContext) =>
141 debugExpressionEnter("doubleLiteral", expression, typeContext); 153 debugExpressionEnter("doubleLiteral", expression, typeContext);
142 154
143 void doubleLiteralExit(DoubleLiteral expression, DartType inferredType) => 155 void doubleLiteralExit(DoubleLiteral expression, DartType inferredType) =>
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
387 399
388 void whileStatementExit(WhileStatement statement) => 400 void whileStatementExit(WhileStatement statement) =>
389 debugStatementExit("whileStatement", statement); 401 debugStatementExit("whileStatement", statement);
390 402
391 void yieldStatementEnter(YieldStatement statement) => 403 void yieldStatementEnter(YieldStatement statement) =>
392 debugStatementEnter('yieldStatement', statement); 404 debugStatementEnter('yieldStatement', statement);
393 405
394 void yieldStatementExit(YieldStatement statement) => 406 void yieldStatementExit(YieldStatement statement) =>
395 debugStatementExit('yieldStatement', statement); 407 debugStatementExit('yieldStatement', statement);
396 } 408 }
OLDNEW
« no previous file with comments | « pkg/front_end/lib/src/fasta/kernel/kernel_shadow_ast.dart ('k') | pkg/front_end/testcases/inference/switch_continue.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698