wrap all allocs of HParser in helper h_new_parser

This commit is contained in:
Sven M. Hallberg 2013-04-27 04:17:47 +02:00
parent 3dfc313118
commit 88091b602f
23 changed files with 44 additions and 113 deletions

View file

@ -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);
}