OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 import "package:expect/expect.dart"; | 5 import "package:expect/expect.dart"; |
6 import "package:compiler/src/parser/element_listener.dart"; | 6 import "package:compiler/src/parser/element_listener.dart"; |
7 import "package:compiler/src/parser/node_listener.dart"; | 7 import "package:compiler/src/parser/node_listener.dart"; |
8 import "package:front_end/src/fasta/parser.dart"; | 8 import "package:front_end/src/fasta/parser.dart"; |
9 import "package:front_end/src/fasta/scanner.dart"; | 9 import "package:front_end/src/fasta/scanner.dart"; |
10 import "package:compiler/src/tree/tree.dart"; | 10 import "package:compiler/src/tree/tree.dart"; |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 Node node = listener.popNode(); | 95 Node node = listener.popNode(); |
96 Expect.isTrue(listener.nodes.isEmpty); | 96 Expect.isTrue(listener.nodes.isEmpty); |
97 return unparse(node); | 97 return unparse(node); |
98 } | 98 } |
99 | 99 |
100 class MessageCollector extends DiagnosticReporter { | 100 class MessageCollector extends DiagnosticReporter { |
101 List<String> messages; | 101 List<String> messages; |
102 MessageCollector() { | 102 MessageCollector() { |
103 messages = []; | 103 messages = []; |
104 } | 104 } |
105 void internalError(node, String reason) { | 105 void internalError(node, covariant String reason) { |
106 messages.add(reason); | 106 messages.add(reason); |
107 throw reason; | 107 throw reason; |
108 } | 108 } |
109 | 109 |
110 void log(message) { | 110 void log(message) { |
111 messages.add(message); | 111 messages.add(message); |
112 } | 112 } |
113 | 113 |
114 noSuchMethod(Invocation invocation) => throw 'unsupported operation'; | 114 noSuchMethod(Invocation invocation) => throw 'unsupported operation'; |
115 } | 115 } |
OLD | NEW |