summaryrefslogtreecommitdiff
path: root/node_dump.c
diff options
context:
space:
mode:
authoryui-knk <[email protected]>2024-01-01 01:31:28 +0900
committerYuichiro Kaneko <[email protected]>2024-01-09 16:07:19 +0900
commitdb476cc71cb6c690bd5b32cebebf7ebcbff604ad (patch)
tree3fa0bfc4a58f6016e7cad7304e951b063f94209f /node_dump.c
parentf82a6172a2a96815f9478410116d35c76b56efb5 (diff)
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
Diffstat (limited to 'node_dump.c')
-rw-r--r--node_dump.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/node_dump.c b/node_dump.c
index 3ed71f0d86..61c1b6a14f 100644
--- a/node_dump.c
+++ b/node_dump.c
@@ -784,6 +784,13 @@ dump_node(VALUE buf, VALUE indent, int comment, const NODE * node)
F_NODE(nd_next->nd_next, RNODE_DSTR, "tailing strings");
return;
+ case NODE_SYM:
+ ANN("symbol literal");
+ ANN("format: [string]");
+ ANN("example: :foo");
+ F_VALUE(string, rb_node_sym_string_val(node), "string");
+ return;
+
case NODE_EVSTR:
ANN("interpolation expression");
ANN("format: \"..#{ [nd_body] }..\"");