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

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

Issue 1093363002: Refactor DartTypeVisitor and ElementVisitor. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 8 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 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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 }); 84 });
85 return cachedNode; 85 return cachedNode;
86 } 86 }
87 87
88 Token get position => beginToken; 88 Token get position => beginToken;
89 89
90 // TODO(johnniwinther): Ensure that modifiers are always available. 90 // TODO(johnniwinther): Ensure that modifiers are always available.
91 Modifiers get modifiers => 91 Modifiers get modifiers =>
92 cachedNode != null ? cachedNode.modifiers : Modifiers.EMPTY; 92 cachedNode != null ? cachedNode.modifiers : Modifiers.EMPTY;
93 93
94 accept(ElementVisitor visitor) => visitor.visitClassElement(this); 94 accept(ElementVisitor visitor, arg) {
95 return visitor.visitClassElement(this, arg);
96 }
95 97
96 PartialClassElement copyWithEnclosing(CompilationUnitElement enclosing) { 98 PartialClassElement copyWithEnclosing(CompilationUnitElement enclosing) {
97 return new PartialClassElement(name, beginToken, endToken, enclosing, id); 99 return new PartialClassElement(name, beginToken, endToken, enclosing, id);
98 } 100 }
99 } 101 }
100 102
101 class MemberListener extends NodeListener { 103 class MemberListener extends NodeListener {
102 final ClassElement enclosingClass; 104 final ClassElement enclosingClass;
103 105
104 MemberListener(DiagnosticListener listener, 106 MemberListener(DiagnosticListener listener,
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 242
241 void endMetadata(Token beginToken, Token periodBeforeName, Token endToken) { 243 void endMetadata(Token beginToken, Token periodBeforeName, Token endToken) {
242 popNode(); // Discard arguments. 244 popNode(); // Discard arguments.
243 if (periodBeforeName != null) { 245 if (periodBeforeName != null) {
244 popNode(); // Discard name. 246 popNode(); // Discard name.
245 } 247 }
246 popNode(); // Discard node (Send or Identifier). 248 popNode(); // Discard node (Send or Identifier).
247 pushMetadata(new PartialMetadataAnnotation(beginToken, endToken)); 249 pushMetadata(new PartialMetadataAnnotation(beginToken, endToken));
248 } 250 }
249 } 251 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698