From 69e927d7bc6f797e5922aa81579b5ac4de77e2a0 Mon Sep 17 00:00:00 2001 From: Yuichi Nishiwaki Date: Sat, 12 Oct 2013 14:40:27 +0900 Subject: [PATCH] add pic_raise --- include/picrin.h | 2 ++ src/vm.c | 7 +++++++ 2 files changed, 9 insertions(+) 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(); +}