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