Create some new standard library modules
This commit is contained in:
0
modules/debug/build.gradle
Normal file
0
modules/debug/build.gradle
Normal file
7
modules/debug/gradle.properties
Normal file
7
modules/debug/gradle.properties
Normal file
@@ -0,0 +1,7 @@
|
||||
version=0.0.1
|
||||
|
||||
pluginVersion=0.1
|
||||
pluginId=smnp.lang.debug
|
||||
pluginClass=
|
||||
pluginProvider=Bartłomiej Pluta
|
||||
pluginDependencies=
|
||||
9
modules/debug/src/main/kotlin/io/smnp/ext/DebugModule.kt
Normal file
9
modules/debug/src/main/kotlin/io/smnp/ext/DebugModule.kt
Normal file
@@ -0,0 +1,9 @@
|
||||
package io.smnp.ext
|
||||
|
||||
import io.smnp.ext.function.CallStackFunction
|
||||
import org.pf4j.Extension
|
||||
|
||||
@Extension
|
||||
class DebugModule : NativeModuleProvider("smnp.lang.debug") {
|
||||
override fun functions() = listOf(CallStackFunction())
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package io.smnp.ext.function
|
||||
|
||||
import io.smnp.callable.function.Function
|
||||
import io.smnp.callable.function.FunctionDefinitionTool
|
||||
import io.smnp.callable.signature.Signature
|
||||
import io.smnp.type.model.Value
|
||||
|
||||
class CallStackFunction : Function("callstack") {
|
||||
override fun define(new: FunctionDefinitionTool) {
|
||||
new function Signature.simple() body { env, _ ->
|
||||
env.printCallStack()
|
||||
Value.void()
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user