ruby_parser 3.18.0 → 3.19.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/lib/ruby25_parser.y CHANGED
@@ -689,8 +689,7 @@ rule
689
689
 
690
690
  cpath: tCOLON3 cname
691
691
  {
692
- _, (name, line) = val
693
- result = s(:colon3, name.to_sym).line line
692
+ result = wrap :colon3, val[1]
694
693
  }
695
694
  | cname
696
695
  {
@@ -715,9 +714,7 @@ rule
715
714
 
716
715
  fitem: fname
717
716
  {
718
- (id, line), = val
719
-
720
- result = s(:lit, id.to_sym).line line
717
+ result = wrap :lit, val[0]
721
718
  }
722
719
  | symbol
723
720
 
@@ -786,9 +783,9 @@ rule
786
783
  }
787
784
  | tCOLON3 tCONSTANT tOP_ASGN arg_rhs
788
785
  {
789
- _, (lhs, line), op, rhs = val
786
+ _, lhs, op, rhs = val
790
787
 
791
- lhs = s(:colon3, lhs.to_sym).line line
788
+ lhs = wrap :colon3, lhs
792
789
  result = new_const_op_asgn [lhs, op, rhs]
793
790
  }
794
791
  | backref tOP_ASGN arg_rhs
@@ -1190,9 +1187,7 @@ rule
1190
1187
  }
1191
1188
  | tCOLON3 tCONSTANT
1192
1189
  {
1193
- _, (id, line) = val
1194
-
1195
- result = s(:colon3, id.to_sym).line line
1190
+ result = wrap :colon3, val[1]
1196
1191
  }
1197
1192
  | tLBRACK { result = lexer.lineno } aref_args tRBRACK
1198
1193
  {
@@ -1216,15 +1211,21 @@ rule
1216
1211
  }
1217
1212
  | kYIELD tLPAREN2 call_args rparen
1218
1213
  {
1219
- result = new_yield val[2]
1214
+ (_, line), _, args, _ = val
1215
+
1216
+ result = new_yield(args).line line
1220
1217
  }
1221
1218
  | kYIELD tLPAREN2 rparen
1222
1219
  {
1223
- result = new_yield
1220
+ (_, line), _, _ = val
1221
+
1222
+ result = new_yield.line line
1224
1223
  }
1225
1224
  | kYIELD
1226
1225
  {
1227
- result = new_yield
1226
+ (_, line), = val
1227
+
1228
+ result = new_yield.line line
1228
1229
  }
1229
1230
  | kDEFINED opt_nl tLPAREN2 expr rparen
1230
1231
  {
@@ -1680,8 +1681,7 @@ opt_block_args_tail: tCOMMA block_args_tail
1680
1681
 
1681
1682
  bvar: tIDENTIFIER
1682
1683
  {
1683
- (id, line), = val
1684
- result = s(:shadow, id.to_sym).line line
1684
+ result = wrap :shadow, val[0]
1685
1685
  }
1686
1686
  | f_bad_arg
1687
1687
 
@@ -2196,18 +2196,15 @@ regexp_contents: none
2196
2196
 
2197
2197
  string_dvar: tGVAR
2198
2198
  {
2199
- (id, line), = val
2200
- result = s(:gvar, id.to_sym).line line
2199
+ result = wrap :gvar, val[0]
2201
2200
  }
2202
2201
  | tIVAR
2203
2202
  {
2204
- (id, line), = val
2205
- result = s(:ivar, id.to_sym).line line
2203
+ result = wrap :ivar, val[0]
2206
2204
  }
2207
2205
  | tCVAR
2208
2206
  {
2209
- (id, line), = val
2210
- result = s(:cvar, id.to_sym).line line
2207
+ result = wrap :cvar, val[0]
2211
2208
  }
2212
2209
  | backref
2213
2210
 
@@ -2216,17 +2213,13 @@ regexp_contents: none
2216
2213
 
2217
2214
  ssym: tSYMBEG sym
2218
2215
  {
2219
- _, (id, line) = val
2220
-
2221
2216
  lexer.lex_state = EXPR_END
2222
- result = s(:lit, id.to_sym).line line
2217
+ result = wrap :lit, val[1]
2223
2218
  }
2224
2219
  | tSYMBOL
2225
2220
  {
2226
- (id, line), = val
2227
-
2228
2221
  lexer.lex_state = EXPR_END
2229
- result = s(:lit, id.to_sym).line line
2222
+ result = wrap :lit, val[0]
2230
2223
  }
2231
2224
 
2232
2225
  sym: fname | tIVAR | tGVAR | tCVAR
@@ -2670,10 +2663,10 @@ keyword_variable: kNIL { result = s(:nil).line lexer.lineno }
2670
2663
  }
2671
2664
  | tLABEL arg_value
2672
2665
  {
2673
- (label, line), arg = val
2666
+ label, arg = val
2674
2667
 
2675
- lit = s(:lit, label.to_sym).line line
2676
- result = s(:array, lit, arg).line line
2668
+ lit = wrap :lit, label
2669
+ result = s(:array, lit, arg).line lit.line
2677
2670
  }
2678
2671
  | tSTRING_BEG string_contents tLABEL_END arg_value
2679
2672
  {