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 | 8 import '../common/resolution.dart' show |
9 Parsing, | 9 Parsing, |
10 Resolution; | 10 Resolution; |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 MemberListener; | 59 MemberListener; |
60 import 'node_listener.dart' show | 60 import 'node_listener.dart' show |
61 NodeListener; | 61 NodeListener; |
62 | 62 |
63 abstract class PartialElement implements DeclarationSite { | 63 abstract class PartialElement implements DeclarationSite { |
64 Token beginToken; | 64 Token beginToken; |
65 Token endToken; | 65 Token endToken; |
66 | 66 |
67 bool hasParseError = false; | 67 bool hasParseError = false; |
68 | 68 |
69 bool get isErroneous => hasParseError; | 69 bool get isMalformed => hasParseError; |
70 | 70 |
71 DeclarationSite get declarationSite => this; | 71 DeclarationSite get declarationSite => this; |
72 } | 72 } |
73 | 73 |
74 abstract class PartialFunctionMixin implements BaseFunctionElementX { | 74 abstract class PartialFunctionMixin implements BaseFunctionElementX { |
75 FunctionExpression cachedNode; | 75 FunctionExpression cachedNode; |
76 Modifiers get modifiers; | 76 Modifiers get modifiers; |
77 Token beginToken; | 77 Token beginToken; |
78 Token getOrSet; | 78 Token getOrSet; |
79 Token endToken; | 79 Token endToken; |
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
335 Token beginToken; // TODO(ahe): Make this final when issue 22065 is fixed. | 335 Token beginToken; // TODO(ahe): Make this final when issue 22065 is fixed. |
336 | 336 |
337 final Token tokenAfterEndToken; | 337 final Token tokenAfterEndToken; |
338 | 338 |
339 Expression cachedNode; | 339 Expression cachedNode; |
340 | 340 |
341 bool hasParseError = false; | 341 bool hasParseError = false; |
342 | 342 |
343 PartialMetadataAnnotation(this.beginToken, this.tokenAfterEndToken); | 343 PartialMetadataAnnotation(this.beginToken, this.tokenAfterEndToken); |
344 | 344 |
345 bool get isErroneous => hasParseError; | 345 bool get isMalformed => hasParseError; |
346 | 346 |
347 DeclarationSite get declarationSite => this; | 347 DeclarationSite get declarationSite => this; |
348 | 348 |
349 Token get endToken { | 349 Token get endToken { |
350 Token token = beginToken; | 350 Token token = beginToken; |
351 while (token.kind != Tokens.EOF_TOKEN) { | 351 while (token.kind != Tokens.EOF_TOKEN) { |
352 if (identical(token.next, tokenAfterEndToken)) break; | 352 if (identical(token.next, tokenAfterEndToken)) break; |
353 token = token.next; | 353 token = token.next; |
354 } | 354 } |
355 assert(token != null); | 355 assert(token != null); |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
489 } on ParserError catch (e) { | 489 } on ParserError catch (e) { |
490 partial.hasParseError = true; | 490 partial.hasParseError = true; |
491 return new ErrorNode(element.position, e.reason); | 491 return new ErrorNode(element.position, e.reason); |
492 } | 492 } |
493 Node node = listener.popNode(); | 493 Node node = listener.popNode(); |
494 assert(listener.nodes.isEmpty); | 494 assert(listener.nodes.isEmpty); |
495 return node; | 495 return node; |
496 }); | 496 }); |
497 }); | 497 }); |
498 } | 498 } |
OLD | NEW |