Exemplo n.º 1
0
static kstatus_t MODSUGAR_loadScript(KonohaContext *kctx, const char *path, size_t len, KTraceInfo *trace)
{
	if(GetSugarContext(kctx) == NULL) {
		kmodsugar->h.setupModuleContext(kctx, (KonohaModule *)kmodsugar, 0/*lazy*/);
	}
	INIT_GCSTACK();
	kpackageId_t packageId = KLIB KpackageId(kctx, "main", sizeof("main")-1, 0, _NEWID);
	kNameSpace *ns = new_PackageNameSpace(kctx, packageId);
	kstatus_t result = (kstatus_t)kNameSpace_LoadScript(kctx, ns, path, trace);
	RESET_GCSTACK();
	return result;
}
Exemplo n.º 2
0
static kstatus_t MODSUGAR_loadScript(KonohaContext *kctx, const char *path, size_t len, KTraceInfo *trace)
{
	if(KGetParserContext(kctx) == NULL) {
		KPARSERM->h.setupModelContext(kctx, (KRuntimeModel *)KPARSERM, 0/*lazy*/);
	}
	INIT_GCSTACK();
	kpackageId_t packageId = KLIB KpackageId(kctx, "main", sizeof("main")-1, 0, _NEWID);
	kNameSpace *ns = new_PackageNameSpace(kctx, packageId);
	kstatus_t result = (kstatus_t)kNameSpace_LoadScript(kctx, ns, path, trace);
	RESET_GCSTACK();
	return result;
}