kbool_t Konoha_LoadScript(KonohaContext* kctx, const char *scriptname) { KBeginKonohaContext(); PLATAPI BEFORE_LoadScript(kctx, scriptname); kbool_t res = (MODSUGAR_loadScript(kctx, scriptname, strlen(scriptname), 0) == K_CONTINUE); PLATAPI AFTER_LoadScript(kctx, scriptname); KEndKonohaContext(); return res; }
kbool_t Konoha_Eval(KonohaContext* kctx, const char *script, kfileline_t uline) { KBeginKonohaContext(); if(verbose_sugar) { DUMP_P("\n>>>----\n'%s'\n------\n", script); } kmodsugar->h.setupModuleContext(kctx, (KonohaModule *)kmodsugar, 0/*lazy*/); kbool_t res = (kNameSpace_Eval(kctx, KNULL(NameSpace), script, uline, NULL/*trace*/) == K_CONTINUE); // FIXME KEndKonohaContext(); return res; }
KONOHA_EXPORT(kbool_t) Konoha_Eval(KonohaContext* kctx, const char *script, kfileline_t uline) { KBeginKonohaContext(); if(verbose_sugar) { DUMP_P("\n>>>----\n'%s'\n------\n", script); } KPARSERM->h.setupModelContext(kctx, (KRuntimeModel *)KPARSERM, 0/*lazy*/); kbool_t res = (kNameSpace_Eval(kctx, KNULL(NameSpace), script, uline, NULL/*trace*/) == K_CONTINUE); // FIXME KEndKonohaContext(); return res; }