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

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

Issue 683803003: Support for loops in analyzer2dart. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Add TODO. 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 d5e4f47e6b789185835f3d831295d7b02c5d99cb..bf1f08ae21011cc58811f58bb88420147d7e7bf5 100644
--- a/pkg/analyzer2dart/test/sexpr_data.dart
+++ b/pkg/analyzer2dart/test/sexpr_data.dart
@@ -815,4 +815,77 @@ main(a) {
(InvokeConstructor Deprecated v0 k0))
'''),
]),
+
+ const Group('For loop', const <TestSpec>[
+ const TestSpec('''
+main() {
+ for (;;) {}
+}
+''', '''
+(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() {
+ for (int i = 0; i < 10; i = i + 1) {
+ print(i);
+ }
+}
+''', '''
+(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))
+'''),
+
+const TestSpec('''
+main(i) {
+ for (i = 0; i < 10; i = i + 1) {
+ print(i);
+ }
+}
+''', '''
+(FunctionDefinition main (i 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))
+'''),
+ ]),
];

Powered by Google App Engine
This is Rietveld 408576698