'break' & 'continue'
This commit is contained in:
committed by
Dmitry Petrov
parent
87c7b4834b
commit
03a666690b
+39
@@ -0,0 +1,39 @@
|
||||
fun test1() {
|
||||
while (true) { break }
|
||||
do { break } while (true)
|
||||
while (true) { continue }
|
||||
do { continue } while (true)
|
||||
}
|
||||
|
||||
fun test2() {
|
||||
OUTER@while(true) {
|
||||
INNER@while(true) {
|
||||
break@INNER
|
||||
break@OUTER
|
||||
}
|
||||
break@OUTER
|
||||
}
|
||||
OUTER@while(true) {
|
||||
INNER@while(true) {
|
||||
continue@INNER
|
||||
continue@OUTER
|
||||
}
|
||||
continue@OUTER
|
||||
}
|
||||
}
|
||||
|
||||
fun test3() {
|
||||
L@while(true) {
|
||||
L@while(true) {
|
||||
break@L
|
||||
}
|
||||
break@L
|
||||
}
|
||||
L@while(true) {
|
||||
L@while(true) {
|
||||
continue@L
|
||||
}
|
||||
continue@L
|
||||
}
|
||||
}
|
||||
|
||||
+60
@@ -0,0 +1,60 @@
|
||||
IrFile /breakContinue.kt
|
||||
IrFunction public fun test1(): kotlin.Unit
|
||||
IrExpressionBody
|
||||
BLOCK type=<no-type> hasResult=false operator=null
|
||||
WHILE operator=WHILE_LOOP
|
||||
condition: CONST Boolean type=kotlin.Boolean value='true'
|
||||
body: BLOCK type=<no-type> hasResult=false operator=null
|
||||
BREAK loop.operator=WHILE_LOOP depth=0
|
||||
DO_WHILE operator=DO_WHILE_LOOP
|
||||
body: BLOCK type=<no-type> hasResult=false operator=null
|
||||
BREAK loop.operator=DO_WHILE_LOOP depth=0
|
||||
condition: CONST Boolean type=kotlin.Boolean value='true'
|
||||
WHILE operator=WHILE_LOOP
|
||||
condition: CONST Boolean type=kotlin.Boolean value='true'
|
||||
body: BLOCK type=<no-type> hasResult=false operator=null
|
||||
CONTINUE loop.operator=WHILE_LOOP depth=0
|
||||
DO_WHILE operator=DO_WHILE_LOOP
|
||||
body: BLOCK type=<no-type> hasResult=false operator=null
|
||||
CONTINUE loop.operator=DO_WHILE_LOOP depth=0
|
||||
condition: CONST Boolean type=kotlin.Boolean value='true'
|
||||
IrFunction public fun test2(): kotlin.Unit
|
||||
IrExpressionBody
|
||||
BLOCK type=<no-type> hasResult=false operator=null
|
||||
WHILE operator=WHILE_LOOP
|
||||
condition: CONST Boolean type=kotlin.Boolean value='true'
|
||||
body: BLOCK type=<no-type> hasResult=false operator=null
|
||||
WHILE operator=WHILE_LOOP
|
||||
condition: CONST Boolean type=kotlin.Boolean value='true'
|
||||
body: BLOCK type=<no-type> hasResult=false operator=null
|
||||
BREAK loop.operator=WHILE_LOOP depth=0
|
||||
BREAK loop.operator=WHILE_LOOP depth=1
|
||||
BREAK loop.operator=WHILE_LOOP depth=0
|
||||
WHILE operator=WHILE_LOOP
|
||||
condition: CONST Boolean type=kotlin.Boolean value='true'
|
||||
body: BLOCK type=<no-type> hasResult=false operator=null
|
||||
WHILE operator=WHILE_LOOP
|
||||
condition: CONST Boolean type=kotlin.Boolean value='true'
|
||||
body: BLOCK type=<no-type> hasResult=false operator=null
|
||||
CONTINUE loop.operator=WHILE_LOOP depth=0
|
||||
CONTINUE loop.operator=WHILE_LOOP depth=1
|
||||
CONTINUE loop.operator=WHILE_LOOP depth=0
|
||||
IrFunction public fun test3(): kotlin.Unit
|
||||
IrExpressionBody
|
||||
BLOCK type=<no-type> hasResult=false operator=null
|
||||
WHILE operator=WHILE_LOOP
|
||||
condition: CONST Boolean type=kotlin.Boolean value='true'
|
||||
body: BLOCK type=<no-type> hasResult=false operator=null
|
||||
WHILE operator=WHILE_LOOP
|
||||
condition: CONST Boolean type=kotlin.Boolean value='true'
|
||||
body: BLOCK type=<no-type> hasResult=false operator=null
|
||||
BREAK loop.operator=WHILE_LOOP depth=0
|
||||
BREAK loop.operator=WHILE_LOOP depth=0
|
||||
WHILE operator=WHILE_LOOP
|
||||
condition: CONST Boolean type=kotlin.Boolean value='true'
|
||||
body: BLOCK type=<no-type> hasResult=false operator=null
|
||||
WHILE operator=WHILE_LOOP
|
||||
condition: CONST Boolean type=kotlin.Boolean value='true'
|
||||
body: BLOCK type=<no-type> hasResult=false operator=null
|
||||
CONTINUE loop.operator=WHILE_LOOP depth=0
|
||||
CONTINUE loop.operator=WHILE_LOOP depth=0
|
||||
Reference in New Issue
Block a user