Chromium Code Reviews| 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 abstract class Visitor<R> { | 5 abstract class Visitor<R> { |
| 6 R visitBlock(Block node); | 6 R visitBlock(Block node); |
| 7 R visitBreakStatement(BreakStatement node); | 7 R visitBreakStatement(BreakStatement node); |
| 8 R visitCascade(Cascade node); | 8 R visitCascade(Cascade node); |
| 9 R visitCascadeReceiver(CascadeReceiver node); | 9 R visitCascadeReceiver(CascadeReceiver node); |
| 10 R visitCaseMatch(CaseMatch node); | 10 R visitCaseMatch(CaseMatch node); |
| (...skipping 873 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 884 final Expression expression; | 884 final Expression expression; |
| 885 final Token beginToken; | 885 final Token beginToken; |
| 886 final Token endToken; | 886 final Token endToken; |
| 887 | 887 |
| 888 Return(this.beginToken, this.endToken, this.expression); | 888 Return(this.beginToken, this.endToken, this.expression); |
| 889 | 889 |
| 890 Return asReturn() => this; | 890 Return asReturn() => this; |
| 891 | 891 |
| 892 bool get hasExpression => expression !== null; | 892 bool get hasExpression => expression !== null; |
| 893 | 893 |
| 894 String get firstTokenStringValue => beginToken.stringValue; | |
|
ahe
2012/10/05 08:23:20
Where is this used?
Lasse Reichstein Nielsen
2012/10/09 09:46:54
In unparser, validator and resolver. Looking at th
| |
| 895 | |
| 894 accept(Visitor visitor) => visitor.visitReturn(this); | 896 accept(Visitor visitor) => visitor.visitReturn(this); |
| 895 | 897 |
| 896 visitChildren(Visitor visitor) { | 898 visitChildren(Visitor visitor) { |
| 897 if (expression !== null) expression.accept(visitor); | 899 if (expression !== null) expression.accept(visitor); |
| 898 } | 900 } |
| 899 | 901 |
| 900 Token getBeginToken() => beginToken; | 902 Token getBeginToken() => beginToken; |
| 901 | 903 |
| 902 Token getEndToken() { | 904 Token getEndToken() { |
| 903 if (endToken === null) return expression.getEndToken(); | 905 if (endToken === null) return expression.getEndToken(); |
| (...skipping 989 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1893 * argument). | 1895 * argument). |
| 1894 * | 1896 * |
| 1895 * TODO(ahe): This method is controversial, the team needs to discuss | 1897 * TODO(ahe): This method is controversial, the team needs to discuss |
| 1896 * if top-level methods are acceptable and what naming conventions to | 1898 * if top-level methods are acceptable and what naming conventions to |
| 1897 * use. | 1899 * use. |
| 1898 */ | 1900 */ |
| 1899 initializerDo(Node node, f(Node node)) { | 1901 initializerDo(Node node, f(Node node)) { |
| 1900 SendSet send = node.asSendSet(); | 1902 SendSet send = node.asSendSet(); |
| 1901 if (send !== null) return f(send.arguments.head); | 1903 if (send !== null) return f(send.arguments.head); |
| 1902 } | 1904 } |
| OLD | NEW |