rename a property of pic_syntax s/macro/proc/g

This commit is contained in:
Yuichi Nishiwaki 2014-02-12 11:05:32 +09:00
parent 6b69e8e74b
commit 8ea3a7b544
3 changed files with 7 additions and 7 deletions

View File

@ -17,7 +17,7 @@ struct pic_senv {
struct pic_syntax { struct pic_syntax {
PIC_OBJECT_HEADER PIC_OBJECT_HEADER
struct pic_proc *macro; struct pic_proc *proc;
struct pic_senv *senv; struct pic_senv *senv;
}; };

View File

@ -390,8 +390,8 @@ gc_mark_object(pic_state *pic, struct pic_object *obj)
case PIC_TT_SYNTAX: { case PIC_TT_SYNTAX: {
struct pic_syntax *stx = (struct pic_syntax *)obj; struct pic_syntax *stx = (struct pic_syntax *)obj;
if (stx->macro) { if (stx->proc) {
gc_mark_object(pic, (struct pic_object *)stx->macro); gc_mark_object(pic, (struct pic_object *)stx->proc);
} }
if (stx->senv) { if (stx->senv) {
gc_mark_object(pic, (struct pic_object *)stx->senv); gc_mark_object(pic, (struct pic_object *)stx->senv);

View File

@ -60,13 +60,13 @@ new_local_senv(pic_state *pic, pic_value formals, struct pic_senv *up)
} }
struct pic_syntax * struct pic_syntax *
syntax_new(pic_state *pic, struct pic_proc *macro, struct pic_senv *mac_env) syntax_new(pic_state *pic, struct pic_proc *proc, struct pic_senv *mac_env)
{ {
struct pic_syntax *stx; struct pic_syntax *stx;
stx = (struct pic_syntax *)pic_obj_alloc(pic, sizeof(struct pic_syntax), PIC_TT_SYNTAX); stx = (struct pic_syntax *)pic_obj_alloc(pic, sizeof(struct pic_syntax), PIC_TT_SYNTAX);
stx->senv = mac_env; stx->senv = mac_env;
stx->macro = macro; stx->proc = proc;
return stx; return stx;
} }
@ -434,14 +434,14 @@ macroexpand(pic_state *pic, pic_value expr, struct pic_senv *senv)
pic_value v; pic_value v;
struct pic_syntax *stx = (struct pic_syntax *)e->val; struct pic_syntax *stx = (struct pic_syntax *)e->val;
if (stx->senv == NULL) { /* legacy macro */ if (stx->senv == NULL) { /* legacy macro */
v = pic_apply(pic, stx->macro, pic_cdr(pic, expr)); v = pic_apply(pic, stx->proc, pic_cdr(pic, expr));
if (pic->err) { if (pic->err) {
printf("macroexpand error: %s\n", pic_errmsg(pic)); printf("macroexpand error: %s\n", pic_errmsg(pic));
abort(); abort();
} }
} }
else { else {
v = pic_apply_argv(pic, stx->macro, 3, expr, pic_obj_value(senv), pic_obj_value(stx->senv)); v = pic_apply_argv(pic, stx->proc, 3, expr, pic_obj_value(senv), pic_obj_value(stx->senv));
if (pic->err) { if (pic->err) {
printf("macroexpand error: %s\n", pic_errmsg(pic)); printf("macroexpand error: %s\n", pic_errmsg(pic));
abort(); abort();