1
Fork 0

syntax: Allow closure args to be mutable

This commit is contained in:
Tim Chevalier 2013-01-22 23:33:13 -08:00
parent 800b8a759d
commit a7eaa1f5e4

View file

@ -747,6 +747,7 @@ impl Parser {
fn parse_fn_block_arg() -> arg_or_capture_item { fn parse_fn_block_arg() -> arg_or_capture_item {
do self.parse_capture_item_or |p| { do self.parse_capture_item_or |p| {
let m = p.parse_arg_mode(); let m = p.parse_arg_mode();
let is_mutbl = self.eat_keyword(~"mut");
let pat = p.parse_pat(false); let pat = p.parse_pat(false);
let t = if p.eat(token::COLON) { let t = if p.eat(token::COLON) {
p.parse_ty(false) p.parse_ty(false)
@ -759,7 +760,7 @@ impl Parser {
}; };
either::Left(ast::arg { either::Left(ast::arg {
mode: m, mode: m,
is_mutbl: false, is_mutbl: is_mutbl,
ty: t, ty: t,
pat: pat, pat: pat,
id: p.get_id() id: p.get_id()