inline macro_new and add_macro
This commit is contained in:
parent
845778eefb
commit
4ec8398118
17
src/macro.c
17
src/macro.c
|
@ -125,29 +125,18 @@ pic_core_syntactic_env(pic_state *pic)
|
||||||
return senv;
|
return senv;
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct pic_macro *
|
static void
|
||||||
macro_new(pic_state *pic, struct pic_proc *proc, struct pic_senv *mac_env)
|
define_macro(pic_state *pic, pic_sym rename, struct pic_proc *proc, struct pic_senv *senv)
|
||||||
{
|
{
|
||||||
struct pic_macro *mac;
|
struct pic_macro *mac;
|
||||||
|
|
||||||
mac = (struct pic_macro *)pic_obj_alloc(pic, sizeof(struct pic_macro), PIC_TT_MACRO);
|
mac = (struct pic_macro *)pic_obj_alloc(pic, sizeof(struct pic_macro), PIC_TT_MACRO);
|
||||||
mac->senv = mac_env;
|
mac->senv = senv;
|
||||||
mac->proc = proc;
|
mac->proc = proc;
|
||||||
return mac;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
add_macro(pic_state *pic, pic_sym rename, struct pic_macro *mac)
|
|
||||||
{
|
|
||||||
xh_put(&pic->macros, rename, &mac);
|
xh_put(&pic->macros, rename, &mac);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
define_macro(pic_state *pic, pic_sym rename, struct pic_proc *proc, struct pic_senv *senv)
|
|
||||||
{
|
|
||||||
add_macro(pic, rename, macro_new(pic, proc, senv));
|
|
||||||
}
|
|
||||||
|
|
||||||
static struct pic_macro *
|
static struct pic_macro *
|
||||||
find_macro(pic_state *pic, pic_sym rename)
|
find_macro(pic_state *pic, pic_sym rename)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue