summaryrefslogtreecommitdiffhomepage
path: root/mrbgems/mruby-compiler/core/parse.y
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2020-04-25 14:29:58 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2020-10-12 16:20:41 +0900
commiteddd3249793b3b307da2fe7734d5923cd238a35b (patch)
tree8575bd761c26472c9dbb6a81cdeb65a2b3ecc3bd /mrbgems/mruby-compiler/core/parse.y
parentf221f4e0fa08da25498042b2cd61331af40294e5 (diff)
downloadmruby-eddd3249793b3b307da2fe7734d5923cd238a35b.tar.gz
mruby-eddd3249793b3b307da2fe7734d5923cd238a35b.zip
Add `MRB_SYM()` for inline symbols.
Diffstat (limited to 'mrbgems/mruby-compiler/core/parse.y')
-rw-r--r--mrbgems/mruby-compiler/core/parse.y16
1 files changed, 8 insertions, 8 deletions
diff --git a/mrbgems/mruby-compiler/core/parse.y b/mrbgems/mruby-compiler/core/parse.y
index 9de45a536..393d6b098 100644
--- a/mrbgems/mruby-compiler/core/parse.y
+++ b/mrbgems/mruby-compiler/core/parse.y
@@ -311,14 +311,14 @@ static void
local_add_blk(parser_state *p, mrb_sym blk)
{
/* allocate register for block */
- local_add_f(p, blk ? blk : mrb_intern_lit(p->mrb, "&"));
+ local_add_f(p, blk ? blk : intern_lit("&"));
}
static void
local_add_kw(parser_state *p, mrb_sym kwd)
{
/* allocate register for keywords hash */
- local_add_f(p, kwd ? kwd : mrb_intern_lit(p->mrb, "**"));
+ local_add_f(p, kwd ? kwd : intern_lit("**"));
}
static node*
@@ -932,13 +932,13 @@ new_op_asgn(parser_state *p, node *a, mrb_sym op, node *b)
static node*
new_imaginary(parser_state *p, node *imaginary)
{
- return new_call(p, new_const(p, intern_lit("Kernel")), intern_lit("Complex"), list1(list2(list3((node*)NODE_INT, (node*)strdup("0"), nint(10)), imaginary)), 1);
+ return new_call(p, new_const(p, MRB_SYM(Kernel)), MRB_SYM(Complex), list1(list2(list3((node*)NODE_INT, (node*)strdup("0"), nint(10)), imaginary)), 1);
}
static node*
new_rational(parser_state *p, node *rational)
{
- return new_call(p, new_const(p, intern_lit("Kernel")), intern_lit("Rational"), list1(list1(rational)), 1);
+ return new_call(p, new_const(p, MRB_SYM(Kernel)), MRB_SYM(Rational), list1(list1(rational)), 1);
}
/* (:int . i) */
@@ -3010,11 +3010,11 @@ method_call : operation paren_args
}
| primary_value call_op paren_args
{
- $$ = new_call(p, $1, intern_lit("call"), $3, $2);
+ $$ = new_call(p, $1, MRB_SYM(call), $3, $2);
}
| primary_value tCOLON2 paren_args
{
- $$ = new_call(p, $1, intern_lit("call"), $3, tCOLON2);
+ $$ = new_call(p, $1, MRB_SYM(call), $3, tCOLON2);
}
| keyword_super paren_args
{
@@ -3580,7 +3580,7 @@ f_args : f_arg ',' f_optarg ',' f_rest_arg opt_args_tail
}
| /* none */
{
- local_add_f(p, mrb_intern_lit(p->mrb, "&"));
+ local_add_f(p, intern_lit("&"));
$$ = new_args(p, 0, 0, 0, 0, 0);
}
;
@@ -3704,7 +3704,7 @@ f_rest_arg : restarg_mark tIDENTIFIER
}
| restarg_mark
{
- local_add_f(p, mrb_intern_lit(p->mrb, "*"));
+ local_add_f(p, intern_lit("*"));
$$ = -1;
}
;