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

Unified 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: TODO added 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 side-by-side diff with in-line comments
Download patch
Index: lib/compiler/implementation/scanner/class_element_parser.dart
diff --git a/lib/compiler/implementation/scanner/class_element_parser.dart b/lib/compiler/implementation/scanner/class_element_parser.dart
index 70655d4a5a37f2d53e205ac4e40330d13e015bf2..33a31b93cdd00d46c7452649d1446790a3a60e62 100644
--- a/lib/compiler/implementation/scanner/class_element_parser.dart
+++ b/lib/compiler/implementation/scanner/class_element_parser.dart
@@ -11,7 +11,7 @@ class ClassElementParser extends PartialParser {
class PartialClassElement extends ClassElement {
final Token beginToken;
final Token endToken;
- Node cachedNode;
+ ClassNode cachedNode;
PartialClassElement(SourceString name,
Token this.beginToken,
@@ -56,37 +56,11 @@ class PartialClassElement extends ClassElement {
Token position() => beginToken;
- bool isInterface() => beginToken.stringValue === "interface";
-
- PartialClassElement cloneTo(Element enclosing, DiagnosticListener listener) {
- parseNode(listener);
- // TODO(lrn): Is copying id acceptable?
- // TODO(ahe): No.
- PartialClassElement result =
- new PartialClassElement(name, beginToken, endToken, enclosing, id);
-
- assert(this.supertypeLoadState == STATE_NOT_STARTED);
- assert(this.resolutionState == STATE_NOT_STARTED);
- assert(this.type === null);
- assert(this.supertype === null);
- assert(this.defaultClass === null);
- assert(this.interfaces === null);
- assert(this.allSupertypes === null);
- assert(this.backendMembers.isEmpty());
-
- // Native is only used in DOM/HTML library for which we don't
- // support patching.
- assert(this.nativeName === null);
-
- Link<Element> elementList = this.localMembers;
- while (!elementList.isEmpty()) {
- result.addMember(elementList.head.cloneTo(result, listener), listener);
- elementList = elementList.tail;
- }
+ // TODO(johnniwinther): Ensure that modifiers are always available.
+ Modifiers get modifiers =>
+ cachedNode != null ? cachedNode.modifiers : Modifiers.EMPTY;
- result.cachedNode = cachedNode;
- return result;
- }
+ bool isInterface() => beginToken.stringValue === "interface";
}
class MemberListener extends NodeListener {
« 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