parse.y: consistent argument `pass` for `new_call()`.
MODIFY
mrbgems/mruby-compiler/core/parse.y
mrbgems/mruby-compiler/core/parse.y
@@ -994,13 +994,13 @@ static node*
new_imaginary(parser_state *p, node *imaginary)
{
return new_call(p, new_const(p, MRB_SYM_2(p->mrb, Kernel)), MRB_SYM_2(p->mrb, Complex),
- new_callargs(p, list2(list3((node*)NODE_INT, (node*)strdup("0"), nint(10)), imaginary), 0, 0), 1);
+ new_callargs(p, list2(list3((node*)NODE_INT, (node*)strdup("0"), nint(10)), imaginary), 0, 0), '.');
}
static node*
new_rational(parser_state *p, node *rational)
{
- return new_call(p, new_const(p, MRB_SYM_2(p->mrb, Kernel)), MRB_SYM_2(p->mrb, Rational), new_callargs(p, list1(rational), 0, 0), 1);
+ return new_call(p, new_const(p, MRB_SYM_2(p->mrb, Kernel)), MRB_SYM_2(p->mrb, Rational), new_callargs(p, list1(rational), 0, 0), '.');
}
/* (:int . i) */
@@ -1216,14 +1216,14 @@ static node*
call_uni_op(parser_state *p, node *recv, const char *m)
{
void_expr_error(p, recv);
- return new_call(p, recv, intern_cstr(m), 0, 1);
+ return new_call(p, recv, intern_cstr(m), 0, '.');
}
/* (:call a op b) */
static node*
call_bin_op(parser_state *p, node *recv, const char *m, node *arg1)
{
- return new_call(p, recv, intern_cstr(m), new_callargs(p, list1(arg1), 0, 0), 1);
+ return new_call(p, recv, intern_cstr(m), new_callargs(p, list1(arg1), 0, 0), '.');
}
static void

MODIFY
mrbgems/mruby-compiler/core/y.tab.c
mrbgems/mruby-compiler/core/y.tab.c
@@ -1057,13 +1057,13 @@ static node*
new_imaginary(parser_state *p, node *imaginary)
{
return new_call(p, new_const(p, MRB_SYM_2(p->mrb, Kernel)), MRB_SYM_2(p->mrb, Complex),
- new_callargs(p, list2(list3((node*)NODE_INT, (node*)strdup("0"), nint(10)), imaginary), 0, 0), 1);
+ new_callargs(p, list2(list3((node*)NODE_INT, (node*)strdup("0"), nint(10)), imaginary), 0, 0), '.');
}
static node*
new_rational(parser_state *p, node *rational)
{
- return new_call(p, new_const(p, MRB_SYM_2(p->mrb, Kernel)), MRB_SYM_2(p->mrb, Rational), new_callargs(p, list1(rational), 0, 0), 1);
+ return new_call(p, new_const(p, MRB_SYM_2(p->mrb, Kernel)), MRB_SYM_2(p->mrb, Rational), new_callargs(p, list1(rational), 0, 0), '.');
}
/* (:int . i) */
@@ -1279,14 +1279,14 @@ static node*
call_uni_op(parser_state *p, node *recv, const char *m)
{
void_expr_error(p, recv);
- return new_call(p, recv, intern_cstr(m), 0, 1);
+ return new_call(p, recv, intern_cstr(m), 0, '.');
}
/* (:call a op b) */
static node*
call_bin_op(parser_state *p, node *recv, const char *m, node *arg1)
{
- return new_call(p, recv, intern_cstr(m), new_callargs(p, list1(arg1), 0, 0), 1);
+ return new_call(p, recv, intern_cstr(m), new_callargs(p, list1(arg1), 0, 0), '.');
}
static void
@@ -12649,18 +12649,19 @@ parser_yylex(parser_state *p)
nvars = nvars->cdr;
}
nvar = intn(p->nvars->car);
+ if (nvar != -2) { /* numbered parameters never appear on toplevel */
if (nvar == -1) {
yywarning(p, "numbered parameter used in inner block");
}
else {
- int nvars = intn(p->nvars->car);
- p->nvars->car = nint(nvars > n ? nvars : n);
+ p->nvars->car = nint(nvar > n ? nvar : n);
}
pylval.num = n;
p->lstate = EXPR_END;
return tNUMPARAM;
}
}
+ }
/* fall through */
default:
if (toklast(p) == '!' || toklast(p) == '?') {

parse.y: consistent argument `pass` for `new_call()`.