add PIC_TT_IREP
This commit is contained in:
parent
b62374b4b4
commit
586b228156
|
@ -102,7 +102,8 @@ enum pic_tt {
|
||||||
PIC_TT_SYNTAX,
|
PIC_TT_SYNTAX,
|
||||||
PIC_TT_SC,
|
PIC_TT_SC,
|
||||||
PIC_TT_LIB,
|
PIC_TT_LIB,
|
||||||
PIC_TT_VAR
|
PIC_TT_VAR,
|
||||||
|
PIC_TT_IREP
|
||||||
};
|
};
|
||||||
|
|
||||||
#define PIC_OBJECT_HEADER \
|
#define PIC_OBJECT_HEADER \
|
||||||
|
|
|
@ -679,11 +679,11 @@ codegen(codegen_state *state, pic_value obj, bool tailpos)
|
||||||
case PIC_TT_SYNTAX:
|
case PIC_TT_SYNTAX:
|
||||||
case PIC_TT_SC:
|
case PIC_TT_SC:
|
||||||
case PIC_TT_LIB:
|
case PIC_TT_LIB:
|
||||||
case PIC_TT_VAR: {
|
case PIC_TT_VAR:
|
||||||
|
case PIC_TT_IREP:
|
||||||
pic_error(pic, "invalid expression given");
|
pic_error(pic, "invalid expression given");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
codegen_call(codegen_state *state, pic_value obj, bool tailpos)
|
codegen_call(codegen_state *state, pic_value obj, bool tailpos)
|
||||||
|
|
6
src/gc.c
6
src/gc.c
|
@ -428,6 +428,9 @@ gc_mark_object(pic_state *pic, struct pic_object *obj)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case PIC_TT_IREP: {
|
||||||
|
break;
|
||||||
|
}
|
||||||
case PIC_TT_NIL:
|
case PIC_TT_NIL:
|
||||||
case PIC_TT_BOOL:
|
case PIC_TT_BOOL:
|
||||||
case PIC_TT_FLOAT:
|
case PIC_TT_FLOAT:
|
||||||
|
@ -567,6 +570,9 @@ gc_finalize_object(pic_state *pic, struct pic_object *obj)
|
||||||
case PIC_TT_VAR: {
|
case PIC_TT_VAR: {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case PIC_TT_IREP: {
|
||||||
|
break;
|
||||||
|
}
|
||||||
case PIC_TT_NIL:
|
case PIC_TT_NIL:
|
||||||
case PIC_TT_BOOL:
|
case PIC_TT_BOOL:
|
||||||
case PIC_TT_FLOAT:
|
case PIC_TT_FLOAT:
|
||||||
|
|
|
@ -547,6 +547,7 @@ macroexpand(pic_state *pic, pic_value expr, struct pic_senv *senv)
|
||||||
case PIC_TT_SYNTAX:
|
case PIC_TT_SYNTAX:
|
||||||
case PIC_TT_LIB:
|
case PIC_TT_LIB:
|
||||||
case PIC_TT_VAR:
|
case PIC_TT_VAR:
|
||||||
|
case PIC_TT_IREP:
|
||||||
pic_error(pic, "unexpected value type");
|
pic_error(pic, "unexpected value type");
|
||||||
return pic_undef_value(); /* unreachable */
|
return pic_undef_value(); /* unreachable */
|
||||||
}
|
}
|
||||||
|
|
|
@ -84,6 +84,8 @@ pic_type_repr(enum pic_tt tt)
|
||||||
return "lib";
|
return "lib";
|
||||||
case PIC_TT_VAR:
|
case PIC_TT_VAR:
|
||||||
return "var";
|
return "var";
|
||||||
|
case PIC_TT_IREP:
|
||||||
|
return "irep";
|
||||||
}
|
}
|
||||||
/* logic flaw */
|
/* logic flaw */
|
||||||
abort();
|
abort();
|
||||||
|
|
|
@ -146,6 +146,9 @@ write(pic_state *pic, pic_value obj)
|
||||||
case PIC_TT_VAR:
|
case PIC_TT_VAR:
|
||||||
printf("#<var %p>", pic_ptr(obj));
|
printf("#<var %p>", pic_ptr(obj));
|
||||||
break;
|
break;
|
||||||
|
case PIC_TT_IREP:
|
||||||
|
printf("#<irep %p>", pic_ptr(obj));
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue