mirror of
https://github.com/GayPizzaSpecifications/pork.git
synced 2025-08-03 21:21:33 +00:00
vm: very basic virtual machine
This commit is contained in:
@ -25,7 +25,7 @@ class FfiNativeProvider : NativeProvider {
|
||||
override fun provideNativeFunction(
|
||||
definitions: List<String>,
|
||||
arguments: List<ArgumentSpec>,
|
||||
inside: CompilationUnitContext
|
||||
inside: SlabContext
|
||||
): CallableFunction {
|
||||
if (definitions[0] == "internal") {
|
||||
val internal = internalFunctions[definitions[1]] ?:
|
||||
@ -73,7 +73,7 @@ class FfiNativeProvider : NativeProvider {
|
||||
}
|
||||
}
|
||||
|
||||
private fun addStructDefs(ffiTypeRegistry: FfiTypeRegistry, types: List<String>, inside: CompilationUnitContext) {
|
||||
private fun addStructDefs(ffiTypeRegistry: FfiTypeRegistry, types: List<String>, inside: SlabContext) {
|
||||
for (parameter in types) {
|
||||
if (!parameter.startsWith("struct ")) {
|
||||
continue
|
||||
|
@ -15,5 +15,5 @@ object JavaAutogenContentSource : ContentSource {
|
||||
return StringCharSource(content)
|
||||
}
|
||||
|
||||
override fun stableContentIdentity(path: String): String = path
|
||||
override fun stableContentPath(path: String): String = path
|
||||
}
|
||||
|
@ -2,7 +2,7 @@ package gay.pizza.pork.ffi
|
||||
|
||||
import gay.pizza.pork.ast.gen.ArgumentSpec
|
||||
import gay.pizza.pork.evaluator.CallableFunction
|
||||
import gay.pizza.pork.evaluator.CompilationUnitContext
|
||||
import gay.pizza.pork.evaluator.SlabContext
|
||||
import gay.pizza.pork.evaluator.NativeProvider
|
||||
import gay.pizza.pork.evaluator.None
|
||||
import java.lang.invoke.MethodHandles
|
||||
@ -14,7 +14,7 @@ class JavaNativeProvider : NativeProvider {
|
||||
override fun provideNativeFunction(
|
||||
definitions: List<String>,
|
||||
arguments: List<ArgumentSpec>,
|
||||
inside: CompilationUnitContext
|
||||
inside: SlabContext
|
||||
): CallableFunction {
|
||||
val functionDefinition = JavaFunctionDefinition.parse(definitions)
|
||||
val javaClass = lookupClass(functionDefinition.type)
|
||||
|
Reference in New Issue
Block a user