Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mruby
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
mruby
Commits
9e86d204
Unverified
Commit
9e86d204
authored
Sep 12, 2021
by
Yukihiro "Matz" Matsumoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
parse.y: avoid adding zero length strings.
parent
e1a865f2
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
301 additions
and
269 deletions
+301
-269
mrbgems/mruby-compiler/core/parse.y
mrbgems/mruby-compiler/core/parse.y
+20
-4
mrbgems/mruby-compiler/core/y.tab.c
mrbgems/mruby-compiler/core/y.tab.c
+281
-265
No files found.
mrbgems/mruby-compiler/core/parse.y
View file @
9e86d204
...
...
@@ -3305,7 +3305,11 @@ string_fragment : tCHAR
}
| tSTRING_BEG string_rep tSTRING
{
$$ = new_dstr(p, push($2, $3));
node *n = $2;
if (nint($3->cdr->cdr) > 0) {
n = push(n, $3);
}
$$ = new_dstr(p, n);
}
;
...
...
@@ -3347,7 +3351,11 @@ xstring : tXSTRING_BEG tXSTRING
}
| tXSTRING_BEG string_rep tXSTRING
{
$$ = new_dxstr(p, push($2, $3));
node *n = $2;
if (nint($3->cdr->cdr) > 0) {
n = push(n, $3);
}
$$ = new_dxstr(p, n);
}
;
...
...
@@ -3410,7 +3418,11 @@ words : tWORDS_BEG tSTRING
}
| tWORDS_BEG string_rep tSTRING
{
$$ = new_words(p, push($2, $3));
node *n = $2;
if (nint($3->cdr->cdr) > 0) {
n = push(n, $3);
}
$$ = new_words(p, n);
}
;
...
...
@@ -3422,8 +3434,12 @@ symbol : basic_symbol
}
| tSYMBEG tSTRING_BEG string_rep tSTRING
{
node *n = $3;
p->lstate = EXPR_ENDARG;
$$ = new_dsym(p, new_dstr(p, push($3, $4)));
if (nint($4->cdr->cdr) > 0) {
n = push(n, $4);
}
$$ = new_dsym(p, new_dstr(p, n));
}
;
...
...
mrbgems/mruby-compiler/core/y.tab.c
View file @
9e86d204
...
...
@@ -2057,24 +2057,24 @@ static const yytype_int16 yyrline[] =
3183
,
3187
,
3191
,
3195
,
3199
,
3206
,
3205
,
3220
,
3219
,
3235
,
3243
,
3252
,
3255
,
3262
,
3265
,
3269
,
3270
,
3273
,
3277
,
3280
,
3284
,
3287
,
3288
,
3289
,
3290
,
3293
,
3294
,
3300
,
3301
,
3302
,
3306
,
331
2
,
3313
,
3319
,
3324
,
3323
,
3334
,
3338
,
3344
,
3348
,
33
54
,
3358
,
3364
,
3367
,
3368
,
3371
,
3377
,
3383
,
3384
,
3387
,
3
394
,
3393
,
3407
,
3411
,
3418
,
3423
,
3430
,
3436
,
3437
,
3438
,
34
39
,
3440
,
3444
,
3450
,
3454
,
3460
,
3461
,
3462
,
3466
,
3472
,
34
76
,
3480
,
3484
,
3488
,
3494
,
3498
,
3504
,
3508
,
3512
,
3516
,
35
20
,
3524
,
3532
,
3539
,
3550
,
3551
,
3555
,
3559
,
3558
,
3575
,
35
76
,
3579
,
3585
,
3603
,
3623
,
3624
,
3630
,
3636
,
3642
,
3649
,
36
54
,
3661
,
3665
,
3671
,
3675
,
3681
,
3682
,
3685
,
3689
,
3695
,
3
699
,
3703
,
3707
,
3713
,
3718
,
3723
,
3727
,
3731
,
3735
,
3739
,
37
43
,
3747
,
3751
,
3755
,
3759
,
3763
,
3767
,
3771
,
3775
,
3780
,
3
786
,
3791
,
3796
,
3801
,
3806
,
3813
,
3817
,
3824
,
3829
,
3828
,
38
40
,
3844
,
3850
,
3858
,
3866
,
3874
,
3878
,
3884
,
3888
,
3894
,
3
895
,
3898
,
3903
,
3910
,
3911
,
3914
,
3920
,
3924
,
3930
,
3935
,
39
35
,
3960
,
3961
,
3967
,
3972
,
3978
,
3979
,
3982
,
3988
,
3993
,
40
03
,
4010
,
4011
,
4012
,
4015
,
4016
,
4017
,
4018
,
4021
,
4022
,
40
23
,
4026
,
4027
,
4030
,
4034
,
4040
,
4041
,
4047
,
4048
,
4051
,
40
52
,
4055
,
4058
,
4059
,
4060
,
4063
,
4064
,
4065
,
4068
,
4075
,
40
76
,
4080
3306
,
331
6
,
3317
,
3323
,
3328
,
3327
,
3338
,
3342
,
3348
,
3352
,
33
62
,
3366
,
3372
,
3375
,
3376
,
3379
,
3385
,
3391
,
3392
,
3395
,
3
402
,
3401
,
3415
,
3419
,
3430
,
3435
,
3446
,
3452
,
3453
,
3454
,
34
55
,
3456
,
3460
,
3466
,
3470
,
3476
,
3477
,
3478
,
3482
,
3488
,
34
92
,
3496
,
3500
,
3504
,
3510
,
3514
,
3520
,
3524
,
3528
,
3532
,
35
36
,
3540
,
3548
,
3555
,
3566
,
3567
,
3571
,
3575
,
3574
,
3591
,
35
92
,
3595
,
3601
,
3619
,
3639
,
3640
,
3646
,
3652
,
3658
,
3665
,
36
70
,
3677
,
3681
,
3687
,
3691
,
3697
,
3698
,
3701
,
3705
,
3711
,
3
715
,
3719
,
3723
,
3729
,
3734
,
3739
,
3743
,
3747
,
3751
,
3755
,
37
59
,
3763
,
3767
,
3771
,
3775
,
3779
,
3783
,
3787
,
3791
,
3796
,
3
802
,
3807
,
3812
,
3817
,
3822
,
3829
,
3833
,
3840
,
3845
,
3844
,
38
56
,
3860
,
3866
,
3874
,
3882
,
3890
,
3894
,
3900
,
3904
,
3910
,
3
911
,
3914
,
3919
,
3926
,
3927
,
3930
,
3936
,
3940
,
3946
,
3951
,
39
51
,
3976
,
3977
,
3983
,
3988
,
3994
,
3995
,
3998
,
4004
,
4009
,
40
19
,
4026
,
4027
,
4028
,
4031
,
4032
,
4033
,
4034
,
4037
,
4038
,
40
39
,
4042
,
4043
,
4046
,
4050
,
4056
,
4057
,
4063
,
4064
,
4067
,
40
68
,
4071
,
4074
,
4075
,
4076
,
4079
,
4080
,
4081
,
4084
,
4091
,
40
92
,
4096
};
#endif
...
...
@@ -8970,328 +8970,344 @@ yyreduce:
case
440
:
#line 3307 "mrbgems/mruby-compiler/core/parse.y"
{
(
yyval
.
nd
)
=
new_dstr
(
p
,
push
((
yyvsp
[
-
1
].
nd
),
(
yyvsp
[
0
].
nd
)));
node
*
n
=
(
yyvsp
[
-
1
].
nd
);
if
(
nint
((
yyvsp
[
0
].
nd
)
->
cdr
->
cdr
)
>
0
)
{
n
=
push
(
n
,
(
yyvsp
[
0
].
nd
));
}
#line 8976 "mrbgems/mruby-compiler/core/y.tab.c"
(
yyval
.
nd
)
=
new_dstr
(
p
,
n
);
}
#line 8980 "mrbgems/mruby-compiler/core/y.tab.c"
break
;
case
442
:
#line 331
4
"mrbgems/mruby-compiler/core/parse.y"
#line 331
8
"mrbgems/mruby-compiler/core/parse.y"
{
(
yyval
.
nd
)
=
append
((
yyvsp
[
-
1
].
nd
),
(
yyvsp
[
0
].
nd
));
}
#line 898
4
"mrbgems/mruby-compiler/core/y.tab.c"
#line 898
8
"mrbgems/mruby-compiler/core/y.tab.c"
break
;
case
443
:
#line 332
0
"mrbgems/mruby-compiler/core/parse.y"
#line 332
4
"mrbgems/mruby-compiler/core/parse.y"
{
(
yyval
.
nd
)
=
list1
((
yyvsp
[
0
].
nd
));
}
#line 899
2
"mrbgems/mruby-compiler/core/y.tab.c"
#line 899
6
"mrbgems/mruby-compiler/core/y.tab.c"
break
;
case
444
:
#line 332
4
"mrbgems/mruby-compiler/core/parse.y"
#line 332
8
"mrbgems/mruby-compiler/core/parse.y"
{
(
yyval
.
nd
)
=
p
->
lex_strterm
;
p
->
lex_strterm
=
NULL
;
}
#line 900
1
"mrbgems/mruby-compiler/core/y.tab.c"
#line 900
5
"mrbgems/mruby-compiler/core/y.tab.c"
break
;
case
445
:
#line 333
0
"mrbgems/mruby-compiler/core/parse.y"
#line 333
4
"mrbgems/mruby-compiler/core/parse.y"
{
p
->
lex_strterm
=
(
yyvsp
[
-
2
].
nd
);
(
yyval
.
nd
)
=
list2
((
yyvsp
[
-
3
].
nd
),
(
yyvsp
[
-
1
].
nd
));
}
#line 901
0
"mrbgems/mruby-compiler/core/y.tab.c"
#line 901
4
"mrbgems/mruby-compiler/core/y.tab.c"
break
;
case
446
:
#line 333
5
"mrbgems/mruby-compiler/core/parse.y"
#line 333
9
"mrbgems/mruby-compiler/core/parse.y"
{
(
yyval
.
nd
)
=
list1
(
new_literal_delim
(
p
));
}
#line 90
18
"mrbgems/mruby-compiler/core/y.tab.c"
#line 90
22
"mrbgems/mruby-compiler/core/y.tab.c"
break
;
case
447
:
#line 33
39
"mrbgems/mruby-compiler/core/parse.y"
#line 33
43
"mrbgems/mruby-compiler/core/parse.y"
{
(
yyval
.
nd
)
=
list1
(
new_literal_delim
(
p
));
}
#line 90
26
"mrbgems/mruby-compiler/core/y.tab.c"
#line 90
30
"mrbgems/mruby-compiler/core/y.tab.c"
break
;
case
448
:
#line 334
5
"mrbgems/mruby-compiler/core/parse.y"
#line 334
9
"mrbgems/mruby-compiler/core/parse.y"
{
(
yyval
.
nd
)
=
(
yyvsp
[
0
].
nd
);
}
#line 903
4
"mrbgems/mruby-compiler/core/y.tab.c"
#line 903
8
"mrbgems/mruby-compiler/core/y.tab.c"
break
;
case
449
:
#line 33
49
"mrbgems/mruby-compiler/core/parse.y"
#line 33
53
"mrbgems/mruby-compiler/core/parse.y"
{
(
yyval
.
nd
)
=
new_dxstr
(
p
,
push
((
yyvsp
[
-
1
].
nd
),
(
yyvsp
[
0
].
nd
)));
node
*
n
=
(
yyvsp
[
-
1
].
nd
);
if
(
nint
((
yyvsp
[
0
].
nd
)
->
cdr
->
cdr
)
>
0
)
{
n
=
push
(
n
,
(
yyvsp
[
0
].
nd
));
}
(
yyval
.
nd
)
=
new_dxstr
(
p
,
n
);
}
#line 90
42
"mrbgems/mruby-compiler/core/y.tab.c"
#line 90
50
"mrbgems/mruby-compiler/core/y.tab.c"
break
;
case
450
:
#line 33
55
"mrbgems/mruby-compiler/core/parse.y"
#line 33
63
"mrbgems/mruby-compiler/core/parse.y"
{
(
yyval
.
nd
)
=
(
yyvsp
[
0
].
nd
);
}
#line 905
0
"mrbgems/mruby-compiler/core/y.tab.c"
#line 905
8
"mrbgems/mruby-compiler/core/y.tab.c"
break
;
case
451
:
#line 33
59
"mrbgems/mruby-compiler/core/parse.y"
#line 33
67
"mrbgems/mruby-compiler/core/parse.y"
{
(
yyval
.
nd
)
=
new_dregx
(
p
,
(
yyvsp
[
-
1
].
nd
),
(
yyvsp
[
0
].
nd
));
}
#line 90
58
"mrbgems/mruby-compiler/core/y.tab.c"
#line 90
66
"mrbgems/mruby-compiler/core/y.tab.c"
break
;
case
455
:
#line 33
72
"mrbgems/mruby-compiler/core/parse.y"
#line 33
80
"mrbgems/mruby-compiler/core/parse.y"
{
parser_heredoc_info
*
inf
=
parsing_heredoc_inf
(
p
);
inf
->
doc
=
push
(
inf
->
doc
,
new_str
(
p
,
""
,
0
));
heredoc_end
(
p
);
}
#line 90
68
"mrbgems/mruby-compiler/core/y.tab.c"
#line 90
76
"mrbgems/mruby-compiler/core/y.tab.c"
break
;
case
456
:
#line 33
78
"mrbgems/mruby-compiler/core/parse.y"
#line 33
86
"mrbgems/mruby-compiler/core/parse.y"
{
heredoc_end
(
p
);
}
#line 90
76
"mrbgems/mruby-compiler/core/y.tab.c"
#line 90
84
"mrbgems/mruby-compiler/core/y.tab.c"
break
;
case
459
:
#line 33
88
"mrbgems/mruby-compiler/core/parse.y"
#line 33
96
"mrbgems/mruby-compiler/core/parse.y"
{
parser_heredoc_info
*
inf
=
parsing_heredoc_inf
(
p
);
inf
->
doc
=
push
(
inf
->
doc
,
(
yyvsp
[
0
].
nd
));
heredoc_treat_nextline
(
p
);
}
#line 90
86
"mrbgems/mruby-compiler/core/y.tab.c"
#line 90
94
"mrbgems/mruby-compiler/core/y.tab.c"
break
;
case
460
:
#line 3
394
"mrbgems/mruby-compiler/core/parse.y"
#line 3
402
"mrbgems/mruby-compiler/core/parse.y"
{
(
yyval
.
nd
)
=
p
->
lex_strterm
;
p
->
lex_strterm
=
NULL
;
}
#line 9
095
"mrbgems/mruby-compiler/core/y.tab.c"
#line 9
103
"mrbgems/mruby-compiler/core/y.tab.c"
break
;
case
461
:
#line 340
0
"mrbgems/mruby-compiler/core/parse.y"
#line 340
8
"mrbgems/mruby-compiler/core/parse.y"
{
parser_heredoc_info
*
inf
=
parsing_heredoc_inf
(
p
);
p
->
lex_strterm
=
(
yyvsp
[
-
2
].
nd
);
inf
->
doc
=
push
(
push
(
inf
->
doc
,
(
yyvsp
[
-
3
].
nd
)),
(
yyvsp
[
-
1
].
nd
));
}
#line 91
05
"mrbgems/mruby-compiler/core/y.tab.c"
#line 91
13
"mrbgems/mruby-compiler/core/y.tab.c"
break
;
case
462
:
#line 34
08
"mrbgems/mruby-compiler/core/parse.y"
#line 34
16
"mrbgems/mruby-compiler/core/parse.y"
{
(
yyval
.
nd
)
=
new_words
(
p
,
list1
((
yyvsp
[
0
].
nd
)));
}
#line 91
13
"mrbgems/mruby-compiler/core/y.tab.c"
#line 91
21
"mrbgems/mruby-compiler/core/y.tab.c"
break
;
case
463
:
#line 34
12
"mrbgems/mruby-compiler/core/parse.y"
#line 34
20
"mrbgems/mruby-compiler/core/parse.y"
{
(
yyval
.
nd
)
=
new_words
(
p
,
push
((
yyvsp
[
-
1
].
nd
),
(
yyvsp
[
0
].
nd
)));
node
*
n
=
(
yyvsp
[
-
1
].
nd
);
if
(
nint
((
yyvsp
[
0
].
nd
)
->
cdr
->
cdr
)
>
0
)
{
n
=
push
(
n
,
(
yyvsp
[
0
].
nd
));
}
#line 9121 "mrbgems/mruby-compiler/core/y.tab.c"
(
yyval
.
nd
)
=
new_words
(
p
,
n
);
}
#line 9133 "mrbgems/mruby-compiler/core/y.tab.c"
break
;
case
464
:
#line 34
19
"mrbgems/mruby-compiler/core/parse.y"
#line 34
31
"mrbgems/mruby-compiler/core/parse.y"
{
p
->
lstate
=
EXPR_ENDARG
;
(
yyval
.
nd
)
=
new_sym
(
p
,
(
yyvsp
[
0
].
id
));
}
#line 91
30
"mrbgems/mruby-compiler/core/y.tab.c"
#line 91
42
"mrbgems/mruby-compiler/core/y.tab.c"
break
;
case
465
:
#line 34
24
"mrbgems/mruby-compiler/core/parse.y"
#line 34
36
"mrbgems/mruby-compiler/core/parse.y"
{
node
*
n
=
(
yyvsp
[
-
1
].
nd
);
p
->
lstate
=
EXPR_ENDARG
;
(
yyval
.
nd
)
=
new_dsym
(
p
,
new_dstr
(
p
,
push
((
yyvsp
[
-
1
].
nd
),
(
yyvsp
[
0
].
nd
))));
if
(
nint
((
yyvsp
[
0
].
nd
)
->
cdr
->
cdr
)
>
0
)
{
n
=
push
(
n
,
(
yyvsp
[
0
].
nd
));
}
(
yyval
.
nd
)
=
new_dsym
(
p
,
new_dstr
(
p
,
n
));
}
#line 91
39
"mrbgems/mruby-compiler/core/y.tab.c"
#line 91
55
"mrbgems/mruby-compiler/core/y.tab.c"
break
;
case
466
:
#line 34
31
"mrbgems/mruby-compiler/core/parse.y"
#line 34
47
"mrbgems/mruby-compiler/core/parse.y"
{
(
yyval
.
id
)
=
(
yyvsp
[
0
].
id
);
}
#line 91
47
"mrbgems/mruby-compiler/core/y.tab.c"
#line 91
63
"mrbgems/mruby-compiler/core/y.tab.c"
break
;
case
471
:
#line 34
41
"mrbgems/mruby-compiler/core/parse.y"
#line 34
57
"mrbgems/mruby-compiler/core/parse.y"
{
(
yyval
.
id
)
=
new_strsym
(
p
,
(
yyvsp
[
0
].
nd
));
}
#line 91
55
"mrbgems/mruby-compiler/core/y.tab.c"
#line 91
71
"mrbgems/mruby-compiler/core/y.tab.c"
break
;
case
472
:
#line 34
45
"mrbgems/mruby-compiler/core/parse.y"
#line 34
61
"mrbgems/mruby-compiler/core/parse.y"
{
(
yyval
.
id
)
=
new_strsym
(
p
,
(
yyvsp
[
0
].
nd
));
}
#line 91
63
"mrbgems/mruby-compiler/core/y.tab.c"
#line 91
79
"mrbgems/mruby-compiler/core/y.tab.c"
break
;
case
473
:
#line 34
51
"mrbgems/mruby-compiler/core/parse.y"
#line 34
67
"mrbgems/mruby-compiler/core/parse.y"
{
(
yyval
.
nd
)
=
new_symbols
(
p
,
list1
((
yyvsp
[
0
].
nd
)));
}
#line 91
71
"mrbgems/mruby-compiler/core/y.tab.c"
#line 91
87
"mrbgems/mruby-compiler/core/y.tab.c"
break
;
case
474
:
#line 34
55
"mrbgems/mruby-compiler/core/parse.y"
#line 34
71
"mrbgems/mruby-compiler/core/parse.y"
{
(
yyval
.
nd
)
=
new_symbols
(
p
,
push
((
yyvsp
[
-
1
].
nd
),
(
yyvsp
[
0
].
nd
)));
}
#line 91
79
"mrbgems/mruby-compiler/core/y.tab.c"
#line 91
95
"mrbgems/mruby-compiler/core/y.tab.c"
break
;
case
477
:
#line 34
63
"mrbgems/mruby-compiler/core/parse.y"
#line 34
79
"mrbgems/mruby-compiler/core/parse.y"
{
(
yyval
.
nd
)
=
new_negate
(
p
,
(
yyvsp
[
0
].
nd
));
}
#line 9
187
"mrbgems/mruby-compiler/core/y.tab.c"
#line 9
203
"mrbgems/mruby-compiler/core/y.tab.c"
break
;
case
478
:
#line 34
67
"mrbgems/mruby-compiler/core/parse.y"
#line 34
83
"mrbgems/mruby-compiler/core/parse.y"
{
(
yyval
.
nd
)
=
new_negate
(
p
,
(
yyvsp
[
0
].
nd
));
}
#line 9
195
"mrbgems/mruby-compiler/core/y.tab.c"
#line 9
211
"mrbgems/mruby-compiler/core/y.tab.c"
break
;
case
479
:
#line 34
73
"mrbgems/mruby-compiler/core/parse.y"
#line 34
89
"mrbgems/mruby-compiler/core/parse.y"
{
(
yyval
.
nd
)
=
new_lvar
(
p
,
(
yyvsp
[
0
].
id
));
}
#line 92
03
"mrbgems/mruby-compiler/core/y.tab.c"
#line 92
19
"mrbgems/mruby-compiler/core/y.tab.c"
break
;
case
480
:
#line 34
77
"mrbgems/mruby-compiler/core/parse.y"
#line 34
93
"mrbgems/mruby-compiler/core/parse.y"
{
(
yyval
.
nd
)
=
new_ivar
(
p
,
(
yyvsp
[
0
].
id
));
}
#line 92
11
"mrbgems/mruby-compiler/core/y.tab.c"
#line 92
27
"mrbgems/mruby-compiler/core/y.tab.c"
break
;
case
481
:
#line 34
81
"mrbgems/mruby-compiler/core/parse.y"
#line 34
97
"mrbgems/mruby-compiler/core/parse.y"
{
(
yyval
.
nd
)
=
new_gvar
(
p
,
(
yyvsp
[
0
].
id
));
}
#line 92
19
"mrbgems/mruby-compiler/core/y.tab.c"
#line 92
35
"mrbgems/mruby-compiler/core/y.tab.c"
break
;
case
482
:
#line 3
485
"mrbgems/mruby-compiler/core/parse.y"
#line 3
501
"mrbgems/mruby-compiler/core/parse.y"
{
(
yyval
.
nd
)
=
new_cvar
(
p
,
(
yyvsp
[
0
].
id
));
}
#line 92
27
"mrbgems/mruby-compiler/core/y.tab.c"
#line 92
43
"mrbgems/mruby-compiler/core/y.tab.c"
break
;
case
483
:
#line 3
489
"mrbgems/mruby-compiler/core/parse.y"
#line 3
505
"mrbgems/mruby-compiler/core/parse.y"
{
(
yyval
.
nd
)
=
new_const
(
p
,
(
yyvsp
[
0
].
id
));
}
#line 92
35
"mrbgems/mruby-compiler/core/y.tab.c"
#line 92
51
"mrbgems/mruby-compiler/core/y.tab.c"
break
;
case
484
:
#line 3
495
"mrbgems/mruby-compiler/core/parse.y"
#line 3
511
"mrbgems/mruby-compiler/core/parse.y"
{
assignable
(
p
,
(
yyvsp
[
0
].
nd
));
}
#line 92
43
"mrbgems/mruby-compiler/core/y.tab.c"
#line 92
59
"mrbgems/mruby-compiler/core/y.tab.c"
break
;
case
485
:
#line 3
499
"mrbgems/mruby-compiler/core/parse.y"
#line 3
515
"mrbgems/mruby-compiler/core/parse.y"
{
yyerror
(
p
,
"can't assign to numbered parameter"
);
}
#line 92
51
"mrbgems/mruby-compiler/core/y.tab.c"
#line 92
67
"mrbgems/mruby-compiler/core/y.tab.c"
break
;
case
486
:
#line 35
05
"mrbgems/mruby-compiler/core/parse.y"
#line 35
21
"mrbgems/mruby-compiler/core/parse.y"
{
(
yyval
.
nd
)
=
var_reference
(
p
,
(
yyvsp
[
0
].
nd
));
}
#line 92
59
"mrbgems/mruby-compiler/core/y.tab.c"
#line 92
75
"mrbgems/mruby-compiler/core/y.tab.c"
break
;
case
487
:
#line 35
09
"mrbgems/mruby-compiler/core/parse.y"
#line 35
25
"mrbgems/mruby-compiler/core/parse.y"
{
(
yyval
.
nd
)
=
new_nil
(
p
);
}
#line 92
67
"mrbgems/mruby-compiler/core/y.tab.c"
#line 92
83
"mrbgems/mruby-compiler/core/y.tab.c"
break
;
case
488
:
#line 35
13
"mrbgems/mruby-compiler/core/parse.y"
#line 35
29
"mrbgems/mruby-compiler/core/parse.y"
{
(
yyval
.
nd
)
=
new_self
(
p
);
}
#line 92
75
"mrbgems/mruby-compiler/core/y.tab.c"
#line 92
91
"mrbgems/mruby-compiler/core/y.tab.c"
break
;
case
489
:
#line 35
17
"mrbgems/mruby-compiler/core/parse.y"
#line 35
33
"mrbgems/mruby-compiler/core/parse.y"
{
(
yyval
.
nd
)
=
new_true
(
p
);
}
#line 92
83
"mrbgems/mruby-compiler/core/y.tab.c"
#line 92
99
"mrbgems/mruby-compiler/core/y.tab.c"
break
;
case
490
:
#line 35
21
"mrbgems/mruby-compiler/core/parse.y"
#line 35
37
"mrbgems/mruby-compiler/core/parse.y"
{
(
yyval
.
nd
)
=
new_false
(
p
);
}
#line 9
291
"mrbgems/mruby-compiler/core/y.tab.c"
#line 9
307
"mrbgems/mruby-compiler/core/y.tab.c"
break
;
case
491
:
#line 35
25
"mrbgems/mruby-compiler/core/parse.y"
#line 35
41
"mrbgems/mruby-compiler/core/parse.y"
{
const
char
*
fn
=
mrb_sym_name_len
(
p
->
mrb
,
p
->
filename_sym
,
NULL
);
if
(
!
fn
)
{
...
...
@@ -9299,22 +9315,22 @@ yyreduce:
}
(
yyval
.
nd
)
=
new_str
(
p
,
fn
,
strlen
(
fn
));
}
#line 93
03
"mrbgems/mruby-compiler/core/y.tab.c"
#line 93
19
"mrbgems/mruby-compiler/core/y.tab.c"
break
;
case
492
:
#line 35
33
"mrbgems/mruby-compiler/core/parse.y"
#line 35
49
"mrbgems/mruby-compiler/core/parse.y"
{
char
buf
[
16
];
dump_int
(
p
->
lineno
,
buf
);
(
yyval
.
nd
)
=
new_int
(
p
,
buf
,
10
,
0
);
}
#line 93
14
"mrbgems/mruby-compiler/core/y.tab.c"
#line 93
30
"mrbgems/mruby-compiler/core/y.tab.c"
break
;
case
493
:
#line 35
40
"mrbgems/mruby-compiler/core/parse.y"
#line 35
56
"mrbgems/mruby-compiler/core/parse.y"
{
#ifdef MRB_UTF8_STRING
const
char
*
enc
=
"UTF-8"
;
...
...
@@ -9323,46 +9339,46 @@ yyreduce:
#endif
(
yyval
.
nd
)
=
new_str
(
p
,
enc
,
strlen
(
enc
));
}
#line 93
27
"mrbgems/mruby-compiler/core/y.tab.c"
#line 93
43
"mrbgems/mruby-compiler/core/y.tab.c"
break
;
case
496
:
#line 35
55
"mrbgems/mruby-compiler/core/parse.y"
#line 35
71
"mrbgems/mruby-compiler/core/parse.y"
{
(
yyval
.
nd
)
=
0
;
}
#line 93
35
"mrbgems/mruby-compiler/core/y.tab.c"
#line 93
51
"mrbgems/mruby-compiler/core/y.tab.c"
break
;
case
497
:
#line 35
59
"mrbgems/mruby-compiler/core/parse.y"
#line 35
75
"mrbgems/mruby-compiler/core/parse.y"
{
p
->
lstate
=
EXPR_BEG
;
p
->
cmd_start
=
TRUE
;
}
#line 93
44
"mrbgems/mruby-compiler/core/y.tab.c"
#line 93
60
"mrbgems/mruby-compiler/core/y.tab.c"
break
;
case
498
:
#line 35
64
"mrbgems/mruby-compiler/core/parse.y"
#line 35
80
"mrbgems/mruby-compiler/core/parse.y"
{
(
yyval
.
nd
)
=
(
yyvsp
[
-
1
].
nd
);
}
#line 93
52
"mrbgems/mruby-compiler/core/y.tab.c"
#line 93
68
"mrbgems/mruby-compiler/core/y.tab.c"
break
;
case
501
:
#line 35
80
"mrbgems/mruby-compiler/core/parse.y"
#line 35
96
"mrbgems/mruby-compiler/core/parse.y"
{
(
yyval
.
nd
)
=
(
yyvsp
[
-
1
].
nd
);
p
->
lstate
=
EXPR_BEG
;
p
->
cmd_start
=
TRUE
;
}
#line 93
62
"mrbgems/mruby-compiler/core/y.tab.c"
#line 93
78
"mrbgems/mruby-compiler/core/y.tab.c"
break
;
case
502
:
#line 3
586
"mrbgems/mruby-compiler/core/parse.y"
#line 3
602
"mrbgems/mruby-compiler/core/parse.y"
{
#if 1
/* til real keyword args implemented */
...
...
@@ -9380,11 +9396,11 @@ yyreduce:
new_args_tail
(
p
,
0
,
new_kw_rest_args
(
p
,
nsym
(
k
)),
b
));
#endif
}
#line 9
384
"mrbgems/mruby-compiler/core/y.tab.c"
#line 9
400
"mrbgems/mruby-compiler/core/y.tab.c"
break
;
case
503
:
#line 36
04
"mrbgems/mruby-compiler/core/parse.y"
#line 36
20
"mrbgems/mruby-compiler/core/parse.y"
{
#if 1
/* til real keyword args implemented */
...
...
@@ -9402,504 +9418,504 @@ yyreduce:
new_args_tail
(
p
,
0
,
new_kw_rest_args
(
p
,
nsym
(
k
)),
b
));
#endif
}
#line 94
06
"mrbgems/mruby-compiler/core/y.tab.c"
#line 94
22
"mrbgems/mruby-compiler/core/y.tab.c"
break
;
case
505
:
#line 36
25
"mrbgems/mruby-compiler/core/parse.y"
#line 36
41
"mrbgems/mruby-compiler/core/parse.y"
{
(
yyval
.
nd
)
=
(
yyvsp
[
-
1
].
nd
);
}
#line 94
14
"mrbgems/mruby-compiler/core/y.tab.c"
#line 94
30
"mrbgems/mruby-compiler/core/y.tab.c"
break
;
case
506
:
#line 36
31
"mrbgems/mruby-compiler/core/parse.y"
#line 36
47
"mrbgems/mruby-compiler/core/parse.y"
{
local_nest
(
p
);
}
#line 94
22
"mrbgems/mruby-compiler/core/y.tab.c"
#line 94
38
"mrbgems/mruby-compiler/core/y.tab.c"
break
;
case
507
:
#line 36
37
"mrbgems/mruby-compiler/core/parse.y"
#line 36
53
"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 94
32
"mrbgems/mruby-compiler/core/y.tab.c"
#line 94
48
"mrbgems/mruby-compiler/core/y.tab.c"
break
;
case
508
:
#line 36
43
"mrbgems/mruby-compiler/core/parse.y"
#line 36
59
"mrbgems/mruby-compiler/core/parse.y"
{
(
yyval
.
nd
)
=
new_kw_arg
(
p
,
(
yyvsp
[
0
].
id
),
0
);
local_unnest
(
p
);
}
#line 94
41
"mrbgems/mruby-compiler/core/y.tab.c"
#line 94
57
"mrbgems/mruby-compiler/core/y.tab.c"
break
;
case
509
:
#line 36
50
"mrbgems/mruby-compiler/core/parse.y"
#line 36
66
"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 94
50
"mrbgems/mruby-compiler/core/y.tab.c"
#line 94
66
"mrbgems/mruby-compiler/core/y.tab.c"
break
;
case
510
:
#line 36
55
"mrbgems/mruby-compiler/core/parse.y"
#line 36
71
"mrbgems/mruby-compiler/core/parse.y"
{
(
yyval
.
nd
)
=
new_kw_arg
(
p
,
(
yyvsp
[
0
].
id
),
0
);
local_unnest
(
p
);
}
#line 94
59
"mrbgems/mruby-compiler/core/y.tab.c"
#line 94
75
"mrbgems/mruby-compiler/core/y.tab.c"
break
;
case
511
:
#line 36
62
"mrbgems/mruby-compiler/core/parse.y"
#line 36
78
"mrbgems/mruby-compiler/core/parse.y"
{
(
yyval
.
nd
)
=
list1
((
yyvsp
[
0
].
nd
));
}
#line 94
67
"mrbgems/mruby-compiler/core/y.tab.c"
#line 94
83
"mrbgems/mruby-compiler/core/y.tab.c"
break
;
case
512
:
#line 36
66
"mrbgems/mruby-compiler/core/parse.y"
#line 36
82
"mrbgems/mruby-compiler/core/parse.y"
{
(
yyval
.
nd
)
=
push
((
yyvsp
[
-
2
].
nd
),
(
yyvsp
[
0
].
nd
));
}
#line 94
75
"mrbgems/mruby-compiler/core/y.tab.c"
#line 94
91
"mrbgems/mruby-compiler/core/y.tab.c"
break
;
case
513
:
#line 36
72
"mrbgems/mruby-compiler/core/parse.y"
#line 36
88
"mrbgems/mruby-compiler/core/parse.y"
{
(
yyval
.
nd
)
=
list1
((
yyvsp
[
0
].
nd
));
}
#line 94
83
"mrbgems/mruby-compiler/core/y.tab.c"
#line 94
99
"mrbgems/mruby-compiler/core/y.tab.c"
break
;
case
514
:
#line 36
76
"mrbgems/mruby-compiler/core/parse.y"
#line 36
92
"mrbgems/mruby-compiler/core/parse.y"
{
(
yyval
.
nd
)
=
push
((
yyvsp
[
-
2
].
nd
),
(
yyvsp
[
0
].
nd
));
}
#line 9
491
"mrbgems/mruby-compiler/core/y.tab.c"
#line 9
507
"mrbgems/mruby-compiler/core/y.tab.c"
break
;
case
517
:
#line 3
686
"mrbgems/mruby-compiler/core/parse.y"
#line 3
702
"mrbgems/mruby-compiler/core/parse.y"
{
(
yyval
.
nd
)
=
new_kw_rest_args
(
p
,
nsym
((
yyvsp
[
0
].
id
)));
}
#line 9
499
"mrbgems/mruby-compiler/core/y.tab.c"
#line 9
515
"mrbgems/mruby-compiler/core/y.tab.c"
break
;
case
518
:
#line 3
690
"mrbgems/mruby-compiler/core/parse.y"
#line 3
706
"mrbgems/mruby-compiler/core/parse.y"
{
(
yyval
.
nd
)
=
new_kw_rest_args
(
p
,
0
);
}
#line 95
07
"mrbgems/mruby-compiler/core/y.tab.c"
#line 95
23
"mrbgems/mruby-compiler/core/y.tab.c"
break
;
case
519
:
#line 3
696
"mrbgems/mruby-compiler/core/parse.y"
#line 3
712
"mrbgems/mruby-compiler/core/parse.y"
{
(
yyval
.
nd
)
=
new_args_tail
(
p
,
(
yyvsp
[
-
3
].
nd
),
(
yyvsp
[
-
1
].
nd
),
(
yyvsp
[
0
].
id
));
}
#line 95
15
"mrbgems/mruby-compiler/core/y.tab.c"
#line 95
31
"mrbgems/mruby-compiler/core/y.tab.c"
break
;
case
520
:
#line 37
00
"mrbgems/mruby-compiler/core/parse.y"
#line 37
16
"mrbgems/mruby-compiler/core/parse.y"
{
(
yyval
.
nd
)
=
new_args_tail
(
p
,
(
yyvsp
[
-
1
].
nd
),
0
,
(
yyvsp
[
0
].
id
));
}
#line 95
23
"mrbgems/mruby-compiler/core/y.tab.c"
#line 95
39
"mrbgems/mruby-compiler/core/y.tab.c"
break
;
case
521
:
#line 37
04
"mrbgems/mruby-compiler/core/parse.y"
#line 37
20
"mrbgems/mruby-compiler/core/parse.y"
{
(
yyval
.
nd
)
=
new_args_tail
(
p
,
0
,
(
yyvsp
[
-
1
].
nd
),
(
yyvsp
[
0
].
id
));
}
#line 95
31
"mrbgems/mruby-compiler/core/y.tab.c"
#line 95
47
"mrbgems/mruby-compiler/core/y.tab.c"
break
;
case
522
:
#line 37
08
"mrbgems/mruby-compiler/core/parse.y"
#line 37
24
"mrbgems/mruby-compiler/core/parse.y"
{
(
yyval
.
nd
)
=
new_args_tail
(
p
,
0
,
0
,
(
yyvsp
[
0
].
id
));
}
#line 95
39
"mrbgems/mruby-compiler/core/y.tab.c"
#line 95
55
"mrbgems/mruby-compiler/core/y.tab.c"
break
;
case
523
:
#line 37
14
"mrbgems/mruby-compiler/core/parse.y"
#line 37
30
"mrbgems/mruby-compiler/core/parse.y"
{
(
yyval
.
nd
)
=
(
yyvsp
[
0
].
nd
);
}
#line 95
47
"mrbgems/mruby-compiler/core/y.tab.c"
#line 95
63
"mrbgems/mruby-compiler/core/y.tab.c"
break
;
case
524
:
#line 37
18
"mrbgems/mruby-compiler/core/parse.y"
#line 37
34
"mrbgems/mruby-compiler/core/parse.y"
{
(
yyval
.
nd
)
=
new_args_tail
(
p
,
0
,
0
,
0
);
}
#line 95
55
"mrbgems/mruby-compiler/core/y.tab.c"
#line 95
71
"mrbgems/mruby-compiler/core/y.tab.c"
break
;
case
525
:
#line 37
24
"mrbgems/mruby-compiler/core/parse.y"
#line 37
40
"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 95
63
"mrbgems/mruby-compiler/core/y.tab.c"
#line 95
79
"mrbgems/mruby-compiler/core/y.tab.c"
break
;
case
526
:
#line 37
28
"mrbgems/mruby-compiler/core/parse.y"
#line 37
44
"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 95
71
"mrbgems/mruby-compiler/core/y.tab.c"
#line 95
87
"mrbgems/mruby-compiler/core/y.tab.c"
break
;
case
527
:
#line 37
32
"mrbgems/mruby-compiler/core/parse.y"
#line 37
48
"mrbgems/mruby-compiler/core/parse.y"
{
(
yyval
.
nd
)
=
new_args
(
p
,
(
yyvsp
[
-
3
].
nd
),
(
yyvsp
[
-
1
].
nd
),
0
,
0
,
(
yyvsp
[
0
].
nd
));
}
#line 95
79
"mrbgems/mruby-compiler/core/y.tab.c"
#line 95
95
"mrbgems/mruby-compiler/core/y.tab.c"
break
;
case
528
:
#line 37
36
"mrbgems/mruby-compiler/core/parse.y"
#line 37
52
"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 9
587
"mrbgems/mruby-compiler/core/y.tab.c"
#line 9
603
"mrbgems/mruby-compiler/core/y.tab.c"
break
;
case
529
:
#line 37
40
"mrbgems/mruby-compiler/core/parse.y"
#line 37
56
"mrbgems/mruby-compiler/core/parse.y"
{
(
yyval
.
nd
)
=
new_args
(
p
,
(
yyvsp
[
-
3
].
nd
),
0
,
(
yyvsp
[
-
1
].
id
),
0
,
(
yyvsp
[
0
].
nd
));
}
#line 9
595
"mrbgems/mruby-compiler/core/y.tab.c"
#line 9
611
"mrbgems/mruby-compiler/core/y.tab.c"
break
;
case
530
:
#line 37
44
"mrbgems/mruby-compiler/core/parse.y"
#line 37
60
"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 96
03
"mrbgems/mruby-compiler/core/y.tab.c"
#line 96
19
"mrbgems/mruby-compiler/core/y.tab.c"
break
;
case
531
:
#line 37
48
"mrbgems/mruby-compiler/core/parse.y"
#line 37
64
"mrbgems/mruby-compiler/core/parse.y"
{
(
yyval
.
nd
)
=
new_args
(
p
,
(
yyvsp
[
-
1
].
nd
),
0
,
0
,
0
,
(
yyvsp
[
0
].
nd
));
}
#line 96
11
"mrbgems/mruby-compiler/core/y.tab.c"
#line 96
27
"mrbgems/mruby-compiler/core/y.tab.c"
break
;
case
532
:
#line 37
52
"mrbgems/mruby-compiler/core/parse.y"
#line 37
68
"mrbgems/mruby-compiler/core/parse.y"
{
(
yyval
.
nd
)
=
new_args
(
p
,
0
,
(
yyvsp
[
-
3
].
nd
),
(
yyvsp
[
-
1
].
id
),
0
,
(
yyvsp
[
0
].
nd
));
}
#line 96
19
"mrbgems/mruby-compiler/core/y.tab.c"
#line 96
35
"mrbgems/mruby-compiler/core/y.tab.c"
break
;
case
533
:
#line 37
56
"mrbgems/mruby-compiler/core/parse.y"
#line 37
72
"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 96
27
"mrbgems/mruby-compiler/core/y.tab.c"
#line 96
43
"mrbgems/mruby-compiler/core/y.tab.c"
break
;
case
534
:
#line 37
60
"mrbgems/mruby-compiler/core/parse.y"
#line 37
76
"mrbgems/mruby-compiler/core/parse.y"
{
(
yyval
.
nd
)
=
new_args
(
p
,
0
,
(
yyvsp
[
-
1
].
nd
),
0
,
0
,
(
yyvsp
[
0
].
nd
));
}
#line 96
35
"mrbgems/mruby-compiler/core/y.tab.c"
#line 96
51
"mrbgems/mruby-compiler/core/y.tab.c"
break
;
case
535
:
#line 37
64
"mrbgems/mruby-compiler/core/parse.y"
#line 37
80
"mrbgems/mruby-compiler/core/parse.y"
{
(
yyval
.
nd
)
=
new_args
(
p
,
0
,
(
yyvsp
[
-
3
].
nd
),
0
,
(
yyvsp
[
-
1
].
nd
),
(
yyvsp
[
0
].
nd
));
}
#line 96
43
"mrbgems/mruby-compiler/core/y.tab.c"
#line 96
59
"mrbgems/mruby-compiler/core/y.tab.c"
break
;
case
536
:
#line 37
68
"mrbgems/mruby-compiler/core/parse.y"
#line 37
84
"mrbgems/mruby-compiler/core/parse.y"
{
(
yyval
.
nd
)
=
new_args
(
p
,
0
,
0
,
(
yyvsp
[
-
1
].
id
),
0
,
(
yyvsp
[
0
].
nd
));
}
#line 96
51
"mrbgems/mruby-compiler/core/y.tab.c"
#line 96
67
"mrbgems/mruby-compiler/core/y.tab.c"
break
;
case
537
:
#line 37
72
"mrbgems/mruby-compiler/core/parse.y"
#line 37
88
"mrbgems/mruby-compiler/core/parse.y"
{
(
yyval
.
nd
)
=
new_args
(
p
,
0
,
0
,
(
yyvsp
[
-
3
].
id
),
(
yyvsp
[
-
1
].
nd
),
(
yyvsp
[
0
].
nd
));
}
#line 96
59
"mrbgems/mruby-compiler/core/y.tab.c"
#line 96
75
"mrbgems/mruby-compiler/core/y.tab.c"
break
;
case
538
:
#line 37
76
"mrbgems/mruby-compiler/core/parse.y"
#line 37
92
"mrbgems/mruby-compiler/core/parse.y"
{
(
yyval
.
nd
)
=
new_args
(
p
,
0
,
0
,
0
,
0
,
(
yyvsp
[
0
].
nd
));
}
#line 96
67
"mrbgems/mruby-compiler/core/y.tab.c"
#line 96
83
"mrbgems/mruby-compiler/core/y.tab.c"
break
;
case
539
:
#line 37
80
"mrbgems/mruby-compiler/core/parse.y"
#line 37
96
"mrbgems/mruby-compiler/core/parse.y"
{
local_add_f
(
p
,
intern_op
(
and
));
(
yyval
.
nd
)
=
new_args
(
p
,
0
,
0
,
0
,
0
,
0
);
}
#line 96
76
"mrbgems/mruby-compiler/core/y.tab.c"
#line 96
92
"mrbgems/mruby-compiler/core/y.tab.c"
break
;
case
540
:
#line 3
787
"mrbgems/mruby-compiler/core/parse.y"
#line 3
803
"mrbgems/mruby-compiler/core/parse.y"
{
yyerror
(
p
,
"formal argument cannot be a constant"
);
(
yyval
.
nd
)
=
0
;
}
#line 9
685
"mrbgems/mruby-compiler/core/y.tab.c"
#line 9
701
"mrbgems/mruby-compiler/core/y.tab.c"
break
;
case
541
:
#line 3
792
"mrbgems/mruby-compiler/core/parse.y"
#line 3
808
"mrbgems/mruby-compiler/core/parse.y"
{
yyerror
(
p
,
"formal argument cannot be an instance variable"
);
(
yyval
.
nd
)
=
0
;
}
#line 9
694
"mrbgems/mruby-compiler/core/y.tab.c"
#line 9
710
"mrbgems/mruby-compiler/core/y.tab.c"
break
;
case
542
:
#line 3
797
"mrbgems/mruby-compiler/core/parse.y"
#line 3
813
"mrbgems/mruby-compiler/core/parse.y"
{
yyerror
(
p
,
"formal argument cannot be a global variable"
);
(
yyval
.
nd
)
=
0
;
}
#line 97
03
"mrbgems/mruby-compiler/core/y.tab.c"
#line 97
19
"mrbgems/mruby-compiler/core/y.tab.c"
break
;
case
543
:
#line 38
02
"mrbgems/mruby-compiler/core/parse.y"
#line 38
18
"mrbgems/mruby-compiler/core/parse.y"
{
yyerror
(
p
,
"formal argument cannot be a class variable"
);
(
yyval
.
nd
)
=
0
;
}
#line 97
12
"mrbgems/mruby-compiler/core/y.tab.c"
#line 97
28
"mrbgems/mruby-compiler/core/y.tab.c"
break
;
case
544
:
#line 38
07
"mrbgems/mruby-compiler/core/parse.y"
#line 38
23
"mrbgems/mruby-compiler/core/parse.y"
{
yyerror
(
p
,
"formal argument cannot be a numbered parameter"
);
(
yyval
.
nd
)
=
0
;
}
#line 97
21
"mrbgems/mruby-compiler/core/y.tab.c"
#line 97
37
"mrbgems/mruby-compiler/core/y.tab.c"
break
;
case
545
:
#line 38
14
"mrbgems/mruby-compiler/core/parse.y"
#line 38
30
"mrbgems/mruby-compiler/core/parse.y"
{
(
yyval
.
id
)
=
0
;
}
#line 97
29
"mrbgems/mruby-compiler/core/y.tab.c"
#line 97
45
"mrbgems/mruby-compiler/core/y.tab.c"
break
;
case
546
:
#line 38
18
"mrbgems/mruby-compiler/core/parse.y"
#line 38
34
"mrbgems/mruby-compiler/core/parse.y"
{
local_add_f
(
p
,
(
yyvsp
[
0
].
id
));
(
yyval
.
id
)
=
(
yyvsp
[
0
].
id
);
}
#line 97
38
"mrbgems/mruby-compiler/core/y.tab.c"
#line 97
54
"mrbgems/mruby-compiler/core/y.tab.c"
break
;
case
547
:
#line 38
25
"mrbgems/mruby-compiler/core/parse.y"
#line 38
41
"mrbgems/mruby-compiler/core/parse.y"
{
(
yyval
.
nd
)
=
new_arg
(
p
,
(
yyvsp
[
0
].
id
));
}
#line 97
46
"mrbgems/mruby-compiler/core/y.tab.c"
#line 97
62
"mrbgems/mruby-compiler/core/y.tab.c"
break
;
case
548
:
#line 38
29
"mrbgems/mruby-compiler/core/parse.y"
#line 38
45
"mrbgems/mruby-compiler/core/parse.y"
{
(
yyval
.
nd
)
=
local_switch
(
p
);
}
#line 97
54
"mrbgems/mruby-compiler/core/y.tab.c"
#line 97
70
"mrbgems/mruby-compiler/core/y.tab.c"
break
;
case
549
:
#line 38
33
"mrbgems/mruby-compiler/core/parse.y"
#line 38
49
"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 97
64
"mrbgems/mruby-compiler/core/y.tab.c"
#line 97
80
"mrbgems/mruby-compiler/core/y.tab.c"
break
;
case
550
:
#line 38
41
"mrbgems/mruby-compiler/core/parse.y"
#line 38
57
"mrbgems/mruby-compiler/core/parse.y"
{
(
yyval
.
nd
)
=
list1
((
yyvsp
[
0
].
nd
));
}
#line 97
72
"mrbgems/mruby-compiler/core/y.tab.c"
#line 97
88
"mrbgems/mruby-compiler/core/y.tab.c"
break
;
case
551
:
#line 38
45
"mrbgems/mruby-compiler/core/parse.y"
#line 38
61
"mrbgems/mruby-compiler/core/parse.y"
{
(
yyval
.
nd
)
=
push
((
yyvsp
[
-
2
].
nd
),
(
yyvsp
[
0
].
nd
));
}
#line 97
80
"mrbgems/mruby-compiler/core/y.tab.c"
#line 97
96
"mrbgems/mruby-compiler/core/y.tab.c"
break
;
case
552
:
#line 38
51
"mrbgems/mruby-compiler/core/parse.y"
#line 38
67
"mrbgems/mruby-compiler/core/parse.y"
{
local_add_f
(
p
,
(
yyvsp
[
-
1
].
id
));
local_nest
(
p
);
(
yyval
.
id
)
=
(
yyvsp
[
-
1
].
id
);
}
#line 9
790
"mrbgems/mruby-compiler/core/y.tab.c"
#line 9
806
"mrbgems/mruby-compiler/core/y.tab.c"
break
;
case
553
:
#line 38
59
"mrbgems/mruby-compiler/core/parse.y"
#line 38
75
"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 98
00
"mrbgems/mruby-compiler/core/y.tab.c"
#line 98
16
"mrbgems/mruby-compiler/core/y.tab.c"
break
;
case
554
:
#line 38
67
"mrbgems/mruby-compiler/core/parse.y"
#line 38
83
"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 98
10
"mrbgems/mruby-compiler/core/y.tab.c"
#line 98
26
"mrbgems/mruby-compiler/core/y.tab.c"
break
;
case
555
:
#line 38
75
"mrbgems/mruby-compiler/core/parse.y"
#line 38
91
"mrbgems/mruby-compiler/core/parse.y"
{
(
yyval
.
nd
)
=
list1
((
yyvsp
[
0
].
nd
));
}
#line 98
18
"mrbgems/mruby-compiler/core/y.tab.c"
#line 98
34
"mrbgems/mruby-compiler/core/y.tab.c"
break
;
case
556
:
#line 38
79
"mrbgems/mruby-compiler/core/parse.y"
#line 38
95
"mrbgems/mruby-compiler/core/parse.y"
{
(
yyval
.
nd
)
=
push
((
yyvsp
[
-
2
].
nd
),
(
yyvsp
[
0
].
nd
));
}
#line 98
26
"mrbgems/mruby-compiler/core/y.tab.c"
#line 98
42
"mrbgems/mruby-compiler/core/y.tab.c"
break
;
case
557
:
#line 3
885
"mrbgems/mruby-compiler/core/parse.y"
#line 3
901
"mrbgems/mruby-compiler/core/parse.y"
{
(
yyval
.
nd
)
=
list1
((
yyvsp
[
0
].
nd
));
}
#line 98
34
"mrbgems/mruby-compiler/core/y.tab.c"
#line 98
50
"mrbgems/mruby-compiler/core/y.tab.c"
break
;
case
558
:
#line 3
889
"mrbgems/mruby-compiler/core/parse.y"
#line 3
905
"mrbgems/mruby-compiler/core/parse.y"
{
(
yyval
.
nd
)
=
push
((
yyvsp
[
-
2
].
nd
),
(
yyvsp
[
0
].
nd
));
}
#line 98
42
"mrbgems/mruby-compiler/core/y.tab.c"
#line 98
58
"mrbgems/mruby-compiler/core/y.tab.c"
break
;
case
561
:
#line 3
899
"mrbgems/mruby-compiler/core/parse.y"
#line 3
915
"mrbgems/mruby-compiler/core/parse.y"
{
local_add_f
(
p
,
(
yyvsp
[
0
].
id
));
(
yyval
.
id
)
=
(
yyvsp
[
0
].
id
);
}
#line 98
51
"mrbgems/mruby-compiler/core/y.tab.c"
#line 98
67
"mrbgems/mruby-compiler/core/y.tab.c"
break
;
case
562
:
#line 39
04
"mrbgems/mruby-compiler/core/parse.y"
#line 39
20
"mrbgems/mruby-compiler/core/parse.y"
{
local_add_f
(
p
,
intern_op
(
mul
));
(
yyval
.
id
)
=
-
1
;
}
#line 98
60
"mrbgems/mruby-compiler/core/y.tab.c"
#line 98
76
"mrbgems/mruby-compiler/core/y.tab.c"
break
;
case
565
:
#line 39
15
"mrbgems/mruby-compiler/core/parse.y"
#line 39
31
"mrbgems/mruby-compiler/core/parse.y"
{
(
yyval
.
id
)
=
(
yyvsp
[
0
].
id
);
}
#line 98
68
"mrbgems/mruby-compiler/core/y.tab.c"
#line 98
84
"mrbgems/mruby-compiler/core/y.tab.c"
break
;
case
566
:
#line 39
21
"mrbgems/mruby-compiler/core/parse.y"
#line 39
37
"mrbgems/mruby-compiler/core/parse.y"
{
(
yyval
.
id
)
=
(
yyvsp
[
0
].
id
);
}
#line 98
76
"mrbgems/mruby-compiler/core/y.tab.c"
#line 98
92
"mrbgems/mruby-compiler/core/y.tab.c"
break
;
case
567
:
#line 39
25
"mrbgems/mruby-compiler/core/parse.y"
#line 39
41
"mrbgems/mruby-compiler/core/parse.y"
{
(
yyval
.
id
)
=
0
;
}
#line 9
884
"mrbgems/mruby-compiler/core/y.tab.c"
#line 9
900
"mrbgems/mruby-compiler/core/y.tab.c"
break
;
case
568
:
#line 39
31
"mrbgems/mruby-compiler/core/parse.y"
#line 39
47
"mrbgems/mruby-compiler/core/parse.y"
{
(
yyval
.
nd
)
=
(
yyvsp
[
0
].
nd
);
if
(
!
(
yyval
.
nd
))
(
yyval
.
nd
)
=
new_nil
(
p
);
}
#line 9
893
"mrbgems/mruby-compiler/core/y.tab.c"
#line 9
909
"mrbgems/mruby-compiler/core/y.tab.c"
break
;
case
569
:
#line 39
35
"mrbgems/mruby-compiler/core/parse.y"
#line 39
51
"mrbgems/mruby-compiler/core/parse.y"
{
p
->
lstate
=
EXPR_BEG
;}
#line 9
899
"mrbgems/mruby-compiler/core/y.tab.c"
#line 9
915
"mrbgems/mruby-compiler/core/y.tab.c"
break
;
case
570
:
#line 39
36
"mrbgems/mruby-compiler/core/parse.y"
#line 39
52
"mrbgems/mruby-compiler/core/parse.y"
{
if
((
yyvsp
[
-
1
].
nd
)
==
0
)
{
yyerror
(
p
,
"can't define singleton method for ()."
);
...
...
@@ -9922,55 +9938,55 @@ yyreduce:
}
(
yyval
.
nd
)
=
(
yyvsp
[
-
1
].
nd
);
}
#line 99
26
"mrbgems/mruby-compiler/core/y.tab.c"
#line 99
42
"mrbgems/mruby-compiler/core/y.tab.c"
break
;
case
572
:
#line 39
62
"mrbgems/mruby-compiler/core/parse.y"
#line 39
78
"mrbgems/mruby-compiler/core/parse.y"
{
(
yyval
.
nd
)
=
(
yyvsp
[
-
1
].
nd
);
}
#line 99
34
"mrbgems/mruby-compiler/core/y.tab.c"
#line 99
50
"mrbgems/mruby-compiler/core/y.tab.c"
break
;
case
573
:
#line 39
68
"mrbgems/mruby-compiler/core/parse.y"
#line 39
84
"mrbgems/mruby-compiler/core/parse.y"
{
(
yyval
.
nd
)
=
list1
((
yyvsp
[
0
].
nd
));
NODE_LINENO
((
yyval
.
nd
),
(
yyvsp
[
0
].
nd
));
}
#line 99
43
"mrbgems/mruby-compiler/core/y.tab.c"
#line 99
59
"mrbgems/mruby-compiler/core/y.tab.c"
break
;
case
574
:
#line 39
73
"mrbgems/mruby-compiler/core/parse.y"
#line 39
89
"mrbgems/mruby-compiler/core/parse.y"
{
(
yyval
.
nd
)
=
push
((
yyvsp
[
-
2
].
nd
),
(
yyvsp
[
0
].
nd
));
}
#line 99
51
"mrbgems/mruby-compiler/core/y.tab.c"
#line 99
67
"mrbgems/mruby-compiler/core/y.tab.c"
break
;
case
577
:
#line 39
83
"mrbgems/mruby-compiler/core/parse.y"
#line 39
99
"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 99
61
"mrbgems/mruby-compiler/core/y.tab.c"
#line 99
77
"mrbgems/mruby-compiler/core/y.tab.c"
break
;
case
578
:
#line
3989
"mrbgems/mruby-compiler/core/parse.y"
#line
4005
"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 99
70
"mrbgems/mruby-compiler/core/y.tab.c"
#line 99
86
"mrbgems/mruby-compiler/core/y.tab.c"
break
;
case
579
:
#line
3994
"mrbgems/mruby-compiler/core/parse.y"
#line
4010
"mrbgems/mruby-compiler/core/parse.y"
{
void_expr_error
(
p
,
(
yyvsp
[
0
].
nd
));
if
(
typen
((
yyvsp
[
-
2
].
nd
)
->
car
)
==
NODE_DSTR
)
{
...
...
@@ -9980,67 +9996,67 @@ yyreduce:
(
yyval
.
nd
)
=
cons
(
new_sym
(
p
,
new_strsym
(
p
,
(
yyvsp
[
-
2
].
nd
))),
(
yyvsp
[
0
].
nd
));
}
}
#line
9984
"mrbgems/mruby-compiler/core/y.tab.c"
#line
10000
"mrbgems/mruby-compiler/core/y.tab.c"
break
;
case
580
:
#line 40
04
"mrbgems/mruby-compiler/core/parse.y"
#line 40
20
"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
9993
"mrbgems/mruby-compiler/core/y.tab.c"
#line
10009
"mrbgems/mruby-compiler/core/y.tab.c"
break
;
case
593
:
#line 40
31
"mrbgems/mruby-compiler/core/parse.y"
#line 40
47
"mrbgems/mruby-compiler/core/parse.y"
{
(
yyval
.
num
)
=
'.'
;
}
#line 100
01
"mrbgems/mruby-compiler/core/y.tab.c"
#line 100
17
"mrbgems/mruby-compiler/core/y.tab.c"
break
;
case
594
:
#line 40
35
"mrbgems/mruby-compiler/core/parse.y"
#line 40
51
"mrbgems/mruby-compiler/core/parse.y"
{
(
yyval
.
num
)
=
0
;
}
#line 100
09
"mrbgems/mruby-compiler/core/y.tab.c"
#line 100
25
"mrbgems/mruby-compiler/core/y.tab.c"
break
;
case
596
:
#line 40
42
"mrbgems/mruby-compiler/core/parse.y"
#line 40
58
"mrbgems/mruby-compiler/core/parse.y"
{
(
yyval
.
num
)
=
tCOLON2
;
}
#line 100
17
"mrbgems/mruby-compiler/core/y.tab.c"
#line 100
33
"mrbgems/mruby-compiler/core/y.tab.c"
break
;
case
605
:
#line 40
63
"mrbgems/mruby-compiler/core/parse.y"
#line 40
79
"mrbgems/mruby-compiler/core/parse.y"
{
yyerrok
;}
#line 100
23
"mrbgems/mruby-compiler/core/y.tab.c"
#line 100
39
"mrbgems/mruby-compiler/core/y.tab.c"
break
;
case
608
:
#line 40
69
"mrbgems/mruby-compiler/core/parse.y"
#line 40
85
"mrbgems/mruby-compiler/core/parse.y"
{
p
->
lineno
+=
(
yyvsp
[
0
].
num
);
p
->
column
=
0
;
}
#line 100
32
"mrbgems/mruby-compiler/core/y.tab.c"
#line 100
48
"mrbgems/mruby-compiler/core/y.tab.c"
break
;
case
611
:
#line 40
80
"mrbgems/mruby-compiler/core/parse.y"
#line 40
96
"mrbgems/mruby-compiler/core/parse.y"
{
(
yyval
.
nd
)
=
0
;
}
#line 100
40
"mrbgems/mruby-compiler/core/y.tab.c"
#line 100
56
"mrbgems/mruby-compiler/core/y.tab.c"
break
;
#line 100
44
"mrbgems/mruby-compiler/core/y.tab.c"
#line 100
60
"mrbgems/mruby-compiler/core/y.tab.c"
default:
break
;
}
...
...
@@ -10272,7 +10288,7 @@ yyreturn:
#endif
return
yyresult
;
}
#line 4
084
"mrbgems/mruby-compiler/core/parse.y"
#line 4
100
"mrbgems/mruby-compiler/core/parse.y"
#define pylval (*((YYSTYPE*)(p->ylval)))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment