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

Side by Side Diff: tests/compiler/dart2js/backend_dart/dart_printer_test.dart

Issue 1863053003: Adds support for --generic-method-syntax (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 years, 8 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) 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 library dart_printer_test; 5 library dart_printer_test;
6 6
7 import 'dart:mirrors'; 7 import 'dart:mirrors';
8 import 'package:expect/expect.dart'; 8 import 'package:expect/expect.dart';
9 import 'package:compiler/src/constants/values.dart'; 9 import 'package:compiler/src/constants/values.dart';
10 import 'package:compiler/src/dart_backend/backend_ast_nodes.dart'; 10 import 'package:compiler/src/dart_backend/backend_ast_nodes.dart';
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 push(new Identifier("void")); 226 push(new Identifier("void"));
227 push(<TypeAnnotation>[]); // prepare for popTypeAnnotation 227 push(<TypeAnnotation>[]); // prepare for popTypeAnnotation
228 } 228 }
229 handleQualified(Token period) { 229 handleQualified(Token period) {
230 String last = pop(asName); 230 String last = pop(asName);
231 String first = pop(asName); 231 String first = pop(asName);
232 push(new Identifier('$first.$last')); 232 push(new Identifier('$first.$last'));
233 } 233 }
234 endSend(t) { 234 endSend(t) {
235 List<Argument> arguments = pop(); 235 List<Argument> arguments = pop();
236 pop(); // typeArguments
236 if (arguments == null) 237 if (arguments == null)
237 return; // not a function call 238 return; // not a function call
238 Expression selector = pop(); 239 Expression selector = pop();
239 push(new CallFunction(selector, arguments)); 240 push(new CallFunction(selector, arguments));
240 } 241 }
241 endThrowExpression(t, tt) { 242 endThrowExpression(t, tt) {
242 push(new Throw(pop())); 243 push(new Throw(pop()));
243 } 244 }
244 handleAssignmentExpression(Token token) { 245 handleAssignmentExpression(Token token) {
245 Expression right = pop(); 246 Expression right = pop();
(...skipping 734 matching lines...) Expand 10 before | Expand all | Expand 10 after
980 checkStatement("do while(x); while (y);"); 981 checkStatement("do while(x); while (y);");
981 checkStatement("{do; while(x); while (y);}"); 982 checkStatement("{do; while(x); while (y);}");
982 983
983 checkStatement('switch(x) { case 1: case 2: return y; }'); 984 checkStatement('switch(x) { case 1: case 2: return y; }');
984 checkStatement('switch(x) { default: return y; }'); 985 checkStatement('switch(x) { default: return y; }');
985 checkStatement('switch(x) { case 1: x=y; default: return y; }'); 986 checkStatement('switch(x) { case 1: x=y; default: return y; }');
986 checkStatement('switch(x) { case 1: x=y; y=z; break; default: return y; }'); 987 checkStatement('switch(x) { case 1: x=y; y=z; break; default: return y; }');
987 988
988 } 989 }
989 990
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698