Create base for CLI

This commit is contained in:
2020-03-14 23:36:19 +01:00
parent 86fc8ae086
commit 4ce35ce34c
8 changed files with 67 additions and 7 deletions

View File

@@ -20,6 +20,5 @@ interface Environment {
fun setVariable(name: String, value: Value)
fun getVariable(name: String): Value
fun dispose()
fun getRootModule(): Module
}

View File

@@ -98,7 +98,7 @@ class Module(
println(newPrefix + (if (first) "" else if (newLast) "└─ " else "├─ ") + name)
newPrefix += if (newLast) " " else ""
if (printContent) {
val contentPrefix = newPrefix + if (children.isNotEmpty()) "|" else ""
val contentPrefix = newPrefix + if (children.isNotEmpty()) "" else ""
for ((index, function) in functions.withIndex()) {
println(contentPrefix + (if (index == functions.size - 1 && methods.isEmpty()) "" else "") + "${function.name}()")
}