Add new arg-passing mode 'move' denoted with '-T'. Translate as pass-by-value, doesn't deinit source yet nor get proper analysis in typestate, alias passes.

This commit is contained in:
Graydon Hoare 2011-08-08 15:53:31 -07:00
parent 3dda9aabf2
commit b54e7e4506
10 changed files with 39 additions and 6 deletions

View file

@ -597,6 +597,8 @@ fn parse_arg(p: &parser) -> ast::arg {
expect(p, token::COLON);
if eat(p, token::BINOP(token::AND)) {
m = ast::alias(eat_word(p, "mutable"));
} else if eat(p, token::BINOP(token::MINUS)) {
m = ast::move;
}
let t: @ast::ty = parse_ty(p);
ret {mode: m, ty: t, ident: i, id: p.get_id()};