Fix issue when break added into wrong code block

This commit is contained in:
Vitaliy.Bibaev
2017-09-18 19:49:13 +03:00
parent 5e9aac6e06
commit 359d1145a0
3 changed files with 5 additions and 9 deletions
@@ -20,5 +20,5 @@ package com.intellij.debugger.streams.trace.dsl
*/
interface ForLoopBody : CodeBlock {
val loopVariable: Variable
fun breakIteration()
fun breakIteration(): Expression
}
@@ -15,6 +15,7 @@
*/
package com.intellij.debugger.streams.trace.dsl.impl.java
import com.intellij.debugger.streams.trace.dsl.Expression
import com.intellij.debugger.streams.trace.dsl.ForLoopBody
import com.intellij.debugger.streams.trace.dsl.StatementFactory
import com.intellij.debugger.streams.trace.dsl.Variable
@@ -29,5 +30,5 @@ class JavaForLoopBody(statementFactory: StatementFactory, override val loopVaria
val BREAK = TextExpression("break")
}
override fun breakIteration() = addStatement(BREAK)
override fun breakIteration(): Expression = BREAK
}
@@ -15,10 +15,7 @@
*/
package com.intellij.debugger.streams.trace.dsl.impl.kotlin
import com.intellij.debugger.streams.trace.dsl.Dsl
import com.intellij.debugger.streams.trace.dsl.ForLoopBody
import com.intellij.debugger.streams.trace.dsl.StatementFactory
import com.intellij.debugger.streams.trace.dsl.Variable
import com.intellij.debugger.streams.trace.dsl.*
import com.intellij.debugger.streams.trace.dsl.impl.TextExpression
/**
@@ -30,7 +27,5 @@ class KotlinForLoopBody(override val loopVariable: Variable,
val BREAK = TextExpression("break")
}
override fun breakIteration() {
addStatement(BREAK)
}
override fun breakIteration(): Expression = BREAK
}