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 #library('parser_helper'); | 5 #library('parser_helper'); |
6 | 6 |
7 #import("dart:uri"); | 7 #import("dart:uri"); |
8 | 8 |
9 #import("../../../lib/compiler/implementation/elements/elements.dart"); | 9 #import("../../../lib/compiler/implementation/elements/elements.dart"); |
10 #import("../../../lib/compiler/implementation/tree/tree.dart"); | 10 #import("../../../lib/compiler/implementation/tree/tree.dart"); |
11 #import('../../../lib/compiler/implementation/scanner/scannerlib.dart'); | 11 #import('../../../lib/compiler/implementation/scanner/scannerlib.dart'); |
12 #import("../../../lib/compiler/implementation/leg.dart"); | 12 #import("../../../lib/compiler/implementation/leg.dart"); |
13 #import("../../../lib/compiler/implementation/source_file.dart"); | 13 #import("../../../lib/compiler/implementation/source_file.dart"); |
14 #import("../../../lib/compiler/implementation/util/util.dart"); | 14 #import("../../../lib/compiler/implementation/util/util.dart"); |
15 | 15 |
16 class LoggerCanceler implements DiagnosticListener { | 16 class LoggerCanceler implements DiagnosticListener { |
17 void cancel([String reason, node, token, instruction, element]) { | 17 void cancel(String reason, {node, token, instruction, element}) { |
18 throw new CompilerCancelledException(reason); | 18 throw new CompilerCancelledException(reason); |
19 } | 19 } |
20 | 20 |
21 void log(message) { | 21 void log(message) { |
22 print(message); | 22 print(message); |
23 } | 23 } |
24 } | 24 } |
25 | 25 |
26 Token scan(String text) => new StringScanner(text).tokenize(); | 26 Token scan(String text) => new StringScanner(text).tokenize(); |
27 | 27 |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 NodeList fullParseUnit(String source) { | 78 NodeList fullParseUnit(String source) { |
79 return parseBodyCode(source, (parser, tokens) => parser.parseUnit(tokens)); | 79 return parseBodyCode(source, (parser, tokens) => parser.parseUnit(tokens)); |
80 } | 80 } |
81 | 81 |
82 // TODO(ahe): We define this method to avoid having to import | 82 // TODO(ahe): We define this method to avoid having to import |
83 // the scanner in the tests. We should move SourceString to another | 83 // the scanner in the tests. We should move SourceString to another |
84 // location instead. | 84 // location instead. |
85 SourceString buildSourceString(String name) { | 85 SourceString buildSourceString(String name) { |
86 return new SourceString(name); | 86 return new SourceString(name); |
87 } | 87 } |
OLD | NEW |