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

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

Issue 1162603006: Element model cleanup + prepare for easier reimplementation. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 6 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
« no previous file with comments | « pkg/compiler/lib/src/resolution/members.dart ('k') | pkg/compiler/lib/src/ssa/builder.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 accept(ElementVisitor visitor, arg) { 94 accept(ElementVisitor visitor, arg) {
95 return visitor.visitClassElement(this, arg); 95 return visitor.visitClassElement(this, arg);
96 } 96 }
97 97
98 PartialClassElement copyWithEnclosing(CompilationUnitElement enclosing) { 98 PartialClassElement copyWithEnclosing(CompilationUnitElement enclosing) {
99 return new PartialClassElement(name, beginToken, endToken, enclosing, id); 99 return new PartialClassElement(name, beginToken, endToken, enclosing, id);
100 } 100 }
101 } 101 }
102 102
103 class MemberListener extends NodeListener { 103 class MemberListener extends NodeListener {
104 final ClassElement enclosingClass; 104 final ClassElementX enclosingClass;
105 105
106 MemberListener(DiagnosticListener listener, 106 MemberListener(DiagnosticListener listener,
107 ClassElement enclosingElement) 107 ClassElementX enclosingElement)
108 : this.enclosingClass = enclosingElement, 108 : this.enclosingClass = enclosingElement,
109 super(listener, enclosingElement.compilationUnit); 109 super(listener, enclosingElement.compilationUnit);
110 110
111 bool isConstructorName(Node nameNode) { 111 bool isConstructorName(Node nameNode) {
112 if (enclosingClass == null || 112 if (enclosingClass == null ||
113 enclosingClass.kind != ElementKind.CLASS) { 113 enclosingClass.kind != ElementKind.CLASS) {
114 return false; 114 return false;
115 } 115 }
116 String name; 116 String name;
117 if (nameNode.asIdentifier() != null) { 117 if (nameNode.asIdentifier() != null) {
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 236
237 void endMetadata(Token beginToken, Token periodBeforeName, Token endToken) { 237 void endMetadata(Token beginToken, Token periodBeforeName, Token endToken) {
238 popNode(); // Discard arguments. 238 popNode(); // Discard arguments.
239 if (periodBeforeName != null) { 239 if (periodBeforeName != null) {
240 popNode(); // Discard name. 240 popNode(); // Discard name.
241 } 241 }
242 popNode(); // Discard node (Send or Identifier). 242 popNode(); // Discard node (Send or Identifier).
243 pushMetadata(new PartialMetadataAnnotation(beginToken, endToken)); 243 pushMetadata(new PartialMetadataAnnotation(beginToken, endToken));
244 } 244 }
245 } 245 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/resolution/members.dart ('k') | pkg/compiler/lib/src/ssa/builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698