summary refs log tree commit diff
path: root/src/libsyntax/parse/parser.rs
diff options
context:
space:
mode:
authorBen Blum <bblum@andrew.cmu.edu>2012-08-22 19:00:28 -0400
committerBen Blum <bblum@andrew.cmu.edu>2012-08-22 20:40:25 -0400
commit5b25fc918a8b91322c28242d3956109001b0f7c4 (patch)
treec02331c20638ff3602959b9c80aaea60e845ea12 /src/libsyntax/parse/parser.rs
parent1b804ce343a79fec2b08b88740782c1e8c081417 (diff)
downloadrust-5b25fc918a8b91322c28242d3956109001b0f7c4.tar.gz
rust-5b25fc918a8b91322c28242d3956109001b0f7c4.zip
Parse and typecheck moving out of enums (#2329)
Diffstat (limited to 'src/libsyntax/parse/parser.rs')
-rw-r--r--src/libsyntax/parse/parser.rs7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs
index fed81fa7520..f81d6de25b4 100644
--- a/src/libsyntax/parse/parser.rs
+++ b/src/libsyntax/parse/parser.rs
@@ -16,7 +16,7 @@ import common::{seq_sep_trailing_disallowed, seq_sep_trailing_allowed,
 import dvec::dvec;
 import vec::{push};
 import ast::{_mod, add, alt_check, alt_exhaustive, arg, arm, attribute,
-             bind_by_ref, bind_by_implicit_ref, bind_by_value,
+             bind_by_ref, bind_by_implicit_ref, bind_by_value, bind_by_move,
              bitand, bitor, bitxor, blk, blk_check_mode, bound_const,
              bound_copy, bound_send, bound_trait, bound_owned, box, by_copy,
              by_move, by_mutbl_ref, by_ref, by_val, capture_clause,
@@ -1887,12 +1887,17 @@ struct parser {
                 pat = self.parse_pat_ident(refutable, bind_by_ref(mutbl));
             } else if self.eat_keyword(~"copy") {
                 pat = self.parse_pat_ident(refutable, bind_by_value);
+            } else if self.eat_keyword(~"move") {
+                pat = self.parse_pat_ident(refutable, bind_by_move);
             } else if !is_plain_ident(self.token) {
                 pat = self.parse_enum_variant(refutable);
             } else {
                 let binding_mode;
+                // XXX: Aren't these two cases deadcode? -- bblum
                 if self.eat_keyword(~"copy") {
                     binding_mode = bind_by_value;
+                } else if self.eat_keyword(~"move") {
+                    binding_mode = bind_by_move;
                 } else if refutable {
                     // XXX: Should be bind_by_value, but that's not
                     // backward compatible.