Remove ast_new
field from struct rb_parser_config_struct
`ast_new` can be embedded into `rb_ast_new`.
This commit is contained in:
parent
5c3d5c7cdd
commit
29aaf4abe6
3
node.c
3
node.c
@ -301,8 +301,9 @@ rb_ast_t *
|
|||||||
rb_ast_new(const rb_parser_config_t *config)
|
rb_ast_new(const rb_parser_config_t *config)
|
||||||
{
|
{
|
||||||
node_buffer_t *nb = rb_node_buffer_new(config);
|
node_buffer_t *nb = rb_node_buffer_new(config);
|
||||||
rb_ast_t *ast = config->ast_new(nb);
|
rb_ast_t *ast = (rb_ast_t *)config->calloc(1, sizeof(rb_ast_t));
|
||||||
ast->config = config;
|
ast->config = config;
|
||||||
|
ast->node_buffer = nb;
|
||||||
return ast;
|
return ast;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
|
@ -292,14 +292,6 @@ arg_error(void)
|
|||||||
return rb_eArgError;
|
return rb_eArgError;
|
||||||
}
|
}
|
||||||
|
|
||||||
static rb_ast_t *
|
|
||||||
ast_new(node_buffer_t *nb)
|
|
||||||
{
|
|
||||||
rb_ast_t *ast = ruby_xcalloc(1, sizeof(rb_ast_t));
|
|
||||||
ast->node_buffer = nb;
|
|
||||||
return ast;
|
|
||||||
}
|
|
||||||
|
|
||||||
static VALUE
|
static VALUE
|
||||||
static_id2sym(ID id)
|
static_id2sym(ID id)
|
||||||
{
|
{
|
||||||
@ -348,8 +340,6 @@ static const rb_parser_config_t rb_global_parser_config = {
|
|||||||
.nonempty_memcpy = nonempty_memcpy,
|
.nonempty_memcpy = nonempty_memcpy,
|
||||||
.xmalloc_mul_add = rb_xmalloc_mul_add,
|
.xmalloc_mul_add = rb_xmalloc_mul_add,
|
||||||
|
|
||||||
.ast_new = ast_new,
|
|
||||||
|
|
||||||
.compile_callback = rb_suppress_tracing,
|
.compile_callback = rb_suppress_tracing,
|
||||||
.reg_named_capture_assign = reg_named_capture_assign,
|
.reg_named_capture_assign = reg_named_capture_assign,
|
||||||
|
|
||||||
|
@ -1255,8 +1255,6 @@ typedef struct rb_parser_config_struct {
|
|||||||
void *(*nonempty_memcpy)(void *dest, const void *src, size_t t, size_t n);
|
void *(*nonempty_memcpy)(void *dest, const void *src, size_t t, size_t n);
|
||||||
void *(*xmalloc_mul_add)(size_t x, size_t y, size_t z);
|
void *(*xmalloc_mul_add)(size_t x, size_t y, size_t z);
|
||||||
|
|
||||||
rb_ast_t *(*ast_new)(node_buffer_t *nb);
|
|
||||||
|
|
||||||
// VALUE rb_suppress_tracing(VALUE (*func)(VALUE), VALUE arg);
|
// VALUE rb_suppress_tracing(VALUE (*func)(VALUE), VALUE arg);
|
||||||
VALUE (*compile_callback)(VALUE (*func)(VALUE), VALUE arg);
|
VALUE (*compile_callback)(VALUE (*func)(VALUE), VALUE arg);
|
||||||
NODE *(*reg_named_capture_assign)(struct parser_params* p, VALUE regexp, const rb_code_location_t *loc);
|
NODE *(*reg_named_capture_assign)(struct parser_params* p, VALUE regexp, const rb_code_location_t *loc);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user