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

@ -14,4 +14,10 @@ pub fn main() {
break 'foo;
}
}
'bar: for _ in range(0, 100) {
loop {
break 'bar;
}
}
}