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 \
|
#define pic_try \
|
||||||
pic_try_(PIC_GENSYM(escape))
|
pic_try_(PIC_GENSYM(escape))
|
||||||
|
#define pic_catch \
|
||||||
|
pic_catch_(PIC_GENSYM(label))
|
||||||
#define pic_try_(escape) \
|
#define pic_try_(escape) \
|
||||||
|
do { \
|
||||||
struct pic_escape *escape = pic_alloc(pic, sizeof(struct pic_escape)); \
|
struct pic_escape *escape = pic_alloc(pic, sizeof(struct pic_escape)); \
|
||||||
pic_save_point(pic, escape); \
|
pic_save_point(pic, escape); \
|
||||||
if (setjmp(escape->jmp) == 0) { \
|
if (setjmp(escape->jmp) == 0) { \
|
||||||
pic_push_try(pic, escape); \
|
pic_push_try(pic, escape); \
|
||||||
do
|
do
|
||||||
#define pic_catch \
|
#define pic_catch_(label) \
|
||||||
while (0); \
|
while (0); \
|
||||||
pic_pop_try(pic); \
|
pic_pop_try(pic); \
|
||||||
} else
|
} else { \
|
||||||
|
goto label; \
|
||||||
|
} \
|
||||||
|
} while (0); \
|
||||||
|
if (0) \
|
||||||
|
label:
|
||||||
|
|
||||||
void pic_push_try(pic_state *, struct pic_escape *);
|
void pic_push_try(pic_state *, struct pic_escape *);
|
||||||
void pic_pop_try(pic_state *);
|
void pic_pop_try(pic_state *);
|
||||||
|
|
Loading…
Reference in New Issue