Split out the core and main modules.

- Implicitly import everything in core into every imported module.
- Test cyclic imports.
This commit is contained in:
Bob Nystrom
2015-02-11 10:06:45 -08:00
parent 2005e1e0a2
commit bc5a793c41
8 changed files with 190 additions and 86 deletions
+7 -2
View File
@@ -109,8 +109,13 @@ void wrenFreeVM(WrenVM* vm);
// Runs [source], a string of Wren source code in a new fiber in [vm].
//
// [sourcePath] is a string describing where [source] was located, for use in
// debugging stack traces. It must not be `null`. If an empty string, it will
// not be shown in a stack trace.
// debugging stack traces. It must not be `null`.
//
// If it's an empty string, then [source] is considered part of the "core"
// module. Any module-level names defined in it will be implicitly imported by
// another other modules. This also means runtime errors in its code will be
// omitted from stack traces (to avoid confusing users with core library
// implementation details).
WrenInterpretResult wrenInterpret(WrenVM* vm, const char* sourcePath,
const char* source);