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/ruby21_parser.y
CHANGED
@@ -679,8 +679,7 @@ rule
|
|
679
679
|
|
680
680
|
cpath: tCOLON3 cname
|
681
681
|
{
|
682
|
-
|
683
|
-
result = s(:colon3, name.to_sym).line line
|
682
|
+
result = wrap :colon3, val[1]
|
684
683
|
}
|
685
684
|
| cname
|
686
685
|
{
|
@@ -705,9 +704,7 @@ rule
|
|
705
704
|
|
706
705
|
fitem: fname
|
707
706
|
{
|
708
|
-
|
709
|
-
|
710
|
-
result = s(:lit, id.to_sym).line line
|
707
|
+
result = wrap :lit, val[0]
|
711
708
|
}
|
712
709
|
| symbol
|
713
710
|
|
@@ -776,9 +773,9 @@ rule
|
|
776
773
|
}
|
777
774
|
| tCOLON3 tCONSTANT tOP_ASGN arg_rhs
|
778
775
|
{
|
779
|
-
_,
|
776
|
+
_, lhs, op, rhs = val
|
780
777
|
|
781
|
-
lhs =
|
778
|
+
lhs = wrap :colon3, lhs
|
782
779
|
result = new_const_op_asgn [lhs, op, rhs]
|
783
780
|
}
|
784
781
|
| backref tOP_ASGN arg_rhs
|
@@ -1180,9 +1177,7 @@ rule
|
|
1180
1177
|
}
|
1181
1178
|
| tCOLON3 tCONSTANT
|
1182
1179
|
{
|
1183
|
-
|
1184
|
-
|
1185
|
-
result = s(:colon3, id.to_sym).line line
|
1180
|
+
result = wrap :colon3, val[1]
|
1186
1181
|
}
|
1187
1182
|
| tLBRACK { result = lexer.lineno } aref_args tRBRACK
|
1188
1183
|
{
|
@@ -1676,8 +1671,7 @@ opt_block_args_tail: tCOMMA block_args_tail
|
|
1676
1671
|
|
1677
1672
|
bvar: tIDENTIFIER
|
1678
1673
|
{
|
1679
|
-
|
1680
|
-
result = s(:shadow, id.to_sym).line line
|
1674
|
+
result = wrap :shadow, val[0]
|
1681
1675
|
}
|
1682
1676
|
| f_bad_arg
|
1683
1677
|
|
@@ -2192,18 +2186,15 @@ regexp_contents: none
|
|
2192
2186
|
|
2193
2187
|
string_dvar: tGVAR
|
2194
2188
|
{
|
2195
|
-
|
2196
|
-
result = s(:gvar, id.to_sym).line line
|
2189
|
+
result = wrap :gvar, val[0]
|
2197
2190
|
}
|
2198
2191
|
| tIVAR
|
2199
2192
|
{
|
2200
|
-
|
2201
|
-
result = s(:ivar, id.to_sym).line line
|
2193
|
+
result = wrap :ivar, val[0]
|
2202
2194
|
}
|
2203
2195
|
| tCVAR
|
2204
2196
|
{
|
2205
|
-
|
2206
|
-
result = s(:cvar, id.to_sym).line line
|
2197
|
+
result = wrap :cvar, val[0]
|
2207
2198
|
}
|
2208
2199
|
| backref
|
2209
2200
|
|
@@ -2212,17 +2203,13 @@ regexp_contents: none
|
|
2212
2203
|
|
2213
2204
|
ssym: tSYMBEG sym
|
2214
2205
|
{
|
2215
|
-
_, (id, line) = val
|
2216
|
-
|
2217
2206
|
lexer.lex_state = EXPR_END
|
2218
|
-
result =
|
2207
|
+
result = wrap :lit, val[1]
|
2219
2208
|
}
|
2220
2209
|
| tSYMBOL
|
2221
2210
|
{
|
2222
|
-
(id, line), = val
|
2223
|
-
|
2224
2211
|
lexer.lex_state = EXPR_END
|
2225
|
-
result =
|
2212
|
+
result = wrap :lit, val[0]
|
2226
2213
|
}
|
2227
2214
|
|
2228
2215
|
sym: fname | tIVAR | tGVAR | tCVAR
|
@@ -2664,10 +2651,10 @@ keyword_variable: kNIL { result = s(:nil).line lexer.lineno }
|
|
2664
2651
|
}
|
2665
2652
|
| tLABEL arg_value
|
2666
2653
|
{
|
2667
|
-
|
2654
|
+
label, arg = val
|
2668
2655
|
|
2669
|
-
lit =
|
2670
|
-
result = s(:array, lit, arg).line line
|
2656
|
+
lit = wrap :lit, label
|
2657
|
+
result = s(:array, lit, arg).line lit.line
|
2671
2658
|
}
|
2672
2659
|
| tDSTAR arg_value
|
2673
2660
|
{
|