syntax: implement labelled breaks for for.

`for` desugars to `loop` so it is trivial to just desugar to `loop` while
retaining any label.
This commit is contained in:
Huon Wilson
2013-09-08 22:08:01 +10:00
parent b609d022c4
commit 07351b44c6
9 changed files with 32 additions and 16 deletions

View File

@@ -528,7 +528,7 @@ pub enum Expr_ {
ExprCast(@Expr, Ty),
ExprIf(@Expr, Block, Option<@Expr>),
ExprWhile(@Expr, Block),
ExprForLoop(@Pat, @Expr, Block),
ExprForLoop(@Pat, @Expr, Block, Option<Ident>),
/* Conditionless loop (can be exited with break, cont, or ret)
Same semantics as while(true) { body }, but typestate knows that the
(implicit) condition is always true. */