mirror of
https://github.com/wren-lang/wren.git
synced 2026-01-11 14:18:42 +01:00
This is a breaking API change: wrenInterpret() now takes an additional parameter for the module name to interpret the code in.
22 lines
471 B
C
22 lines
471 B
C
#include <string.h>
|
|
|
|
#include "new_vm.h"
|
|
|
|
static void nullConfig(WrenVM* vm)
|
|
{
|
|
WrenVM* otherVM = wrenNewVM(NULL);
|
|
|
|
// We should be able to execute code.
|
|
WrenInterpretResult result = wrenInterpret(otherVM, "main", "1 + 2");
|
|
wrenSetSlotBool(vm, 0, result == WREN_RESULT_SUCCESS);
|
|
|
|
wrenFreeVM(otherVM);
|
|
}
|
|
|
|
WrenForeignMethodFn newVMBindMethod(const char* signature)
|
|
{
|
|
if (strcmp(signature, "static VM.nullConfig()") == 0) return nullConfig;
|
|
|
|
return NULL;
|
|
}
|