diff --git a/include/picrin.h b/include/picrin.h index be785106..2f2832e1 100644 --- a/include/picrin.h +++ b/include/picrin.h @@ -45,6 +45,8 @@ pic_value pic_eval(pic_state *, pic_value, struct pic_env *); pic_value pic_run(pic_state *, struct pic_proc *, pic_value); struct pic_proc *pic_codegen(pic_state *, pic_value, struct pic_env*); +void pic_raise(pic_state *, const char *); + void pic_debug(pic_state *, pic_value); #endif diff --git a/src/vm.c b/src/vm.c index f669fd84..5c06b30f 100644 --- a/src/vm.c +++ b/src/vm.c @@ -142,3 +142,10 @@ pic_run(pic_state *pic, struct pic_proc *proc, pic_value args) STOP: return *sp; } + +void +pic_raise(pic_state *pic, const char *str) +{ + puts(str); + abort(); +}