Refactor ALL the things!
This commit is contained in:
parent
6a2f10df0c
commit
f2def8fa05
28 changed files with 930 additions and 855 deletions
22
src/parsers/ignore.c
Normal file
22
src/parsers/ignore.c
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
#include "parser_internal.h"
|
||||
|
||||
static HParseResult* parse_ignore(void* env, HParseState* state) {
|
||||
HParseResult *res0 = h_do_parse((HParser*)env, state);
|
||||
if (!res0)
|
||||
return NULL;
|
||||
HParseResult *res = a_new(HParseResult, 1);
|
||||
res->ast = NULL;
|
||||
res->arena = state->arena;
|
||||
return res;
|
||||
}
|
||||
|
||||
static const HParserVtable ignore_vt = {
|
||||
.parse = parse_ignore,
|
||||
};
|
||||
|
||||
const HParser* h_ignore(const HParser* p) {
|
||||
HParser* ret = g_new(HParser, 1);
|
||||
ret->vtable = &ignore_vt;
|
||||
ret->env = (void*)p;
|
||||
return ret;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue