com.simiacryptus.skyenet.interpreter.Interpreter.kt Maven / Gradle / Ivy
package com.simiacryptus.skyenet.interpreter
interface Interpreter {
fun getLanguage(): String
fun getSymbols(): Map
fun run(code: String): Any?
fun validate(code: String): Throwable?
fun wrapCode(code: String): String = code
fun wrapExecution(fn: java.util.function.Supplier): T? = fn.get()
companion object {
private class TestObject {
@Suppress("unused")
fun square(x: Int): Int = x * x
}
private interface TestInterface {
fun square(x: Int): Int
}
@JvmStatic
fun test(factory: java.util.function.Function