Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(137)

Side by Side Diff: pkg/compiler/lib/src/parser/partial_elements.dart

Issue 1414913002: Introduce .isMalformed (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Address review Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
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 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/library_loader.dart ('k') | pkg/compiler/lib/src/resolution/class_hierarchy.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698