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 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'; |
11 import 'package:compiler/src/dart_backend/backend_ast_to_frontend_ast.dart' | 11 import 'package:compiler/src/dart_backend/backend_ast_to_frontend_ast.dart' |
12 show TreePrinter; | 12 show TreePrinter; |
13 import 'package:compiler/src/diagnostics/diagnostic_listener.dart'; | 13 import 'package:compiler/src/diagnostics/diagnostic_listener.dart'; |
14 import 'package:compiler/src/diagnostics/messages.dart'; | 14 import 'package:compiler/src/diagnostics/messages.dart'; |
15 import 'package:compiler/src/diagnostics/spannable.dart' show Spannable; | 15 import 'package:compiler/src/diagnostics/spannable.dart' show Spannable; |
16 import 'package:compiler/src/scanner/listener.dart'; | 16 import 'package:compiler/src/parser/listener.dart'; |
17 import 'package:compiler/src/scanner/parser.dart'; | 17 import 'package:compiler/src/parser/parser.dart'; |
18 import 'package:compiler/src/scanner/scanner.dart'; | 18 import 'package:compiler/src/scanner/scanner.dart'; |
19 import 'package:compiler/src/scanner/token.dart'; | 19 import 'package:compiler/src/tokens/token.dart'; |
20 import 'package:compiler/src/io/source_file.dart'; | 20 import 'package:compiler/src/io/source_file.dart'; |
21 import 'package:compiler/src/string_validator.dart'; | 21 import 'package:compiler/src/string_validator.dart'; |
22 import 'package:compiler/src/tree/tree.dart' show DartString; | 22 import 'package:compiler/src/tree/tree.dart' show DartString; |
23 import 'package:compiler/src/tree/tree.dart' as tree; | 23 import 'package:compiler/src/tree/tree.dart' as tree; |
24 | 24 |
25 /// For debugging the [AstBuilder] stack. Prints information about [x]. | 25 /// For debugging the [AstBuilder] stack. Prints information about [x]. |
26 void show(x) { | 26 void show(x) { |
27 StringBuffer buf = new StringBuffer(); | 27 StringBuffer buf = new StringBuffer(); |
28 Unparser unparser = new Unparser(buf); | 28 Unparser unparser = new Unparser(buf); |
29 void unparse(x) { | 29 void unparse(x) { |
(...skipping 943 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
973 checkStatement("do while(x); while (y);"); | 973 checkStatement("do while(x); while (y);"); |
974 checkStatement("{do; while(x); while (y);}"); | 974 checkStatement("{do; while(x); while (y);}"); |
975 | 975 |
976 checkStatement('switch(x) { case 1: case 2: return y; }'); | 976 checkStatement('switch(x) { case 1: case 2: return y; }'); |
977 checkStatement('switch(x) { default: return y; }'); | 977 checkStatement('switch(x) { default: return y; }'); |
978 checkStatement('switch(x) { case 1: x=y; default: return y; }'); | 978 checkStatement('switch(x) { case 1: x=y; default: return y; }'); |
979 checkStatement('switch(x) { case 1: x=y; y=z; break; default: return y; }'); | 979 checkStatement('switch(x) { case 1: x=y; y=z; break; default: return y; }'); |
980 | 980 |
981 } | 981 } |
982 | 982 |
OLD | NEW |