Commit 4a98d5c8 authored by Yukihiro Matsumoto's avatar Yukihiro Matsumoto

allow string interpolation in symbols like :"a=#{15}"

parent 4fd93254
......@@ -1711,6 +1711,15 @@ codegen(codegen_scope *s, node *tree, int val)
}
break;
case NODE_DSYM:
codegen(s, tree, val);
if (val) {
pop();
genop(s, MKOP_ABC(OP_SEND, cursp(), new_msym(s, mrb_intern(s->mrb, "intern")), 0));
push();
}
break;
case NODE_SELF:
if (val) {
genop(s, MKOP_A(OP_LOADSELF, cursp()));
......
......@@ -527,13 +527,6 @@ new_strsym(parser_state *p, node* str)
return mrb_intern2(p->mrb, s, len);
}
// (:sym . a)
static node*
new_dsym(parser_state *p, node *a)
{
return cons((node*)NODE_DSYM, a);
}
// (:lvar . a)
static node*
new_lvar(parser_state *p, mrb_sym sym)
......@@ -705,6 +698,13 @@ new_dstr(parser_state *p, node *a)
return cons((node*)NODE_DSTR, a);
}
// (:dsym . a)
static node*
new_dsym(parser_state *p, node *a)
{
return cons((node*)NODE_DSYM, new_dstr(p, a));
}
// (:backref . n)
static node*
new_back_ref(parser_state *p, int n)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment