remove pic_tt_sc type
This commit is contained in:
parent
8781b9a6aa
commit
6cc37281d6
|
@ -21,15 +21,6 @@ struct pic_macro {
|
||||||
struct pic_senv *senv;
|
struct pic_senv *senv;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct pic_sc {
|
|
||||||
PIC_OBJECT_HEADER
|
|
||||||
pic_value expr;
|
|
||||||
struct pic_senv *senv;
|
|
||||||
};
|
|
||||||
|
|
||||||
#define pic_sc_p(v) (pic_type(v) == PIC_TT_SC)
|
|
||||||
#define pic_sc_ptr(v) ((struct pic_sc *)pic_ptr(v))
|
|
||||||
|
|
||||||
#define pic_macro_p(v) (pic_type(v) == PIC_TT_MACRO)
|
#define pic_macro_p(v) (pic_type(v) == PIC_TT_MACRO)
|
||||||
#define pic_macro_ptr(v) ((struct pic_macro *)pic_ptr(v))
|
#define pic_macro_ptr(v) ((struct pic_macro *)pic_ptr(v))
|
||||||
|
|
||||||
|
|
|
@ -111,7 +111,6 @@ enum pic_tt {
|
||||||
PIC_TT_CONT,
|
PIC_TT_CONT,
|
||||||
PIC_TT_SENV,
|
PIC_TT_SENV,
|
||||||
PIC_TT_MACRO,
|
PIC_TT_MACRO,
|
||||||
PIC_TT_SC,
|
|
||||||
PIC_TT_LIB,
|
PIC_TT_LIB,
|
||||||
PIC_TT_VAR,
|
PIC_TT_VAR,
|
||||||
PIC_TT_IREP,
|
PIC_TT_IREP,
|
||||||
|
@ -256,8 +255,6 @@ pic_type_repr(enum pic_tt tt)
|
||||||
return "cont";
|
return "cont";
|
||||||
case PIC_TT_PROC:
|
case PIC_TT_PROC:
|
||||||
return "proc";
|
return "proc";
|
||||||
case PIC_TT_SC:
|
|
||||||
return "sc";
|
|
||||||
case PIC_TT_SENV:
|
case PIC_TT_SENV:
|
||||||
return "senv";
|
return "senv";
|
||||||
case PIC_TT_MACRO:
|
case PIC_TT_MACRO:
|
||||||
|
|
|
@ -826,7 +826,6 @@ analyze_node(analyze_state *state, pic_value obj, bool tailpos)
|
||||||
case PIC_TT_ERROR:
|
case PIC_TT_ERROR:
|
||||||
case PIC_TT_SENV:
|
case PIC_TT_SENV:
|
||||||
case PIC_TT_MACRO:
|
case PIC_TT_MACRO:
|
||||||
case PIC_TT_SC:
|
|
||||||
case PIC_TT_LIB:
|
case PIC_TT_LIB:
|
||||||
case PIC_TT_VAR:
|
case PIC_TT_VAR:
|
||||||
case PIC_TT_IREP:
|
case PIC_TT_IREP:
|
||||||
|
|
9
src/gc.c
9
src/gc.c
|
@ -461,12 +461,6 @@ gc_mark_object(pic_state *pic, struct pic_object *obj)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case PIC_TT_SC: {
|
|
||||||
struct pic_sc *sc = (struct pic_sc *)obj;
|
|
||||||
gc_mark(pic, sc->expr);
|
|
||||||
gc_mark_object(pic, (struct pic_object *)sc->senv);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case PIC_TT_LIB: {
|
case PIC_TT_LIB: {
|
||||||
struct pic_lib *lib = (struct pic_lib *)obj;
|
struct pic_lib *lib = (struct pic_lib *)obj;
|
||||||
gc_mark(pic, lib->name);
|
gc_mark(pic, lib->name);
|
||||||
|
@ -641,9 +635,6 @@ gc_finalize_object(pic_state *pic, struct pic_object *obj)
|
||||||
case PIC_TT_MACRO: {
|
case PIC_TT_MACRO: {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case PIC_TT_SC: {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case PIC_TT_LIB: {
|
case PIC_TT_LIB: {
|
||||||
struct pic_lib *lib = (struct pic_lib *)obj;
|
struct pic_lib *lib = (struct pic_lib *)obj;
|
||||||
xh_destroy(&lib->exports);
|
xh_destroy(&lib->exports);
|
||||||
|
|
|
@ -454,9 +454,6 @@ macroexpand_node(pic_state *pic, pic_value expr, struct pic_senv *senv, struct p
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
switch (pic_type(expr)) {
|
switch (pic_type(expr)) {
|
||||||
case PIC_TT_SC: {
|
|
||||||
return macroexpand(pic, pic_sc_ptr(expr)->expr, pic_sc_ptr(expr)->senv, cxt);
|
|
||||||
}
|
|
||||||
case PIC_TT_SYMBOL: {
|
case PIC_TT_SYMBOL: {
|
||||||
return macroexpand_symbol(pic, pic_sym(expr), senv, cxt);
|
return macroexpand_symbol(pic, pic_sym(expr), senv, cxt);
|
||||||
}
|
}
|
||||||
|
|
|
@ -318,11 +318,6 @@ write_core(struct writer_control *p, pic_value obj)
|
||||||
case PIC_TT_MACRO:
|
case PIC_TT_MACRO:
|
||||||
xfprintf(file, "#<macro %p>", pic_ptr(obj));
|
xfprintf(file, "#<macro %p>", pic_ptr(obj));
|
||||||
break;
|
break;
|
||||||
case PIC_TT_SC:
|
|
||||||
xfprintf(file, "#<sc %p: ", pic_ptr(obj));
|
|
||||||
write_core(p, pic_sc_ptr(obj)->expr);
|
|
||||||
xfprintf(file, ">");
|
|
||||||
break;
|
|
||||||
case PIC_TT_LIB:
|
case PIC_TT_LIB:
|
||||||
xfprintf(file, "#<lib %p>", pic_ptr(obj));
|
xfprintf(file, "#<lib %p>", pic_ptr(obj));
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue