Enable passing arguments to custom functions

This commit is contained in:
2020-03-11 22:16:29 +01:00
parent 7d61756273
commit 53bba579c1
11 changed files with 110 additions and 32 deletions

View File

@@ -79,4 +79,14 @@ class DefaultEnvironment : Environment {
override fun defineMethod(method: Method) {
rootModule.addMethod(method)
}
override fun pushScope(scope: MutableMap<String, Value>) = callStack.top().pushScope(scope)
override fun popScope() = callStack.top().popScope()
override fun printScopes() = callStack.top().prettyScope()
override fun setVariable(name: String, value: Value) = callStack.top().setVariable(name, value)
override fun getVariable(name: String) = callStack.top().getVariable(name)
}