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

Unified Diff: pkg/analyzer2dart/test/sexpr_data.dart

Issue 686743002: Support while loop in analyzer2dart. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: pkg/analyzer2dart/test/sexpr_data.dart
diff --git a/pkg/analyzer2dart/test/sexpr_data.dart b/pkg/analyzer2dart/test/sexpr_data.dart
index bf1f08ae21011cc58811f58bb88420147d7e7bf5..87cdfe5e50f2186a6117f7ea6ace1c28e6751377 100644
--- a/pkg/analyzer2dart/test/sexpr_data.dart
+++ b/pkg/analyzer2dart/test/sexpr_data.dart
@@ -836,7 +836,7 @@ main() {
const TestSpec('''
main() {
- for (int i = 0; i < 10; i = i + 1) {
+ for (var i = 0; i < 10; i = i + 1) {
print(i);
}
}
@@ -888,4 +888,52 @@ main(i) {
(InvokeContinuation k0 v0))
'''),
]),
+
+ const Group('While loop', const <TestSpec>[
+ const TestSpec('''
+main() {
+ while (true) {}
+}
+''', '''
+(FunctionDefinition main ( return)
+ (LetCont* (k0)
+ (LetPrim v0 (Constant BoolConstant(true)))
+ (LetCont (k1)
+ (LetPrim v1 (Constant NullConstant))
+ (InvokeContinuation return v1))
+ (LetCont (k2)
+ (InvokeContinuation* k0 ))
+ (Branch (IsTrue v0) k2 k1))
+ (InvokeContinuation k0 ))
+'''),
+
+const TestSpec('''
+main() {
+ var i = 0;
+ while (i < 10) {
+ print(i);
+ i = i + 1;
+ }
+}
+''', '''
+(FunctionDefinition main ( return)
+ (LetPrim v0 (Constant IntConstant(0)))
+ (LetCont* (k0 v1)
+ (LetPrim v2 (Constant IntConstant(10)))
+ (LetCont (k1 v3)
+ (LetCont (k2)
+ (LetPrim v4 (Constant NullConstant))
+ (InvokeContinuation return v4))
+ (LetCont (k3)
+ (LetCont (k4 v5)
+ (LetPrim v6 (Constant IntConstant(1)))
+ (LetCont (k5 v7)
+ (InvokeContinuation* k0 v7))
+ (InvokeMethod v1 + v6 k5))
+ (InvokeStatic print v1 k4))
+ (Branch (IsTrue v3) k3 k2))
+ (InvokeMethod v1 < v2 k1))
+ (InvokeContinuation k0 v0))
+'''),
+ ]),
];
« no previous file with comments | « pkg/analyzer2dart/test/end2end_test.dart ('k') | sdk/lib/_internal/compiler/implementation/cps_ir/cps_ir_builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698