Introduce NODE_SYM to manage symbol literal

`:sym` was managed by `NODE_LIT` with `Symbol` object.
This commit introduces `NODE_SYM` so that

1. Symbol literal is detectable from AST Node
2. Reduce dependency on ruby object
This commit is contained in:
yui-knk 2024-01-01 01:31:28 +09:00 committed by Yuichiro Kaneko
parent f82a6172a2
commit db476cc71c
11 changed files with 166 additions and 39 deletions

3
node.c
View file

@ -179,6 +179,9 @@ static void
free_ast_value(rb_ast_t *ast, void *ctx, NODE *node)
{
switch (nd_type(node)) {
case NODE_SYM:
parser_string_free(ast, RNODE_SYM(node)->string);
break;
case NODE_FILE:
parser_string_free(ast, RNODE_FILE(node)->path);
break;