wrap all allocs of HParser in helper h_new_parser
This commit is contained in:
parent
3dfc313118
commit
88091b602f
23 changed files with 44 additions and 113 deletions
|
|
@ -52,9 +52,8 @@ const HParser* h_butnot(const HParser* p1, const HParser* p2) {
|
|||
}
|
||||
const HParser* h_butnot__m(HAllocator* mm__, const HParser* p1, const HParser* p2) {
|
||||
HTwoParsers *env = h_new(HTwoParsers, 1);
|
||||
env->p1 = p1; env->p2 = p2;
|
||||
HParser *ret = h_new(HParser, 1);
|
||||
ret->vtable = &butnot_vt; ret->env = (void*)env;
|
||||
return ret;
|
||||
env->p1 = p1;
|
||||
env->p2 = p2;
|
||||
return h_new_parser(mm__, &butnot_vt, env);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue