rename a property of pic_syntax s/macro/proc/g
This commit is contained in:
parent
6b69e8e74b
commit
8ea3a7b544
|
@ -17,7 +17,7 @@ struct pic_senv {
|
|||
|
||||
struct pic_syntax {
|
||||
PIC_OBJECT_HEADER
|
||||
struct pic_proc *macro;
|
||||
struct pic_proc *proc;
|
||||
struct pic_senv *senv;
|
||||
};
|
||||
|
||||
|
|
4
src/gc.c
4
src/gc.c
|
@ -390,8 +390,8 @@ gc_mark_object(pic_state *pic, struct pic_object *obj)
|
|||
case PIC_TT_SYNTAX: {
|
||||
struct pic_syntax *stx = (struct pic_syntax *)obj;
|
||||
|
||||
if (stx->macro) {
|
||||
gc_mark_object(pic, (struct pic_object *)stx->macro);
|
||||
if (stx->proc) {
|
||||
gc_mark_object(pic, (struct pic_object *)stx->proc);
|
||||
}
|
||||
if (stx->senv) {
|
||||
gc_mark_object(pic, (struct pic_object *)stx->senv);
|
||||
|
|
|
@ -60,13 +60,13 @@ new_local_senv(pic_state *pic, pic_value formals, struct pic_senv *up)
|
|||
}
|
||||
|
||||
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;
|
||||
|
||||
stx = (struct pic_syntax *)pic_obj_alloc(pic, sizeof(struct pic_syntax), PIC_TT_SYNTAX);
|
||||
stx->senv = mac_env;
|
||||
stx->macro = macro;
|
||||
stx->proc = proc;
|
||||
return stx;
|
||||
}
|
||||
|
||||
|
@ -434,14 +434,14 @@ macroexpand(pic_state *pic, pic_value expr, struct pic_senv *senv)
|
|||
pic_value v;
|
||||
struct pic_syntax *stx = (struct pic_syntax *)e->val;
|
||||
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) {
|
||||
printf("macroexpand error: %s\n", pic_errmsg(pic));
|
||||
abort();
|
||||
}
|
||||
}
|
||||
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) {
|
||||
printf("macroexpand error: %s\n", pic_errmsg(pic));
|
||||
abort();
|
||||
|
|
Loading…
Reference in New Issue