diff options
| author | P1start <rewi-github@whanau.org> | 2014-08-10 15:54:33 +1200 |
|---|---|---|
| committer | P1start <rewi-github@whanau.org> | 2014-09-10 10:25:12 +1200 |
| commit | bf274bc18bcbfea1377c5c64ae0cc099b03d9beb (patch) | |
| tree | 78f4b0455b6c93991836bed81b7b57096737b462 /src/libsyntax/ast.rs | |
| parent | 651106462c357b71a4ca2c02ba2bfedfc38b0035 (diff) | |
| download | rust-bf274bc18bcbfea1377c5c64ae0cc099b03d9beb.tar.gz rust-bf274bc18bcbfea1377c5c64ae0cc099b03d9beb.zip | |
Implement tuple and tuple struct indexing
This allows code to access the fields of tuples and tuple structs:
let x = (1i, 2i);
assert_eq!(x.1, 2);
struct Point(int, int);
let origin = Point(0, 0);
assert_eq!(origin.0, 0);
assert_eq!(origin.1, 0);
Diffstat (limited to 'src/libsyntax/ast.rs')
| -rw-r--r-- | src/libsyntax/ast.rs | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/libsyntax/ast.rs b/src/libsyntax/ast.rs index 68a1c521f19..4e65082fe3a 100644 --- a/src/libsyntax/ast.rs +++ b/src/libsyntax/ast.rs @@ -540,6 +540,7 @@ pub enum Expr_ { ExprAssign(Gc<Expr>, Gc<Expr>), ExprAssignOp(BinOp, Gc<Expr>, Gc<Expr>), ExprField(Gc<Expr>, SpannedIdent, Vec<P<Ty>>), + ExprTupField(Gc<Expr>, Spanned<uint>, Vec<P<Ty>>), ExprIndex(Gc<Expr>, Gc<Expr>), /// Variable reference, possibly containing `::` and/or |
