about summary refs log tree commit diff
path: root/src/rustc/syntax
diff options
context:
space:
mode:
authorMarijn Haverbeke <marijnh@gmail.com>2012-03-27 12:33:13 +0200
committerMarijn Haverbeke <marijnh@gmail.com>2012-03-27 12:33:13 +0200
commit064f82d68d151c04ec39c48ad163c2edacbbf9db (patch)
tree27a016fa7dde47f54c980a22a9d23571e98efa9f /src/rustc/syntax
parentf6e3738b9c824e56f561e75f0ff11cf3a0d2dd09 (diff)
downloadrust-064f82d68d151c04ec39c48ad163c2edacbbf9db.tar.gz
rust-064f82d68d151c04ec39c48ad163c2edacbbf9db.zip
Support returning from loop blocks
The code is somewhat invasive, but it seems hard to do this in a
clean way, since the design itself involves a bunch of 'action
at a distance'.

Issue #1819
Diffstat (limited to 'src/rustc/syntax')
-rw-r--r--src/rustc/syntax/ast.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/rustc/syntax/ast.rs b/src/rustc/syntax/ast.rs
index e657b6a6fe4..95c5b607cd4 100644
--- a/src/rustc/syntax/ast.rs
+++ b/src/rustc/syntax/ast.rs
@@ -303,6 +303,9 @@ enum expr_ {
     expr_alt(@expr, [arm], alt_mode),
     expr_fn(proto, fn_decl, blk, @capture_clause),
     expr_fn_block(fn_decl, blk),
+    // Inner expr is always an expr_fn_block. We need the wrapping node to
+    // sanely type this (a function returning nil on the inside but bool on
+    // the outside).
     expr_loop_body(@expr),
     expr_block(blk),