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

Side by Side Diff: pkg/analyzer2dart/test/sexpr_data.dart

Issue 652403005: Support assignment of locals in analyzer2dart. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated cf. comments. Created 6 years, 1 month 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 | Annotate | Revision Log
OLDNEW
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 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 const TestSpec(''' 176 const TestSpec('''
177 main(a) { 177 main(a) {
178 return a; 178 return a;
179 } 179 }
180 ''', ''' 180 ''', '''
181 (FunctionDefinition main (a return) 181 (FunctionDefinition main (a return)
182 (InvokeContinuation return a)) 182 (InvokeContinuation return a))
183 '''), 183 '''),
184 ]), 184 ]),
185 185
186 const Group('Local variable writes', const <TestSpec>[
187 const TestSpec('''
188 main() {
189 var a;
190 a = 10;
191 return a;
192 }
193 ''', '''
194 (FunctionDefinition main ( return)
195 (LetPrim v0 (Constant NullConstant))
196 (LetPrim v1 (Constant IntConstant(10)))
197 (InvokeContinuation return v1))
198 '''),
199
200 const TestSpec('''
201 main() {
202 var a = 0;
203 a = 10;
204 return a;
205 }
206 ''', '''
207 (FunctionDefinition main ( return)
208 (LetPrim v0 (Constant IntConstant(0)))
209 (LetPrim v1 (Constant IntConstant(10)))
210 (InvokeContinuation return v1))
211 '''),
212
213 const TestSpec('''
214 main() {
215 var a = 0;
216 print(a);
217 a = "";
218 print(a);
219 return a;
220 }
221 ''', '''
222 (FunctionDefinition main ( return)
223 (LetPrim v0 (Constant IntConstant(0)))
224 (LetCont (k0 v1)
225 (LetPrim v2 (Constant StringConstant("")))
226 (LetCont (k1 v3)
227 (InvokeContinuation return v2))
228 (InvokeStatic print v2 k1))
229 (InvokeStatic print v0 k0))
230 '''),
231
232 const TestSpec('''
233 main(a) {
234 print(a);
235 a = "";
236 print(a);
237 return a;
238 }
239 ''', '''
240 (FunctionDefinition main (a return)
241 (LetCont (k0 v0)
242 (LetPrim v1 (Constant StringConstant("")))
243 (LetCont (k1 v2)
244 (InvokeContinuation return v1))
245 (InvokeStatic print v1 k1))
246 (InvokeStatic print a k0))
247 '''),
248
249 const TestSpec('''
250 main(a) {
251 if (a) {
252 a = "";
253 }
254 print(a);
255 return a;
256 }
257 ''', '''
258 (FunctionDefinition main (a return)
259 (LetCont (k0 v0)
260 (LetCont (k1 v1)
261 (InvokeContinuation return v0))
262 (InvokeStatic print v0 k1))
263 (LetCont (k2)
264 (LetPrim v2 (Constant StringConstant("")))
265 (InvokeContinuation k0 v2))
266 (LetCont (k3)
267 (InvokeContinuation k0 a))
268 (Branch (IsTrue a) k2 k3))
269 '''),
270 ]),
271
186 const Group('Dynamic access', const [ 272 const Group('Dynamic access', const [
187 const TestSpec(''' 273 const TestSpec('''
188 main(a) { 274 main(a) {
189 return a.foo; 275 return a.foo;
190 } 276 }
191 ''', ''' 277 ''', '''
192 (FunctionDefinition main (a return) 278 (FunctionDefinition main (a return)
193 (LetCont (k0 v0) 279 (LetCont (k0 v0)
194 (InvokeContinuation return v0)) 280 (InvokeContinuation return v0))
195 (InvokeMethod a foo k0)) 281 (InvokeMethod a foo k0))
(...skipping 527 matching lines...) Expand 10 before | Expand all | Expand 10 after
723 ''', ''' 809 ''', '''
724 (FunctionDefinition main (a return) 810 (FunctionDefinition main (a return)
725 (LetPrim v0 (Constant StringConstant(""))) 811 (LetPrim v0 (Constant StringConstant("")))
726 (LetCont (k0 v1) 812 (LetCont (k0 v1)
727 (LetPrim v2 (Constant NullConstant)) 813 (LetPrim v2 (Constant NullConstant))
728 (InvokeContinuation return v2)) 814 (InvokeContinuation return v2))
729 (InvokeConstructor Deprecated v0 k0)) 815 (InvokeConstructor Deprecated v0 k0))
730 '''), 816 '''),
731 ]), 817 ]),
732 ]; 818 ];
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698