| 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 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 |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 Parser parser = new ClassElementParser(listener); | 40 Parser parser = new ClassElementParser(listener); |
| 41 Token token = parser.parseTopLevelDeclaration(beginToken); | 41 Token token = parser.parseTopLevelDeclaration(beginToken); |
| 42 assert(token === endToken.next); | 42 assert(token === endToken.next); |
| 43 cachedNode = listener.popNode(); | 43 cachedNode = listener.popNode(); |
| 44 assert(listener.nodes.isEmpty()); | 44 assert(listener.nodes.isEmpty()); |
| 45 }); | 45 }); |
| 46 compiler.patchParser.measure(() { | 46 compiler.patchParser.measure(() { |
| 47 if (isPatched) { | 47 if (isPatched) { |
| 48 // TODO(lrn): Perhaps extract functionality so it doesn't | 48 // TODO(lrn): Perhaps extract functionality so it doesn't |
| 49 // need compiler. | 49 // need compiler. |
| 50 ClassNode patchNode = compiler.patchParser.parsePatchClassNode(patch); | 50 compiler.patchParser.parsePatchClassNode(patch); |
| 51 Link<Element> patches = patch.localMembers; | |
| 52 compiler.applyContainerPatch(this, patches); | |
| 53 } | 51 } |
| 54 }); | 52 }); |
| 55 }); | 53 }); |
| 56 return cachedNode; | 54 return cachedNode; |
| 57 } | 55 } |
| 58 | 56 |
| 59 Token position() => beginToken; | 57 Token position() => beginToken; |
| 60 | 58 |
| 61 bool isInterface() => beginToken.stringValue === "interface"; | 59 bool isInterface() => beginToken.stringValue === "interface"; |
| 62 | 60 |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 } | 191 } |
| 194 | 192 |
| 195 void addMember(Element memberElement) { | 193 void addMember(Element memberElement) { |
| 196 for (Link link = metadata; !link.isEmpty(); link = link.tail) { | 194 for (Link link = metadata; !link.isEmpty(); link = link.tail) { |
| 197 memberElement.addMetadata(link.head); | 195 memberElement.addMetadata(link.head); |
| 198 } | 196 } |
| 199 metadata = const EmptyLink<MetadataAnnotation>(); | 197 metadata = const EmptyLink<MetadataAnnotation>(); |
| 200 enclosingElement.addMember(memberElement, listener); | 198 enclosingElement.addMember(memberElement, listener); |
| 201 } | 199 } |
| 202 } | 200 } |
| OLD | NEW |