summaryrefslogtreecommitdiffhomepage
path: root/mrbgems/mruby-compiler/core/parse.y
diff options
context:
space:
mode:
Diffstat (limited to 'mrbgems/mruby-compiler/core/parse.y')
-rw-r--r--mrbgems/mruby-compiler/core/parse.y7
1 files changed, 3 insertions, 4 deletions
diff --git a/mrbgems/mruby-compiler/core/parse.y b/mrbgems/mruby-compiler/core/parse.y
index 579d4291a..5054085df 100644
--- a/mrbgems/mruby-compiler/core/parse.y
+++ b/mrbgems/mruby-compiler/core/parse.y
@@ -712,10 +712,6 @@ new_cvar(parser_state *p, mrb_sym sym)
static node*
new_nvar(parser_state *p, int num)
{
- if (p->nvars) {
- int nvars = intn(p->nvars->car);
- p->nvars->car = nint(nvars > num ? nvars : num);
- }
return cons((node*)NODE_NVAR, nint(num));
}
@@ -6429,6 +6425,9 @@ parser_yylex(parser_state *p)
if (nvar == -1) {
yywarning(p, "numbered parameter used in inner block");
}
+ else {
+ p->nvars->car = nint(nvar > n ? nvar : n);
+ }
pylval.num = n;
p->lstate = EXPR_END;
return tNUMPARAM;