1
0
mirror of https://github.com/DanilaFe/abacus synced 2024-09-28 01:25:33 -07:00

Fix toString errors failing unit tests.

This commit is contained in:
Danila Fedorin 2017-08-07 19:22:35 -07:00
parent 355a91d690
commit ff7d90967e
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(children[i].toString())
buffer.append(if (i == children.size - 1) ")" else ",") 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) return reducer.reduceNode(this, reducedChild)
} }
override fun toString(): String {
return "(" + (applyTo?.toString() ?: "null") + ")" + operation
}
} }