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/ruby26_parser.y CHANGED
@@ -690,8 +690,7 @@ rule
690
690
 
691
691
  cpath: tCOLON3 cname
692
692
  {
693
- _, (name, line) = val
694
- result = s(:colon3, name.to_sym).line line
693
+ result = wrap :colon3, val[1]
695
694
  }
696
695
  | cname
697
696
  {
@@ -716,9 +715,7 @@ rule
716
715
 
717
716
  fitem: fname
718
717
  {
719
- (id, line), = val
720
-
721
- result = s(:lit, id.to_sym).line line
718
+ result = wrap :lit, val[0]
722
719
  }
723
720
  | symbol
724
721
 
@@ -787,9 +784,9 @@ rule
787
784
  }
788
785
  | tCOLON3 tCONSTANT tOP_ASGN arg_rhs
789
786
  {
790
- _, (lhs, line), op, rhs = val
787
+ _, lhs, op, rhs = val
791
788
 
792
- lhs = s(:colon3, lhs.to_sym).line line
789
+ lhs = wrap :colon3, lhs
793
790
  result = new_const_op_asgn [lhs, op, rhs]
794
791
  }
795
792
  | backref tOP_ASGN arg_rhs
@@ -1205,9 +1202,7 @@ rule
1205
1202
  }
1206
1203
  | tCOLON3 tCONSTANT
1207
1204
  {
1208
- _, (id, line) = val
1209
-
1210
- result = s(:colon3, id.to_sym).line line
1205
+ result = wrap :colon3, val[1]
1211
1206
  }
1212
1207
  | tLBRACK { result = lexer.lineno } aref_args tRBRACK
1213
1208
  {
@@ -1231,15 +1226,21 @@ rule
1231
1226
  }
1232
1227
  | kYIELD tLPAREN2 call_args rparen
1233
1228
  {
1234
- result = new_yield val[2]
1229
+ (_, line), _, args, _ = val
1230
+
1231
+ result = new_yield(args).line line
1235
1232
  }
1236
1233
  | kYIELD tLPAREN2 rparen
1237
1234
  {
1238
- result = new_yield
1235
+ (_, line), _, _ = val
1236
+
1237
+ result = new_yield.line line
1239
1238
  }
1240
1239
  | kYIELD
1241
1240
  {
1242
- result = new_yield
1241
+ (_, line), = val
1242
+
1243
+ result = new_yield.line line
1243
1244
  }
1244
1245
  | kDEFINED opt_nl tLPAREN2 expr rparen
1245
1246
  {
@@ -1695,8 +1696,7 @@ opt_block_args_tail: tCOMMA block_args_tail
1695
1696
 
1696
1697
  bvar: tIDENTIFIER
1697
1698
  {
1698
- (id, line), = val
1699
- result = s(:shadow, id.to_sym).line line
1699
+ result = wrap :shadow, val[0]
1700
1700
  }
1701
1701
  | f_bad_arg
1702
1702
 
@@ -2211,18 +2211,15 @@ regexp_contents: none
2211
2211
 
2212
2212
  string_dvar: tGVAR
2213
2213
  {
2214
- (id, line), = val
2215
- result = s(:gvar, id.to_sym).line line
2214
+ result = wrap :gvar, val[0]
2216
2215
  }
2217
2216
  | tIVAR
2218
2217
  {
2219
- (id, line), = val
2220
- result = s(:ivar, id.to_sym).line line
2218
+ result = wrap :ivar, val[0]
2221
2219
  }
2222
2220
  | tCVAR
2223
2221
  {
2224
- (id, line), = val
2225
- result = s(:cvar, id.to_sym).line line
2222
+ result = wrap :cvar, val[0]
2226
2223
  }
2227
2224
  | backref
2228
2225
 
@@ -2231,17 +2228,13 @@ regexp_contents: none
2231
2228
 
2232
2229
  ssym: tSYMBEG sym
2233
2230
  {
2234
- _, (id, line) = val
2235
-
2236
2231
  lexer.lex_state = EXPR_END
2237
- result = s(:lit, id.to_sym).line line
2232
+ result = wrap :lit, val[1]
2238
2233
  }
2239
2234
  | tSYMBOL
2240
2235
  {
2241
- (id, line), = val
2242
-
2243
2236
  lexer.lex_state = EXPR_END
2244
- result = s(:lit, id.to_sym).line line
2237
+ result = wrap :lit, val[0]
2245
2238
  }
2246
2239
 
2247
2240
  sym: fname | tIVAR | tGVAR | tCVAR
@@ -2685,10 +2678,10 @@ keyword_variable: kNIL { result = s(:nil).line lexer.lineno }
2685
2678
  }
2686
2679
  | tLABEL arg_value
2687
2680
  {
2688
- (label, line), arg = val
2681
+ label, arg = val
2689
2682
 
2690
- lit = s(:lit, label.to_sym).line line
2691
- result = s(:array, lit, arg).line line
2683
+ lit = wrap :lit, label
2684
+ result = s(:array, lit, arg).line lit.line
2692
2685
  }
2693
2686
  | tSTRING_BEG string_contents tLABEL_END arg_value
2694
2687
  {