1
0
mirror of https://github.com/DanilaFe/abacus synced 2026-02-01 03:25:19 +00:00

Format code.

This commit is contained in:
2017-08-14 19:03:52 -07:00
parent d861444d13
commit 205d5dbc77
20 changed files with 261 additions and 259 deletions

View File

@@ -36,7 +36,7 @@ data class FunctionNode(val function: String) : TreeNode() {
*
* @node the node to append.
*/
fun appendChild(node: TreeNode){
fun appendChild(node: TreeNode) {
children.add(node)
}
@@ -45,7 +45,7 @@ data class FunctionNode(val function: String) : TreeNode() {
*
* @node the node to prepend.
*/
fun prependChild(node: TreeNode){
fun prependChild(node: TreeNode) {
children.add(0, node)
}

View File

@@ -6,7 +6,7 @@ package org.nwapw.abacus.tree
* The reducer walks the tree, visiting the children first, converting them into
* a value, and then attempts to reduce the parent. Eventually, the single final value is returned.
*/
interface Reducer <out T> {
interface Reducer<out T> {
/**
* Reduces the given tree node, given its already reduced children.
@@ -14,6 +14,6 @@ interface Reducer <out T> {
* @param treeNode the tree node to reduce.
* @param children the list of children, of type T.
*/
fun reduceNode(treeNode: TreeNode, vararg children: Any) : T?
fun reduceNode(treeNode: TreeNode, vararg children: Any): T?
}

View File

@@ -5,6 +5,6 @@ package org.nwapw.abacus.tree
*/
abstract class TreeNode {
abstract fun <T: Any> reduce(reducer: Reducer<T>) : T?
abstract fun <T : Any> reduce(reducer: Reducer<T>): T?
}