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
|
@ -964,6 +964,13 @@ rb_parser_set_yydebug(VALUE vparser, VALUE flag)
|
|||
}
|
||||
#endif
|
||||
|
||||
VALUE
|
||||
rb_node_sym_string_val(const NODE *node)
|
||||
{
|
||||
rb_parser_string_t *str = RNODE_SYM(node)->string;
|
||||
return ID2SYM(rb_intern3(str->ptr, str->len, str->enc));
|
||||
}
|
||||
|
||||
VALUE
|
||||
rb_node_line_lineno_val(const NODE *node)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue