refactor: move meta and random modules from vm and cli into new aux library category
Restructure module hierarchy by extracting meta and random from the core VM and CLI-specific modules into a new "aux" (auxiliary) directory. This introduces WREN_AUX_META and WREN_AUX_RANDOM configuration flags, updates include paths and build system to compile aux sources separately, removes random module registration from CLI modules.c, and adjusts the VM's module loading to implicitly import core into all modules regardless of name.
This commit is contained in:
@@ -4,7 +4,6 @@
|
||||
#include "modules.h"
|
||||
|
||||
#include "io.wren.inc"
|
||||
#include "random.wren.inc"
|
||||
#include "scheduler.wren.inc"
|
||||
#include "timer.wren.inc"
|
||||
|
||||
@@ -16,12 +15,6 @@ extern void fileClose(WrenVM* vm);
|
||||
extern void fileDescriptor(WrenVM* vm);
|
||||
extern void fileReadBytes(WrenVM* vm);
|
||||
extern void fileSize(WrenVM* vm);
|
||||
extern void randomAllocate(WrenVM* vm);
|
||||
extern void randomSeed0(WrenVM* vm);
|
||||
extern void randomSeed1(WrenVM* vm);
|
||||
extern void randomSeed16(WrenVM* vm);
|
||||
extern void randomFloat(WrenVM* vm);
|
||||
extern void randomInt0(WrenVM* vm);
|
||||
extern void stdinReadStart(WrenVM* vm);
|
||||
extern void stdinReadStop(WrenVM* vm);
|
||||
extern void schedulerCaptureMethods(WrenVM* vm);
|
||||
@@ -105,16 +98,6 @@ static ModuleRegistry modules[] =
|
||||
STATIC_METHOD("readStop_()", stdinReadStop)
|
||||
END_CLASS
|
||||
END_MODULE
|
||||
MODULE(random)
|
||||
CLASS(Random)
|
||||
STATIC_METHOD("<allocate>", randomAllocate)
|
||||
METHOD("seed_()", randomSeed0)
|
||||
METHOD("seed_(_)", randomSeed1)
|
||||
METHOD("seed_(_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_)", randomSeed16)
|
||||
METHOD("float()", randomFloat)
|
||||
METHOD("int()", randomInt0)
|
||||
END_CLASS
|
||||
END_MODULE
|
||||
MODULE(scheduler)
|
||||
CLASS(Scheduler)
|
||||
STATIC_METHOD("captureMethods_()", schedulerCaptureMethods)
|
||||
|
||||
Reference in New Issue
Block a user