| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 tree; | 5 part of tree; |
| 6 | 6 |
| 7 abstract class Visitor<R> { | 7 abstract class Visitor<R> { |
| 8 const Visitor(); | 8 const Visitor(); |
| 9 | 9 |
| 10 R visitNode(Node node); | 10 R visitNode(Node node); |
| (...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 260 // TODO(kasperl): Let this share some structure with the typedef for function | 260 // TODO(kasperl): Let this share some structure with the typedef for function |
| 261 // type aliases? | 261 // type aliases? |
| 262 class NamedMixinApplication extends Node implements MixinApplication { | 262 class NamedMixinApplication extends Node implements MixinApplication { |
| 263 final Identifier name; | 263 final Identifier name; |
| 264 final NodeList typeParameters; | 264 final NodeList typeParameters; |
| 265 | 265 |
| 266 final Modifiers modifiers; | 266 final Modifiers modifiers; |
| 267 final MixinApplication mixinApplication; | 267 final MixinApplication mixinApplication; |
| 268 final NodeList interfaces; | 268 final NodeList interfaces; |
| 269 | 269 |
| 270 final Token typedefKeyword; | 270 final Token classKeyword; |
| 271 final Token endToken; | 271 final Token endToken; |
| 272 | 272 |
| 273 NamedMixinApplication(this.name, this.typeParameters, | 273 NamedMixinApplication(this.name, this.typeParameters, |
| 274 this.modifiers, this.mixinApplication, this.interfaces, | 274 this.modifiers, this.mixinApplication, this.interfaces, |
| 275 this.typedefKeyword, this.endToken); | 275 this.classKeyword, this.endToken); |
| 276 | 276 |
| 277 TypeAnnotation get superclass => mixinApplication.superclass; | 277 TypeAnnotation get superclass => mixinApplication.superclass; |
| 278 NodeList get mixins => mixinApplication.mixins; | 278 NodeList get mixins => mixinApplication.mixins; |
| 279 | 279 |
| 280 MixinApplication asMixinApplication() => this; | 280 MixinApplication asMixinApplication() => this; |
| 281 NamedMixinApplication asNamedMixinApplication() => this; | 281 NamedMixinApplication asNamedMixinApplication() => this; |
| 282 | 282 |
| 283 accept(Visitor visitor) => visitor.visitNamedMixinApplication(this); | 283 accept(Visitor visitor) => visitor.visitNamedMixinApplication(this); |
| 284 | 284 |
| 285 visitChildren(Visitor visitor) { | 285 visitChildren(Visitor visitor) { |
| 286 name.accept(visitor); | 286 name.accept(visitor); |
| 287 if (typeParameters != null) typeParameters.accept(visitor); | 287 if (typeParameters != null) typeParameters.accept(visitor); |
| 288 if (modifiers != null) modifiers.accept(visitor); | 288 if (modifiers != null) modifiers.accept(visitor); |
| 289 if (interfaces != null) interfaces.accept(visitor); | 289 if (interfaces != null) interfaces.accept(visitor); |
| 290 mixinApplication.accept(visitor); | 290 mixinApplication.accept(visitor); |
| 291 } | 291 } |
| 292 | 292 |
| 293 Token getBeginToken() => typedefKeyword; | 293 Token getBeginToken() => classKeyword; |
| 294 Token getEndToken() => endToken; | 294 Token getEndToken() => endToken; |
| 295 } | 295 } |
| 296 | 296 |
| 297 abstract class Expression extends Node { | 297 abstract class Expression extends Node { |
| 298 Expression(); | 298 Expression(); |
| 299 | 299 |
| 300 Expression asExpression() => this; | 300 Expression asExpression() => this; |
| 301 | 301 |
| 302 // TODO(ahe): make class abstract instead of adding an abstract method. | 302 // TODO(ahe): make class abstract instead of adding an abstract method. |
| 303 accept(Visitor visitor); | 303 accept(Visitor visitor); |
| (...skipping 1773 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2077 * argument). | 2077 * argument). |
| 2078 * | 2078 * |
| 2079 * TODO(ahe): This method is controversial, the team needs to discuss | 2079 * TODO(ahe): This method is controversial, the team needs to discuss |
| 2080 * if top-level methods are acceptable and what naming conventions to | 2080 * if top-level methods are acceptable and what naming conventions to |
| 2081 * use. | 2081 * use. |
| 2082 */ | 2082 */ |
| 2083 initializerDo(Node node, f(Node node)) { | 2083 initializerDo(Node node, f(Node node)) { |
| 2084 SendSet send = node.asSendSet(); | 2084 SendSet send = node.asSendSet(); |
| 2085 if (send != null) return f(send.arguments.head); | 2085 if (send != null) return f(send.arguments.head); |
| 2086 } | 2086 } |
| OLD | NEW |