Skip to content

Commit

Permalink
[IR] KotlinLikeDumper: merge Break & Continue
Browse files Browse the repository at this point in the history
  • Loading branch information
bashor authored and teamcityserver committed Nov 25, 2020
1 parent 64b4240 commit ad5df79
Showing 1 changed file with 4 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1194,23 +1194,15 @@ private class KotlinLikeDumper(val p: Printer, val options: KotlinLikeDumpOption
p.printlnWithNoIndent()
}

private fun IrBreakContinue.printLabel() {
label?.let {
override fun visitBreakContinue(jump: IrBreakContinue, data: IrDeclaration?) {
// TODO render loop reference
p.printWithNoIndent(if (jump is IrContinue) "continue" else "break")
jump.label?.let {
p.printWithNoIndent("@")
p.printWithNoIndent(it)
}
}

override fun visitBreak(jump: IrBreak, data: IrDeclaration?) {
p.printWithNoIndent("break")
jump.printLabel()
}

override fun visitContinue(jump: IrContinue, data: IrDeclaration?) {
p.printWithNoIndent("continue")
jump.printLabel()
}

override fun visitErrorDeclaration(declaration: IrErrorDeclaration, data: IrDeclaration?) {
p.println("/* ERROR DECLARATION */")
}
Expand Down

0 comments on commit ad5df79

Please sign in to comment.