mirror of
https://github.com/krgamestudios/Toy.git
synced 2026-04-20 01:04:08 +10:00
Implemented native C functions called from Toy scripts
There's only example functions for now, but I'll add type-specific functions later.
This commit is contained in:
@@ -7,6 +7,8 @@
|
||||
#include "toy_compiler.h"
|
||||
#include "toy_vm.h"
|
||||
|
||||
#include "standard_library.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
@@ -337,6 +339,12 @@ int repl(const char* filepath, bool verbose) {
|
||||
Toy_VM vm;
|
||||
Toy_initVM(&vm);
|
||||
|
||||
//hacky test
|
||||
if (vm.scope == NULL) {
|
||||
vm.scope = Toy_pushScope(&vm.memoryBucket, NULL);
|
||||
initStandardLibrary(&vm);
|
||||
}
|
||||
|
||||
printf("%s> ", prompt); //shows the terminal prompt and begin
|
||||
|
||||
//read from the terminal
|
||||
|
||||
Reference in New Issue
Block a user