Included arena allocator in return value
This commit is contained in:
parent
79f9e21da7
commit
18c2d1f2ca
2 changed files with 2 additions and 0 deletions
|
|
@ -72,6 +72,7 @@ parse_result_t* do_parse(const parser_t* parser, parse_state_t *state) {
|
|||
parse_result_t* make_result(parse_state_t *state, parsed_token_t *tok) {
|
||||
parse_result_t *ret = a_new(parse_result_t, 1);
|
||||
ret->ast = tok;
|
||||
ret->arena = state->arena;
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -80,6 +80,7 @@ typedef struct parsed_token {
|
|||
*/
|
||||
typedef struct parse_result {
|
||||
const parsed_token_t *ast;
|
||||
arena_t arena;
|
||||
} parse_result_t;
|
||||
|
||||
/* Type of an action to apply to an AST, used in the action() parser. */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue