mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
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:
parent
f82a6172a2
commit
db476cc71c
11 changed files with 166 additions and 39 deletions
3
node.c
3
node.c
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue