error report is propagated through pic->err

This commit is contained in:
Yuichi Nishiwaki
2014-02-11 13:21:00 +09:00
parent 468e1b4d1f
commit 372fd3157b
9 changed files with 59 additions and 38 deletions
+3 -1
View File
@@ -110,7 +110,7 @@ typedef struct {
struct pic_lib *lib;
jmp_buf *jmp;
const char *errmsg;
struct pic_error *err;
struct pic_heap *heap;
struct pic_object *arena[PIC_ARENA_SIZE];
@@ -210,6 +210,8 @@ NORETURN void pic_error(pic_state *, const char *);
NORETURN void pic_errorf(pic_state *, const char *, size_t, ...);
void pic_warn(pic_state *, const char *);
const char *pic_errmsg(pic_state *);
void pic_debug(pic_state *, pic_value);
void pic_fdebug(pic_state *, pic_value, XFILE *);
+3 -2
View File
@@ -14,9 +14,10 @@ struct pic_error {
enum pic_error_kind {
PIC_ERROR_OTHER,
PIC_ERROR_FILE,
PIC_ERROR_READ
PIC_ERROR_READ,
PIC_ERROR_RAISED
} type;
char *msg;
struct pic_string *msg;
pic_value irrs;
};