about summary refs log tree commit diff
path: root/src/comp/syntax/parse
diff options
context:
space:
mode:
authorBrian Anderson <banderson@mozilla.com>2011-08-19 12:01:01 -0700
committerBrian Anderson <banderson@mozilla.com>2011-08-19 12:50:05 -0700
commit7053b6010aa35580c051b334920a4bba3ffbec1a (patch)
treefc9ab768605411d8fc91206c40a88b41ffb44e30 /src/comp/syntax/parse
parent325ea41a1ef2b648cc032f4b0370f285d6d4821a (diff)
downloadrust-7053b6010aa35580c051b334920a4bba3ffbec1a.tar.gz
rust-7053b6010aa35580c051b334920a4bba3ffbec1a.zip
Parse x[y] as indexes
Diffstat (limited to 'src/comp/syntax/parse')
-rw-r--r--src/comp/syntax/parse/parser.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/comp/syntax/parse/parser.rs b/src/comp/syntax/parse/parser.rs
index 5361a686814..2d11ae974d3 100644
--- a/src/comp/syntax/parse/parser.rs
+++ b/src/comp/syntax/parse/parser.rs
@@ -1109,6 +1109,13 @@ fn parse_dot_or_call_expr_with(p: &parser, e: @ast::expr) -> @ast::expr {
                 e = mk_expr(p, lo, hi, ast::expr_call(e, es.node));
             }
           }
+          token::LBRACKET. {
+            p.bump();
+            let ix = parse_expr(p);
+            hi = ix.span.hi;
+            expect(p, token::RBRACKET);
+            e = mk_expr(p, lo, hi, ast::expr_index(e, ix));
+          }
           token::DOT. {
             p.bump();
             alt p.peek() {