userenv[ARGS_ENV] = tag_object(args);
- platform_run();
+ run_toplevel();
- critical_error("run() returned due to empty callstack",0);
+ critical_error("run_toplevel() returned due to empty callstack",0);
return 0;
}
#include "factor.h"
-void platform_run(void)
+void run(void)
{
- run_toplevel();
+ interpreter();
+}
+
+void run_toplevel(void)
+{
+ run();
}
const char *default_image_path(void)
/* This code is convoluted because Cocoa places restrictions on longjmp and
exception handling. In particular, a longjmp can never cross an NS_DURING,
NS_HANDLER or NS_ENDHANDLER. */
-void platform_run()
+void run()
{
error = F;
general_error(ERROR_OBJECTIVE_C,e,F,true);
}
- run();
+ interpreter_loop();
NS_VOIDRETURN;
NS_HANDLER
error = tag_object(make_alien(F,(CELL)localException));
}
}
+void run_toplevel(void)
+{
+ interpreter();
+}
+
void early_init(void)
{
[[NSAutoreleasePool alloc] init];
return -1; /* unreachable */
}
-void platform_run(void)
+void run(void)
{
- seh_call(run_toplevel, exception_handler);
+ interpreter();
+}
+
+void run_toplevel(void)
+{
+ seh_call(run, exception_handler);
}
set_callframe(quot);
}
-/* Called from platform_run() */
+/* Called from interpreter() */
void handle_error(void)
{
if(throwing)
}
}
-void run(void)
+void interpreter_loop(void)
{
CELL next;
}
}
-void run_toplevel(void)
+void interpreter(void)
{
SETJMP(stack_chain->toplevel);
handle_error();
- run();
+ interpreter_loop();
}
/* Called by compiled callbacks after nest_stacks() and boxing registers */
void run_callback(CELL quot)
{
call(quot);
- platform_run();
+ run();
}
/* XT of deferred words */
thrown_ds = ds;
thrown_rs = rs;
- /* Return to run() method */
+ /* Return to interpreter() function */
LONGJMP(stack_chain->toplevel,1);
}
void call(CELL quot);
void handle_error();
+void interpreter_loop(void);
+void interpreter(void);
+DLLEXPORT void run_callback(CELL quot);
void run(void);
void run_toplevel(void);
-DLLEXPORT void run_callback(CELL quot);
-void platform_run(void);
void undefined(F_WORD *word);
void docol(F_WORD *word);
void dosym(F_WORD *word);