[orx-expression-evaluator] Switch to antlr-kotlin for parser generation and make it a common kotlin module

This commit is contained in:
Edwin Jakobs
2024-01-05 12:40:59 +01:00
parent a407824bae
commit 456596aba7
21 changed files with 101 additions and 63 deletions

View File

@@ -0,0 +1,16 @@
import org.amshove.kluent.shouldBeEqualTo
import org.openrndr.extra.expressions.watchingExpression1
import kotlin.test.Test
class TestExpressionDelegates {
@Test
fun test() {
val state = object {
var expression = "x * x"
val function1 by watchingExpression1(::expression, "x")
}
state.function1(5.0).shouldBeEqualTo(25.0)
}
}