about summary refs log tree commit diff
path: root/src/comp/syntax/parse
diff options
context:
space:
mode:
Diffstat (limited to 'src/comp/syntax/parse')
-rw-r--r--src/comp/syntax/parse/parser.rs10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/comp/syntax/parse/parser.rs b/src/comp/syntax/parse/parser.rs
index 1ea3ddbec67..4a449c25a97 100644
--- a/src/comp/syntax/parse/parser.rs
+++ b/src/comp/syntax/parse/parser.rs
@@ -1505,11 +1505,13 @@ fn parse_local(p: parser, allow_init: bool) -> @ast::local {
 }
 
 fn parse_let(p: parser) -> @ast::decl {
+    fn parse_let_style(p: parser) -> ast::let_style {
+        eat(p, token::BINOP(token::AND)) ? ast::let_ref : ast::let_copy
+    }
     let lo = p.get_lo_pos();
-    let locals = [parse_local(p, true)];
-    while p.peek() == token::COMMA {
-        p.bump();
-        locals += [parse_local(p, true)];
+    let locals = [(parse_let_style(p), parse_local(p, true))];
+    while eat(p, token::COMMA) {
+        locals += [(parse_let_style(p), parse_local(p, true))];
     }
     ret @spanned(lo, p.get_last_hi_pos(), ast::decl_local(locals));
 }