OLD | NEW |
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 dart2js.serialization.resolved_ast; | 5 library dart2js.serialization.resolved_ast; |
6 | 6 |
7 import '../common.dart'; | 7 import '../common.dart'; |
8 import '../common/resolution.dart'; | 8 import '../common/resolution.dart'; |
9 import '../constants/expressions.dart'; | 9 import '../constants/expressions.dart'; |
10 import '../dart_types.dart'; | 10 import '../dart_types.dart'; |
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
393 | 393 |
394 /// Create the [Node] for the element by parsing the source code. | 394 /// Create the [Node] for the element by parsing the source code. |
395 Node doParse(parse(Parser parser)) { | 395 Node doParse(parse(Parser parser)) { |
396 return parsing.measure(() { | 396 return parsing.measure(() { |
397 return reporter.withCurrentElement(element, () { | 397 return reporter.withCurrentElement(element, () { |
398 CompilationUnitElement unit = element.compilationUnit; | 398 CompilationUnitElement unit = element.compilationUnit; |
399 NodeListener listener = new NodeListener( | 399 NodeListener listener = new NodeListener( |
400 parsing.getScannerOptionsFor(element), reporter, null); | 400 parsing.getScannerOptionsFor(element), reporter, null); |
401 listener.memberErrors = listener.memberErrors.prepend(false); | 401 listener.memberErrors = listener.memberErrors.prepend(false); |
402 try { | 402 try { |
403 Parser parser = new Parser(listener, parsing.parserOptions); | 403 Parser parser = new Parser(listener); |
404 parse(parser); | 404 parse(parser); |
405 } on ParserError catch (e) { | 405 } on ParserError catch (e) { |
406 reporter.internalError(element, '$e'); | 406 reporter.internalError(element, '$e'); |
407 } | 407 } |
408 return listener.popNode(); | 408 return listener.popNode(); |
409 }); | 409 }); |
410 }); | 410 }); |
411 } | 411 } |
412 | 412 |
413 /// Computes the [Node] for the element based on the [AstKind]. | 413 /// Computes the [Node] for the element based on the [AstKind]. |
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
687 } | 687 } |
688 } | 688 } |
689 } | 689 } |
690 element.resolvedAst = | 690 element.resolvedAst = |
691 new ParsedResolvedAst(element, root, body, elements, uri); | 691 new ParsedResolvedAst(element, root, body, elements, uri); |
692 } | 692 } |
693 } | 693 } |
694 | 694 |
695 const Key PARAMETER_NODE = const Key('parameter.node'); | 695 const Key PARAMETER_NODE = const Key('parameter.node'); |
696 const Key PARAMETER_INITIALIZER = const Key('parameter.initializer'); | 696 const Key PARAMETER_INITIALIZER = const Key('parameter.initializer'); |
OLD | NEW |