parse.y: fix `nint` (int to node) and `intn` (node to int).
MODIFY
mrbgems/mruby-compiler/core/parse.y
mrbgems/mruby-compiler/core/parse.y
@@ -3306,7 +3306,7 @@ string_fragment : tCHAR
| tSTRING_BEG string_rep tSTRING
{
node *n = $2;
- if (nint($3->cdr->cdr) > 0) {
+ if (intn($3->cdr->cdr) > 0) {
n = push(n, $3);
}
$$ = new_dstr(p, n);
@@ -3352,7 +3352,7 @@ xstring : tXSTRING_BEG tXSTRING
| tXSTRING_BEG string_rep tXSTRING
{
node *n = $2;
- if (nint($3->cdr->cdr) > 0) {
+ if (intn($3->cdr->cdr) > 0) {
n = push(n, $3);
}
$$ = new_dxstr(p, n);
@@ -3419,7 +3419,7 @@ words : tWORDS_BEG tSTRING
| tWORDS_BEG string_rep tSTRING
{
node *n = $2;
- if (nint($3->cdr->cdr) > 0) {
+ if (intn($3->cdr->cdr) > 0) {
n = push(n, $3);
}
$$ = new_words(p, n);
@@ -3436,7 +3436,7 @@ symbol : basic_symbol
{
node *n = $3;
p->lstate = EXPR_ENDARG;
- if (nint($4->cdr->cdr) > 0) {
+ if (intn($4->cdr->cdr) > 0) {
n = push(n, $4);
}
$$ = new_dsym(p, new_dstr(p, n));
@@ -3469,7 +3469,11 @@ symbols : tSYMBOLS_BEG tSTRING
}
| tSYMBOLS_BEG string_rep tSTRING
{
- $$ = new_symbols(p, push($2, $3));
+ node *n = $2;
+ if (intn($3->cdr->cdr) > 0) {
+ n = push(n, $3);
+ }
+ $$ = new_symbols(p, n);
}
;

MODIFY
mrbgems/mruby-compiler/core/y.tab.c
mrbgems/mruby-compiler/core/y.tab.c
@@ -2060,21 +2060,21 @@ static const yytype_int16 yyrline[] =
3306, 3316, 3317, 3323, 3328, 3327, 3338, 3342, 3348, 3352,
3362, 3366, 3372, 3375, 3376, 3379, 3385, 3391, 3392, 3395,
3402, 3401, 3415, 3419, 3430, 3435, 3446, 3452, 3453, 3454,
- 3455, 3456, 3460, 3466, 3470, 3476, 3477, 3478, 3482, 3488,
- 3492, 3496, 3500, 3504, 3510, 3514, 3520, 3524, 3528, 3532,
- 3536, 3540, 3548, 3555, 3566, 3567, 3571, 3575, 3574, 3591,
- 3592, 3595, 3601, 3619, 3639, 3640, 3646, 3652, 3658, 3665,
- 3670, 3677, 3681, 3687, 3691, 3697, 3698, 3701, 3705, 3711,
- 3715, 3719, 3723, 3729, 3734, 3739, 3743, 3747, 3751, 3755,
- 3759, 3763, 3767, 3771, 3775, 3779, 3783, 3787, 3791, 3796,
- 3802, 3807, 3812, 3817, 3822, 3829, 3833, 3840, 3845, 3844,
- 3856, 3860, 3866, 3874, 3882, 3890, 3894, 3900, 3904, 3910,
- 3911, 3914, 3919, 3926, 3927, 3930, 3936, 3940, 3946, 3951,
- 3951, 3976, 3977, 3983, 3988, 3994, 3995, 3998, 4004, 4009,
- 4019, 4026, 4027, 4028, 4031, 4032, 4033, 4034, 4037, 4038,
- 4039, 4042, 4043, 4046, 4050, 4056, 4057, 4063, 4064, 4067,
- 4068, 4071, 4074, 4075, 4076, 4079, 4080, 4081, 4084, 4091,
- 4092, 4096
+ 3455, 3456, 3460, 3466, 3470, 3480, 3481, 3482, 3486, 3492,
+ 3496, 3500, 3504, 3508, 3514, 3518, 3524, 3528, 3532, 3536,
+ 3540, 3544, 3552, 3559, 3570, 3571, 3575, 3579, 3578, 3595,
+ 3596, 3599, 3605, 3623, 3643, 3644, 3650, 3656, 3662, 3669,
+ 3674, 3681, 3685, 3691, 3695, 3701, 3702, 3705, 3709, 3715,
+ 3719, 3723, 3727, 3733, 3738, 3743, 3747, 3751, 3755, 3759,
+ 3763, 3767, 3771, 3775, 3779, 3783, 3787, 3791, 3795, 3800,
+ 3806, 3811, 3816, 3821, 3826, 3833, 3837, 3844, 3849, 3848,
+ 3860, 3864, 3870, 3878, 3886, 3894, 3898, 3904, 3908, 3914,
+ 3915, 3918, 3923, 3930, 3931, 3934, 3940, 3944, 3950, 3955,
+ 3955, 3980, 3981, 3987, 3992, 3998, 3999, 4002, 4008, 4013,
+ 4023, 4030, 4031, 4032, 4035, 4036, 4037, 4038, 4041, 4042,
+ 4043, 4046, 4047, 4050, 4054, 4060, 4061, 4067, 4068, 4071,
+ 4072, 4075, 4078, 4079, 4080, 4083, 4084, 4085, 4088, 4095,
+ 4096, 4100
};
#endif
@@ -8971,7 +8971,7 @@ yyreduce:
#line 3307 "mrbgems/mruby-compiler/core/parse.y"
{
node *n = (yyvsp[-1].nd);
- if (nint((yyvsp[0].nd)->cdr->cdr) > 0) {
+ if (intn((yyvsp[0].nd)->cdr->cdr) > 0) {
n = push(n, (yyvsp[0].nd));
}
(yyval.nd) = new_dstr(p, n);
@@ -9041,7 +9041,7 @@ yyreduce:
#line 3353 "mrbgems/mruby-compiler/core/parse.y"
{
node *n = (yyvsp[-1].nd);
- if (nint((yyvsp[0].nd)->cdr->cdr) > 0) {
+ if (intn((yyvsp[0].nd)->cdr->cdr) > 0) {
n = push(n, (yyvsp[0].nd));
}
(yyval.nd) = new_dxstr(p, n);
@@ -9124,7 +9124,7 @@ yyreduce:
#line 3420 "mrbgems/mruby-compiler/core/parse.y"
{
node *n = (yyvsp[-1].nd);
- if (nint((yyvsp[0].nd)->cdr->cdr) > 0) {
+ if (intn((yyvsp[0].nd)->cdr->cdr) > 0) {
n = push(n, (yyvsp[0].nd));
}
(yyval.nd) = new_words(p, n);
@@ -9146,7 +9146,7 @@ yyreduce:
{
node *n = (yyvsp[-1].nd);
p->lstate = EXPR_ENDARG;
- if (nint((yyvsp[0].nd)->cdr->cdr) > 0) {
+ if (intn((yyvsp[0].nd)->cdr->cdr) > 0) {
n = push(n, (yyvsp[0].nd));
}
(yyval.nd) = new_dsym(p, new_dstr(p, n));
@@ -9189,125 +9189,129 @@ yyreduce:
case 474:
#line 3471 "mrbgems/mruby-compiler/core/parse.y"
{
- (yyval.nd) = new_symbols(p, push((yyvsp[-1].nd), (yyvsp[0].nd)));
+ node *n = (yyvsp[-1].nd);
+ if (intn((yyvsp[0].nd)->cdr->cdr) > 0) {
+ n = push(n, (yyvsp[0].nd));
+ }
+ (yyval.nd) = new_symbols(p, n);
}
-#line 9195 "mrbgems/mruby-compiler/core/y.tab.c"
+#line 9199 "mrbgems/mruby-compiler/core/y.tab.c"
break;
case 477:
-#line 3479 "mrbgems/mruby-compiler/core/parse.y"
+#line 3483 "mrbgems/mruby-compiler/core/parse.y"
{
(yyval.nd) = new_negate(p, (yyvsp[0].nd));
}
-#line 9203 "mrbgems/mruby-compiler/core/y.tab.c"
+#line 9207 "mrbgems/mruby-compiler/core/y.tab.c"
break;
case 478:
-#line 3483 "mrbgems/mruby-compiler/core/parse.y"
+#line 3487 "mrbgems/mruby-compiler/core/parse.y"
{
(yyval.nd) = new_negate(p, (yyvsp[0].nd));
}
-#line 9211 "mrbgems/mruby-compiler/core/y.tab.c"
+#line 9215 "mrbgems/mruby-compiler/core/y.tab.c"
break;
case 479:
-#line 3489 "mrbgems/mruby-compiler/core/parse.y"
+#line 3493 "mrbgems/mruby-compiler/core/parse.y"
{
(yyval.nd) = new_lvar(p, (yyvsp[0].id));
}
-#line 9219 "mrbgems/mruby-compiler/core/y.tab.c"
+#line 9223 "mrbgems/mruby-compiler/core/y.tab.c"
break;
case 480:
-#line 3493 "mrbgems/mruby-compiler/core/parse.y"
+#line 3497 "mrbgems/mruby-compiler/core/parse.y"
{
(yyval.nd) = new_ivar(p, (yyvsp[0].id));
}
-#line 9227 "mrbgems/mruby-compiler/core/y.tab.c"
+#line 9231 "mrbgems/mruby-compiler/core/y.tab.c"
break;
case 481:
-#line 3497 "mrbgems/mruby-compiler/core/parse.y"
+#line 3501 "mrbgems/mruby-compiler/core/parse.y"
{
(yyval.nd) = new_gvar(p, (yyvsp[0].id));
}
-#line 9235 "mrbgems/mruby-compiler/core/y.tab.c"
+#line 9239 "mrbgems/mruby-compiler/core/y.tab.c"
break;
case 482:
-#line 3501 "mrbgems/mruby-compiler/core/parse.y"
+#line 3505 "mrbgems/mruby-compiler/core/parse.y"
{
(yyval.nd) = new_cvar(p, (yyvsp[0].id));
}
-#line 9243 "mrbgems/mruby-compiler/core/y.tab.c"
+#line 9247 "mrbgems/mruby-compiler/core/y.tab.c"
break;
case 483:
-#line 3505 "mrbgems/mruby-compiler/core/parse.y"
+#line 3509 "mrbgems/mruby-compiler/core/parse.y"
{
(yyval.nd) = new_const(p, (yyvsp[0].id));
}
-#line 9251 "mrbgems/mruby-compiler/core/y.tab.c"
+#line 9255 "mrbgems/mruby-compiler/core/y.tab.c"
break;
case 484:
-#line 3511 "mrbgems/mruby-compiler/core/parse.y"
+#line 3515 "mrbgems/mruby-compiler/core/parse.y"
{
assignable(p, (yyvsp[0].nd));
}
-#line 9259 "mrbgems/mruby-compiler/core/y.tab.c"
+#line 9263 "mrbgems/mruby-compiler/core/y.tab.c"
break;
case 485:
-#line 3515 "mrbgems/mruby-compiler/core/parse.y"
+#line 3519 "mrbgems/mruby-compiler/core/parse.y"
{
yyerror(p, "can't assign to numbered parameter");
}
-#line 9267 "mrbgems/mruby-compiler/core/y.tab.c"
+#line 9271 "mrbgems/mruby-compiler/core/y.tab.c"
break;
case 486:
-#line 3521 "mrbgems/mruby-compiler/core/parse.y"
+#line 3525 "mrbgems/mruby-compiler/core/parse.y"
{
(yyval.nd) = var_reference(p, (yyvsp[0].nd));
}
-#line 9275 "mrbgems/mruby-compiler/core/y.tab.c"
+#line 9279 "mrbgems/mruby-compiler/core/y.tab.c"
break;
case 487:
-#line 3525 "mrbgems/mruby-compiler/core/parse.y"
+#line 3529 "mrbgems/mruby-compiler/core/parse.y"
{
(yyval.nd) = new_nil(p);
}
-#line 9283 "mrbgems/mruby-compiler/core/y.tab.c"
+#line 9287 "mrbgems/mruby-compiler/core/y.tab.c"
break;
case 488:
-#line 3529 "mrbgems/mruby-compiler/core/parse.y"
+#line 3533 "mrbgems/mruby-compiler/core/parse.y"
{
(yyval.nd) = new_self(p);
}
-#line 9291 "mrbgems/mruby-compiler/core/y.tab.c"
+#line 9295 "mrbgems/mruby-compiler/core/y.tab.c"
break;
case 489:
-#line 3533 "mrbgems/mruby-compiler/core/parse.y"
+#line 3537 "mrbgems/mruby-compiler/core/parse.y"
{
(yyval.nd) = new_true(p);
}
-#line 9299 "mrbgems/mruby-compiler/core/y.tab.c"
+#line 9303 "mrbgems/mruby-compiler/core/y.tab.c"
break;
case 490:
-#line 3537 "mrbgems/mruby-compiler/core/parse.y"
+#line 3541 "mrbgems/mruby-compiler/core/parse.y"
{
(yyval.nd) = new_false(p);
}
-#line 9307 "mrbgems/mruby-compiler/core/y.tab.c"
+#line 9311 "mrbgems/mruby-compiler/core/y.tab.c"
break;
case 491:
-#line 3541 "mrbgems/mruby-compiler/core/parse.y"
+#line 3545 "mrbgems/mruby-compiler/core/parse.y"
{
const char *fn = mrb_sym_name_len(p->mrb, p->filename_sym, NULL);
if (!fn) {
@@ -9315,22 +9319,22 @@ yyreduce:
}
(yyval.nd) = new_str(p, fn, strlen(fn));
}
-#line 9319 "mrbgems/mruby-compiler/core/y.tab.c"
+#line 9323 "mrbgems/mruby-compiler/core/y.tab.c"
break;
case 492:
-#line 3549 "mrbgems/mruby-compiler/core/parse.y"
+#line 3553 "mrbgems/mruby-compiler/core/parse.y"
{
char buf[16];
dump_int(p->lineno, buf);
(yyval.nd) = new_int(p, buf, 10, 0);
}
-#line 9330 "mrbgems/mruby-compiler/core/y.tab.c"
+#line 9334 "mrbgems/mruby-compiler/core/y.tab.c"
break;
case 493:
-#line 3556 "mrbgems/mruby-compiler/core/parse.y"
+#line 3560 "mrbgems/mruby-compiler/core/parse.y"
{
#ifdef MRB_UTF8_STRING
const char *enc = "UTF-8";
@@ -9339,46 +9343,46 @@ yyreduce:
#endif
(yyval.nd) = new_str(p, enc, strlen(enc));
}
-#line 9343 "mrbgems/mruby-compiler/core/y.tab.c"
+#line 9347 "mrbgems/mruby-compiler/core/y.tab.c"
break;
case 496:
-#line 3571 "mrbgems/mruby-compiler/core/parse.y"
+#line 3575 "mrbgems/mruby-compiler/core/parse.y"
{
(yyval.nd) = 0;
}
-#line 9351 "mrbgems/mruby-compiler/core/y.tab.c"
+#line 9355 "mrbgems/mruby-compiler/core/y.tab.c"
break;
case 497:
-#line 3575 "mrbgems/mruby-compiler/core/parse.y"
+#line 3579 "mrbgems/mruby-compiler/core/parse.y"
{
p->lstate = EXPR_BEG;
p->cmd_start = TRUE;
}
-#line 9360 "mrbgems/mruby-compiler/core/y.tab.c"
+#line 9364 "mrbgems/mruby-compiler/core/y.tab.c"
break;
case 498:
-#line 3580 "mrbgems/mruby-compiler/core/parse.y"
+#line 3584 "mrbgems/mruby-compiler/core/parse.y"
{
(yyval.nd) = (yyvsp[-1].nd);
}
-#line 9368 "mrbgems/mruby-compiler/core/y.tab.c"
+#line 9372 "mrbgems/mruby-compiler/core/y.tab.c"
break;
case 501:
-#line 3596 "mrbgems/mruby-compiler/core/parse.y"
+#line 3600 "mrbgems/mruby-compiler/core/parse.y"
{
(yyval.nd) = (yyvsp[-1].nd);
p->lstate = EXPR_BEG;
p->cmd_start = TRUE;
}
-#line 9378 "mrbgems/mruby-compiler/core/y.tab.c"
+#line 9382 "mrbgems/mruby-compiler/core/y.tab.c"
break;
case 502:
-#line 3602 "mrbgems/mruby-compiler/core/parse.y"
+#line 3606 "mrbgems/mruby-compiler/core/parse.y"
{
#if 1
/* til real keyword args implemented */
@@ -9396,11 +9400,11 @@ yyreduce:
new_args_tail(p, 0, new_kw_rest_args(p, nsym(k)), b));
#endif
}
-#line 9400 "mrbgems/mruby-compiler/core/y.tab.c"
+#line 9404 "mrbgems/mruby-compiler/core/y.tab.c"
break;
case 503:
-#line 3620 "mrbgems/mruby-compiler/core/parse.y"
+#line 3624 "mrbgems/mruby-compiler/core/parse.y"
{
#if 1
/* til real keyword args implemented */
@@ -9418,504 +9422,504 @@ yyreduce:
new_args_tail(p, 0, new_kw_rest_args(p, nsym(k)), b));
#endif
}
-#line 9422 "mrbgems/mruby-compiler/core/y.tab.c"
+#line 9426 "mrbgems/mruby-compiler/core/y.tab.c"
break;
case 505:
-#line 3641 "mrbgems/mruby-compiler/core/parse.y"
+#line 3645 "mrbgems/mruby-compiler/core/parse.y"
{
(yyval.nd) = (yyvsp[-1].nd);
}
-#line 9430 "mrbgems/mruby-compiler/core/y.tab.c"
+#line 9434 "mrbgems/mruby-compiler/core/y.tab.c"
break;
case 506:
-#line 3647 "mrbgems/mruby-compiler/core/parse.y"
+#line 3651 "mrbgems/mruby-compiler/core/parse.y"
{
local_nest(p);
}
-#line 9438 "mrbgems/mruby-compiler/core/y.tab.c"
+#line 9442 "mrbgems/mruby-compiler/core/y.tab.c"
break;
case 507:
-#line 3653 "mrbgems/mruby-compiler/core/parse.y"
+#line 3657 "mrbgems/mruby-compiler/core/parse.y"
{
void_expr_error(p, (yyvsp[0].nd));
(yyval.nd) = new_kw_arg(p, (yyvsp[-1].id), cons((yyvsp[0].nd), locals_node(p)));
local_unnest(p);
}
-#line 9448 "mrbgems/mruby-compiler/core/y.tab.c"
+#line 9452 "mrbgems/mruby-compiler/core/y.tab.c"
break;
case 508:
-#line 3659 "mrbgems/mruby-compiler/core/parse.y"
+#line 3663 "mrbgems/mruby-compiler/core/parse.y"
{
(yyval.nd) = new_kw_arg(p, (yyvsp[0].id), 0);
local_unnest(p);
}
-#line 9457 "mrbgems/mruby-compiler/core/y.tab.c"
+#line 9461 "mrbgems/mruby-compiler/core/y.tab.c"
break;
case 509:
-#line 3666 "mrbgems/mruby-compiler/core/parse.y"
+#line 3670 "mrbgems/mruby-compiler/core/parse.y"
{
(yyval.nd) = new_kw_arg(p, (yyvsp[-1].id), cons((yyvsp[0].nd), locals_node(p)));
local_unnest(p);
}
-#line 9466 "mrbgems/mruby-compiler/core/y.tab.c"
+#line 9470 "mrbgems/mruby-compiler/core/y.tab.c"
break;
case 510:
-#line 3671 "mrbgems/mruby-compiler/core/parse.y"
+#line 3675 "mrbgems/mruby-compiler/core/parse.y"
{
(yyval.nd) = new_kw_arg(p, (yyvsp[0].id), 0);
local_unnest(p);
}
-#line 9475 "mrbgems/mruby-compiler/core/y.tab.c"
+#line 9479 "mrbgems/mruby-compiler/core/y.tab.c"
break;
case 511:
-#line 3678 "mrbgems/mruby-compiler/core/parse.y"
+#line 3682 "mrbgems/mruby-compiler/core/parse.y"
{
(yyval.nd) = list1((yyvsp[0].nd));
}
-#line 9483 "mrbgems/mruby-compiler/core/y.tab.c"
+#line 9487 "mrbgems/mruby-compiler/core/y.tab.c"
break;
case 512:
-#line 3682 "mrbgems/mruby-compiler/core/parse.y"
+#line 3686 "mrbgems/mruby-compiler/core/parse.y"
{
(yyval.nd) = push((yyvsp[-2].nd), (yyvsp[0].nd));
}
-#line 9491 "mrbgems/mruby-compiler/core/y.tab.c"
+#line 9495 "mrbgems/mruby-compiler/core/y.tab.c"
break;
case 513:
-#line 3688 "mrbgems/mruby-compiler/core/parse.y"
+#line 3692 "mrbgems/mruby-compiler/core/parse.y"
{
(yyval.nd) = list1((yyvsp[0].nd));
}
-#line 9499 "mrbgems/mruby-compiler/core/y.tab.c"
+#line 9503 "mrbgems/mruby-compiler/core/y.tab.c"
break;
case 514:
-#line 3692 "mrbgems/mruby-compiler/core/parse.y"
+#line 3696 "mrbgems/mruby-compiler/core/parse.y"
{
(yyval.nd) = push((yyvsp[-2].nd), (yyvsp[0].nd));
}
-#line 9507 "mrbgems/mruby-compiler/core/y.tab.c"
+#line 9511 "mrbgems/mruby-compiler/core/y.tab.c"
break;
case 517:
-#line 3702 "mrbgems/mruby-compiler/core/parse.y"
+#line 3706 "mrbgems/mruby-compiler/core/parse.y"
{
(yyval.nd) = new_kw_rest_args(p, nsym((yyvsp[0].id)));
}
-#line 9515 "mrbgems/mruby-compiler/core/y.tab.c"
+#line 9519 "mrbgems/mruby-compiler/core/y.tab.c"
break;
case 518:
-#line 3706 "mrbgems/mruby-compiler/core/parse.y"
+#line 3710 "mrbgems/mruby-compiler/core/parse.y"
{
(yyval.nd) = new_kw_rest_args(p, 0);
}
-#line 9523 "mrbgems/mruby-compiler/core/y.tab.c"
+#line 9527 "mrbgems/mruby-compiler/core/y.tab.c"
break;
case 519:
-#line 3712 "mrbgems/mruby-compiler/core/parse.y"
+#line 3716 "mrbgems/mruby-compiler/core/parse.y"
{
(yyval.nd) = new_args_tail(p, (yyvsp[-3].nd), (yyvsp[-1].nd), (yyvsp[0].id));
}
-#line 9531 "mrbgems/mruby-compiler/core/y.tab.c"
+#line 9535 "mrbgems/mruby-compiler/core/y.tab.c"
break;
case 520:
-#line 3716 "mrbgems/mruby-compiler/core/parse.y"
+#line 3720 "mrbgems/mruby-compiler/core/parse.y"
{
(yyval.nd) = new_args_tail(p, (yyvsp[-1].nd), 0, (yyvsp[0].id));
}
-#line 9539 "mrbgems/mruby-compiler/core/y.tab.c"
+#line 9543 "mrbgems/mruby-compiler/core/y.tab.c"
break;
case 521:
-#line 3720 "mrbgems/mruby-compiler/core/parse.y"
+#line 3724 "mrbgems/mruby-compiler/core/parse.y"
{
(yyval.nd) = new_args_tail(p, 0, (yyvsp[-1].nd), (yyvsp[0].id));
}
-#line 9547 "mrbgems/mruby-compiler/core/y.tab.c"
+#line 9551 "mrbgems/mruby-compiler/core/y.tab.c"
break;
case 522:
-#line 3724 "mrbgems/mruby-compiler/core/parse.y"
+#line 3728 "mrbgems/mruby-compiler/core/parse.y"
{
(yyval.nd) = new_args_tail(p, 0, 0, (yyvsp[0].id));
}
-#line 9555 "mrbgems/mruby-compiler/core/y.tab.c"
+#line 9559 "mrbgems/mruby-compiler/core/y.tab.c"
break;
case 523:
-#line 3730 "mrbgems/mruby-compiler/core/parse.y"
+#line 3734 "mrbgems/mruby-compiler/core/parse.y"
{
(yyval.nd) = (yyvsp[0].nd);
}
-#line 9563 "mrbgems/mruby-compiler/core/y.tab.c"
+#line 9567 "mrbgems/mruby-compiler/core/y.tab.c"
break;
case 524:
-#line 3734 "mrbgems/mruby-compiler/core/parse.y"
+#line 3738 "mrbgems/mruby-compiler/core/parse.y"
{
(yyval.nd) = new_args_tail(p, 0, 0, 0);
}
-#line 9571 "mrbgems/mruby-compiler/core/y.tab.c"
+#line 9575 "mrbgems/mruby-compiler/core/y.tab.c"
break;
case 525:
-#line 3740 "mrbgems/mruby-compiler/core/parse.y"
+#line 3744 "mrbgems/mruby-compiler/core/parse.y"
{
(yyval.nd) = new_args(p, (yyvsp[-5].nd), (yyvsp[-3].nd), (yyvsp[-1].id), 0, (yyvsp[0].nd));
}
-#line 9579 "mrbgems/mruby-compiler/core/y.tab.c"
+#line 9583 "mrbgems/mruby-compiler/core/y.tab.c"
break;
case 526:
-#line 3744 "mrbgems/mruby-compiler/core/parse.y"
+#line 3748 "mrbgems/mruby-compiler/core/parse.y"
{
(yyval.nd) = new_args(p, (yyvsp[-7].nd), (yyvsp[-5].nd), (yyvsp[-3].id), (yyvsp[-1].nd), (yyvsp[0].nd));
}
-#line 9587 "mrbgems/mruby-compiler/core/y.tab.c"
+#line 9591 "mrbgems/mruby-compiler/core/y.tab.c"
break;
case 527:
-#line 3748 "mrbgems/mruby-compiler/core/parse.y"
+#line 3752 "mrbgems/mruby-compiler/core/parse.y"
{
(yyval.nd) = new_args(p, (yyvsp[-3].nd), (yyvsp[-1].nd), 0, 0, (yyvsp[0].nd));
}
-#line 9595 "mrbgems/mruby-compiler/core/y.tab.c"
+#line 9599 "mrbgems/mruby-compiler/core/y.tab.c"
break;
case 528:
-#line 3752 "mrbgems/mruby-compiler/core/parse.y"
+#line 3756 "mrbgems/mruby-compiler/core/parse.y"
{
(yyval.nd) = new_args(p, (yyvsp[-5].nd), (yyvsp[-3].nd), 0, (yyvsp[-1].nd), (yyvsp[0].nd));
}
-#line 9603 "mrbgems/mruby-compiler/core/y.tab.c"
+#line 9607 "mrbgems/mruby-compiler/core/y.tab.c"
break;
case 529:
-#line 3756 "mrbgems/mruby-compiler/core/parse.y"
+#line 3760 "mrbgems/mruby-compiler/core/parse.y"
{
(yyval.nd) = new_args(p, (yyvsp[-3].nd), 0, (yyvsp[-1].id), 0, (yyvsp[0].nd));
}
-#line 9611 "mrbgems/mruby-compiler/core/y.tab.c"
+#line 9615 "mrbgems/mruby-compiler/core/y.tab.c"
break;
case 530:
-#line 3760 "mrbgems/mruby-compiler/core/parse.y"
+#line 3764 "mrbgems/mruby-compiler/core/parse.y"
{
(yyval.nd) = new_args(p, (yyvsp[-5].nd), 0, (yyvsp[-3].id), (yyvsp[-1].nd), (yyvsp[0].nd));
}
-#line 9619 "mrbgems/mruby-compiler/core/y.tab.c"
+#line 9623 "mrbgems/mruby-compiler/core/y.tab.c"
break;
case 531:
-#line 3764 "mrbgems/mruby-compiler/core/parse.y"
+#line 3768 "mrbgems/mruby-compiler/core/parse.y"
{
(yyval.nd) = new_args(p, (yyvsp[-1].nd), 0, 0, 0, (yyvsp[0].nd));
}
-#line 9627 "mrbgems/mruby-compiler/core/y.tab.c"
+#line 9631 "mrbgems/mruby-compiler/core/y.tab.c"
break;
case 532:
-#line 3768 "mrbgems/mruby-compiler/core/parse.y"
+#line 3772 "mrbgems/mruby-compiler/core/parse.y"
{
(yyval.nd) = new_args(p, 0, (yyvsp[-3].nd), (yyvsp[-1].id), 0, (yyvsp[0].nd));
}
-#line 9635 "mrbgems/mruby-compiler/core/y.tab.c"
+#line 9639 "mrbgems/mruby-compiler/core/y.tab.c"
break;
case 533:
-#line 3772 "mrbgems/mruby-compiler/core/parse.y"
+#line 3776 "mrbgems/mruby-compiler/core/parse.y"
{
(yyval.nd) = new_args(p, 0, (yyvsp[-5].nd), (yyvsp[-3].id), (yyvsp[-1].nd), (yyvsp[0].nd));
}
-#line 9643 "mrbgems/mruby-compiler/core/y.tab.c"
+#line 9647 "mrbgems/mruby-compiler/core/y.tab.c"
break;
case 534:
-#line 3776 "mrbgems/mruby-compiler/core/parse.y"
+#line 3780 "mrbgems/mruby-compiler/core/parse.y"
{
(yyval.nd) = new_args(p, 0, (yyvsp[-1].nd), 0, 0, (yyvsp[0].nd));
}
-#line 9651 "mrbgems/mruby-compiler/core/y.tab.c"
+#line 9655 "mrbgems/mruby-compiler/core/y.tab.c"
break;
case 535:
-#line 3780 "mrbgems/mruby-compiler/core/parse.y"
+#line 3784 "mrbgems/mruby-compiler/core/parse.y"
{
(yyval.nd) = new_args(p, 0, (yyvsp[-3].nd), 0, (yyvsp[-1].nd), (yyvsp[0].nd));
}
-#line 9659 "mrbgems/mruby-compiler/core/y.tab.c"
+#line 9663 "mrbgems/mruby-compiler/core/y.tab.c"
break;
case 536:
-#line 3784 "mrbgems/mruby-compiler/core/parse.y"
+#line 3788 "mrbgems/mruby-compiler/core/parse.y"
{
(yyval.nd) = new_args(p, 0, 0, (yyvsp[-1].id), 0, (yyvsp[0].nd));
}
-#line 9667 "mrbgems/mruby-compiler/core/y.tab.c"
+#line 9671 "mrbgems/mruby-compiler/core/y.tab.c"
break;
case 537:
-#line 3788 "mrbgems/mruby-compiler/core/parse.y"
+#line 3792 "mrbgems/mruby-compiler/core/parse.y"
{
(yyval.nd) = new_args(p, 0, 0, (yyvsp[-3].id), (yyvsp[-1].nd), (yyvsp[0].nd));
}
-#line 9675 "mrbgems/mruby-compiler/core/y.tab.c"
+#line 9679 "mrbgems/mruby-compiler/core/y.tab.c"
break;
case 538:
-#line 3792 "mrbgems/mruby-compiler/core/parse.y"
+#line 3796 "mrbgems/mruby-compiler/core/parse.y"
{
(yyval.nd) = new_args(p, 0, 0, 0, 0, (yyvsp[0].nd));
}
-#line 9683 "mrbgems/mruby-compiler/core/y.tab.c"
+#line 9687 "mrbgems/mruby-compiler/core/y.tab.c"
break;
case 539:
-#line 3796 "mrbgems/mruby-compiler/core/parse.y"
+#line 3800 "mrbgems/mruby-compiler/core/parse.y"
{
local_add_f(p, intern_op(and));
(yyval.nd) = new_args(p, 0, 0, 0, 0, 0);
}
-#line 9692 "mrbgems/mruby-compiler/core/y.tab.c"
+#line 9696 "mrbgems/mruby-compiler/core/y.tab.c"
break;
case 540:
-#line 3803 "mrbgems/mruby-compiler/core/parse.y"
+#line 3807 "mrbgems/mruby-compiler/core/parse.y"
{
yyerror(p, "formal argument cannot be a constant");
(yyval.nd) = 0;
}
-#line 9701 "mrbgems/mruby-compiler/core/y.tab.c"
+#line 9705 "mrbgems/mruby-compiler/core/y.tab.c"
break;
case 541:
-#line 3808 "mrbgems/mruby-compiler/core/parse.y"
+#line 3812 "mrbgems/mruby-compiler/core/parse.y"
{
yyerror(p, "formal argument cannot be an instance variable");
(yyval.nd) = 0;
}
-#line 9710 "mrbgems/mruby-compiler/core/y.tab.c"
+#line 9714 "mrbgems/mruby-compiler/core/y.tab.c"
break;
case 542:
-#line 3813 "mrbgems/mruby-compiler/core/parse.y"
+#line 3817 "mrbgems/mruby-compiler/core/parse.y"
{
yyerror(p, "formal argument cannot be a global variable");
(yyval.nd) = 0;
}
-#line 9719 "mrbgems/mruby-compiler/core/y.tab.c"
+#line 9723 "mrbgems/mruby-compiler/core/y.tab.c"
break;
case 543:
-#line 3818 "mrbgems/mruby-compiler/core/parse.y"
+#line 3822 "mrbgems/mruby-compiler/core/parse.y"
{
yyerror(p, "formal argument cannot be a class variable");
(yyval.nd) = 0;
}
-#line 9728 "mrbgems/mruby-compiler/core/y.tab.c"
+#line 9732 "mrbgems/mruby-compiler/core/y.tab.c"
break;
case 544:
-#line 3823 "mrbgems/mruby-compiler/core/parse.y"
+#line 3827 "mrbgems/mruby-compiler/core/parse.y"
{
yyerror(p, "formal argument cannot be a numbered parameter");
(yyval.nd) = 0;
}
-#line 9737 "mrbgems/mruby-compiler/core/y.tab.c"
+#line 9741 "mrbgems/mruby-compiler/core/y.tab.c"
break;
case 545:
-#line 3830 "mrbgems/mruby-compiler/core/parse.y"
+#line 3834 "mrbgems/mruby-compiler/core/parse.y"
{
(yyval.id) = 0;
}
-#line 9745 "mrbgems/mruby-compiler/core/y.tab.c"
+#line 9749 "mrbgems/mruby-compiler/core/y.tab.c"
break;
case 546:
-#line 3834 "mrbgems/mruby-compiler/core/parse.y"
+#line 3838 "mrbgems/mruby-compiler/core/parse.y"
{
local_add_f(p, (yyvsp[0].id));
(yyval.id) = (yyvsp[0].id);
}
-#line 9754 "mrbgems/mruby-compiler/core/y.tab.c"
+#line 9758 "mrbgems/mruby-compiler/core/y.tab.c"
break;
case 547:
-#line 3841 "mrbgems/mruby-compiler/core/parse.y"
+#line 3845 "mrbgems/mruby-compiler/core/parse.y"
{
(yyval.nd) = new_arg(p, (yyvsp[0].id));
}
-#line 9762 "mrbgems/mruby-compiler/core/y.tab.c"
+#line 9766 "mrbgems/mruby-compiler/core/y.tab.c"
break;
case 548:
-#line 3845 "mrbgems/mruby-compiler/core/parse.y"
+#line 3849 "mrbgems/mruby-compiler/core/parse.y"
{
(yyval.nd) = local_switch(p);
}
-#line 9770 "mrbgems/mruby-compiler/core/y.tab.c"
+#line 9774 "mrbgems/mruby-compiler/core/y.tab.c"
break;
case 549:
-#line 3849 "mrbgems/mruby-compiler/core/parse.y"
+#line 3853 "mrbgems/mruby-compiler/core/parse.y"
{
(yyval.nd) = new_masgn_param(p, (yyvsp[-1].nd), p->locals->car);
local_resume(p, (yyvsp[-2].nd));
local_add_f(p, 0);
}
-#line 9780 "mrbgems/mruby-compiler/core/y.tab.c"
+#line 9784 "mrbgems/mruby-compiler/core/y.tab.c"
break;
case 550:
-#line 3857 "mrbgems/mruby-compiler/core/parse.y"
+#line 3861 "mrbgems/mruby-compiler/core/parse.y"
{
(yyval.nd) = list1((yyvsp[0].nd));
}
-#line 9788 "mrbgems/mruby-compiler/core/y.tab.c"
+#line 9792 "mrbgems/mruby-compiler/core/y.tab.c"
break;
case 551:
-#line 3861 "mrbgems/mruby-compiler/core/parse.y"
+#line 3865 "mrbgems/mruby-compiler/core/parse.y"
{
(yyval.nd) = push((yyvsp[-2].nd), (yyvsp[0].nd));
}
-#line 9796 "mrbgems/mruby-compiler/core/y.tab.c"
+#line 9800 "mrbgems/mruby-compiler/core/y.tab.c"
break;
case 552:
-#line 3867 "mrbgems/mruby-compiler/core/parse.y"
+#line 3871 "mrbgems/mruby-compiler/core/parse.y"
{
local_add_f(p, (yyvsp[-1].id));
local_nest(p);
(yyval.id) = (yyvsp[-1].id);
}
-#line 9806 "mrbgems/mruby-compiler/core/y.tab.c"
+#line 9810 "mrbgems/mruby-compiler/core/y.tab.c"
break;
case 553:
-#line 3875 "mrbgems/mruby-compiler/core/parse.y"
+#line 3879 "mrbgems/mruby-compiler/core/parse.y"
{
void_expr_error(p, (yyvsp[0].nd));
(yyval.nd) = cons(nsym((yyvsp[-1].id)), cons((yyvsp[0].nd), locals_node(p)));
local_unnest(p);
}
-#line 9816 "mrbgems/mruby-compiler/core/y.tab.c"
+#line 9820 "mrbgems/mruby-compiler/core/y.tab.c"
break;
case 554:
-#line 3883 "mrbgems/mruby-compiler/core/parse.y"
+#line 3887 "mrbgems/mruby-compiler/core/parse.y"
{
void_expr_error(p, (yyvsp[0].nd));
(yyval.nd) = cons(nsym((yyvsp[-1].id)), cons((yyvsp[0].nd), locals_node(p)));
local_unnest(p);
}
-#line 9826 "mrbgems/mruby-compiler/core/y.tab.c"
+#line 9830 "mrbgems/mruby-compiler/core/y.tab.c"
break;
case 555:
-#line 3891 "mrbgems/mruby-compiler/core/parse.y"
+#line 3895 "mrbgems/mruby-compiler/core/parse.y"
{
(yyval.nd) = list1((yyvsp[0].nd));
}
-#line 9834 "mrbgems/mruby-compiler/core/y.tab.c"
+#line 9838 "mrbgems/mruby-compiler/core/y.tab.c"
break;
case 556:
-#line 3895 "mrbgems/mruby-compiler/core/parse.y"
+#line 3899 "mrbgems/mruby-compiler/core/parse.y"
{
(yyval.nd) = push((yyvsp[-2].nd), (yyvsp[0].nd));
}
-#line 9842 "mrbgems/mruby-compiler/core/y.tab.c"
+#line 9846 "mrbgems/mruby-compiler/core/y.tab.c"
break;
case 557:
-#line 3901 "mrbgems/mruby-compiler/core/parse.y"
+#line 3905 "mrbgems/mruby-compiler/core/parse.y"
{
(yyval.nd) = list1((yyvsp[0].nd));
}
-#line 9850 "mrbgems/mruby-compiler/core/y.tab.c"
+#line 9854 "mrbgems/mruby-compiler/core/y.tab.c"
break;
case 558:
-#line 3905 "mrbgems/mruby-compiler/core/parse.y"
+#line 3909 "mrbgems/mruby-compiler/core/parse.y"
{
(yyval.nd) = push((yyvsp[-2].nd), (yyvsp[0].nd));
}
-#line 9858 "mrbgems/mruby-compiler/core/y.tab.c"
+#line 9862 "mrbgems/mruby-compiler/core/y.tab.c"
break;
case 561:
-#line 3915 "mrbgems/mruby-compiler/core/parse.y"
+#line 3919 "mrbgems/mruby-compiler/core/parse.y"
{
local_add_f(p, (yyvsp[0].id));
(yyval.id) = (yyvsp[0].id);
}
-#line 9867 "mrbgems/mruby-compiler/core/y.tab.c"
+#line 9871 "mrbgems/mruby-compiler/core/y.tab.c"
break;
case 562:
-#line 3920 "mrbgems/mruby-compiler/core/parse.y"
+#line 3924 "mrbgems/mruby-compiler/core/parse.y"
{
local_add_f(p, intern_op(mul));
(yyval.id) = -1;
}
-#line 9876 "mrbgems/mruby-compiler/core/y.tab.c"
+#line 9880 "mrbgems/mruby-compiler/core/y.tab.c"
break;
case 565:
-#line 3931 "mrbgems/mruby-compiler/core/parse.y"
+#line 3935 "mrbgems/mruby-compiler/core/parse.y"
{
(yyval.id) = (yyvsp[0].id);
}
-#line 9884 "mrbgems/mruby-compiler/core/y.tab.c"
+#line 9888 "mrbgems/mruby-compiler/core/y.tab.c"
break;
case 566:
-#line 3937 "mrbgems/mruby-compiler/core/parse.y"
+#line 3941 "mrbgems/mruby-compiler/core/parse.y"
{
(yyval.id) = (yyvsp[0].id);
}
-#line 9892 "mrbgems/mruby-compiler/core/y.tab.c"
+#line 9896 "mrbgems/mruby-compiler/core/y.tab.c"
break;
case 567:
-#line 3941 "mrbgems/mruby-compiler/core/parse.y"
+#line 3945 "mrbgems/mruby-compiler/core/parse.y"
{
(yyval.id) = 0;
}
-#line 9900 "mrbgems/mruby-compiler/core/y.tab.c"
+#line 9904 "mrbgems/mruby-compiler/core/y.tab.c"
break;
case 568:
-#line 3947 "mrbgems/mruby-compiler/core/parse.y"
+#line 3951 "mrbgems/mruby-compiler/core/parse.y"
{
(yyval.nd) = (yyvsp[0].nd);
if (!(yyval.nd)) (yyval.nd) = new_nil(p);
}
-#line 9909 "mrbgems/mruby-compiler/core/y.tab.c"
+#line 9913 "mrbgems/mruby-compiler/core/y.tab.c"
break;
case 569:
-#line 3951 "mrbgems/mruby-compiler/core/parse.y"
+#line 3955 "mrbgems/mruby-compiler/core/parse.y"
{p->lstate = EXPR_BEG;}
-#line 9915 "mrbgems/mruby-compiler/core/y.tab.c"
+#line 9919 "mrbgems/mruby-compiler/core/y.tab.c"
break;
case 570:
-#line 3952 "mrbgems/mruby-compiler/core/parse.y"
+#line 3956 "mrbgems/mruby-compiler/core/parse.y"
{
if ((yyvsp[-1].nd) == 0) {
yyerror(p, "can't define singleton method for ().");
@@ -9938,55 +9942,55 @@ yyreduce:
}
(yyval.nd) = (yyvsp[-1].nd);
}
-#line 9942 "mrbgems/mruby-compiler/core/y.tab.c"
+#line 9946 "mrbgems/mruby-compiler/core/y.tab.c"
break;
case 572:
-#line 3978 "mrbgems/mruby-compiler/core/parse.y"
+#line 3982 "mrbgems/mruby-compiler/core/parse.y"
{
(yyval.nd) = (yyvsp[-1].nd);
}
-#line 9950 "mrbgems/mruby-compiler/core/y.tab.c"
+#line 9954 "mrbgems/mruby-compiler/core/y.tab.c"
break;
case 573:
-#line 3984 "mrbgems/mruby-compiler/core/parse.y"
+#line 3988 "mrbgems/mruby-compiler/core/parse.y"
{
(yyval.nd) = list1((yyvsp[0].nd));
NODE_LINENO((yyval.nd), (yyvsp[0].nd));
}
-#line 9959 "mrbgems/mruby-compiler/core/y.tab.c"
+#line 9963 "mrbgems/mruby-compiler/core/y.tab.c"
break;
case 574:
-#line 3989 "mrbgems/mruby-compiler/core/parse.y"
+#line 3993 "mrbgems/mruby-compiler/core/parse.y"
{
(yyval.nd) = push((yyvsp[-2].nd), (yyvsp[0].nd));
}
-#line 9967 "mrbgems/mruby-compiler/core/y.tab.c"
+#line 9971 "mrbgems/mruby-compiler/core/y.tab.c"
break;
case 577:
-#line 3999 "mrbgems/mruby-compiler/core/parse.y"
+#line 4003 "mrbgems/mruby-compiler/core/parse.y"
{
void_expr_error(p, (yyvsp[-2].nd));
void_expr_error(p, (yyvsp[0].nd));
(yyval.nd) = cons((yyvsp[-2].nd), (yyvsp[0].nd));
}
-#line 9977 "mrbgems/mruby-compiler/core/y.tab.c"
+#line 9981 "mrbgems/mruby-compiler/core/y.tab.c"
break;
case 578:
-#line 4005 "mrbgems/mruby-compiler/core/parse.y"
+#line 4009 "mrbgems/mruby-compiler/core/parse.y"
{
void_expr_error(p, (yyvsp[0].nd));
(yyval.nd) = cons(new_sym(p, (yyvsp[-2].id)), (yyvsp[0].nd));
}
-#line 9986 "mrbgems/mruby-compiler/core/y.tab.c"
+#line 9990 "mrbgems/mruby-compiler/core/y.tab.c"
break;
case 579:
-#line 4010 "mrbgems/mruby-compiler/core/parse.y"
+#line 4014 "mrbgems/mruby-compiler/core/parse.y"
{
void_expr_error(p, (yyvsp[0].nd));
if (typen((yyvsp[-2].nd)->car) == NODE_DSTR) {
@@ -9996,67 +10000,67 @@ yyreduce:
(yyval.nd) = cons(new_sym(p, new_strsym(p, (yyvsp[-2].nd))), (yyvsp[0].nd));
}
}
-#line 10000 "mrbgems/mruby-compiler/core/y.tab.c"
+#line 10004 "mrbgems/mruby-compiler/core/y.tab.c"
break;
case 580:
-#line 4020 "mrbgems/mruby-compiler/core/parse.y"
+#line 4024 "mrbgems/mruby-compiler/core/parse.y"
{
void_expr_error(p, (yyvsp[0].nd));
(yyval.nd) = cons(new_kw_rest_args(p, 0), (yyvsp[0].nd));
}
-#line 10009 "mrbgems/mruby-compiler/core/y.tab.c"
+#line 10013 "mrbgems/mruby-compiler/core/y.tab.c"
break;
case 593:
-#line 4047 "mrbgems/mruby-compiler/core/parse.y"
+#line 4051 "mrbgems/mruby-compiler/core/parse.y"
{
(yyval.num) = '.';
}
-#line 10017 "mrbgems/mruby-compiler/core/y.tab.c"
+#line 10021 "mrbgems/mruby-compiler/core/y.tab.c"
break;
case 594:
-#line 4051 "mrbgems/mruby-compiler/core/parse.y"
+#line 4055 "mrbgems/mruby-compiler/core/parse.y"
{
(yyval.num) = 0;
}
-#line 10025 "mrbgems/mruby-compiler/core/y.tab.c"
+#line 10029 "mrbgems/mruby-compiler/core/y.tab.c"
break;
case 596:
-#line 4058 "mrbgems/mruby-compiler/core/parse.y"
+#line 4062 "mrbgems/mruby-compiler/core/parse.y"
{
(yyval.num) = tCOLON2;
}
-#line 10033 "mrbgems/mruby-compiler/core/y.tab.c"
+#line 10037 "mrbgems/mruby-compiler/core/y.tab.c"
break;
case 605:
-#line 4079 "mrbgems/mruby-compiler/core/parse.y"
+#line 4083 "mrbgems/mruby-compiler/core/parse.y"
{yyerrok;}
-#line 10039 "mrbgems/mruby-compiler/core/y.tab.c"
+#line 10043 "mrbgems/mruby-compiler/core/y.tab.c"
break;
case 608:
-#line 4085 "mrbgems/mruby-compiler/core/parse.y"
+#line 4089 "mrbgems/mruby-compiler/core/parse.y"
{
p->lineno += (yyvsp[0].num);
p->column = 0;
}
-#line 10048 "mrbgems/mruby-compiler/core/y.tab.c"
+#line 10052 "mrbgems/mruby-compiler/core/y.tab.c"
break;
case 611:
-#line 4096 "mrbgems/mruby-compiler/core/parse.y"
+#line 4100 "mrbgems/mruby-compiler/core/parse.y"
{
(yyval.nd) = 0;
}
-#line 10056 "mrbgems/mruby-compiler/core/y.tab.c"
+#line 10060 "mrbgems/mruby-compiler/core/y.tab.c"
break;
-#line 10060 "mrbgems/mruby-compiler/core/y.tab.c"
+#line 10064 "mrbgems/mruby-compiler/core/y.tab.c"
default: break;
}
@@ -10288,7 +10292,7 @@ yyreturn:
#endif
return yyresult;
}
-#line 4100 "mrbgems/mruby-compiler/core/parse.y"
+#line 4104 "mrbgems/mruby-compiler/core/parse.y"
#define pylval (*((YYSTYPE*)(p->ylval)))

parse.y: fix `nint` (int to node) and `intn` (node to int).