Skip to content

Commit

Permalink
Add command to compile and run code.
Browse files Browse the repository at this point in the history
  • Loading branch information
litan committed May 6, 2022
1 parent 88365c3 commit 2ee0559
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions src/main/scala/net/kogics/kojo/lite/Builtins.scala
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,8 @@ class Builtins(
def stRunCode(code: String) = interpret(code)
UserCommand("stRunCode", List("code"), "Runs the supplied code (without copying it to the script editor).")

def stCompileRunCode(code: String) = compileRunCode(code)

def stClickRunButton() = kojoCtx.clickRun()
UserCommand("stClickRunButton", Nil, "Simulates a click of the run button")

Expand Down Expand Up @@ -282,6 +284,10 @@ Here's a partial list of the available commands:
scalaCodeRunner.runCode(code)
}

def compileRunCode(code: String): Unit = {
scalaCodeRunner.compileRunCode(code)
}

def eval(expr: String) = scalaCodeRunner.evalExpression(expr)

def resetInterpreter(): Unit = {
Expand Down
4 changes: 2 additions & 2 deletions src/main/scala/net/kogics/kojo/lite/Versions.scala
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package net.kogics.kojo.lite
object Versions {
val KojoMajorVersion = "2.9"
val KojoVersion = "2.9.21"
val KojoRevision = "r3"
val KojoBuildDate = "3 May 2022"
val KojoRevision = "r4"
val KojoBuildDate = "6 May 2022"
val JavaVersion = {
val jrv = System.getProperty("java.runtime.version")
val arch = System.getProperty("os.arch")
Expand Down

0 comments on commit 2ee0559

Please sign in to comment.