|
|
@@ -1514,4 +1514,17 @@ void VM::post_init(){
|
|
|
#endif
|
|
|
}
|
|
|
|
|
|
+CodeObject_ VM::compile(Str source, Str filename, CompileMode mode, bool unknown_global_scope) {
|
|
|
+ Compiler compiler(this, source, filename, mode, unknown_global_scope);
|
|
|
+ try{
|
|
|
+ return compiler.compile();
|
|
|
+ }catch(Exception& e){
|
|
|
+#if PK_DEBUG_FULL_EXCEPTION
|
|
|
+ std::cerr << e.summary() << std::endl;
|
|
|
+#endif
|
|
|
+ _error(e);
|
|
|
+ return nullptr;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
} // namespace pkpy
|