ruby_parser 3.18.1 → 3.19.0
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 +21 -0
- data/Manifest.txt +2 -0
- data/README.rdoc +8 -6
- data/Rakefile +8 -7
- data/gauntlet.md +17 -15
- data/lib/ruby20_parser.rb +5871 -2026
- data/lib/ruby20_parser.y +14 -27
- data/lib/ruby21_parser.rb +5847 -2049
- data/lib/ruby21_parser.y +14 -27
- data/lib/ruby22_parser.rb +5969 -2074
- data/lib/ruby22_parser.y +14 -27
- data/lib/ruby23_parser.rb +5973 -2078
- data/lib/ruby23_parser.y +14 -27
- data/lib/ruby24_parser.rb +6061 -2098
- data/lib/ruby24_parser.y +14 -27
- data/lib/ruby25_parser.rb +6061 -2098
- data/lib/ruby25_parser.y +14 -27
- data/lib/ruby26_parser.rb +6063 -2097
- data/lib/ruby26_parser.y +14 -27
- data/lib/ruby27_parser.rb +6862 -2399
- data/lib/ruby27_parser.y +19 -41
- data/lib/ruby30_parser.rb +7162 -2671
- data/lib/ruby30_parser.y +65 -90
- data/lib/ruby31_parser.rb +13622 -0
- data/lib/ruby31_parser.y +3481 -0
- data/lib/ruby3_parser.yy +149 -89
- data/lib/ruby_parser.rb +2 -0
- data/lib/ruby_parser.yy +19 -41
- data/lib/ruby_parser_extras.rb +46 -1
- data/test/test_ruby_parser.rb +116 -0
- data.tar.gz.sig +0 -0
- metadata +18 -13
- metadata.gz.sig +0 -0
data/lib/ruby23_parser.y
CHANGED
@@ -681,8 +681,7 @@ rule
|
|
681
681
|
|
682
682
|
cpath: tCOLON3 cname
|
683
683
|
{
|
684
|
-
|
685
|
-
result = s(:colon3, name.to_sym).line line
|
684
|
+
result = wrap :colon3, val[1]
|
686
685
|
}
|
687
686
|
| cname
|
688
687
|
{
|
@@ -707,9 +706,7 @@ rule
|
|
707
706
|
|
708
707
|
fitem: fname
|
709
708
|
{
|
710
|
-
|
711
|
-
|
712
|
-
result = s(:lit, id.to_sym).line line
|
709
|
+
result = wrap :lit, val[0]
|
713
710
|
}
|
714
711
|
| symbol
|
715
712
|
|
@@ -778,9 +775,9 @@ rule
|
|
778
775
|
}
|
779
776
|
| tCOLON3 tCONSTANT tOP_ASGN arg_rhs
|
780
777
|
{
|
781
|
-
_,
|
778
|
+
_, lhs, op, rhs = val
|
782
779
|
|
783
|
-
lhs =
|
780
|
+
lhs = wrap :colon3, lhs
|
784
781
|
result = new_const_op_asgn [lhs, op, rhs]
|
785
782
|
}
|
786
783
|
| backref tOP_ASGN arg_rhs
|
@@ -1182,9 +1179,7 @@ rule
|
|
1182
1179
|
}
|
1183
1180
|
| tCOLON3 tCONSTANT
|
1184
1181
|
{
|
1185
|
-
|
1186
|
-
|
1187
|
-
result = s(:colon3, id.to_sym).line line
|
1182
|
+
result = wrap :colon3, val[1]
|
1188
1183
|
}
|
1189
1184
|
| tLBRACK { result = lexer.lineno } aref_args tRBRACK
|
1190
1185
|
{
|
@@ -1678,8 +1673,7 @@ opt_block_args_tail: tCOMMA block_args_tail
|
|
1678
1673
|
|
1679
1674
|
bvar: tIDENTIFIER
|
1680
1675
|
{
|
1681
|
-
|
1682
|
-
result = s(:shadow, id.to_sym).line line
|
1676
|
+
result = wrap :shadow, val[0]
|
1683
1677
|
}
|
1684
1678
|
| f_bad_arg
|
1685
1679
|
|
@@ -2194,18 +2188,15 @@ regexp_contents: none
|
|
2194
2188
|
|
2195
2189
|
string_dvar: tGVAR
|
2196
2190
|
{
|
2197
|
-
|
2198
|
-
result = s(:gvar, id.to_sym).line line
|
2191
|
+
result = wrap :gvar, val[0]
|
2199
2192
|
}
|
2200
2193
|
| tIVAR
|
2201
2194
|
{
|
2202
|
-
|
2203
|
-
result = s(:ivar, id.to_sym).line line
|
2195
|
+
result = wrap :ivar, val[0]
|
2204
2196
|
}
|
2205
2197
|
| tCVAR
|
2206
2198
|
{
|
2207
|
-
|
2208
|
-
result = s(:cvar, id.to_sym).line line
|
2199
|
+
result = wrap :cvar, val[0]
|
2209
2200
|
}
|
2210
2201
|
| backref
|
2211
2202
|
|
@@ -2214,17 +2205,13 @@ regexp_contents: none
|
|
2214
2205
|
|
2215
2206
|
ssym: tSYMBEG sym
|
2216
2207
|
{
|
2217
|
-
_, (id, line) = val
|
2218
|
-
|
2219
2208
|
lexer.lex_state = EXPR_END
|
2220
|
-
result =
|
2209
|
+
result = wrap :lit, val[1]
|
2221
2210
|
}
|
2222
2211
|
| tSYMBOL
|
2223
2212
|
{
|
2224
|
-
(id, line), = val
|
2225
|
-
|
2226
2213
|
lexer.lex_state = EXPR_END
|
2227
|
-
result =
|
2214
|
+
result = wrap :lit, val[0]
|
2228
2215
|
}
|
2229
2216
|
|
2230
2217
|
sym: fname | tIVAR | tGVAR | tCVAR
|
@@ -2668,10 +2655,10 @@ keyword_variable: kNIL { result = s(:nil).line lexer.lineno }
|
|
2668
2655
|
}
|
2669
2656
|
| tLABEL arg_value
|
2670
2657
|
{
|
2671
|
-
|
2658
|
+
label, arg = val
|
2672
2659
|
|
2673
|
-
lit =
|
2674
|
-
result = s(:array, lit, arg).line line
|
2660
|
+
lit = wrap :lit, label
|
2661
|
+
result = s(:array, lit, arg).line lit.line
|
2675
2662
|
}
|
2676
2663
|
| tSTRING_BEG string_contents tLABEL_END arg_value
|
2677
2664
|
{
|