Skip to content

Commit

Permalink
format code in :repl
Browse files Browse the repository at this point in the history
  • Loading branch information
gciatto committed Sep 14, 2020
1 parent 890d935 commit fdbfeac
Show file tree
Hide file tree
Showing 10 changed files with 11 additions and 17 deletions.
2 changes: 1 addition & 1 deletion repl/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,4 @@ if (githubToken != null) {
rootProject.tasks.withType(GithubReleaseTask::class) {
dependsOn(shadowJar)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ class NullInputException : TuPrologException {
constructor(message: String?, cause: Throwable?) : super(message, cause)
constructor(cause: Throwable?) : super(cause)
constructor(message: String?) : this(message, null)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ import it.unibo.tuprolog.theory.Theory

expect fun isReadableFile(path: String): Boolean

expect fun loadTheoryFromFile(path: String): Theory
expect fun loadTheoryFromFile(path: String): Theory
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ class TuPrologCmd : CliktCommand(
|# Line : ${e.line}
|# Column : ${e.column}
|# Clause : ${e.clauseIndex}
""".trimMargin(), err = true
""".trimMargin(),
err = true
)
}
}
Expand Down Expand Up @@ -101,5 +102,3 @@ class TuPrologCmd : CliktCommand(
)
}
}


Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package it.unibo.tuprolog.ui.repl

import com.github.ajalt.clikt.core.CliktCommand
import com.github.ajalt.clikt.core.ProgramResult
import com.github.ajalt.clikt.output.TermUi
import com.github.ajalt.clikt.parameters.arguments.argument
import com.github.ajalt.clikt.parameters.options.default
import com.github.ajalt.clikt.parameters.options.option
Expand All @@ -22,7 +20,6 @@ class TuPrologSolveQuery : CliktCommand(help = "Compute a particular query and t
private val parentCommand: TuPrologCmd
get() = currentContext.parent?.command as TuPrologCmd


override fun run() {
val solver = parentCommand.getSolver()
evalAndPrint(solver)
Expand All @@ -45,4 +42,4 @@ class TuPrologSolveQuery : CliktCommand(help = "Compute a particular query and t
TODO("throw adequate exception")
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package it.unibo.tuprolog.ui.repl
import com.github.ajalt.clikt.core.ProgramResult
import com.github.ajalt.clikt.output.TermUi
import com.github.ajalt.clikt.output.defaultCliktConsole
import it.unibo.tuprolog.core.TermFormatter
import it.unibo.tuprolog.core.TermFormatter.Companion.prettyExpressions
import it.unibo.tuprolog.core.format
import it.unibo.tuprolog.core.operators.OperatorSet
Expand Down Expand Up @@ -125,4 +124,4 @@ object TuPrologUtils {
}
printEndOfSolutions()
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ actual fun isReadableFile(path: String): Boolean {

actual fun loadTheoryFromFile(path: String): Theory {
TODO("Not yet implemented")
}
}
2 changes: 1 addition & 1 deletion repl/src/jsMain/kotlin/it/unibo/tuprolog/ui/repl/Repl.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ import com.github.ajalt.clikt.core.subcommands

fun main(args: Array<String>) {
TuPrologCmd().subcommands(TuPrologSolveQuery()).main(args)
}
}
3 changes: 1 addition & 2 deletions repl/src/jvmMain/kotlin/it/unibo/tuprolog/ui/repl/Main.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
package it.unibo.tuprolog.ui.repl

import com.github.ajalt.clikt.core.subcommands
import kotlin.jvm.JvmName

fun main(args: Array<String>) {
TuPrologCmd().subcommands(TuPrologSolveQuery()).main(args)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ actual fun loadTheoryFromFile(path: String): Theory {
return File(path).let {
Theory.parse(it.readText())
}
}
}

0 comments on commit fdbfeac

Please sign in to comment.