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

Side by Side Diff: lib/compiler/implementation/scanner/class_element_parser.dart

Issue 10990108: Handle modifiers (abstract) on class nodes. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated cf. comment Created 8 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 | 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 class ClassElementParser extends PartialParser { 5 class ClassElementParser extends PartialParser {
6 ClassElementParser(Listener listener) : super(listener); 6 ClassElementParser(Listener listener) : super(listener);
7 7
8 Token parseClassBody(Token token) => fullParseClassBody(token); 8 Token parseClassBody(Token token) => fullParseClassBody(token);
9 } 9 }
10 10
11 class PartialClassElement extends ClassElement { 11 class PartialClassElement extends ClassElement {
12 final Token beginToken; 12 final Token beginToken;
13 final Token endToken; 13 final Token endToken;
14 Node cachedNode; 14 ClassNode cachedNode;
15 15
16 PartialClassElement(SourceString name, 16 PartialClassElement(SourceString name,
17 Token this.beginToken, 17 Token this.beginToken,
18 Token this.endToken, 18 Token this.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 22
23 void set supertypeLoadState(int state) { 23 void set supertypeLoadState(int state) {
24 assert(state == supertypeLoadState + 1); 24 assert(state == supertypeLoadState + 1);
(...skipping 24 matching lines...) Expand all
49 // need compiler. 49 // need compiler.
50 compiler.patchParser.parsePatchClassNode(patch); 50 compiler.patchParser.parsePatchClassNode(patch);
51 } 51 }
52 }); 52 });
53 }); 53 });
54 return cachedNode; 54 return cachedNode;
55 } 55 }
56 56
57 Token position() => beginToken; 57 Token position() => beginToken;
58 58
59 Modifiers get modifiers => cachedNode.modifiers;
Johnni Winther 2012/10/10 10:30:36 This didn't work. Added a TODO instead.
60
59 bool isInterface() => beginToken.stringValue === "interface"; 61 bool isInterface() => beginToken.stringValue === "interface";
60 62
61 PartialClassElement cloneTo(Element enclosing, DiagnosticListener listener) { 63 PartialClassElement cloneTo(Element enclosing, DiagnosticListener listener) {
62 parseNode(listener); 64 parseNode(listener);
63 // TODO(lrn): Is copying id acceptable? 65 // TODO(lrn): Is copying id acceptable?
64 // TODO(ahe): No. 66 // TODO(ahe): No.
65 PartialClassElement result = 67 PartialClassElement result =
66 new PartialClassElement(name, beginToken, endToken, enclosing, id); 68 new PartialClassElement(name, beginToken, endToken, enclosing, id);
67 69
68 assert(this.supertypeLoadState == STATE_NOT_STARTED); 70 assert(this.supertypeLoadState == STATE_NOT_STARTED);
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 } 193 }
192 194
193 void addMember(Element memberElement) { 195 void addMember(Element memberElement) {
194 for (Link link = metadata; !link.isEmpty(); link = link.tail) { 196 for (Link link = metadata; !link.isEmpty(); link = link.tail) {
195 memberElement.addMetadata(link.head); 197 memberElement.addMetadata(link.head);
196 } 198 }
197 metadata = const EmptyLink<MetadataAnnotation>(); 199 metadata = const EmptyLink<MetadataAnnotation>();
198 enclosingElement.addMember(memberElement, listener); 200 enclosingElement.addMember(memberElement, listener);
199 } 201 }
200 } 202 }
OLDNEW
« no previous file with comments | « lib/compiler/implementation/dart_backend/utils.dart ('k') | lib/compiler/implementation/scanner/listener.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698