From 3009473d52017f363eec4630a04677ec114e2ee9 Mon Sep 17 00:00:00 2001 From: Yuichi Nishiwaki Date: Tue, 26 Nov 2013 08:38:26 -0800 Subject: [PATCH] debug prints for macroexpand --- src/macro.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/macro.c b/src/macro.c index cac35c3d..b379aed0 100644 --- a/src/macro.c +++ b/src/macro.c @@ -392,6 +392,7 @@ pic_value pic_macroexpand_2(pic_state *pic, pic_value expr) { struct pic_senv *senv; + pic_value v; senv = (struct pic_senv *)pic_obj_alloc(pic, sizeof(struct pic_senv), PIC_TT_SENV); senv->up = NULL; @@ -400,5 +401,19 @@ pic_macroexpand_2(pic_state *pic, pic_value expr) senv->xlen = pic->xlen; 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; }