Move meta and random to "aux" modules.
Wren now has three classes of modules: - The one magic "core" module that's built in and always needed. - Auxiliary libraries like "meta" and "random". These do not have any dependencies, so can be used even when you embed Wren inside an application. But they're also optional and can be disabled if you don't need them. - CLI modules. These ones need libuv and are tied to the CLI wrapper around the VM.
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