ruby_parser 3.20.0 → 3.20.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/History.rdoc +6 -0
- data/lib/ruby20_parser.rb +170 -134
- data/lib/ruby20_parser.y +50 -16
- data/lib/ruby21_parser.rb +110 -74
- data/lib/ruby21_parser.y +50 -16
- data/lib/ruby22_parser.rb +238 -202
- data/lib/ruby22_parser.y +50 -16
- data/lib/ruby23_parser.rb +383 -347
- data/lib/ruby23_parser.y +50 -16
- data/lib/ruby24_parser.rb +96 -60
- data/lib/ruby24_parser.y +50 -16
- data/lib/ruby25_parser.rb +92 -56
- data/lib/ruby25_parser.y +50 -16
- data/lib/ruby26_parser.rb +92 -56
- data/lib/ruby26_parser.y +50 -16
- data/lib/ruby27_parser.rb +574 -538
- data/lib/ruby27_parser.y +50 -16
- data/lib/ruby30_parser.rb +357 -331
- data/lib/ruby30_parser.y +42 -16
- data/lib/ruby31_parser.rb +174 -148
- data/lib/ruby31_parser.y +42 -16
- data/lib/ruby32_parser.rb +174 -148
- data/lib/ruby32_parser.y +42 -16
- data/lib/ruby3_parser.yy +42 -16
- data/lib/ruby_parser.yy +50 -16
- data/lib/ruby_parser_extras.rb +19 -13
- data/test/test_ruby_parser.rb +156 -6
- data.tar.gz.sig +0 -0
- metadata +3 -3
- metadata.gz.sig +0 -0
data/lib/ruby23_parser.y
CHANGED
@@ -222,6 +222,7 @@ rule
|
|
222
222
|
| lhs tEQL mrhs
|
223
223
|
{
|
224
224
|
lhs, _, rhs = val
|
225
|
+
|
225
226
|
result = new_assign lhs, s(:svalue, rhs).line(rhs.line)
|
226
227
|
}
|
227
228
|
| mlhs tEQL mrhs_arg
|
@@ -975,8 +976,10 @@ rule
|
|
975
976
|
|
976
977
|
paren_args: tLPAREN2 opt_call_args rparen
|
977
978
|
{
|
978
|
-
_, args, _ = val
|
979
|
+
_, args, (_, line_max) = val
|
980
|
+
|
979
981
|
result = args
|
982
|
+
result.line_max = line_max if args
|
980
983
|
}
|
981
984
|
|
982
985
|
opt_paren_args: none
|
@@ -1181,12 +1184,14 @@ rule
|
|
1181
1184
|
{
|
1182
1185
|
result = wrap :colon3, val[1]
|
1183
1186
|
}
|
1184
|
-
| tLBRACK { result = lexer.lineno } aref_args
|
1187
|
+
| tLBRACK { result = lexer.lineno } aref_args rbracket
|
1185
1188
|
{
|
1186
|
-
_, line, args, _ = val
|
1189
|
+
_, line, args, (_, line_max) = val
|
1190
|
+
|
1187
1191
|
result = args || s(:array)
|
1188
1192
|
result.sexp_type = :array # aref_args is :args
|
1189
1193
|
result.line line
|
1194
|
+
result.line_max = line_max
|
1190
1195
|
}
|
1191
1196
|
| tLBRACE
|
1192
1197
|
{
|
@@ -1774,13 +1779,19 @@ opt_block_args_tail: tCOMMA block_args_tail
|
|
1774
1779
|
{
|
1775
1780
|
call, args = val
|
1776
1781
|
|
1777
|
-
result = call
|
1782
|
+
result = call
|
1783
|
+
|
1784
|
+
if args then
|
1785
|
+
call.concat args.sexp_body
|
1786
|
+
result.line_max = args.line_max
|
1787
|
+
end
|
1778
1788
|
}
|
1779
1789
|
| primary_value call_op operation2 opt_paren_args
|
1780
1790
|
{
|
1781
|
-
recv, call_op, (op,
|
1791
|
+
recv, call_op, (op, op_line), args = val
|
1782
1792
|
|
1783
1793
|
result = new_call recv, op.to_sym, args, call_op
|
1794
|
+
result.line_max = op_line unless args
|
1784
1795
|
}
|
1785
1796
|
| primary_value tCOLON2 operation2 paren_args
|
1786
1797
|
{
|
@@ -1994,15 +2005,17 @@ opt_block_args_tail: tCOMMA block_args_tail
|
|
1994
2005
|
|
1995
2006
|
words: tWORDS_BEG tSPACE tSTRING_END
|
1996
2007
|
{
|
1997
|
-
(_, line), _, _ = val
|
2008
|
+
(_, line), _, (_, line_max) = val
|
1998
2009
|
|
1999
2010
|
result = s(:array).line line
|
2011
|
+
result.line_max = line_max
|
2000
2012
|
}
|
2001
2013
|
| tWORDS_BEG word_list tSTRING_END
|
2002
2014
|
{
|
2003
|
-
(_, line), list, _ = val
|
2015
|
+
(_, line), list, (_, line_max) = val
|
2004
2016
|
|
2005
2017
|
result = list.line line
|
2018
|
+
result.line_max = line_max
|
2006
2019
|
}
|
2007
2020
|
|
2008
2021
|
word_list: none
|
@@ -2022,15 +2035,17 @@ opt_block_args_tail: tCOMMA block_args_tail
|
|
2022
2035
|
|
2023
2036
|
symbols: tSYMBOLS_BEG tSPACE tSTRING_END
|
2024
2037
|
{
|
2025
|
-
(_, line), _, _ = val
|
2038
|
+
(_, line), _, (_, line_max) = val
|
2026
2039
|
|
2027
2040
|
result = s(:array).line line
|
2041
|
+
result.line_max = line_max
|
2028
2042
|
}
|
2029
2043
|
| tSYMBOLS_BEG symbol_list tSTRING_END
|
2030
2044
|
{
|
2031
|
-
(_, line), list, _, = val
|
2032
|
-
|
2033
|
-
result = list
|
2045
|
+
(_, line), list, (_, line_max), = val
|
2046
|
+
|
2047
|
+
result = list.line line
|
2048
|
+
result.line_max = line_max
|
2034
2049
|
}
|
2035
2050
|
|
2036
2051
|
symbol_list: none
|
@@ -2045,28 +2060,32 @@ opt_block_args_tail: tCOMMA block_args_tail
|
|
2045
2060
|
|
2046
2061
|
qwords: tQWORDS_BEG tSPACE tSTRING_END
|
2047
2062
|
{
|
2048
|
-
(_, line), _, _ = val
|
2063
|
+
(_, line), _, (_, line_max) = val
|
2049
2064
|
|
2050
2065
|
result = s(:array).line line
|
2066
|
+
result.line_max = line_max
|
2051
2067
|
}
|
2052
2068
|
| tQWORDS_BEG qword_list tSTRING_END
|
2053
2069
|
{
|
2054
|
-
(_, line), list, _ = val
|
2070
|
+
(_, line), list, (_, line_max) = val
|
2055
2071
|
|
2056
2072
|
result = list.line line
|
2073
|
+
result.line_max = line_max
|
2057
2074
|
}
|
2058
2075
|
|
2059
2076
|
qsymbols: tQSYMBOLS_BEG tSPACE tSTRING_END
|
2060
2077
|
{
|
2061
|
-
(_, line), _, _ = val
|
2078
|
+
(_, line), _, (_, line_max) = val
|
2062
2079
|
|
2063
2080
|
result = s(:array).line line
|
2081
|
+
result.line_max = line_max
|
2064
2082
|
}
|
2065
2083
|
| tQSYMBOLS_BEG qsym_list tSTRING_END
|
2066
2084
|
{
|
2067
|
-
(_, line), list, _ = val
|
2085
|
+
(_, line), list, (_, line_max) = val
|
2068
2086
|
|
2069
2087
|
result = list.line line
|
2088
|
+
result.line_max = line_max
|
2070
2089
|
}
|
2071
2090
|
|
2072
2091
|
qword_list: none
|
@@ -2470,7 +2489,14 @@ keyword_variable: kNIL { result = s(:nil).line lexer.lineno }
|
|
2470
2489
|
result = s(:args, list).line list.line
|
2471
2490
|
end
|
2472
2491
|
|
2473
|
-
|
2492
|
+
if Sexp === item then
|
2493
|
+
line_max = item.line_max
|
2494
|
+
else
|
2495
|
+
item, line_max = item
|
2496
|
+
end
|
2497
|
+
|
2498
|
+
result << item
|
2499
|
+
result.line_max = line_max
|
2474
2500
|
}
|
2475
2501
|
|
2476
2502
|
f_label: tLABEL
|
@@ -2688,7 +2714,15 @@ keyword_variable: kNIL { result = s(:nil).line lexer.lineno }
|
|
2688
2714
|
opt_terms: | terms
|
2689
2715
|
opt_nl: | tNL
|
2690
2716
|
rparen: opt_nl tRPAREN
|
2717
|
+
{
|
2718
|
+
_, close = val
|
2719
|
+
result = [close, lexer.lineno]
|
2720
|
+
}
|
2691
2721
|
rbracket: opt_nl tRBRACK
|
2722
|
+
{
|
2723
|
+
_, close = val
|
2724
|
+
result = [close, lexer.lineno]
|
2725
|
+
}
|
2692
2726
|
trailer: | tNL | tCOMMA
|
2693
2727
|
|
2694
2728
|
term: tSEMI { yyerrok }
|
data/lib/ruby24_parser.rb
CHANGED
@@ -106,7 +106,7 @@ racc_action_table = [
|
|
106
106
|
-302, 230, -95, 614, 706, 235, 553, -302, 755, 717,
|
107
107
|
722, -302, 624, 623, 627, 626, -302, 757, -302, -301,
|
108
108
|
-301, -301, -301, -301, -301, -301, -301, -302, -301, -301,
|
109
|
-
725, 235,
|
109
|
+
725, 235, 235, -623, 733, 522, -301, -301, 736, 725,
|
110
110
|
611, -623, 608, 607, 606, -301, 609, 725, 620, 575,
|
111
111
|
-301, -301, -301, -301, -301, -301, -301, -301, -301, -301,
|
112
112
|
-301, -301, -301, -301, -302, 231, -301, -301, -301, 725,
|
@@ -5326,7 +5326,7 @@ racc_action_pointer = [
|
|
5326
5326
|
712, 702, 703, nil, nil, 705, 17197, 709, 17336, 25146,
|
5327
5327
|
25214, 752, 746, nil, 17475, 710, nil, 17614, 17753, 25282,
|
5328
5328
|
25350, 1298, 2718, 17892, 833, 851, 735, nil, nil, -80,
|
5329
|
-
-68,
|
5329
|
+
-68, 736, 751, nil, 340, 777, 3278, 856, nil, 3418,
|
5330
5330
|
30, 860, 868, 863, 890, nil, nil, 18031, 25418, 25486,
|
5331
5331
|
5, nil, 311, 342, 308, nil, 753, nil, 794, 18170,
|
5332
5332
|
nil, 812, nil, nil, nil, 18309, nil, 744, nil, 774,
|
@@ -5438,7 +5438,7 @@ racc_action_default = [
|
|
5438
5438
|
-649, -637, -81, -300, -97, -86, -649, -637, -648, -649,
|
5439
5439
|
-649, -107, -649, -519, -649, -93, -98, -649, -649, -649,
|
5440
5440
|
-649, -248, -240, -649, -458, -649, -637, -297, -250, -641,
|
5441
|
-
-641, -
|
5441
|
+
-641, -637, -649, -611, -641, -649, -648, -364, -365, -648,
|
5442
5442
|
-649, -649, -649, -649, -649, -359, -453, -648, -649, -649,
|
5443
5443
|
-302, -59, -118, -119, -649, -121, -649, -292, -648, -649,
|
5444
5444
|
-333, -546, -337, -629, -630, -649, -419, -568, -422, -607,
|
@@ -5505,23 +5505,23 @@ racc_goto_table = [
|
|
5505
5505
|
389, 741, 742, 787, 744, 833, 415, 416, 417, 418,
|
5506
5506
|
407, 864, 692, 390, 978, 392, 394, 397, 400, 403,
|
5507
5507
|
406, 314, 144, 390, 297, 297, 297, 727, 730, 132,
|
5508
|
-
926,
|
5509
|
-
|
5508
|
+
926, 976, 734, 889, 640, 1031, 1, 643, 352, 352,
|
5509
|
+
2, 1015, 352, 588, 1017, 590, 296, 296, 296, 138,
|
5510
5510
|
316, 652, 545, 847, 938, 236, 359, 703, 530, 219,
|
5511
5511
|
368, 429, 9, 422, 896, 738, 865, 293, 306, 307,
|
5512
5512
|
278, 419, 690, 654, 343, 561, 689, 385, 562, 366,
|
5513
5513
|
758, 382, 592, 775, 777, 779, 346, 348, 556, 349,
|
5514
|
-
350, 369, 19,
|
5515
|
-
468, 371, 762,
|
5516
|
-
|
5517
|
-
387,
|
5518
|
-
768, 1057,
|
5519
|
-
|
5520
|
-
|
5521
|
-
|
5522
|
-
769, 903,
|
5523
|
-
|
5524
|
-
836, 641,
|
5514
|
+
350, 369, 19, 732, 447, 929, 876, 589, 19, 878,
|
5515
|
+
468, 1010, 371, 762, 352, 352, 352, 352, 1031, 591,
|
5516
|
+
766, 519, 960, 237, 977, 928, 930, 1014, 596, 295,
|
5517
|
+
885, 387, 237, 237, 237, 700, 19, 323, 323, 1079,
|
5518
|
+
768, 1057, 1017, 697, 697, 512, 513, 838, 869, 613,
|
5519
|
+
687, 427, 1045, 745, 854, 450, 466, 781, 473, 413,
|
5520
|
+
976, 906, 19, 940, 388, 391, 937, 237, 237, 743,
|
5521
|
+
393, 237, 363, 396, 399, 402, 317, 405, 874, 684,
|
5522
|
+
769, 903, 908, 866, 295, 295, 792, 456, 462, 793,
|
5523
|
+
408, 899, 1027, 635, 295, 637, 877, 894, 641, 700,
|
5524
|
+
836, 641, 891, 605, 991, 444, 445, 457, 1025, 595,
|
5525
5525
|
450, nil, nil, nil, 469, 470, nil, 524, nil, nil,
|
5526
5526
|
nil, nil, nil, nil, 518, 518, 827, nil, 19, nil,
|
5527
5527
|
390, 546, nil, 237, 237, 237, 237, 19, 570, 542,
|
@@ -5548,7 +5548,7 @@ racc_goto_table = [
|
|
5548
5548
|
295, 677, 795, nil, nil, 795, 19, nil, nil, nil,
|
5549
5549
|
nil, 688, 457, nil, nil, 237, 19, 19, nil, nil,
|
5550
5550
|
332, 875, nil, nil, 855, nil, 450, 466, 332, 586,
|
5551
|
-
712, 586,
|
5551
|
+
712, 586, 665, nil, 950, 953, nil, 466, nil, 295,
|
5552
5552
|
840, nil, nil, nil, 672, 751, 962, nil, 1077, 1078,
|
5553
5553
|
nil, nil, nil, nil, nil, nil, 735, nil, nil, 737,
|
5554
5554
|
nil, nil, 739, nil, nil, 450, 466, nil, nil, 1053,
|
@@ -5904,23 +5904,23 @@ racc_goto_check = [
|
|
5904
5904
|
188, 100, 100, 147, 100, 160, 24, 24, 24, 24,
|
5905
5905
|
188, 109, 53, 6, 148, 6, 6, 6, 6, 6,
|
5906
5906
|
6, 59, 71, 6, 84, 84, 84, 83, 83, 7,
|
5907
|
-
158,
|
5908
|
-
|
5907
|
+
158, 145, 83, 162, 192, 216, 1, 192, 31, 31,
|
5908
|
+
3, 164, 31, 69, 165, 69, 82, 82, 82, 11,
|
5909
5909
|
60, 13, 65, 16, 18, 27, 5, 20, 21, 23,
|
5910
5910
|
26, 30, 9, 32, 210, 43, 45, 58, 58, 58,
|
5911
5911
|
49, 9, 55, 74, 79, 81, 86, 98, 101, 115,
|
5912
5912
|
117, 122, 123, 207, 207, 207, 124, 125, 126, 127,
|
5913
|
-
128, 129, 35,
|
5914
|
-
75, 134, 135,
|
5915
|
-
|
5916
|
-
|
5917
|
-
169, 148,
|
5918
|
-
|
5919
|
-
|
5920
|
-
|
5921
|
-
170, 147,
|
5922
|
-
|
5923
|
-
53, 193,
|
5913
|
+
128, 129, 35, 37, 75, 162, 130, 131, 35, 132,
|
5914
|
+
75, 133, 134, 135, 31, 31, 31, 31, 216, 136,
|
5915
|
+
137, 87, 138, 35, 149, 150, 156, 163, 166, 46,
|
5916
|
+
167, 168, 35, 35, 35, 220, 35, 35, 35, 164,
|
5917
|
+
169, 148, 165, 88, 88, 174, 175, 177, 178, 209,
|
5918
|
+
180, 14, 181, 182, 183, 6, 71, 146, 38, 7,
|
5919
|
+
145, 146, 35, 184, 187, 189, 160, 35, 35, 113,
|
5920
|
+
190, 35, 35, 191, 194, 195, 14, 196, 68, 36,
|
5921
|
+
170, 147, 197, 100, 46, 46, 198, 50, 50, 199,
|
5922
|
+
202, 215, 158, 193, 46, 193, 203, 208, 193, 220,
|
5923
|
+
53, 193, 212, 204, 162, 31, 31, 85, 213, 219,
|
5924
5924
|
6, nil, nil, nil, 31, 31, nil, 188, nil, nil,
|
5925
5925
|
nil, nil, nil, nil, 6, 6, 37, nil, 35, nil,
|
5926
5926
|
6, 63, nil, 35, 35, 35, 35, 35, 24, 40,
|
@@ -5947,7 +5947,7 @@ racc_goto_check = [
|
|
5947
5947
|
46, 85, 193, nil, nil, 193, 35, nil, nil, nil,
|
5948
5948
|
nil, 51, 85, nil, nil, 35, 35, 35, nil, nil,
|
5949
5949
|
78, 36, nil, nil, 29, nil, 6, 71, 78, 35,
|
5950
|
-
50, 35,
|
5950
|
+
50, 35, 40, nil, 106, 12, nil, 71, nil, 46,
|
5951
5951
|
87, nil, nil, nil, 85, 42, 12, nil, 100, 100,
|
5952
5952
|
nil, nil, nil, nil, nil, nil, 14, nil, nil, 14,
|
5953
5953
|
nil, nil, 118, nil, nil, 6, 71, nil, nil, 207,
|
@@ -6292,7 +6292,7 @@ racc_goto_check = [
|
|
6292
6292
|
nil, nil, 67, nil, nil, nil, nil, nil, 67, 67 ]
|
6293
6293
|
|
6294
6294
|
racc_goto_pointer = [
|
6295
|
-
nil, 116, 15,
|
6295
|
+
nil, 116, 15, 120, nil, 65, -2, 101, 63, 14,
|
6296
6296
|
-88, 119, -331, -290, 0, -531, -588, -667, -713, nil,
|
6297
6297
|
-391, -175, 15, 127, -47, -175, 68, 112, 1791, -189,
|
6298
6298
|
-81, 51, 4, -177, 1930, 170, -226, -388, -9, 2261,
|
@@ -6305,15 +6305,15 @@ racc_goto_pointer = [
|
|
6305
6305
|
-490, -192, -46, nil, nil, nil, -325, -698, nil, -646,
|
6306
6306
|
nil, nil, nil, -334, nil, 87, nil, -428, 2, nil,
|
6307
6307
|
nil, -549, 86, -220, 105, 105, -179, 106, 106, 98,
|
6308
|
-
-
|
6309
|
-
nil, nil, nil, nil, nil, -
|
6310
|
-
-
|
6311
|
-
-602, nil, -
|
6312
|
-
-347, -11, -202, nil, -
|
6313
|
-
-
|
6314
|
-
|
6315
|
-
nil, nil,
|
6316
|
-
-630, -119, -
|
6308
|
+
-582, -193, -582, -774, 108, -407, -192, -402, -691, nil,
|
6309
|
+
nil, nil, nil, nil, nil, -793, -555, -531, -811, -710,
|
6310
|
+
-636, nil, -362, -547, 244, 109, -635, -167, -721, -189,
|
6311
|
+
-602, nil, -656, -766, -842, -839, -189, -568, 112, -386,
|
6312
|
+
-347, -11, -202, nil, -72, -72, nil, -476, -527, nil,
|
6313
|
+
-284, -785, -353, -499, -621, nil, nil, 142, -15, 138,
|
6314
|
+
142, 144, -282, -128, 144, 144, 145, -540, -376, -374,
|
6315
|
+
nil, nil, 155, -493, -324, nil, nil, -439, -507, -168,
|
6316
|
+
-630, -119, -498, -702, nil, -705, -871, nil, nil, -107,
|
6317
6317
|
-462 ]
|
6318
6318
|
|
6319
6319
|
racc_goto_default = [
|
@@ -6981,8 +6981,8 @@ racc_reduce_table = [
|
|
6981
6981
|
1, 152, :_reduce_none,
|
6982
6982
|
0, 187, :_reduce_none,
|
6983
6983
|
1, 187, :_reduce_none,
|
6984
|
-
2, 208, :
|
6985
|
-
2, 184, :
|
6984
|
+
2, 208, :_reduce_639,
|
6985
|
+
2, 184, :_reduce_640,
|
6986
6986
|
0, 230, :_reduce_none,
|
6987
6987
|
1, 230, :_reduce_none,
|
6988
6988
|
1, 230, :_reduce_none,
|
@@ -7772,6 +7772,7 @@ end
|
|
7772
7772
|
|
7773
7773
|
def _reduce_38(val, _values, result)
|
7774
7774
|
lhs, _, rhs = val
|
7775
|
+
|
7775
7776
|
result = new_assign lhs, s(:svalue, rhs).line(rhs.line)
|
7776
7777
|
|
7777
7778
|
result
|
@@ -8895,8 +8896,10 @@ def _reduce_255(val, _values, result)
|
|
8895
8896
|
end
|
8896
8897
|
|
8897
8898
|
def _reduce_256(val, _values, result)
|
8898
|
-
_, args, _ = val
|
8899
|
+
_, args, (_, line_max) = val
|
8900
|
+
|
8899
8901
|
result = args
|
8902
|
+
result.line_max = line_max if args
|
8900
8903
|
|
8901
8904
|
result
|
8902
8905
|
end
|
@@ -9177,10 +9180,12 @@ def _reduce_303(val, _values, result)
|
|
9177
9180
|
end
|
9178
9181
|
|
9179
9182
|
def _reduce_304(val, _values, result)
|
9180
|
-
_, line, args, _ = val
|
9183
|
+
_, line, args, (_, line_max) = val
|
9184
|
+
|
9181
9185
|
result = args || s(:array)
|
9182
9186
|
result.sexp_type = :array # aref_args is :args
|
9183
9187
|
result.line line
|
9188
|
+
result.line_max = line_max
|
9184
9189
|
|
9185
9190
|
result
|
9186
9191
|
end
|
@@ -9966,15 +9971,21 @@ end
|
|
9966
9971
|
def _reduce_430(val, _values, result)
|
9967
9972
|
call, args = val
|
9968
9973
|
|
9969
|
-
result = call
|
9974
|
+
result = call
|
9975
|
+
|
9976
|
+
if args then
|
9977
|
+
call.concat args.sexp_body
|
9978
|
+
result.line_max = args.line_max
|
9979
|
+
end
|
9970
9980
|
|
9971
9981
|
result
|
9972
9982
|
end
|
9973
9983
|
|
9974
9984
|
def _reduce_431(val, _values, result)
|
9975
|
-
recv, call_op, (op,
|
9985
|
+
recv, call_op, (op, op_line), args = val
|
9976
9986
|
|
9977
9987
|
result = new_call recv, op.to_sym, args, call_op
|
9988
|
+
result.line_max = op_line unless args
|
9978
9989
|
|
9979
9990
|
result
|
9980
9991
|
end
|
@@ -10261,17 +10272,19 @@ def _reduce_475(val, _values, result)
|
|
10261
10272
|
end
|
10262
10273
|
|
10263
10274
|
def _reduce_476(val, _values, result)
|
10264
|
-
(_, line), _, _ = val
|
10275
|
+
(_, line), _, (_, line_max) = val
|
10265
10276
|
|
10266
10277
|
result = s(:array).line line
|
10278
|
+
result.line_max = line_max
|
10267
10279
|
|
10268
10280
|
result
|
10269
10281
|
end
|
10270
10282
|
|
10271
10283
|
def _reduce_477(val, _values, result)
|
10272
|
-
(_, line), list, _ = val
|
10284
|
+
(_, line), list, (_, line_max) = val
|
10273
10285
|
|
10274
10286
|
result = list.line line
|
10287
|
+
result.line_max = line_max
|
10275
10288
|
|
10276
10289
|
result
|
10277
10290
|
end
|
@@ -10297,17 +10310,19 @@ def _reduce_481(val, _values, result)
|
|
10297
10310
|
end
|
10298
10311
|
|
10299
10312
|
def _reduce_482(val, _values, result)
|
10300
|
-
(_, line), _, _ = val
|
10313
|
+
(_, line), _, (_, line_max) = val
|
10301
10314
|
|
10302
10315
|
result = s(:array).line line
|
10316
|
+
result.line_max = line_max
|
10303
10317
|
|
10304
10318
|
result
|
10305
10319
|
end
|
10306
10320
|
|
10307
10321
|
def _reduce_483(val, _values, result)
|
10308
|
-
(_, line), list, _, = val
|
10309
|
-
|
10310
|
-
result = list
|
10322
|
+
(_, line), list, (_, line_max), = val
|
10323
|
+
|
10324
|
+
result = list.line line
|
10325
|
+
result.line_max = line_max
|
10311
10326
|
|
10312
10327
|
result
|
10313
10328
|
end
|
@@ -10326,33 +10341,37 @@ def _reduce_485(val, _values, result)
|
|
10326
10341
|
end
|
10327
10342
|
|
10328
10343
|
def _reduce_486(val, _values, result)
|
10329
|
-
(_, line), _, _ = val
|
10344
|
+
(_, line), _, (_, line_max) = val
|
10330
10345
|
|
10331
10346
|
result = s(:array).line line
|
10347
|
+
result.line_max = line_max
|
10332
10348
|
|
10333
10349
|
result
|
10334
10350
|
end
|
10335
10351
|
|
10336
10352
|
def _reduce_487(val, _values, result)
|
10337
|
-
(_, line), list, _ = val
|
10353
|
+
(_, line), list, (_, line_max) = val
|
10338
10354
|
|
10339
10355
|
result = list.line line
|
10356
|
+
result.line_max = line_max
|
10340
10357
|
|
10341
10358
|
result
|
10342
10359
|
end
|
10343
10360
|
|
10344
10361
|
def _reduce_488(val, _values, result)
|
10345
|
-
(_, line), _, _ = val
|
10362
|
+
(_, line), _, (_, line_max) = val
|
10346
10363
|
|
10347
10364
|
result = s(:array).line line
|
10365
|
+
result.line_max = line_max
|
10348
10366
|
|
10349
10367
|
result
|
10350
10368
|
end
|
10351
10369
|
|
10352
10370
|
def _reduce_489(val, _values, result)
|
10353
|
-
(_, line), list, _ = val
|
10371
|
+
(_, line), list, (_, line_max) = val
|
10354
10372
|
|
10355
10373
|
result = list.line line
|
10374
|
+
result.line_max = line_max
|
10356
10375
|
|
10357
10376
|
result
|
10358
10377
|
end
|
@@ -10901,7 +10920,14 @@ def _reduce_579(val, _values, result)
|
|
10901
10920
|
result = s(:args, list).line list.line
|
10902
10921
|
end
|
10903
10922
|
|
10904
|
-
|
10923
|
+
if Sexp === item then
|
10924
|
+
line_max = item.line_max
|
10925
|
+
else
|
10926
|
+
item, line_max = item
|
10927
|
+
end
|
10928
|
+
|
10929
|
+
result << item
|
10930
|
+
result.line_max = line_max
|
10905
10931
|
|
10906
10932
|
result
|
10907
10933
|
end
|
@@ -11195,9 +11221,19 @@ end
|
|
11195
11221
|
|
11196
11222
|
# reduce 638 omitted
|
11197
11223
|
|
11198
|
-
|
11224
|
+
def _reduce_639(val, _values, result)
|
11225
|
+
_, close = val
|
11226
|
+
result = [close, lexer.lineno]
|
11227
|
+
|
11228
|
+
result
|
11229
|
+
end
|
11230
|
+
|
11231
|
+
def _reduce_640(val, _values, result)
|
11232
|
+
_, close = val
|
11233
|
+
result = [close, lexer.lineno]
|
11199
11234
|
|
11200
|
-
|
11235
|
+
result
|
11236
|
+
end
|
11201
11237
|
|
11202
11238
|
# reduce 641 omitted
|
11203
11239
|
|
data/lib/ruby24_parser.y
CHANGED
@@ -222,6 +222,7 @@ rule
|
|
222
222
|
| lhs tEQL mrhs
|
223
223
|
{
|
224
224
|
lhs, _, rhs = val
|
225
|
+
|
225
226
|
result = new_assign lhs, s(:svalue, rhs).line(rhs.line)
|
226
227
|
}
|
227
228
|
| mlhs tEQL mrhs_arg
|
@@ -983,8 +984,10 @@ rule
|
|
983
984
|
|
984
985
|
paren_args: tLPAREN2 opt_call_args rparen
|
985
986
|
{
|
986
|
-
_, args, _ = val
|
987
|
+
_, args, (_, line_max) = val
|
988
|
+
|
987
989
|
result = args
|
990
|
+
result.line_max = line_max if args
|
988
991
|
}
|
989
992
|
|
990
993
|
opt_paren_args: none
|
@@ -1189,12 +1192,14 @@ rule
|
|
1189
1192
|
{
|
1190
1193
|
result = wrap :colon3, val[1]
|
1191
1194
|
}
|
1192
|
-
| tLBRACK { result = lexer.lineno } aref_args
|
1195
|
+
| tLBRACK { result = lexer.lineno } aref_args rbracket
|
1193
1196
|
{
|
1194
|
-
_, line, args, _ = val
|
1197
|
+
_, line, args, (_, line_max) = val
|
1198
|
+
|
1195
1199
|
result = args || s(:array)
|
1196
1200
|
result.sexp_type = :array # aref_args is :args
|
1197
1201
|
result.line line
|
1202
|
+
result.line_max = line_max
|
1198
1203
|
}
|
1199
1204
|
| tLBRACE
|
1200
1205
|
{
|
@@ -1782,13 +1787,19 @@ opt_block_args_tail: tCOMMA block_args_tail
|
|
1782
1787
|
{
|
1783
1788
|
call, args = val
|
1784
1789
|
|
1785
|
-
result = call
|
1790
|
+
result = call
|
1791
|
+
|
1792
|
+
if args then
|
1793
|
+
call.concat args.sexp_body
|
1794
|
+
result.line_max = args.line_max
|
1795
|
+
end
|
1786
1796
|
}
|
1787
1797
|
| primary_value call_op operation2 opt_paren_args
|
1788
1798
|
{
|
1789
|
-
recv, call_op, (op,
|
1799
|
+
recv, call_op, (op, op_line), args = val
|
1790
1800
|
|
1791
1801
|
result = new_call recv, op.to_sym, args, call_op
|
1802
|
+
result.line_max = op_line unless args
|
1792
1803
|
}
|
1793
1804
|
| primary_value tCOLON2 operation2 paren_args
|
1794
1805
|
{
|
@@ -2002,15 +2013,17 @@ opt_block_args_tail: tCOMMA block_args_tail
|
|
2002
2013
|
|
2003
2014
|
words: tWORDS_BEG tSPACE tSTRING_END
|
2004
2015
|
{
|
2005
|
-
(_, line), _, _ = val
|
2016
|
+
(_, line), _, (_, line_max) = val
|
2006
2017
|
|
2007
2018
|
result = s(:array).line line
|
2019
|
+
result.line_max = line_max
|
2008
2020
|
}
|
2009
2021
|
| tWORDS_BEG word_list tSTRING_END
|
2010
2022
|
{
|
2011
|
-
(_, line), list, _ = val
|
2023
|
+
(_, line), list, (_, line_max) = val
|
2012
2024
|
|
2013
2025
|
result = list.line line
|
2026
|
+
result.line_max = line_max
|
2014
2027
|
}
|
2015
2028
|
|
2016
2029
|
word_list: none
|
@@ -2030,15 +2043,17 @@ opt_block_args_tail: tCOMMA block_args_tail
|
|
2030
2043
|
|
2031
2044
|
symbols: tSYMBOLS_BEG tSPACE tSTRING_END
|
2032
2045
|
{
|
2033
|
-
(_, line), _, _ = val
|
2046
|
+
(_, line), _, (_, line_max) = val
|
2034
2047
|
|
2035
2048
|
result = s(:array).line line
|
2049
|
+
result.line_max = line_max
|
2036
2050
|
}
|
2037
2051
|
| tSYMBOLS_BEG symbol_list tSTRING_END
|
2038
2052
|
{
|
2039
|
-
(_, line), list, _, = val
|
2040
|
-
|
2041
|
-
result = list
|
2053
|
+
(_, line), list, (_, line_max), = val
|
2054
|
+
|
2055
|
+
result = list.line line
|
2056
|
+
result.line_max = line_max
|
2042
2057
|
}
|
2043
2058
|
|
2044
2059
|
symbol_list: none
|
@@ -2053,28 +2068,32 @@ opt_block_args_tail: tCOMMA block_args_tail
|
|
2053
2068
|
|
2054
2069
|
qwords: tQWORDS_BEG tSPACE tSTRING_END
|
2055
2070
|
{
|
2056
|
-
(_, line), _, _ = val
|
2071
|
+
(_, line), _, (_, line_max) = val
|
2057
2072
|
|
2058
2073
|
result = s(:array).line line
|
2074
|
+
result.line_max = line_max
|
2059
2075
|
}
|
2060
2076
|
| tQWORDS_BEG qword_list tSTRING_END
|
2061
2077
|
{
|
2062
|
-
(_, line), list, _ = val
|
2078
|
+
(_, line), list, (_, line_max) = val
|
2063
2079
|
|
2064
2080
|
result = list.line line
|
2081
|
+
result.line_max = line_max
|
2065
2082
|
}
|
2066
2083
|
|
2067
2084
|
qsymbols: tQSYMBOLS_BEG tSPACE tSTRING_END
|
2068
2085
|
{
|
2069
|
-
(_, line), _, _ = val
|
2086
|
+
(_, line), _, (_, line_max) = val
|
2070
2087
|
|
2071
2088
|
result = s(:array).line line
|
2089
|
+
result.line_max = line_max
|
2072
2090
|
}
|
2073
2091
|
| tQSYMBOLS_BEG qsym_list tSTRING_END
|
2074
2092
|
{
|
2075
|
-
(_, line), list, _ = val
|
2093
|
+
(_, line), list, (_, line_max) = val
|
2076
2094
|
|
2077
2095
|
result = list.line line
|
2096
|
+
result.line_max = line_max
|
2078
2097
|
}
|
2079
2098
|
|
2080
2099
|
qword_list: none
|
@@ -2478,7 +2497,14 @@ keyword_variable: kNIL { result = s(:nil).line lexer.lineno }
|
|
2478
2497
|
result = s(:args, list).line list.line
|
2479
2498
|
end
|
2480
2499
|
|
2481
|
-
|
2500
|
+
if Sexp === item then
|
2501
|
+
line_max = item.line_max
|
2502
|
+
else
|
2503
|
+
item, line_max = item
|
2504
|
+
end
|
2505
|
+
|
2506
|
+
result << item
|
2507
|
+
result.line_max = line_max
|
2482
2508
|
}
|
2483
2509
|
|
2484
2510
|
f_label: tLABEL
|
@@ -2696,7 +2722,15 @@ keyword_variable: kNIL { result = s(:nil).line lexer.lineno }
|
|
2696
2722
|
opt_terms: | terms
|
2697
2723
|
opt_nl: | tNL
|
2698
2724
|
rparen: opt_nl tRPAREN
|
2725
|
+
{
|
2726
|
+
_, close = val
|
2727
|
+
result = [close, lexer.lineno]
|
2728
|
+
}
|
2699
2729
|
rbracket: opt_nl tRBRACK
|
2730
|
+
{
|
2731
|
+
_, close = val
|
2732
|
+
result = [close, lexer.lineno]
|
2733
|
+
}
|
2700
2734
|
trailer: | tNL | tCOMMA
|
2701
2735
|
|
2702
2736
|
term: tSEMI { yyerrok }
|