debug prints for macroexpand

This commit is contained in:
Yuichi Nishiwaki 2013-11-26 08:38:26 -08:00
parent f6bc51d16d
commit 3009473d52
1 changed files with 16 additions and 1 deletions

View File

@ -392,6 +392,7 @@ pic_value
pic_macroexpand_2(pic_state *pic, pic_value expr) pic_macroexpand_2(pic_state *pic, pic_value expr)
{ {
struct pic_senv *senv; struct pic_senv *senv;
pic_value v;
senv = (struct pic_senv *)pic_obj_alloc(pic, sizeof(struct pic_senv), PIC_TT_SENV); senv = (struct pic_senv *)pic_obj_alloc(pic, sizeof(struct pic_senv), PIC_TT_SENV);
senv->up = NULL; senv->up = NULL;
@ -400,5 +401,19 @@ pic_macroexpand_2(pic_state *pic, pic_value expr)
senv->xlen = pic->xlen; senv->xlen = pic->xlen;
senv->xcapa = pic->xcapa; senv->xcapa = pic->xcapa;
return macroexpand(pic, expr, senv); #if DEBUG
puts("before expand:");
pic_debug(pic, expr);
puts("");
#endif
v = macroexpand(pic, expr, senv);
#if DEBUG
puts("after expand:");
pic_debug(pic, v);
puts("");
#endif
return v;
} }