initial raise-continuable support

This commit is contained in:
Yuichi Nishiwaki
2014-07-24 11:02:47 +09:00
parent f52ef27a81
commit 70ace29b7c
2 changed files with 32 additions and 4 deletions
+5 -2
View File
@@ -11,6 +11,7 @@ extern "C" {
struct pic_jmpbuf {
jmp_buf here;
struct pic_proc *handler;
pic_callinfo *ci;
pic_value *sp;
pic_code *ip;
@@ -20,7 +21,9 @@ struct pic_jmpbuf {
/* do not return from try block! */
#define pic_try \
pic_push_try(pic); \
pic_try_with_handler(NULL)
#define pic_try_with_handler(handler) \
pic_push_try(pic, handler); \
if (setjmp(*pic->jmp) == 0) \
do
#define pic_catch \
@@ -28,7 +31,7 @@ struct pic_jmpbuf {
else \
if (pic_pop_try(pic), 1)
void pic_push_try(pic_state *);
void pic_push_try(pic_state *, struct pic_proc *);
void pic_pop_try(pic_state *);
noreturn void pic_throw(pic_state *, short, const char *, pic_value);