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 js; | 5 part of js; |
6 | 6 |
7 abstract class NodeVisitor<T> { | 7 abstract class NodeVisitor<T> { |
8 T visitProgram(Program node); | 8 T visitProgram(Program node); |
9 | 9 |
10 T visitBlock(Block node); | 10 T visitBlock(Block node); |
(...skipping 695 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
706 int get precedenceLevel => CALL; | 706 int get precedenceLevel => CALL; |
707 } | 707 } |
708 | 708 |
709 class PropertyAccess extends Expression { | 709 class PropertyAccess extends Expression { |
710 final Expression receiver; | 710 final Expression receiver; |
711 final Expression selector; | 711 final Expression selector; |
712 | 712 |
713 PropertyAccess(this.receiver, this.selector); | 713 PropertyAccess(this.receiver, this.selector); |
714 PropertyAccess.field(this.receiver, String fieldName) | 714 PropertyAccess.field(this.receiver, String fieldName) |
715 : selector = new LiteralString("'$fieldName'"); | 715 : selector = new LiteralString("'$fieldName'"); |
| 716 PropertyAccess.indexed(this.receiver, int index) |
| 717 : selector = new LiteralNumber('$index'); |
716 | 718 |
717 accept(NodeVisitor visitor) => visitor.visitAccess(this); | 719 accept(NodeVisitor visitor) => visitor.visitAccess(this); |
718 | 720 |
719 void visitChildren(NodeVisitor visitor) { | 721 void visitChildren(NodeVisitor visitor) { |
720 receiver.accept(visitor); | 722 receiver.accept(visitor); |
721 selector.accept(visitor); | 723 selector.accept(visitor); |
722 } | 724 } |
723 | 725 |
724 int get precedenceLevel => CALL; | 726 int get precedenceLevel => CALL; |
725 } | 727 } |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
832 /** Contains the pattern and the flags.*/ | 834 /** Contains the pattern and the flags.*/ |
833 String pattern; | 835 String pattern; |
834 | 836 |
835 RegExpLiteral(this.pattern); | 837 RegExpLiteral(this.pattern); |
836 | 838 |
837 accept(NodeVisitor visitor) => visitor.visitRegExpLiteral(this); | 839 accept(NodeVisitor visitor) => visitor.visitRegExpLiteral(this); |
838 void visitChildren(NodeVisitor visitor) {} | 840 void visitChildren(NodeVisitor visitor) {} |
839 | 841 |
840 int get precedenceLevel => PRIMARY; | 842 int get precedenceLevel => PRIMARY; |
841 } | 843 } |
OLD | NEW |