1
0
mirror of https://github.com/DanilaFe/abacus synced 2024-12-22 15:30:09 -08:00

Fix toString errors failing unit tests.

This commit is contained in:
Danila Fedorin 2017-08-07 19:22:35 -07:00
parent ba39ee1fad
commit b45c7e2d1b
2 changed files with 5 additions and 1 deletions

View File

@ -28,7 +28,7 @@ data class FunctionNode(val function: String) : TreeNode() {
buffer.append(children[i].toString())
buffer.append(if (i == children.size - 1) ")" else ",")
}
return super.toString()
return buffer.toString()
}
/**

View File

@ -16,4 +16,8 @@ data class UnaryNode(val operation: String, val applyTo: TreeNode? = null) : Tre
return reducer.reduceNode(this, reducedChild)
}
override fun toString(): String {
return "(" + (applyTo?.toString() ?: "null") + ")" + operation
}
}