diff options
| author | Seo Sanghyeon <sanxiyn@gmail.com> | 2013-01-04 01:45:07 +0900 |
|---|---|---|
| committer | Tim Chevalier <chevalier@alum.wellesley.edu> | 2013-01-22 23:34:33 -0800 |
| commit | 9a5d6170927547226870bbf4eb9cad62cdc405f6 (patch) | |
| tree | 4726aaac7d69cdc4e5becae2afdd610a71dcae12 /src/libsyntax | |
| parent | dfa97c21a57f10ff1f904a81a13ad8406e8224cb (diff) | |
| download | rust-9a5d6170927547226870bbf4eb9cad62cdc405f6.tar.gz rust-9a5d6170927547226870bbf4eb9cad62cdc405f6.zip | |
Add is_mutbl field to arg
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/ast.rs | 2 | ||||
| -rw-r--r-- | src/libsyntax/ext/auto_encode.rs | 3 | ||||
| -rw-r--r-- | src/libsyntax/ext/build.rs | 1 | ||||
| -rw-r--r-- | src/libsyntax/ext/pipes/ast_builder.rs | 1 | ||||
| -rw-r--r-- | src/libsyntax/fold.rs | 1 | ||||
| -rw-r--r-- | src/libsyntax/parse/parser.rs | 5 |
6 files changed, 11 insertions, 2 deletions
diff --git a/src/libsyntax/ast.rs b/src/libsyntax/ast.rs index 6bb187b61d1..81853e4875a 100644 --- a/src/libsyntax/ast.rs +++ b/src/libsyntax/ast.rs @@ -1194,11 +1194,11 @@ impl Ty : to_bytes::IterBytes { } } - #[auto_encode] #[auto_decode] struct arg { mode: mode, + is_mutbl: bool, ty: @Ty, pat: @pat, id: node_id, diff --git a/src/libsyntax/ext/auto_encode.rs b/src/libsyntax/ext/auto_encode.rs index 1354b816a00..470b6e540ed 100644 --- a/src/libsyntax/ext/auto_encode.rs +++ b/src/libsyntax/ext/auto_encode.rs @@ -595,6 +595,7 @@ fn mk_ser_method( let ser_inputs = ~[ast::arg { mode: ast::infer(cx.next_id()), + is_mutbl: false, ty: ty_s, pat: @ast::pat { id: cx.next_id(), @@ -658,6 +659,7 @@ fn mk_deser_method( let deser_inputs = ~[ast::arg { mode: ast::infer(cx.next_id()), + is_mutbl: false, ty: ty_d, pat: @ast::pat { id: cx.next_id(), @@ -1194,6 +1196,7 @@ fn mk_enum_deser_body( ast::fn_decl { inputs: ~[ast::arg { mode: ast::infer(cx.next_id()), + is_mutbl: false, ty: @ast::Ty { id: cx.next_id(), node: ast::ty_infer, diff --git a/src/libsyntax/ext/build.rs b/src/libsyntax/ext/build.rs index d17db9ad6aa..5e3d88b8b7f 100644 --- a/src/libsyntax/ext/build.rs +++ b/src/libsyntax/ext/build.rs @@ -319,6 +319,7 @@ fn mk_arg(cx: ext_ctxt, let arg_pat = mk_pat_ident(cx, span, ident); ast::arg { mode: ast::infer(cx.next_id()), + is_mutbl: false, ty: ty, pat: arg_pat, id: cx.next_id() diff --git a/src/libsyntax/ext/pipes/ast_builder.rs b/src/libsyntax/ext/pipes/ast_builder.rs index c8c05d27d80..343ce4b039b 100644 --- a/src/libsyntax/ext/pipes/ast_builder.rs +++ b/src/libsyntax/ext/pipes/ast_builder.rs @@ -200,6 +200,7 @@ impl ext_ctxt: ext_ctxt_ast_builder { fn arg(name: ident, ty: @ast::Ty) -> ast::arg { ast::arg { mode: ast::infer(self.next_id()), + is_mutbl: false, ty: ty, pat: @ast::pat { id: self.next_id(), diff --git a/src/libsyntax/fold.rs b/src/libsyntax/fold.rs index 3582c082b5c..fc2ad0192eb 100644 --- a/src/libsyntax/fold.rs +++ b/src/libsyntax/fold.rs @@ -127,6 +127,7 @@ fn fold_attribute_(at: attribute, fld: ast_fold) -> attribute { fn fold_arg_(a: arg, fld: ast_fold) -> arg { ast::arg { mode: a.mode, + is_mutbl: a.is_mutbl, ty: fld.fold_ty(a.ty), pat: fld.fold_pat(a.pat), id: fld.new_id(a.id), diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index 33ae2f22dfe..29b8528b1c9 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -716,6 +716,7 @@ impl Parser { // identifier names. fn parse_arg_general(require_name: bool) -> arg { let mut m; + let is_mutbl = false; let pat = if require_name || self.is_named_argument() { m = self.parse_arg_mode(); let pat = self.parse_pat(false); @@ -730,7 +731,8 @@ impl Parser { let t = self.parse_ty(false); - ast::arg { mode: m, ty: t, pat: pat, id: self.get_id() } + ast::arg { mode: m, is_mutbl: is_mutbl, + ty: t, pat: pat, id: self.get_id() } } fn parse_arg() -> arg_or_capture_item { @@ -756,6 +758,7 @@ impl Parser { }; either::Left(ast::arg { mode: m, + is_mutbl: false, ty: t, pat: pat, id: p.get_id() |
