| 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 interface Visitor<R> { | 5 interface 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 799 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 810 LiteralNull(Token token) : super(token, null); | 810 LiteralNull(Token token) : super(token, null); |
| 811 | 811 |
| 812 LiteralNull asLiteralNull() => this; | 812 LiteralNull asLiteralNull() => this; |
| 813 | 813 |
| 814 SourceString get value => null; | 814 SourceString get value => null; |
| 815 | 815 |
| 816 accept(Visitor visitor) => visitor.visitLiteralNull(this); | 816 accept(Visitor visitor) => visitor.visitLiteralNull(this); |
| 817 } | 817 } |
| 818 | 818 |
| 819 class LiteralList extends Expression { | 819 class LiteralList extends Expression { |
| 820 final TypeAnnotation type; | 820 final NodeList typeArguments; |
| 821 final NodeList elements; | 821 final NodeList elements; |
| 822 | 822 |
| 823 final Token constKeyword; | 823 final Token constKeyword; |
| 824 | 824 |
| 825 LiteralList(this.type, this.elements, this.constKeyword); | 825 LiteralList(this.typeArguments, this.elements, this.constKeyword); |
| 826 | 826 |
| 827 bool isConst() => constKeyword !== null; | 827 bool isConst() => constKeyword !== null; |
| 828 | 828 |
| 829 LiteralList asLiteralList() => this; | 829 LiteralList asLiteralList() => this; |
| 830 accept(Visitor visitor) => visitor.visitLiteralList(this); | 830 accept(Visitor visitor) => visitor.visitLiteralList(this); |
| 831 | 831 |
| 832 visitChildren(Visitor visitor) { | 832 visitChildren(Visitor visitor) { |
| 833 if (type !== null) type.accept(visitor); | 833 if (typeArguments !== null) typeArguments.accept(visitor); |
| 834 elements.accept(visitor); | 834 elements.accept(visitor); |
| 835 } | 835 } |
| 836 | 836 |
| 837 Token getBeginToken() { | 837 Token getBeginToken() { |
| 838 if (constKeyword !== null) return constKeyword; | 838 if (constKeyword !== null) return constKeyword; |
| 839 return firstBeginToken(type, elements); | 839 return firstBeginToken(typeArguments, elements); |
| 840 } | 840 } |
| 841 | 841 |
| 842 Token getEndToken() => elements.getEndToken(); | 842 Token getEndToken() => elements.getEndToken(); |
| 843 } | 843 } |
| 844 | 844 |
| 845 class Identifier extends Expression { | 845 class Identifier extends Expression { |
| 846 final Token token; | 846 final Token token; |
| 847 | 847 |
| 848 SourceString get source => token.value; | 848 SourceString get source => token.value; |
| 849 | 849 |
| (...skipping 912 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1762 * argument). | 1762 * argument). |
| 1763 * | 1763 * |
| 1764 * TODO(ahe): This method is controversial, the team needs to discuss | 1764 * TODO(ahe): This method is controversial, the team needs to discuss |
| 1765 * if top-level methods are acceptable and what naming conventions to | 1765 * if top-level methods are acceptable and what naming conventions to |
| 1766 * use. | 1766 * use. |
| 1767 */ | 1767 */ |
| 1768 initializerDo(Node node, f(Node node)) { | 1768 initializerDo(Node node, f(Node node)) { |
| 1769 SendSet send = node.asSendSet(); | 1769 SendSet send = node.asSendSet(); |
| 1770 if (send !== null) return f(send.arguments.head); | 1770 if (send !== null) return f(send.arguments.head); |
| 1771 } | 1771 } |
| OLD | NEW |