| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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.parser.partial_elements; | 5 library dart2js.parser.partial_elements; |
| 6 | 6 |
| 7 import '../common.dart'; | 7 import '../common.dart'; |
| 8 import '../common/resolution.dart' show Parsing, Resolution; | 8 import '../common/resolution.dart' show Parsing, Resolution; |
| 9 import '../dart_types.dart' show DynamicType; | 9 import '../dart_types.dart' show DynamicType; |
| 10 import '../elements/elements.dart' | 10 import '../elements/elements.dart' |
| 11 show | 11 show |
| 12 CompilationUnitElement, | 12 CompilationUnitElement, |
| 13 ConstructorElement, | |
| 14 Element, | 13 Element, |
| 15 ElementKind, | 14 ElementKind, |
| 16 GetterElement, | 15 GetterElement, |
| 17 LibraryElement, | |
| 18 MetadataAnnotation, | 16 MetadataAnnotation, |
| 19 MethodElement, | |
| 20 SetterElement, | 17 SetterElement, |
| 21 STATE_NOT_STARTED, | 18 STATE_NOT_STARTED, |
| 22 STATE_DONE; | 19 STATE_DONE; |
| 23 import '../elements/modelx.dart' | 20 import '../elements/modelx.dart' |
| 24 show | 21 show |
| 25 BaseFunctionElementX, | 22 BaseFunctionElementX, |
| 26 ClassElementX, | 23 ClassElementX, |
| 27 ConstructorElementX, | 24 ConstructorElementX, |
| 28 DeclarationSite, | 25 DeclarationSite, |
| 29 ElementX, | 26 ElementX, |
| 30 FieldElementX, | |
| 31 GetterElementX, | 27 GetterElementX, |
| 32 MetadataAnnotationX, | 28 MetadataAnnotationX, |
| 33 MethodElementX, | 29 MethodElementX, |
| 34 SetterElementX, | 30 SetterElementX, |
| 35 TypedefElementX, | 31 TypedefElementX, |
| 36 VariableList; | 32 VariableList; |
| 37 import '../elements/visitor.dart' show ElementVisitor; | 33 import '../elements/visitor.dart' show ElementVisitor; |
| 38 import '../tokens/token.dart' | 34 import '../tokens/token.dart' show Token; |
| 39 show | |
| 40 BadInputToken, | |
| 41 BeginGroupToken, | |
| 42 ErrorToken, | |
| 43 KeywordToken, | |
| 44 StringToken, | |
| 45 Token, | |
| 46 UnmatchedToken, | |
| 47 UnterminatedToken; | |
| 48 import '../tokens/token_constants.dart' as Tokens show EOF_TOKEN; | 35 import '../tokens/token_constants.dart' as Tokens show EOF_TOKEN; |
| 49 import '../tree/tree.dart'; | 36 import '../tree/tree.dart'; |
| 50 | |
| 51 import 'class_element_parser.dart' show ClassElementParser; | 37 import 'class_element_parser.dart' show ClassElementParser; |
| 52 import 'parser.dart' show Parser; | |
| 53 import 'listener.dart' show ParserError; | 38 import 'listener.dart' show ParserError; |
| 54 import 'member_listener.dart' show MemberListener; | 39 import 'member_listener.dart' show MemberListener; |
| 55 import 'node_listener.dart' show NodeListener; | 40 import 'node_listener.dart' show NodeListener; |
| 41 import 'parser.dart' show Parser; |
| 56 | 42 |
| 57 abstract class PartialElement implements DeclarationSite { | 43 abstract class PartialElement implements DeclarationSite { |
| 58 Token beginToken; | 44 Token beginToken; |
| 59 Token endToken; | 45 Token endToken; |
| 60 | 46 |
| 61 bool hasParseError = false; | 47 bool hasParseError = false; |
| 62 | 48 |
| 63 bool get isMalformed => hasParseError; | 49 bool get isMalformed => hasParseError; |
| 64 | 50 |
| 65 DeclarationSite get declarationSite => this; | 51 DeclarationSite get declarationSite => this; |
| (...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 457 } on ParserError catch (e) { | 443 } on ParserError catch (e) { |
| 458 partial.hasParseError = true; | 444 partial.hasParseError = true; |
| 459 return new ErrorNode(element.position, e.reason); | 445 return new ErrorNode(element.position, e.reason); |
| 460 } | 446 } |
| 461 Node node = listener.popNode(); | 447 Node node = listener.popNode(); |
| 462 assert(listener.nodes.isEmpty); | 448 assert(listener.nodes.isEmpty); |
| 463 return node; | 449 return node; |
| 464 }); | 450 }); |
| 465 }); | 451 }); |
| 466 } | 452 } |
| OLD | NEW |