ast printer correctly prints ifexpression

This commit is contained in:
Irmen de Jong 2024-10-22 21:14:55 +02:00
parent 6e2fd41a8b
commit 1e82483152

View File

@ -53,6 +53,15 @@ class AstToSourceTextConverter(val output: (text: String) -> Unit, val program:
outputln("}\n")
}
override fun visit(ifExpr: IfExpression) {
output("if ")
ifExpr.condition.accept(this)
output(" ")
ifExpr.truevalue.accept(this)
output(" else ")
ifExpr.falsevalue.accept(this)
}
override fun visit(continueStmt: Continue) {
output("continue")
}