about summary refs log tree commit diff
path: root/src/comp/syntax/ast.rs
diff options
context:
space:
mode:
authorNiko Matsakis <niko@alum.mit.edu>2011-12-17 21:12:30 -0800
committerNiko Matsakis <niko@alum.mit.edu>2011-12-19 14:07:46 -0800
commitb2b2a430df33a234be62d97d7efc1f0a3d419b50 (patch)
tree392e4e0d7eb11ed978920a38e89de84b86b80a10 /src/comp/syntax/ast.rs
parentb0f1a5f051f1e2a5eb164e0d2abb35edea4a4c75 (diff)
downloadrust-b2b2a430df33a234be62d97d7efc1f0a3d419b50.tar.gz
rust-b2b2a430df33a234be62d97d7efc1f0a3d419b50.zip
resolve capture clauses
Diffstat (limited to 'src/comp/syntax/ast.rs')
-rw-r--r--src/comp/syntax/ast.rs16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/comp/syntax/ast.rs b/src/comp/syntax/ast.rs
index 0b3a03c6b1a..608796696d6 100644
--- a/src/comp/syntax/ast.rs
+++ b/src/comp/syntax/ast.rs
@@ -226,7 +226,7 @@ tag expr_ {
     expr_for(@local, @expr, blk);
     expr_do_while(blk, @expr);
     expr_alt(@expr, [arm]);
-    expr_fn(_fn, @capture);
+    expr_fn(_fn, @capture_clause);
     expr_block(blk);
 
     /*
@@ -261,13 +261,15 @@ tag expr_ {
     expr_mac(mac);
 }
 
-// At the moment, one can only capture local variables.
-type capture_ = {
-    copies: [spanned<ident>],
-    moves: [spanned<ident>]
+type capture_item = {
+    id: int,
+    name: ident, // Currently, can only capture a local var.
+    span: span
+};
+type capture_clause = {
+    copies: [@capture_item],
+    moves: [@capture_item]
 };
-
-type capture = spanned<capture_>;
 
 /*
 // Says whether this is a block the user marked as