don't declare variables in middle of block
This commit is contained in:
parent
15ce163782
commit
6bdfac4ec0
|
@ -28,16 +28,24 @@ struct pic_error *pic_make_error(pic_state *, pic_sym *, const char *, pic_list)
|
|||
|
||||
#define pic_try \
|
||||
pic_try_(PIC_GENSYM(escape))
|
||||
#define pic_catch \
|
||||
pic_catch_(PIC_GENSYM(label))
|
||||
#define pic_try_(escape) \
|
||||
struct pic_escape *escape = pic_alloc(pic, sizeof(struct pic_escape)); \
|
||||
pic_save_point(pic, escape); \
|
||||
if (setjmp(escape->jmp) == 0) { \
|
||||
pic_push_try(pic, escape); \
|
||||
do
|
||||
#define pic_catch \
|
||||
while (0); \
|
||||
pic_pop_try(pic); \
|
||||
} else
|
||||
do { \
|
||||
struct pic_escape *escape = pic_alloc(pic, sizeof(struct pic_escape)); \
|
||||
pic_save_point(pic, escape); \
|
||||
if (setjmp(escape->jmp) == 0) { \
|
||||
pic_push_try(pic, escape); \
|
||||
do
|
||||
#define pic_catch_(label) \
|
||||
while (0); \
|
||||
pic_pop_try(pic); \
|
||||
} else { \
|
||||
goto label; \
|
||||
} \
|
||||
} while (0); \
|
||||
if (0) \
|
||||
label:
|
||||
|
||||
void pic_push_try(pic_state *, struct pic_escape *);
|
||||
void pic_pop_try(pic_state *);
|
||||
|
|
Loading…
Reference in New Issue