syntax: Allow closure args to be mutable
This commit is contained in:
parent
800b8a759d
commit
a7eaa1f5e4
1 changed files with 2 additions and 1 deletions
|
@ -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()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue