OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 | 4 |
5 /// Test data for sexpr_test. | 5 /// Test data for sexpr_test. |
6 library test.sexpr.data; | 6 library test.sexpr.data; |
7 | 7 |
8 import 'test_helper.dart'; | 8 import 'test_helper.dart'; |
9 | 9 |
10 const List<Group> TEST_DATA = const [ | 10 const List<Group> TEST_DATA = const [ |
(...skipping 1027 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1038 (LetPrim v6 (Constant IntConstant(1))) | 1038 (LetPrim v6 (Constant IntConstant(1))) |
1039 (LetCont (k5 v7) | 1039 (LetCont (k5 v7) |
1040 (InvokeContinuation* k0 v7)) | 1040 (InvokeContinuation* k0 v7)) |
1041 (InvokeMethod v1 + v6 k5)) | 1041 (InvokeMethod v1 + v6 k5)) |
1042 (InvokeStatic print v1 k4)) | 1042 (InvokeStatic print v1 k4)) |
1043 (Branch (IsTrue v3) k3 k2)) | 1043 (Branch (IsTrue v3) k3 k2)) |
1044 (InvokeMethod v1 < v2 k1)) | 1044 (InvokeMethod v1 < v2 k1)) |
1045 (InvokeContinuation k0 v0)) | 1045 (InvokeContinuation k0 v0)) |
1046 '''), | 1046 '''), |
1047 ]), | 1047 ]), |
| 1048 |
| 1049 const Group('For in loop', const <TestSpec>[ |
| 1050 // TODO(johnniwinther): Add tests for `i` as top-level, static and instance |
| 1051 // fields. |
| 1052 const TestSpec(''' |
| 1053 main(a) { |
| 1054 for (var i in a) { |
| 1055 print(i); |
| 1056 } |
| 1057 } |
| 1058 ''', ''' |
| 1059 (FunctionDefinition main (a return) |
| 1060 (LetCont (k0 v0) |
| 1061 (LetCont* (k1 v1) |
| 1062 (LetCont (k2 v2) |
| 1063 (LetCont (k3) |
| 1064 (LetPrim v3 (Constant NullConstant)) |
| 1065 (InvokeContinuation return v3)) |
| 1066 (LetCont (k4) |
| 1067 (LetPrim v4 (Constant NullConstant)) |
| 1068 (LetCont (k5 v5) |
| 1069 (LetCont (k6 v6) |
| 1070 (InvokeContinuation* k1 v1)) |
| 1071 (InvokeStatic print v5 k6)) |
| 1072 (InvokeMethod v0 current k5)) |
| 1073 (Branch (IsTrue v2) k4 k3)) |
| 1074 (InvokeMethod v0 moveNext k2)) |
| 1075 (InvokeContinuation k1 a)) |
| 1076 (InvokeMethod a iterator k0)) |
| 1077 '''), |
| 1078 |
| 1079 const TestSpec(''' |
| 1080 main(a) { |
| 1081 for (var i in a) { |
| 1082 print(i); |
| 1083 i = 0; |
| 1084 print(i); |
| 1085 } |
| 1086 } |
| 1087 ''', ''' |
| 1088 (FunctionDefinition main (a return) |
| 1089 (LetCont (k0 v0) |
| 1090 (LetCont* (k1 v1) |
| 1091 (LetCont (k2 v2) |
| 1092 (LetCont (k3) |
| 1093 (LetPrim v3 (Constant NullConstant)) |
| 1094 (InvokeContinuation return v3)) |
| 1095 (LetCont (k4) |
| 1096 (LetPrim v4 (Constant NullConstant)) |
| 1097 (LetCont (k5 v5) |
| 1098 (LetCont (k6 v6) |
| 1099 (LetPrim v7 (Constant IntConstant(0))) |
| 1100 (LetCont (k7 v8) |
| 1101 (InvokeContinuation* k1 v1)) |
| 1102 (InvokeStatic print v7 k7)) |
| 1103 (InvokeStatic print v5 k6)) |
| 1104 (InvokeMethod v0 current k5)) |
| 1105 (Branch (IsTrue v2) k4 k3)) |
| 1106 (InvokeMethod v0 moveNext k2)) |
| 1107 (InvokeContinuation k1 a)) |
| 1108 (InvokeMethod a iterator k0)) |
| 1109 '''), |
| 1110 |
| 1111 const TestSpec(''' |
| 1112 main(a) { |
| 1113 var i; |
| 1114 for (i in a) { |
| 1115 print(i); |
| 1116 } |
| 1117 } |
| 1118 ''', ''' |
| 1119 (FunctionDefinition main (a return) |
| 1120 (LetPrim v0 (Constant NullConstant)) |
| 1121 (LetCont (k0 v1) |
| 1122 (LetCont* (k1 v2 v3) |
| 1123 (LetCont (k2 v4) |
| 1124 (LetCont (k3) |
| 1125 (LetPrim v5 (Constant NullConstant)) |
| 1126 (InvokeContinuation return v5)) |
| 1127 (LetCont (k4) |
| 1128 (LetCont (k5 v6) |
| 1129 (LetCont (k6 v7) |
| 1130 (InvokeContinuation* k1 v2 v6)) |
| 1131 (InvokeStatic print v6 k6)) |
| 1132 (InvokeMethod v1 current k5)) |
| 1133 (Branch (IsTrue v4) k4 k3)) |
| 1134 (InvokeMethod v1 moveNext k2)) |
| 1135 (InvokeContinuation k1 a v0)) |
| 1136 (InvokeMethod a iterator k0)) |
| 1137 '''), |
| 1138 ]), |
1048 ]; | 1139 ]; |
OLD | NEW |