#include "gwion_util.h"
#include "gwion_ast.h"
Go to the source code of this file.
|
MacroArg | new_macroarg (MemPool p, const m_str name) |
|
void | clean_macroarg (const MacroArg a) |
|
static void | free_args (MemPool p, const MacroArg a) |
|
void | free_entry (MemPool p, void *data) |
|
static Macro | mkentry (MemPool p, const m_str name, const Macro next) |
|
| hstraction (Macro, Macro, has,, return sym;,, return NULL) hstraction(Macro |
|
| hstraction (Macro, bool, rem, Macro prev=NULL;, if(prev) prev->next=s->next;else h->table[idx]=NULL;s->next=NULL;free_entry(h->p, s);return false;, prev=s;, return true;) ANN void macro_del(const Hash h) |
|
◆ clean_macroarg()
Definition at line 11 of file macro.c.
11 {
13 text_release(&a->
text);
14}
void clean_macroarg(const MacroArg a)
◆ free_args()
static void free_args |
( |
MemPool | p, |
|
|
const MacroArg | a ) |
|
static |
Definition at line 16 of file macro.c.
16 {
18 text_release(&a->
text);
19 free_mstr(p, a->
name);
21}
static void free_args(MemPool p, const MacroArg a)
◆ free_entry()
void free_entry |
( |
MemPool | p, |
|
|
void * | data ) |
Definition at line 23 of file macro.c.
23 {
26 free_mstr(p, s->
name);
30}
void free_entry(MemPool p, void *data)
◆ hstraction() [1/2]
hstraction |
( |
Macro | , |
|
|
bool | , |
|
|
rem | , |
|
|
Macro | prev = NULL;, |
|
|
if(prev) prev-> | next = s->next; else h->table[idx] = NULL; s->next = NULL; free_entry(h->p, s); return false;, |
|
|
prev | = s;, |
|
|
return true; | ) const |
◆ hstraction() [2/2]
hstraction |
( |
Macro | , |
|
|
Macro | , |
|
|
has | , |
|
|
return sym; | , |
|
|
return | NULL ) |
◆ mkentry()
static Macro mkentry |
( |
MemPool | p, |
|
|
const m_str | name, |
|
|
const Macro | next ) |
|
inlinestatic |
Definition at line 32 of file macro.c.
32 {
34 s->
name = mstrdup(p, name);
36 s->
text = new_text(p);
37 return s;
38}
◆ new_macroarg()
MacroArg new_macroarg |
( |
MemPool | p, |
|
|
const m_str | name ) |
Definition at line 4 of file macro.c.
4 {
6 a->
name = mstrdup(p, name);
7 text_init(&a->
text, p);
8 return a;
9}
◆ add
◆ Macro
◆ NULL
◆ table
return h table[idx] = mkentry(h->p, arg, sym) |