OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |