From 93a259870cb0e39c693a1285841cfcf7b4f55a8e Mon Sep 17 00:00:00 2001 From: Yuichi Nishiwaki Date: Wed, 12 Feb 2014 10:52:33 +0900 Subject: [PATCH] replace pic_syntax_new with pic_syntax_new_macro --- include/picrin/macro.h | 3 +-- src/macro.c | 16 ++-------------- 2 files changed, 3 insertions(+), 16 deletions(-) diff --git a/include/picrin/macro.h b/include/picrin/macro.h index 2672876b..d269776a 100644 --- a/include/picrin/macro.h +++ b/include/picrin/macro.h @@ -42,8 +42,7 @@ struct pic_senv *pic_null_syntactic_env(pic_state *); struct pic_senv *pic_minimal_syntactic_env(pic_state *); struct pic_senv *pic_core_syntactic_env(pic_state *); -struct pic_syntax *pic_syntax_new(pic_state *, pic_sym, struct pic_proc *); -struct pic_syntax *pic_syntax_new_macro(pic_state *, pic_sym, struct pic_proc *, struct pic_senv *); +struct pic_syntax *pic_syntax_new(pic_state *, pic_sym, struct pic_proc *, struct pic_senv *); #if defined(__cplusplus) } diff --git a/src/macro.c b/src/macro.c index fd032921..2f8635f5 100644 --- a/src/macro.c +++ b/src/macro.c @@ -60,19 +60,7 @@ new_local_senv(pic_state *pic, pic_value formals, struct pic_senv *up) } struct pic_syntax * -pic_syntax_new(pic_state *pic, pic_sym sym, struct pic_proc *macro) -{ - struct pic_syntax *stx; - - stx = (struct pic_syntax *)pic_obj_alloc(pic, sizeof(struct pic_syntax), PIC_TT_SYNTAX); - stx->sym = sym; - stx->senv = NULL; - stx->macro = macro; - return stx; -} - -struct pic_syntax * -pic_syntax_new_macro(pic_state *pic, pic_sym sym, struct pic_proc *macro, struct pic_senv *mac_env) +pic_syntax_new(pic_state *pic, pic_sym sym, struct pic_proc *macro, struct pic_senv *mac_env) { struct pic_syntax *stx; @@ -152,7 +140,7 @@ defsyntax(pic_state *pic, pic_sym sym, struct pic_proc *macro, struct pic_senv * pic_sym uniq; uniq = pic_gensym(pic, sym); - stx = pic_syntax_new_macro(pic, sym, macro, mac_env); + stx = pic_syntax_new(pic, sym, macro, mac_env); xh_put_int(pic->lib->senv->name, sym, uniq); xh_put_int(pic->macros, uniq, (long)stx);