diff --git a/src/comp/front/ast.rs b/src/comp/front/ast.rs index 84a6bc9d2e6..531b1b1588d 100644 --- a/src/comp/front/ast.rs +++ b/src/comp/front/ast.rs @@ -407,7 +407,7 @@ type _fn = rec(fn_decl decl, type method_ = rec(ident ident, _fn meth, def_id id, ann ann); type method = spanned[method_]; -type obj_field = rec(@ty ty, ident ident, def_id id, ann ann); +type obj_field = rec(mutability mut, @ty ty, ident ident, def_id id, ann ann); type _obj = rec(vec[obj_field] fields, vec[@method] methods, option::t[@method] dtor); diff --git a/src/comp/front/parser.rs b/src/comp/front/parser.rs index f3b36b073c3..f09d67209bc 100644 --- a/src/comp/front/parser.rs +++ b/src/comp/front/parser.rs @@ -855,15 +855,9 @@ fn parse_bottom_expr(&parser p) -> @ast::expr { // Only make people type () if they're actually adding new fields let option::t[vec[ast::obj_field]] fields = none; if (p.peek() == token::LPAREN) { - auto pf = parse_obj_field; - expect(p, token::LPAREN); - - - fields = some[vec[ast::obj_field]] - (parse_seq_to_end[ast::obj_field] - (token::RPAREN, - some(token::COMMA), - pf, p)); + p.bump(); + fields = some(parse_seq_to_end(token::RPAREN, some(token::COMMA), + parse_obj_field, p)); } let vec[@ast::method] meths = []; @@ -1815,10 +1809,10 @@ fn parse_item_fn_or_iter(&parser p, ast::purity purity, ast::proto proto) fn parse_obj_field(&parser p) -> ast::obj_field { - auto mut = parse_mutability(p); // TODO: store this, use it in typeck + auto mut = parse_mutability(p); auto ty = parse_ty(p); auto ident = parse_value_ident(p); - ret rec(ty=ty, ident=ident, id=p.next_def_id(), ann=p.get_ann()); + ret rec(mut=mut, ty=ty, ident=ident, id=p.next_def_id(), ann=p.get_ann()); } fn parse_method(&parser p) -> @ast::method {