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:
parent
b609d022c4
commit
07351b44c6
9 changed files with 32 additions and 16 deletions
|
|
@ -14,4 +14,10 @@ pub fn main() {
|
|||
break 'foo;
|
||||
}
|
||||
}
|
||||
|
||||
'bar: for _ in range(0, 100) {
|
||||
loop {
|
||||
break 'bar;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue