Skip to content

Commit

Permalink
[IR] KotlinLikeDumper: add more TODOs and remove some obsolete ones
Browse files Browse the repository at this point in the history
  • Loading branch information
bashor authored and teamcityserver committed Nov 25, 2020
1 parent bf20720 commit a128cdc
Showing 1 changed file with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -993,7 +993,6 @@ private class KotlinLikeDumper(val p: Printer, val options: KotlinLikeDumpOption
}

private fun IrFieldAccessExpression.printFieldAccess(data: IrDeclaration?) {
// TODO type
// TODO is not valid kotlin
receiver?.accept(this@KotlinLikeDumper, data)
superQualifierSymbol?.let {
Expand All @@ -1012,6 +1011,7 @@ private class KotlinLikeDumper(val p: Printer, val options: KotlinLikeDumpOption
}

override fun visitReturn(expression: IrReturn, data: IrDeclaration?) {
// TODO label
p.printWithNoIndent("return ")
expression.value.accept(this, data)
}
Expand All @@ -1022,7 +1022,6 @@ private class KotlinLikeDumper(val p: Printer, val options: KotlinLikeDumpOption
}

override fun visitStringConcatenation(expression: IrStringConcatenation, data: IrDeclaration?) {
// TODO type
// TODO escape? see IrTextTestCaseGenerated.Expressions#testStringTemplates
// TODO optionally each argument at a separate line, another option add a wrapping
expression.arguments.forEachIndexed { i, e ->
Expand Down Expand Up @@ -1054,6 +1053,7 @@ private class KotlinLikeDumper(val p: Printer, val options: KotlinLikeDumpOption

override fun visitVararg(expression: IrVararg, data: IrDeclaration?) {
// TODO ???
// TODO varargElementType
p.printWithNoIndent("[")
expression.elements.forEachIndexed { i, e ->
if (i > 0) p.printWithNoIndent(", ")
Expand All @@ -1068,6 +1068,7 @@ private class KotlinLikeDumper(val p: Printer, val options: KotlinLikeDumpOption
}

override fun visitDeclarationReference(expression: IrDeclarationReference, data: IrDeclaration?) {
// TODO support
super.visitDeclarationReference(expression, data)
}

Expand All @@ -1077,7 +1078,6 @@ private class KotlinLikeDumper(val p: Printer, val options: KotlinLikeDumpOption
}

override fun visitGetValue(expression: IrGetValue, data: IrDeclaration?) {
// TODO support `this` and receiver
p.printWithNoIndent(expression.symbol.owner.name.asString())
}

Expand All @@ -1093,6 +1093,13 @@ private class KotlinLikeDumper(val p: Printer, val options: KotlinLikeDumpOption

override fun visitCallableReference(expression: IrCallableReference<*>, data: IrDeclaration?) {
// TODO check
/*
TODO
dispatchReceiver
extensionReceiver
getTypeArgument
getValueArgument
*/
p.printWithNoIndent("::")
p.printWithNoIndent(expression.referencedName.asString())
}
Expand Down Expand Up @@ -1126,6 +1133,7 @@ private class KotlinLikeDumper(val p: Printer, val options: KotlinLikeDumpOption
}

override fun visitWhen(expression: IrWhen, data: IrDeclaration?) {
// TODO print if when possible?
p.printlnWithNoIndent("when {")
p.pushIndent()

Expand Down

0 comments on commit a128cdc

Please sign in to comment.