add macroexpand_quote

This commit is contained in:
Yuichi Nishiwaki 2014-04-03 22:27:36 +09:00
parent aba1f5139b
commit 880c8c2b03
1 changed files with 7 additions and 1 deletions

View File

@ -499,6 +499,12 @@ macroexpand_lambda(pic_state *pic, pic_value expr, struct pic_senv *senv, pic_va
macroexpand_list(pic, pic_cddr(pic, expr), in, assoc_box))); macroexpand_list(pic, pic_cddr(pic, expr), in, assoc_box)));
} }
static pic_value
macroexpand_quote(pic_state *pic, pic_value expr)
{
return pic_cons(pic, pic_sym_value(pic->sQUOTE), pic_cdr(pic, expr));
}
static pic_value static pic_value
macroexpand_macro(pic_state *pic, struct pic_macro *mac, pic_value expr, struct pic_senv *senv, pic_value assoc_box) macroexpand_macro(pic_state *pic, struct pic_macro *mac, pic_value expr, struct pic_senv *senv, pic_value assoc_box)
{ {
@ -582,7 +588,7 @@ macroexpand_node(pic_state *pic, pic_value expr, struct pic_senv *senv, pic_valu
return macroexpand_define(pic, expr, senv, assoc_box); return macroexpand_define(pic, expr, senv, assoc_box);
} }
else if (tag == pic->sQUOTE) { else if (tag == pic->sQUOTE) {
return pic_cons(pic, car, pic_cdr(pic, expr)); return macroexpand_quote(pic, expr);
} }
if ((mac = find_macro(pic, tag)) != NULL) { if ((mac = find_macro(pic, tag)) != NULL) {