define ty and update parser for sendable lambdas

This commit is contained in:
Niko Matsakis 2011-12-08 11:47:01 -08:00
parent 327ec89f69
commit 941101a9cd
3 changed files with 97 additions and 7 deletions

View file

@ -113,6 +113,7 @@ tag proto_sugar {
tag proto {
proto_bare;
proto_send;
proto_shared(proto_sugar);
proto_block;
}
@ -198,7 +199,7 @@ tag expr_ {
expr_for(@local, @expr, blk);
expr_do_while(blk, @expr);
expr_alt(@expr, [arm]);
expr_fn(_fn);
expr_fn(_fn, @capture);
expr_block(blk);
/*
@ -233,6 +234,15 @@ tag expr_ {
expr_mac(mac);
}
// At the moment, one can only capture local variables.
type capture_ = {
is_send: bool,
copies: [ident],
moves: [ident]
};
type capture = spanned<capture_>;
/*
// Says whether this is a block the user marked as
// "unchecked"