| 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 "package:expect/expect.dart"; | 7 import "package:expect/expect.dart"; |
| 8 | 8 |
| 9 import "package:compiler/src/elements/elements.dart"; | 9 import "package:compiler/src/elements/elements.dart"; |
| 10 import "package:compiler/src/tree/tree.dart"; | 10 import "package:compiler/src/tree/tree.dart"; |
| 11 import "package:compiler/src/parser/listener.dart"; | 11 import "package:compiler/src/parser/element_listener.dart"; |
| 12 import "package:compiler/src/parser/node_listener.dart"; |
| 12 import "package:compiler/src/parser/parser.dart"; | 13 import "package:compiler/src/parser/parser.dart"; |
| 13 import "package:compiler/src/parser/partial_parser.dart"; | 14 import "package:compiler/src/parser/partial_parser.dart"; |
| 14 import "package:compiler/src/scanner/string_scanner.dart"; | 15 import "package:compiler/src/scanner/string_scanner.dart"; |
| 15 import "package:compiler/src/tokens/token.dart"; | 16 import "package:compiler/src/tokens/token.dart"; |
| 17 import "package:compiler/src/tokens/token_constants.dart"; |
| 16 import "package:compiler/src/io/source_file.dart"; | 18 import "package:compiler/src/io/source_file.dart"; |
| 17 import "package:compiler/src/util/util.dart"; | 19 import "package:compiler/src/util/util.dart"; |
| 18 | 20 |
| 19 import "package:compiler/src/elements/modelx.dart" | 21 import "package:compiler/src/elements/modelx.dart" |
| 20 show CompilationUnitElementX, ElementX, LibraryElementX; | 22 show CompilationUnitElementX, ElementX, LibraryElementX; |
| 21 | 23 |
| 22 import "package:compiler/src/compiler.dart"; | 24 import "package:compiler/src/compiler.dart"; |
| 23 import "package:compiler/src/diagnostics/source_span.dart"; | 25 import "package:compiler/src/diagnostics/source_span.dart"; |
| 24 import "package:compiler/src/diagnostics/spannable.dart"; | 26 import "package:compiler/src/diagnostics/spannable.dart"; |
| 25 import "package:compiler/src/diagnostics/diagnostic_listener.dart"; | 27 import "package:compiler/src/diagnostics/diagnostic_listener.dart"; |
| 26 import "package:compiler/src/diagnostics/messages.dart"; | 28 import "package:compiler/src/diagnostics/messages.dart"; |
| 27 import "package:compiler/src/script.dart"; | 29 import "package:compiler/src/script.dart"; |
| 28 | 30 |
| 29 export "package:compiler/src/diagnostics/diagnostic_listener.dart"; | 31 export "package:compiler/src/diagnostics/diagnostic_listener.dart"; |
| 30 export 'package:compiler/src/parser/listener.dart'; | 32 export 'package:compiler/src/parser/listener.dart'; |
| 33 export 'package:compiler/src/parser/node_listener.dart'; |
| 31 export 'package:compiler/src/parser/parser.dart'; | 34 export 'package:compiler/src/parser/parser.dart'; |
| 32 export 'package:compiler/src/parser/partial_parser.dart'; | 35 export 'package:compiler/src/parser/partial_parser.dart'; |
| 36 export 'package:compiler/src/parser/partial_elements.dart'; |
| 33 export "package:compiler/src/tokens/token.dart"; | 37 export "package:compiler/src/tokens/token.dart"; |
| 38 export "package:compiler/src/tokens/token_constants.dart"; |
| 34 | 39 |
| 35 class LoggerCanceler implements DiagnosticListener { | 40 class LoggerCanceler implements DiagnosticListener { |
| 36 void log(message) { | 41 void log(message) { |
| 37 print(message); | 42 print(message); |
| 38 } | 43 } |
| 39 | 44 |
| 40 void internalError(node, String message) { | 45 void internalError(node, String message) { |
| 41 log(message); | 46 log(message); |
| 42 } | 47 } |
| 43 | 48 |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 ElementListener listener = new ElementListener(compiler, unit, () => id++); | 138 ElementListener listener = new ElementListener(compiler, unit, () => id++); |
| 134 PartialParser parser = new PartialParser(listener); | 139 PartialParser parser = new PartialParser(listener); |
| 135 compiler.withCurrentElement(unit, () => parser.parseUnit(tokens)); | 140 compiler.withCurrentElement(unit, () => parser.parseUnit(tokens)); |
| 136 return unit.localMembers; | 141 return unit.localMembers; |
| 137 } | 142 } |
| 138 | 143 |
| 139 NodeList fullParseUnit(String source, {DiagnosticListener diagnosticHandler}) { | 144 NodeList fullParseUnit(String source, {DiagnosticListener diagnosticHandler}) { |
| 140 return parseBodyCode(source, (parser, tokens) => parser.parseUnit(tokens), | 145 return parseBodyCode(source, (parser, tokens) => parser.parseUnit(tokens), |
| 141 diagnosticHandler: diagnosticHandler); | 146 diagnosticHandler: diagnosticHandler); |
| 142 } | 147 } |
| OLD | NEW |