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

Side by Side Diff: dart/pkg/compiler/lib/src/scanner/class_element_parser.dart

Issue 750653002: Checked mode fixes. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 part of scanner; 5 part of scanner;
6 6
7 class ClassElementParser extends PartialParser { 7 class ClassElementParser extends PartialParser {
8 ClassElementParser(Listener listener) : super(listener); 8 ClassElementParser(Listener listener) : super(listener);
9 9
10 Token parseClassBody(Token token) => fullParseClassBody(token); 10 Token parseClassBody(Token token) => fullParseClassBody(token);
11 } 11 }
12 12
13 class PartialClassElement extends ClassElementX with PartialElement { 13 class PartialClassElement extends ClassElementX with PartialElement {
14 ClassNode cachedNode; 14 ClassNode cachedNode;
15 15
16 PartialClassElement(String name, 16 PartialClassElement(String name,
17 Token beginToken, 17 Token beginToken,
18 Token endToken, 18 Token endToken,
19 Element enclosing, 19 Element enclosing,
20 int id) 20 int id)
21 : super(name, enclosing, id, STATE_NOT_STARTED) { 21 : super(name, enclosing, id, STATE_NOT_STARTED) {
22 this.beginToken = beginToken; 22 this.beginToken = beginToken;
23 this.endToken = endToken; 23 this.endToken = endToken;
24 } 24 }
25 25
26 void set supertypeLoadState(int state) { 26 void set supertypeLoadState(int state) {
27 assert(state == supertypeLoadState + 1); 27 assert(state == STATE_NOT_STARTED || state == supertypeLoadState + 1);
28 assert(state <= STATE_DONE); 28 assert(state <= STATE_DONE);
29 super.supertypeLoadState = state; 29 super.supertypeLoadState = state;
30 } 30 }
31 31
32 void set resolutionState(int state) { 32 void set resolutionState(int state) {
33 assert(state == resolutionState + 1); 33 assert(state == STATE_NOT_STARTED || state == resolutionState + 1);
34 assert(state <= STATE_DONE); 34 assert(state <= STATE_DONE);
35 super.resolutionState = state; 35 super.resolutionState = state;
36 } 36 }
37 37
38 bool get hasNode => cachedNode != null; 38 bool get hasNode => cachedNode != null;
39 39
40 ClassNode get node { 40 ClassNode get node {
41 assert(invariant(this, cachedNode != null, 41 assert(invariant(this, cachedNode != null,
42 message: "Node has not been computed for $this.")); 42 message: "Node has not been computed for $this."));
43 return cachedNode; 43 return cachedNode;
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 217
218 void endMetadata(Token beginToken, Token periodBeforeName, Token endToken) { 218 void endMetadata(Token beginToken, Token periodBeforeName, Token endToken) {
219 popNode(); // Discard arguments. 219 popNode(); // Discard arguments.
220 if (periodBeforeName != null) { 220 if (periodBeforeName != null) {
221 popNode(); // Discard name. 221 popNode(); // Discard name.
222 } 222 }
223 popNode(); // Discard node (Send or Identifier). 223 popNode(); // Discard node (Send or Identifier).
224 pushMetadata(new PartialMetadataAnnotation(beginToken, endToken)); 224 pushMetadata(new PartialMetadataAnnotation(beginToken, endToken));
225 } 225 }
226 } 226 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698