yarp 0.9.0 → 0.10.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (54) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +15 -1
  3. data/Makefile +5 -1
  4. data/config.yml +156 -125
  5. data/docs/encoding.md +5 -5
  6. data/docs/serialization.md +2 -2
  7. data/ext/yarp/api_node.c +142 -98
  8. data/ext/yarp/extension.c +21 -7
  9. data/ext/yarp/extension.h +1 -1
  10. data/include/yarp/ast.h +327 -18
  11. data/include/yarp/defines.h +2 -1
  12. data/include/yarp/diagnostic.h +3 -3
  13. data/include/yarp/enc/yp_encoding.h +10 -10
  14. data/include/yarp/parser.h +19 -19
  15. data/include/yarp/regexp.h +1 -1
  16. data/include/yarp/unescape.h +4 -4
  17. data/include/yarp/util/yp_buffer.h +3 -0
  18. data/include/yarp/util/yp_char.h +16 -16
  19. data/include/yarp/util/yp_constant_pool.h +2 -2
  20. data/include/yarp/util/yp_newline_list.h +5 -5
  21. data/include/yarp/util/yp_string.h +4 -4
  22. data/include/yarp/util/yp_string_list.h +0 -3
  23. data/include/yarp/util/yp_strpbrk.h +1 -1
  24. data/include/yarp/version.h +2 -2
  25. data/include/yarp.h +5 -4
  26. data/lib/yarp/desugar_visitor.rb +59 -122
  27. data/lib/yarp/node.rb +230 -240
  28. data/lib/yarp/serialize.rb +16 -16
  29. data/lib/yarp.rb +5 -5
  30. data/src/diagnostic.c +1 -1
  31. data/src/enc/yp_big5.c +15 -42
  32. data/src/enc/yp_euc_jp.c +16 -43
  33. data/src/enc/yp_gbk.c +19 -46
  34. data/src/enc/yp_shift_jis.c +16 -43
  35. data/src/enc/yp_tables.c +36 -38
  36. data/src/enc/yp_unicode.c +20 -25
  37. data/src/enc/yp_windows_31j.c +16 -43
  38. data/src/node.c +1271 -899
  39. data/src/prettyprint.c +87 -48
  40. data/src/regexp.c +21 -21
  41. data/src/serialize.c +28 -15
  42. data/src/unescape.c +151 -121
  43. data/src/util/yp_buffer.c +7 -2
  44. data/src/util/yp_char.c +34 -34
  45. data/src/util/yp_constant_pool.c +4 -4
  46. data/src/util/yp_memchr.c +1 -1
  47. data/src/util/yp_newline_list.c +5 -4
  48. data/src/util/yp_string.c +22 -20
  49. data/src/util/yp_string_list.c +0 -6
  50. data/src/util/yp_strncasecmp.c +3 -6
  51. data/src/util/yp_strpbrk.c +8 -8
  52. data/src/yarp.c +355 -216
  53. data/yarp.gemspec +1 -1
  54. metadata +2 -2
data/lib/yarp/node.rb CHANGED
@@ -1142,15 +1142,15 @@ module YARP
1142
1142
  # attr_reader value: Node
1143
1143
  attr_reader :value
1144
1144
 
1145
- # attr_reader operator_id: Symbol
1146
- attr_reader :operator_id
1145
+ # attr_reader operator: Symbol
1146
+ attr_reader :operator
1147
1147
 
1148
- # def initialize: (target: CallNode, operator_loc: Location, value: Node, operator_id: Symbol, location: Location) -> void
1149
- def initialize(target, operator_loc, value, operator_id, location)
1148
+ # def initialize: (target: CallNode, operator_loc: Location, value: Node, operator: Symbol, location: Location) -> void
1149
+ def initialize(target, operator_loc, value, operator, location)
1150
1150
  @target = target
1151
1151
  @operator_loc = operator_loc
1152
1152
  @value = value
1153
- @operator_id = operator_id
1153
+ @operator = operator
1154
1154
  @location = location
1155
1155
  end
1156
1156
 
@@ -1170,7 +1170,7 @@ module YARP
1170
1170
  params.fetch(:target) { target },
1171
1171
  params.fetch(:operator_loc) { operator_loc },
1172
1172
  params.fetch(:value) { value },
1173
- params.fetch(:operator_id) { operator_id },
1173
+ params.fetch(:operator) { operator },
1174
1174
  params.fetch(:location) { location },
1175
1175
  )
1176
1176
  end
@@ -1180,12 +1180,7 @@ module YARP
1180
1180
 
1181
1181
  # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location]
1182
1182
  def deconstruct_keys(keys)
1183
- { target: target, operator_loc: operator_loc, value: value, operator_id: operator_id, location: location }
1184
- end
1185
-
1186
- # def operator: () -> String
1187
- def operator
1188
- operator_loc.slice
1183
+ { target: target, operator_loc: operator_loc, value: value, operator: operator, location: location }
1189
1184
  end
1190
1185
  end
1191
1186
 
@@ -1414,6 +1409,9 @@ module YARP
1414
1409
  # @@target &&= value
1415
1410
  # ^^^^^^^^^^^^^^^^
1416
1411
  class ClassVariableAndWriteNode < Node
1412
+ # attr_reader name: Symbol
1413
+ attr_reader :name
1414
+
1417
1415
  # attr_reader name_loc: Location
1418
1416
  attr_reader :name_loc
1419
1417
 
@@ -1423,8 +1421,9 @@ module YARP
1423
1421
  # attr_reader value: Node
1424
1422
  attr_reader :value
1425
1423
 
1426
- # def initialize: (name_loc: Location, operator_loc: Location, value: Node, location: Location) -> void
1427
- def initialize(name_loc, operator_loc, value, location)
1424
+ # def initialize: (name: Symbol, name_loc: Location, operator_loc: Location, value: Node, location: Location) -> void
1425
+ def initialize(name, name_loc, operator_loc, value, location)
1426
+ @name = name
1428
1427
  @name_loc = name_loc
1429
1428
  @operator_loc = operator_loc
1430
1429
  @value = value
@@ -1444,6 +1443,7 @@ module YARP
1444
1443
  # def copy: (**params) -> ClassVariableAndWriteNode
1445
1444
  def copy(**params)
1446
1445
  ClassVariableAndWriteNode.new(
1446
+ params.fetch(:name) { name },
1447
1447
  params.fetch(:name_loc) { name_loc },
1448
1448
  params.fetch(:operator_loc) { operator_loc },
1449
1449
  params.fetch(:value) { value },
@@ -1456,12 +1456,7 @@ module YARP
1456
1456
 
1457
1457
  # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location]
1458
1458
  def deconstruct_keys(keys)
1459
- { name_loc: name_loc, operator_loc: operator_loc, value: value, location: location }
1460
- end
1461
-
1462
- # def name: () -> String
1463
- def name
1464
- name_loc.slice
1459
+ { name: name, name_loc: name_loc, operator_loc: operator_loc, value: value, location: location }
1465
1460
  end
1466
1461
 
1467
1462
  # def operator: () -> String
@@ -1475,6 +1470,9 @@ module YARP
1475
1470
  # @@target += value
1476
1471
  # ^^^^^^^^^^^^^^^^^
1477
1472
  class ClassVariableOperatorWriteNode < Node
1473
+ # attr_reader name: Symbol
1474
+ attr_reader :name
1475
+
1478
1476
  # attr_reader name_loc: Location
1479
1477
  attr_reader :name_loc
1480
1478
 
@@ -1487,8 +1485,9 @@ module YARP
1487
1485
  # attr_reader operator: Symbol
1488
1486
  attr_reader :operator
1489
1487
 
1490
- # def initialize: (name_loc: Location, operator_loc: Location, value: Node, operator: Symbol, location: Location) -> void
1491
- def initialize(name_loc, operator_loc, value, operator, location)
1488
+ # def initialize: (name: Symbol, name_loc: Location, operator_loc: Location, value: Node, operator: Symbol, location: Location) -> void
1489
+ def initialize(name, name_loc, operator_loc, value, operator, location)
1490
+ @name = name
1492
1491
  @name_loc = name_loc
1493
1492
  @operator_loc = operator_loc
1494
1493
  @value = value
@@ -1509,6 +1508,7 @@ module YARP
1509
1508
  # def copy: (**params) -> ClassVariableOperatorWriteNode
1510
1509
  def copy(**params)
1511
1510
  ClassVariableOperatorWriteNode.new(
1511
+ params.fetch(:name) { name },
1512
1512
  params.fetch(:name_loc) { name_loc },
1513
1513
  params.fetch(:operator_loc) { operator_loc },
1514
1514
  params.fetch(:value) { value },
@@ -1522,12 +1522,7 @@ module YARP
1522
1522
 
1523
1523
  # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location]
1524
1524
  def deconstruct_keys(keys)
1525
- { name_loc: name_loc, operator_loc: operator_loc, value: value, operator: operator, location: location }
1526
- end
1527
-
1528
- # def name: () -> String
1529
- def name
1530
- name_loc.slice
1525
+ { name: name, name_loc: name_loc, operator_loc: operator_loc, value: value, operator: operator, location: location }
1531
1526
  end
1532
1527
  end
1533
1528
 
@@ -1536,6 +1531,9 @@ module YARP
1536
1531
  # @@target ||= value
1537
1532
  # ^^^^^^^^^^^^^^^^^^
1538
1533
  class ClassVariableOrWriteNode < Node
1534
+ # attr_reader name: Symbol
1535
+ attr_reader :name
1536
+
1539
1537
  # attr_reader name_loc: Location
1540
1538
  attr_reader :name_loc
1541
1539
 
@@ -1545,8 +1543,9 @@ module YARP
1545
1543
  # attr_reader value: Node
1546
1544
  attr_reader :value
1547
1545
 
1548
- # def initialize: (name_loc: Location, operator_loc: Location, value: Node, location: Location) -> void
1549
- def initialize(name_loc, operator_loc, value, location)
1546
+ # def initialize: (name: Symbol, name_loc: Location, operator_loc: Location, value: Node, location: Location) -> void
1547
+ def initialize(name, name_loc, operator_loc, value, location)
1548
+ @name = name
1550
1549
  @name_loc = name_loc
1551
1550
  @operator_loc = operator_loc
1552
1551
  @value = value
@@ -1566,6 +1565,7 @@ module YARP
1566
1565
  # def copy: (**params) -> ClassVariableOrWriteNode
1567
1566
  def copy(**params)
1568
1567
  ClassVariableOrWriteNode.new(
1568
+ params.fetch(:name) { name },
1569
1569
  params.fetch(:name_loc) { name_loc },
1570
1570
  params.fetch(:operator_loc) { operator_loc },
1571
1571
  params.fetch(:value) { value },
@@ -1578,12 +1578,7 @@ module YARP
1578
1578
 
1579
1579
  # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location]
1580
1580
  def deconstruct_keys(keys)
1581
- { name_loc: name_loc, operator_loc: operator_loc, value: value, location: location }
1582
- end
1583
-
1584
- # def name: () -> String
1585
- def name
1586
- name_loc.slice
1581
+ { name: name, name_loc: name_loc, operator_loc: operator_loc, value: value, location: location }
1587
1582
  end
1588
1583
 
1589
1584
  # def operator: () -> String
@@ -1597,8 +1592,12 @@ module YARP
1597
1592
  # @@foo
1598
1593
  # ^^^^^
1599
1594
  class ClassVariableReadNode < Node
1600
- # def initialize: (location: Location) -> void
1601
- def initialize(location)
1595
+ # attr_reader name: Symbol
1596
+ attr_reader :name
1597
+
1598
+ # def initialize: (name: Symbol, location: Location) -> void
1599
+ def initialize(name, location)
1600
+ @name = name
1602
1601
  @location = location
1603
1602
  end
1604
1603
 
@@ -1615,6 +1614,7 @@ module YARP
1615
1614
  # def copy: (**params) -> ClassVariableReadNode
1616
1615
  def copy(**params)
1617
1616
  ClassVariableReadNode.new(
1617
+ params.fetch(:name) { name },
1618
1618
  params.fetch(:location) { location },
1619
1619
  )
1620
1620
  end
@@ -1624,7 +1624,7 @@ module YARP
1624
1624
 
1625
1625
  # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location]
1626
1626
  def deconstruct_keys(keys)
1627
- { location: location }
1627
+ { name: name, location: location }
1628
1628
  end
1629
1629
  end
1630
1630
 
@@ -1633,8 +1633,12 @@ module YARP
1633
1633
  # @@foo, @@bar = baz
1634
1634
  # ^^^^^ ^^^^^
1635
1635
  class ClassVariableTargetNode < Node
1636
- # def initialize: (location: Location) -> void
1637
- def initialize(location)
1636
+ # attr_reader name: Symbol
1637
+ attr_reader :name
1638
+
1639
+ # def initialize: (name: Symbol, location: Location) -> void
1640
+ def initialize(name, location)
1641
+ @name = name
1638
1642
  @location = location
1639
1643
  end
1640
1644
 
@@ -1651,6 +1655,7 @@ module YARP
1651
1655
  # def copy: (**params) -> ClassVariableTargetNode
1652
1656
  def copy(**params)
1653
1657
  ClassVariableTargetNode.new(
1658
+ params.fetch(:name) { name },
1654
1659
  params.fetch(:location) { location },
1655
1660
  )
1656
1661
  end
@@ -1660,7 +1665,7 @@ module YARP
1660
1665
 
1661
1666
  # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location]
1662
1667
  def deconstruct_keys(keys)
1663
- { location: location }
1668
+ { name: name, location: location }
1664
1669
  end
1665
1670
  end
1666
1671
 
@@ -1669,6 +1674,9 @@ module YARP
1669
1674
  # @@foo = 1
1670
1675
  # ^^^^^^^^^
1671
1676
  class ClassVariableWriteNode < Node
1677
+ # attr_reader name: Symbol
1678
+ attr_reader :name
1679
+
1672
1680
  # attr_reader name_loc: Location
1673
1681
  attr_reader :name_loc
1674
1682
 
@@ -1678,8 +1686,9 @@ module YARP
1678
1686
  # attr_reader operator_loc: Location?
1679
1687
  attr_reader :operator_loc
1680
1688
 
1681
- # def initialize: (name_loc: Location, value: Node?, operator_loc: Location?, location: Location) -> void
1682
- def initialize(name_loc, value, operator_loc, location)
1689
+ # def initialize: (name: Symbol, name_loc: Location, value: Node?, operator_loc: Location?, location: Location) -> void
1690
+ def initialize(name, name_loc, value, operator_loc, location)
1691
+ @name = name
1683
1692
  @name_loc = name_loc
1684
1693
  @value = value
1685
1694
  @operator_loc = operator_loc
@@ -1699,6 +1708,7 @@ module YARP
1699
1708
  # def copy: (**params) -> ClassVariableWriteNode
1700
1709
  def copy(**params)
1701
1710
  ClassVariableWriteNode.new(
1711
+ params.fetch(:name) { name },
1702
1712
  params.fetch(:name_loc) { name_loc },
1703
1713
  params.fetch(:value) { value },
1704
1714
  params.fetch(:operator_loc) { operator_loc },
@@ -1711,12 +1721,7 @@ module YARP
1711
1721
 
1712
1722
  # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location]
1713
1723
  def deconstruct_keys(keys)
1714
- { name_loc: name_loc, value: value, operator_loc: operator_loc, location: location }
1715
- end
1716
-
1717
- # def name: () -> String
1718
- def name
1719
- name_loc.slice
1724
+ { name: name, name_loc: name_loc, value: value, operator_loc: operator_loc, location: location }
1720
1725
  end
1721
1726
 
1722
1727
  # def operator: () -> String?
@@ -3509,17 +3514,17 @@ module YARP
3509
3514
  # attr_reader name_loc: Location
3510
3515
  attr_reader :name_loc
3511
3516
 
3512
- # attr_reader operator_loc: Location
3513
- attr_reader :operator_loc
3514
-
3515
3517
  # attr_reader value: Node
3516
3518
  attr_reader :value
3517
3519
 
3518
- # def initialize: (name_loc: Location, operator_loc: Location, value: Node, location: Location) -> void
3519
- def initialize(name_loc, operator_loc, value, location)
3520
+ # attr_reader operator_loc: Location
3521
+ attr_reader :operator_loc
3522
+
3523
+ # def initialize: (name_loc: Location, value: Node, operator_loc: Location, location: Location) -> void
3524
+ def initialize(name_loc, value, operator_loc, location)
3520
3525
  @name_loc = name_loc
3521
- @operator_loc = operator_loc
3522
3526
  @value = value
3527
+ @operator_loc = operator_loc
3523
3528
  @location = location
3524
3529
  end
3525
3530
 
@@ -3537,8 +3542,8 @@ module YARP
3537
3542
  def copy(**params)
3538
3543
  GlobalVariableWriteNode.new(
3539
3544
  params.fetch(:name_loc) { name_loc },
3540
- params.fetch(:operator_loc) { operator_loc },
3541
3545
  params.fetch(:value) { value },
3546
+ params.fetch(:operator_loc) { operator_loc },
3542
3547
  params.fetch(:location) { location },
3543
3548
  )
3544
3549
  end
@@ -3548,7 +3553,7 @@ module YARP
3548
3553
 
3549
3554
  # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location]
3550
3555
  def deconstruct_keys(keys)
3551
- { name_loc: name_loc, operator_loc: operator_loc, value: value, location: location }
3556
+ { name_loc: name_loc, value: value, operator_loc: operator_loc, location: location }
3552
3557
  end
3553
3558
 
3554
3559
  # def name: () -> String
@@ -3887,6 +3892,9 @@ module YARP
3887
3892
  # @target &&= value
3888
3893
  # ^^^^^^^^^^^^^^^^^
3889
3894
  class InstanceVariableAndWriteNode < Node
3895
+ # attr_reader name: Symbol
3896
+ attr_reader :name
3897
+
3890
3898
  # attr_reader name_loc: Location
3891
3899
  attr_reader :name_loc
3892
3900
 
@@ -3896,8 +3904,9 @@ module YARP
3896
3904
  # attr_reader value: Node
3897
3905
  attr_reader :value
3898
3906
 
3899
- # def initialize: (name_loc: Location, operator_loc: Location, value: Node, location: Location) -> void
3900
- def initialize(name_loc, operator_loc, value, location)
3907
+ # def initialize: (name: Symbol, name_loc: Location, operator_loc: Location, value: Node, location: Location) -> void
3908
+ def initialize(name, name_loc, operator_loc, value, location)
3909
+ @name = name
3901
3910
  @name_loc = name_loc
3902
3911
  @operator_loc = operator_loc
3903
3912
  @value = value
@@ -3917,6 +3926,7 @@ module YARP
3917
3926
  # def copy: (**params) -> InstanceVariableAndWriteNode
3918
3927
  def copy(**params)
3919
3928
  InstanceVariableAndWriteNode.new(
3929
+ params.fetch(:name) { name },
3920
3930
  params.fetch(:name_loc) { name_loc },
3921
3931
  params.fetch(:operator_loc) { operator_loc },
3922
3932
  params.fetch(:value) { value },
@@ -3929,12 +3939,7 @@ module YARP
3929
3939
 
3930
3940
  # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location]
3931
3941
  def deconstruct_keys(keys)
3932
- { name_loc: name_loc, operator_loc: operator_loc, value: value, location: location }
3933
- end
3934
-
3935
- # def name: () -> String
3936
- def name
3937
- name_loc.slice
3942
+ { name: name, name_loc: name_loc, operator_loc: operator_loc, value: value, location: location }
3938
3943
  end
3939
3944
 
3940
3945
  # def operator: () -> String
@@ -3948,6 +3953,9 @@ module YARP
3948
3953
  # @target += value
3949
3954
  # ^^^^^^^^^^^^^^^^
3950
3955
  class InstanceVariableOperatorWriteNode < Node
3956
+ # attr_reader name: Symbol
3957
+ attr_reader :name
3958
+
3951
3959
  # attr_reader name_loc: Location
3952
3960
  attr_reader :name_loc
3953
3961
 
@@ -3960,8 +3968,9 @@ module YARP
3960
3968
  # attr_reader operator: Symbol
3961
3969
  attr_reader :operator
3962
3970
 
3963
- # def initialize: (name_loc: Location, operator_loc: Location, value: Node, operator: Symbol, location: Location) -> void
3964
- def initialize(name_loc, operator_loc, value, operator, location)
3971
+ # def initialize: (name: Symbol, name_loc: Location, operator_loc: Location, value: Node, operator: Symbol, location: Location) -> void
3972
+ def initialize(name, name_loc, operator_loc, value, operator, location)
3973
+ @name = name
3965
3974
  @name_loc = name_loc
3966
3975
  @operator_loc = operator_loc
3967
3976
  @value = value
@@ -3982,6 +3991,7 @@ module YARP
3982
3991
  # def copy: (**params) -> InstanceVariableOperatorWriteNode
3983
3992
  def copy(**params)
3984
3993
  InstanceVariableOperatorWriteNode.new(
3994
+ params.fetch(:name) { name },
3985
3995
  params.fetch(:name_loc) { name_loc },
3986
3996
  params.fetch(:operator_loc) { operator_loc },
3987
3997
  params.fetch(:value) { value },
@@ -3995,12 +4005,7 @@ module YARP
3995
4005
 
3996
4006
  # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location]
3997
4007
  def deconstruct_keys(keys)
3998
- { name_loc: name_loc, operator_loc: operator_loc, value: value, operator: operator, location: location }
3999
- end
4000
-
4001
- # def name: () -> String
4002
- def name
4003
- name_loc.slice
4008
+ { name: name, name_loc: name_loc, operator_loc: operator_loc, value: value, operator: operator, location: location }
4004
4009
  end
4005
4010
  end
4006
4011
 
@@ -4009,6 +4014,9 @@ module YARP
4009
4014
  # @target ||= value
4010
4015
  # ^^^^^^^^^^^^^^^^^
4011
4016
  class InstanceVariableOrWriteNode < Node
4017
+ # attr_reader name: Symbol
4018
+ attr_reader :name
4019
+
4012
4020
  # attr_reader name_loc: Location
4013
4021
  attr_reader :name_loc
4014
4022
 
@@ -4018,8 +4026,9 @@ module YARP
4018
4026
  # attr_reader value: Node
4019
4027
  attr_reader :value
4020
4028
 
4021
- # def initialize: (name_loc: Location, operator_loc: Location, value: Node, location: Location) -> void
4022
- def initialize(name_loc, operator_loc, value, location)
4029
+ # def initialize: (name: Symbol, name_loc: Location, operator_loc: Location, value: Node, location: Location) -> void
4030
+ def initialize(name, name_loc, operator_loc, value, location)
4031
+ @name = name
4023
4032
  @name_loc = name_loc
4024
4033
  @operator_loc = operator_loc
4025
4034
  @value = value
@@ -4039,6 +4048,7 @@ module YARP
4039
4048
  # def copy: (**params) -> InstanceVariableOrWriteNode
4040
4049
  def copy(**params)
4041
4050
  InstanceVariableOrWriteNode.new(
4051
+ params.fetch(:name) { name },
4042
4052
  params.fetch(:name_loc) { name_loc },
4043
4053
  params.fetch(:operator_loc) { operator_loc },
4044
4054
  params.fetch(:value) { value },
@@ -4051,12 +4061,7 @@ module YARP
4051
4061
 
4052
4062
  # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location]
4053
4063
  def deconstruct_keys(keys)
4054
- { name_loc: name_loc, operator_loc: operator_loc, value: value, location: location }
4055
- end
4056
-
4057
- # def name: () -> String
4058
- def name
4059
- name_loc.slice
4064
+ { name: name, name_loc: name_loc, operator_loc: operator_loc, value: value, location: location }
4060
4065
  end
4061
4066
 
4062
4067
  # def operator: () -> String
@@ -4070,8 +4075,12 @@ module YARP
4070
4075
  # @foo
4071
4076
  # ^^^^
4072
4077
  class InstanceVariableReadNode < Node
4073
- # def initialize: (location: Location) -> void
4074
- def initialize(location)
4078
+ # attr_reader name: Symbol
4079
+ attr_reader :name
4080
+
4081
+ # def initialize: (name: Symbol, location: Location) -> void
4082
+ def initialize(name, location)
4083
+ @name = name
4075
4084
  @location = location
4076
4085
  end
4077
4086
 
@@ -4088,6 +4097,7 @@ module YARP
4088
4097
  # def copy: (**params) -> InstanceVariableReadNode
4089
4098
  def copy(**params)
4090
4099
  InstanceVariableReadNode.new(
4100
+ params.fetch(:name) { name },
4091
4101
  params.fetch(:location) { location },
4092
4102
  )
4093
4103
  end
@@ -4097,7 +4107,7 @@ module YARP
4097
4107
 
4098
4108
  # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location]
4099
4109
  def deconstruct_keys(keys)
4100
- { location: location }
4110
+ { name: name, location: location }
4101
4111
  end
4102
4112
  end
4103
4113
 
@@ -4106,8 +4116,12 @@ module YARP
4106
4116
  # @foo, @bar = baz
4107
4117
  # ^^^^ ^^^^
4108
4118
  class InstanceVariableTargetNode < Node
4109
- # def initialize: (location: Location) -> void
4110
- def initialize(location)
4119
+ # attr_reader name: Symbol
4120
+ attr_reader :name
4121
+
4122
+ # def initialize: (name: Symbol, location: Location) -> void
4123
+ def initialize(name, location)
4124
+ @name = name
4111
4125
  @location = location
4112
4126
  end
4113
4127
 
@@ -4124,6 +4138,7 @@ module YARP
4124
4138
  # def copy: (**params) -> InstanceVariableTargetNode
4125
4139
  def copy(**params)
4126
4140
  InstanceVariableTargetNode.new(
4141
+ params.fetch(:name) { name },
4127
4142
  params.fetch(:location) { location },
4128
4143
  )
4129
4144
  end
@@ -4133,7 +4148,7 @@ module YARP
4133
4148
 
4134
4149
  # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location]
4135
4150
  def deconstruct_keys(keys)
4136
- { location: location }
4151
+ { name: name, location: location }
4137
4152
  end
4138
4153
  end
4139
4154
 
@@ -4142,6 +4157,9 @@ module YARP
4142
4157
  # @foo = 1
4143
4158
  # ^^^^^^^^
4144
4159
  class InstanceVariableWriteNode < Node
4160
+ # attr_reader name: Symbol
4161
+ attr_reader :name
4162
+
4145
4163
  # attr_reader name_loc: Location
4146
4164
  attr_reader :name_loc
4147
4165
 
@@ -4151,8 +4169,9 @@ module YARP
4151
4169
  # attr_reader operator_loc: Location
4152
4170
  attr_reader :operator_loc
4153
4171
 
4154
- # def initialize: (name_loc: Location, value: Node, operator_loc: Location, location: Location) -> void
4155
- def initialize(name_loc, value, operator_loc, location)
4172
+ # def initialize: (name: Symbol, name_loc: Location, value: Node, operator_loc: Location, location: Location) -> void
4173
+ def initialize(name, name_loc, value, operator_loc, location)
4174
+ @name = name
4156
4175
  @name_loc = name_loc
4157
4176
  @value = value
4158
4177
  @operator_loc = operator_loc
@@ -4172,6 +4191,7 @@ module YARP
4172
4191
  # def copy: (**params) -> InstanceVariableWriteNode
4173
4192
  def copy(**params)
4174
4193
  InstanceVariableWriteNode.new(
4194
+ params.fetch(:name) { name },
4175
4195
  params.fetch(:name_loc) { name_loc },
4176
4196
  params.fetch(:value) { value },
4177
4197
  params.fetch(:operator_loc) { operator_loc },
@@ -4184,12 +4204,7 @@ module YARP
4184
4204
 
4185
4205
  # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location]
4186
4206
  def deconstruct_keys(keys)
4187
- { name_loc: name_loc, value: value, operator_loc: operator_loc, location: location }
4188
- end
4189
-
4190
- # def name: () -> String
4191
- def name
4192
- name_loc.slice
4207
+ { name: name, name_loc: name_loc, value: value, operator_loc: operator_loc, location: location }
4193
4208
  end
4194
4209
 
4195
4210
  # def operator: () -> String
@@ -4792,18 +4807,18 @@ module YARP
4792
4807
  # attr_reader value: Node
4793
4808
  attr_reader :value
4794
4809
 
4795
- # attr_reader constant_id: Symbol
4796
- attr_reader :constant_id
4810
+ # attr_reader name: Symbol
4811
+ attr_reader :name
4797
4812
 
4798
4813
  # attr_reader depth: Integer
4799
4814
  attr_reader :depth
4800
4815
 
4801
- # def initialize: (name_loc: Location, operator_loc: Location, value: Node, constant_id: Symbol, depth: Integer, location: Location) -> void
4802
- def initialize(name_loc, operator_loc, value, constant_id, depth, location)
4816
+ # def initialize: (name_loc: Location, operator_loc: Location, value: Node, name: Symbol, depth: Integer, location: Location) -> void
4817
+ def initialize(name_loc, operator_loc, value, name, depth, location)
4803
4818
  @name_loc = name_loc
4804
4819
  @operator_loc = operator_loc
4805
4820
  @value = value
4806
- @constant_id = constant_id
4821
+ @name = name
4807
4822
  @depth = depth
4808
4823
  @location = location
4809
4824
  end
@@ -4824,7 +4839,7 @@ module YARP
4824
4839
  params.fetch(:name_loc) { name_loc },
4825
4840
  params.fetch(:operator_loc) { operator_loc },
4826
4841
  params.fetch(:value) { value },
4827
- params.fetch(:constant_id) { constant_id },
4842
+ params.fetch(:name) { name },
4828
4843
  params.fetch(:depth) { depth },
4829
4844
  params.fetch(:location) { location },
4830
4845
  )
@@ -4835,12 +4850,7 @@ module YARP
4835
4850
 
4836
4851
  # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location]
4837
4852
  def deconstruct_keys(keys)
4838
- { name_loc: name_loc, operator_loc: operator_loc, value: value, constant_id: constant_id, depth: depth, location: location }
4839
- end
4840
-
4841
- # def name: () -> String
4842
- def name
4843
- name_loc.slice
4853
+ { name_loc: name_loc, operator_loc: operator_loc, value: value, name: name, depth: depth, location: location }
4844
4854
  end
4845
4855
 
4846
4856
  # def operator: () -> String
@@ -4863,22 +4873,22 @@ module YARP
4863
4873
  # attr_reader value: Node
4864
4874
  attr_reader :value
4865
4875
 
4866
- # attr_reader constant_id: Symbol
4867
- attr_reader :constant_id
4876
+ # attr_reader name: Symbol
4877
+ attr_reader :name
4868
4878
 
4869
- # attr_reader operator_id: Symbol
4870
- attr_reader :operator_id
4879
+ # attr_reader operator: Symbol
4880
+ attr_reader :operator
4871
4881
 
4872
4882
  # attr_reader depth: Integer
4873
4883
  attr_reader :depth
4874
4884
 
4875
- # def initialize: (name_loc: Location, operator_loc: Location, value: Node, constant_id: Symbol, operator_id: Symbol, depth: Integer, location: Location) -> void
4876
- def initialize(name_loc, operator_loc, value, constant_id, operator_id, depth, location)
4885
+ # def initialize: (name_loc: Location, operator_loc: Location, value: Node, name: Symbol, operator: Symbol, depth: Integer, location: Location) -> void
4886
+ def initialize(name_loc, operator_loc, value, name, operator, depth, location)
4877
4887
  @name_loc = name_loc
4878
4888
  @operator_loc = operator_loc
4879
4889
  @value = value
4880
- @constant_id = constant_id
4881
- @operator_id = operator_id
4890
+ @name = name
4891
+ @operator = operator
4882
4892
  @depth = depth
4883
4893
  @location = location
4884
4894
  end
@@ -4899,8 +4909,8 @@ module YARP
4899
4909
  params.fetch(:name_loc) { name_loc },
4900
4910
  params.fetch(:operator_loc) { operator_loc },
4901
4911
  params.fetch(:value) { value },
4902
- params.fetch(:constant_id) { constant_id },
4903
- params.fetch(:operator_id) { operator_id },
4912
+ params.fetch(:name) { name },
4913
+ params.fetch(:operator) { operator },
4904
4914
  params.fetch(:depth) { depth },
4905
4915
  params.fetch(:location) { location },
4906
4916
  )
@@ -4911,17 +4921,7 @@ module YARP
4911
4921
 
4912
4922
  # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location]
4913
4923
  def deconstruct_keys(keys)
4914
- { name_loc: name_loc, operator_loc: operator_loc, value: value, constant_id: constant_id, operator_id: operator_id, depth: depth, location: location }
4915
- end
4916
-
4917
- # def name: () -> String
4918
- def name
4919
- name_loc.slice
4920
- end
4921
-
4922
- # def operator: () -> String
4923
- def operator
4924
- operator_loc.slice
4924
+ { name_loc: name_loc, operator_loc: operator_loc, value: value, name: name, operator: operator, depth: depth, location: location }
4925
4925
  end
4926
4926
  end
4927
4927
 
@@ -4939,18 +4939,18 @@ module YARP
4939
4939
  # attr_reader value: Node
4940
4940
  attr_reader :value
4941
4941
 
4942
- # attr_reader constant_id: Symbol
4943
- attr_reader :constant_id
4942
+ # attr_reader name: Symbol
4943
+ attr_reader :name
4944
4944
 
4945
4945
  # attr_reader depth: Integer
4946
4946
  attr_reader :depth
4947
4947
 
4948
- # def initialize: (name_loc: Location, operator_loc: Location, value: Node, constant_id: Symbol, depth: Integer, location: Location) -> void
4949
- def initialize(name_loc, operator_loc, value, constant_id, depth, location)
4948
+ # def initialize: (name_loc: Location, operator_loc: Location, value: Node, name: Symbol, depth: Integer, location: Location) -> void
4949
+ def initialize(name_loc, operator_loc, value, name, depth, location)
4950
4950
  @name_loc = name_loc
4951
4951
  @operator_loc = operator_loc
4952
4952
  @value = value
4953
- @constant_id = constant_id
4953
+ @name = name
4954
4954
  @depth = depth
4955
4955
  @location = location
4956
4956
  end
@@ -4971,7 +4971,7 @@ module YARP
4971
4971
  params.fetch(:name_loc) { name_loc },
4972
4972
  params.fetch(:operator_loc) { operator_loc },
4973
4973
  params.fetch(:value) { value },
4974
- params.fetch(:constant_id) { constant_id },
4974
+ params.fetch(:name) { name },
4975
4975
  params.fetch(:depth) { depth },
4976
4976
  params.fetch(:location) { location },
4977
4977
  )
@@ -4982,12 +4982,7 @@ module YARP
4982
4982
 
4983
4983
  # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location]
4984
4984
  def deconstruct_keys(keys)
4985
- { name_loc: name_loc, operator_loc: operator_loc, value: value, constant_id: constant_id, depth: depth, location: location }
4986
- end
4987
-
4988
- # def name: () -> String
4989
- def name
4990
- name_loc.slice
4985
+ { name_loc: name_loc, operator_loc: operator_loc, value: value, name: name, depth: depth, location: location }
4991
4986
  end
4992
4987
 
4993
4988
  # def operator: () -> String
@@ -5003,15 +4998,15 @@ module YARP
5003
4998
  # foo
5004
4999
  # ^^^
5005
5000
  class LocalVariableReadNode < Node
5006
- # attr_reader constant_id: Symbol
5007
- attr_reader :constant_id
5001
+ # attr_reader name: Symbol
5002
+ attr_reader :name
5008
5003
 
5009
5004
  # attr_reader depth: Integer
5010
5005
  attr_reader :depth
5011
5006
 
5012
- # def initialize: (constant_id: Symbol, depth: Integer, location: Location) -> void
5013
- def initialize(constant_id, depth, location)
5014
- @constant_id = constant_id
5007
+ # def initialize: (name: Symbol, depth: Integer, location: Location) -> void
5008
+ def initialize(name, depth, location)
5009
+ @name = name
5015
5010
  @depth = depth
5016
5011
  @location = location
5017
5012
  end
@@ -5029,7 +5024,7 @@ module YARP
5029
5024
  # def copy: (**params) -> LocalVariableReadNode
5030
5025
  def copy(**params)
5031
5026
  LocalVariableReadNode.new(
5032
- params.fetch(:constant_id) { constant_id },
5027
+ params.fetch(:name) { name },
5033
5028
  params.fetch(:depth) { depth },
5034
5029
  params.fetch(:location) { location },
5035
5030
  )
@@ -5040,7 +5035,7 @@ module YARP
5040
5035
 
5041
5036
  # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location]
5042
5037
  def deconstruct_keys(keys)
5043
- { constant_id: constant_id, depth: depth, location: location }
5038
+ { name: name, depth: depth, location: location }
5044
5039
  end
5045
5040
  end
5046
5041
 
@@ -5049,15 +5044,15 @@ module YARP
5049
5044
  # foo, bar = baz
5050
5045
  # ^^^ ^^^
5051
5046
  class LocalVariableTargetNode < Node
5052
- # attr_reader constant_id: Symbol
5053
- attr_reader :constant_id
5047
+ # attr_reader name: Symbol
5048
+ attr_reader :name
5054
5049
 
5055
5050
  # attr_reader depth: Integer
5056
5051
  attr_reader :depth
5057
5052
 
5058
- # def initialize: (constant_id: Symbol, depth: Integer, location: Location) -> void
5059
- def initialize(constant_id, depth, location)
5060
- @constant_id = constant_id
5053
+ # def initialize: (name: Symbol, depth: Integer, location: Location) -> void
5054
+ def initialize(name, depth, location)
5055
+ @name = name
5061
5056
  @depth = depth
5062
5057
  @location = location
5063
5058
  end
@@ -5075,7 +5070,7 @@ module YARP
5075
5070
  # def copy: (**params) -> LocalVariableTargetNode
5076
5071
  def copy(**params)
5077
5072
  LocalVariableTargetNode.new(
5078
- params.fetch(:constant_id) { constant_id },
5073
+ params.fetch(:name) { name },
5079
5074
  params.fetch(:depth) { depth },
5080
5075
  params.fetch(:location) { location },
5081
5076
  )
@@ -5086,7 +5081,7 @@ module YARP
5086
5081
 
5087
5082
  # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location]
5088
5083
  def deconstruct_keys(keys)
5089
- { constant_id: constant_id, depth: depth, location: location }
5084
+ { name: name, depth: depth, location: location }
5090
5085
  end
5091
5086
  end
5092
5087
 
@@ -5095,27 +5090,27 @@ module YARP
5095
5090
  # foo = 1
5096
5091
  # ^^^^^^^
5097
5092
  class LocalVariableWriteNode < Node
5098
- # attr_reader constant_id: Symbol
5099
- attr_reader :constant_id
5093
+ # attr_reader name: Symbol
5094
+ attr_reader :name
5100
5095
 
5101
5096
  # attr_reader depth: Integer
5102
5097
  attr_reader :depth
5103
5098
 
5104
- # attr_reader value: Node
5105
- attr_reader :value
5106
-
5107
5099
  # attr_reader name_loc: Location
5108
5100
  attr_reader :name_loc
5109
5101
 
5102
+ # attr_reader value: Node
5103
+ attr_reader :value
5104
+
5110
5105
  # attr_reader operator_loc: Location
5111
5106
  attr_reader :operator_loc
5112
5107
 
5113
- # def initialize: (constant_id: Symbol, depth: Integer, value: Node, name_loc: Location, operator_loc: Location, location: Location) -> void
5114
- def initialize(constant_id, depth, value, name_loc, operator_loc, location)
5115
- @constant_id = constant_id
5108
+ # def initialize: (name: Symbol, depth: Integer, name_loc: Location, value: Node, operator_loc: Location, location: Location) -> void
5109
+ def initialize(name, depth, name_loc, value, operator_loc, location)
5110
+ @name = name
5116
5111
  @depth = depth
5117
- @value = value
5118
5112
  @name_loc = name_loc
5113
+ @value = value
5119
5114
  @operator_loc = operator_loc
5120
5115
  @location = location
5121
5116
  end
@@ -5133,10 +5128,10 @@ module YARP
5133
5128
  # def copy: (**params) -> LocalVariableWriteNode
5134
5129
  def copy(**params)
5135
5130
  LocalVariableWriteNode.new(
5136
- params.fetch(:constant_id) { constant_id },
5131
+ params.fetch(:name) { name },
5137
5132
  params.fetch(:depth) { depth },
5138
- params.fetch(:value) { value },
5139
5133
  params.fetch(:name_loc) { name_loc },
5134
+ params.fetch(:value) { value },
5140
5135
  params.fetch(:operator_loc) { operator_loc },
5141
5136
  params.fetch(:location) { location },
5142
5137
  )
@@ -5147,12 +5142,7 @@ module YARP
5147
5142
 
5148
5143
  # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location]
5149
5144
  def deconstruct_keys(keys)
5150
- { constant_id: constant_id, depth: depth, value: value, name_loc: name_loc, operator_loc: operator_loc, location: location }
5151
- end
5152
-
5153
- # def name: () -> String
5154
- def name
5155
- name_loc.slice
5145
+ { name: name, depth: depth, name_loc: name_loc, value: value, operator_loc: operator_loc, location: location }
5156
5146
  end
5157
5147
 
5158
5148
  # def operator: () -> String
@@ -5608,8 +5598,12 @@ module YARP
5608
5598
  # $1
5609
5599
  # ^^
5610
5600
  class NumberedReferenceReadNode < Node
5611
- # def initialize: (location: Location) -> void
5612
- def initialize(location)
5601
+ # attr_reader number: Integer
5602
+ attr_reader :number
5603
+
5604
+ # def initialize: (number: Integer, location: Location) -> void
5605
+ def initialize(number, location)
5606
+ @number = number
5613
5607
  @location = location
5614
5608
  end
5615
5609
 
@@ -5626,6 +5620,7 @@ module YARP
5626
5620
  # def copy: (**params) -> NumberedReferenceReadNode
5627
5621
  def copy(**params)
5628
5622
  NumberedReferenceReadNode.new(
5623
+ params.fetch(:number) { number },
5629
5624
  params.fetch(:location) { location },
5630
5625
  )
5631
5626
  end
@@ -5635,7 +5630,7 @@ module YARP
5635
5630
 
5636
5631
  # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location]
5637
5632
  def deconstruct_keys(keys)
5638
- { location: location }
5633
+ { number: number, location: location }
5639
5634
  end
5640
5635
  end
5641
5636
 
@@ -5645,8 +5640,8 @@ module YARP
5645
5640
  # ^^^^^
5646
5641
  # end
5647
5642
  class OptionalParameterNode < Node
5648
- # attr_reader constant_id: Symbol
5649
- attr_reader :constant_id
5643
+ # attr_reader name: Symbol
5644
+ attr_reader :name
5650
5645
 
5651
5646
  # attr_reader name_loc: Location
5652
5647
  attr_reader :name_loc
@@ -5657,9 +5652,9 @@ module YARP
5657
5652
  # attr_reader value: Node
5658
5653
  attr_reader :value
5659
5654
 
5660
- # def initialize: (constant_id: Symbol, name_loc: Location, operator_loc: Location, value: Node, location: Location) -> void
5661
- def initialize(constant_id, name_loc, operator_loc, value, location)
5662
- @constant_id = constant_id
5655
+ # def initialize: (name: Symbol, name_loc: Location, operator_loc: Location, value: Node, location: Location) -> void
5656
+ def initialize(name, name_loc, operator_loc, value, location)
5657
+ @name = name
5663
5658
  @name_loc = name_loc
5664
5659
  @operator_loc = operator_loc
5665
5660
  @value = value
@@ -5679,7 +5674,7 @@ module YARP
5679
5674
  # def copy: (**params) -> OptionalParameterNode
5680
5675
  def copy(**params)
5681
5676
  OptionalParameterNode.new(
5682
- params.fetch(:constant_id) { constant_id },
5677
+ params.fetch(:name) { name },
5683
5678
  params.fetch(:name_loc) { name_loc },
5684
5679
  params.fetch(:operator_loc) { operator_loc },
5685
5680
  params.fetch(:value) { value },
@@ -5692,12 +5687,7 @@ module YARP
5692
5687
 
5693
5688
  # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location]
5694
5689
  def deconstruct_keys(keys)
5695
- { constant_id: constant_id, name_loc: name_loc, operator_loc: operator_loc, value: value, location: location }
5696
- end
5697
-
5698
- # def name: () -> String
5699
- def name
5700
- name_loc.slice
5690
+ { name: name, name_loc: name_loc, operator_loc: operator_loc, value: value, location: location }
5701
5691
  end
5702
5692
 
5703
5693
  # def operator: () -> String
@@ -6538,12 +6528,12 @@ module YARP
6538
6528
  # ^
6539
6529
  # end
6540
6530
  class RequiredParameterNode < Node
6541
- # attr_reader constant_id: Symbol
6542
- attr_reader :constant_id
6531
+ # attr_reader name: Symbol
6532
+ attr_reader :name
6543
6533
 
6544
- # def initialize: (constant_id: Symbol, location: Location) -> void
6545
- def initialize(constant_id, location)
6546
- @constant_id = constant_id
6534
+ # def initialize: (name: Symbol, location: Location) -> void
6535
+ def initialize(name, location)
6536
+ @name = name
6547
6537
  @location = location
6548
6538
  end
6549
6539
 
@@ -6560,7 +6550,7 @@ module YARP
6560
6550
  # def copy: (**params) -> RequiredParameterNode
6561
6551
  def copy(**params)
6562
6552
  RequiredParameterNode.new(
6563
- params.fetch(:constant_id) { constant_id },
6553
+ params.fetch(:name) { name },
6564
6554
  params.fetch(:location) { location },
6565
6555
  )
6566
6556
  end
@@ -6570,7 +6560,7 @@ module YARP
6570
6560
 
6571
6561
  # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location]
6572
6562
  def deconstruct_keys(keys)
6573
- { constant_id: constant_id, location: location }
6563
+ { name: name, location: location }
6574
6564
  end
6575
6565
  end
6576
6566
 
@@ -8537,8 +8527,8 @@ module YARP
8537
8527
  end
8538
8528
 
8539
8529
  # Create a new CallOperatorWriteNode node
8540
- def CallOperatorWriteNode(target, operator_loc, value, operator_id, location = Location())
8541
- CallOperatorWriteNode.new(target, operator_loc, value, operator_id, location)
8530
+ def CallOperatorWriteNode(target, operator_loc, value, operator, location = Location())
8531
+ CallOperatorWriteNode.new(target, operator_loc, value, operator, location)
8542
8532
  end
8543
8533
 
8544
8534
  # Create a new CapturePatternNode node
@@ -8557,33 +8547,33 @@ module YARP
8557
8547
  end
8558
8548
 
8559
8549
  # Create a new ClassVariableAndWriteNode node
8560
- def ClassVariableAndWriteNode(name_loc, operator_loc, value, location = Location())
8561
- ClassVariableAndWriteNode.new(name_loc, operator_loc, value, location)
8550
+ def ClassVariableAndWriteNode(name, name_loc, operator_loc, value, location = Location())
8551
+ ClassVariableAndWriteNode.new(name, name_loc, operator_loc, value, location)
8562
8552
  end
8563
8553
 
8564
8554
  # Create a new ClassVariableOperatorWriteNode node
8565
- def ClassVariableOperatorWriteNode(name_loc, operator_loc, value, operator, location = Location())
8566
- ClassVariableOperatorWriteNode.new(name_loc, operator_loc, value, operator, location)
8555
+ def ClassVariableOperatorWriteNode(name, name_loc, operator_loc, value, operator, location = Location())
8556
+ ClassVariableOperatorWriteNode.new(name, name_loc, operator_loc, value, operator, location)
8567
8557
  end
8568
8558
 
8569
8559
  # Create a new ClassVariableOrWriteNode node
8570
- def ClassVariableOrWriteNode(name_loc, operator_loc, value, location = Location())
8571
- ClassVariableOrWriteNode.new(name_loc, operator_loc, value, location)
8560
+ def ClassVariableOrWriteNode(name, name_loc, operator_loc, value, location = Location())
8561
+ ClassVariableOrWriteNode.new(name, name_loc, operator_loc, value, location)
8572
8562
  end
8573
8563
 
8574
8564
  # Create a new ClassVariableReadNode node
8575
- def ClassVariableReadNode(location = Location())
8576
- ClassVariableReadNode.new(location)
8565
+ def ClassVariableReadNode(name, location = Location())
8566
+ ClassVariableReadNode.new(name, location)
8577
8567
  end
8578
8568
 
8579
8569
  # Create a new ClassVariableTargetNode node
8580
- def ClassVariableTargetNode(location = Location())
8581
- ClassVariableTargetNode.new(location)
8570
+ def ClassVariableTargetNode(name, location = Location())
8571
+ ClassVariableTargetNode.new(name, location)
8582
8572
  end
8583
8573
 
8584
8574
  # Create a new ClassVariableWriteNode node
8585
- def ClassVariableWriteNode(name_loc, value, operator_loc, location = Location())
8586
- ClassVariableWriteNode.new(name_loc, value, operator_loc, location)
8575
+ def ClassVariableWriteNode(name, name_loc, value, operator_loc, location = Location())
8576
+ ClassVariableWriteNode.new(name, name_loc, value, operator_loc, location)
8587
8577
  end
8588
8578
 
8589
8579
  # Create a new ConstantAndWriteNode node
@@ -8742,8 +8732,8 @@ module YARP
8742
8732
  end
8743
8733
 
8744
8734
  # Create a new GlobalVariableWriteNode node
8745
- def GlobalVariableWriteNode(name_loc, operator_loc, value, location = Location())
8746
- GlobalVariableWriteNode.new(name_loc, operator_loc, value, location)
8735
+ def GlobalVariableWriteNode(name_loc, value, operator_loc, location = Location())
8736
+ GlobalVariableWriteNode.new(name_loc, value, operator_loc, location)
8747
8737
  end
8748
8738
 
8749
8739
  # Create a new HashNode node
@@ -8772,33 +8762,33 @@ module YARP
8772
8762
  end
8773
8763
 
8774
8764
  # Create a new InstanceVariableAndWriteNode node
8775
- def InstanceVariableAndWriteNode(name_loc, operator_loc, value, location = Location())
8776
- InstanceVariableAndWriteNode.new(name_loc, operator_loc, value, location)
8765
+ def InstanceVariableAndWriteNode(name, name_loc, operator_loc, value, location = Location())
8766
+ InstanceVariableAndWriteNode.new(name, name_loc, operator_loc, value, location)
8777
8767
  end
8778
8768
 
8779
8769
  # Create a new InstanceVariableOperatorWriteNode node
8780
- def InstanceVariableOperatorWriteNode(name_loc, operator_loc, value, operator, location = Location())
8781
- InstanceVariableOperatorWriteNode.new(name_loc, operator_loc, value, operator, location)
8770
+ def InstanceVariableOperatorWriteNode(name, name_loc, operator_loc, value, operator, location = Location())
8771
+ InstanceVariableOperatorWriteNode.new(name, name_loc, operator_loc, value, operator, location)
8782
8772
  end
8783
8773
 
8784
8774
  # Create a new InstanceVariableOrWriteNode node
8785
- def InstanceVariableOrWriteNode(name_loc, operator_loc, value, location = Location())
8786
- InstanceVariableOrWriteNode.new(name_loc, operator_loc, value, location)
8775
+ def InstanceVariableOrWriteNode(name, name_loc, operator_loc, value, location = Location())
8776
+ InstanceVariableOrWriteNode.new(name, name_loc, operator_loc, value, location)
8787
8777
  end
8788
8778
 
8789
8779
  # Create a new InstanceVariableReadNode node
8790
- def InstanceVariableReadNode(location = Location())
8791
- InstanceVariableReadNode.new(location)
8780
+ def InstanceVariableReadNode(name, location = Location())
8781
+ InstanceVariableReadNode.new(name, location)
8792
8782
  end
8793
8783
 
8794
8784
  # Create a new InstanceVariableTargetNode node
8795
- def InstanceVariableTargetNode(location = Location())
8796
- InstanceVariableTargetNode.new(location)
8785
+ def InstanceVariableTargetNode(name, location = Location())
8786
+ InstanceVariableTargetNode.new(name, location)
8797
8787
  end
8798
8788
 
8799
8789
  # Create a new InstanceVariableWriteNode node
8800
- def InstanceVariableWriteNode(name_loc, value, operator_loc, location = Location())
8801
- InstanceVariableWriteNode.new(name_loc, value, operator_loc, location)
8790
+ def InstanceVariableWriteNode(name, name_loc, value, operator_loc, location = Location())
8791
+ InstanceVariableWriteNode.new(name, name_loc, value, operator_loc, location)
8802
8792
  end
8803
8793
 
8804
8794
  # Create a new IntegerNode node
@@ -8847,33 +8837,33 @@ module YARP
8847
8837
  end
8848
8838
 
8849
8839
  # Create a new LocalVariableAndWriteNode node
8850
- def LocalVariableAndWriteNode(name_loc, operator_loc, value, constant_id, depth, location = Location())
8851
- LocalVariableAndWriteNode.new(name_loc, operator_loc, value, constant_id, depth, location)
8840
+ def LocalVariableAndWriteNode(name_loc, operator_loc, value, name, depth, location = Location())
8841
+ LocalVariableAndWriteNode.new(name_loc, operator_loc, value, name, depth, location)
8852
8842
  end
8853
8843
 
8854
8844
  # Create a new LocalVariableOperatorWriteNode node
8855
- def LocalVariableOperatorWriteNode(name_loc, operator_loc, value, constant_id, operator_id, depth, location = Location())
8856
- LocalVariableOperatorWriteNode.new(name_loc, operator_loc, value, constant_id, operator_id, depth, location)
8845
+ def LocalVariableOperatorWriteNode(name_loc, operator_loc, value, name, operator, depth, location = Location())
8846
+ LocalVariableOperatorWriteNode.new(name_loc, operator_loc, value, name, operator, depth, location)
8857
8847
  end
8858
8848
 
8859
8849
  # Create a new LocalVariableOrWriteNode node
8860
- def LocalVariableOrWriteNode(name_loc, operator_loc, value, constant_id, depth, location = Location())
8861
- LocalVariableOrWriteNode.new(name_loc, operator_loc, value, constant_id, depth, location)
8850
+ def LocalVariableOrWriteNode(name_loc, operator_loc, value, name, depth, location = Location())
8851
+ LocalVariableOrWriteNode.new(name_loc, operator_loc, value, name, depth, location)
8862
8852
  end
8863
8853
 
8864
8854
  # Create a new LocalVariableReadNode node
8865
- def LocalVariableReadNode(constant_id, depth, location = Location())
8866
- LocalVariableReadNode.new(constant_id, depth, location)
8855
+ def LocalVariableReadNode(name, depth, location = Location())
8856
+ LocalVariableReadNode.new(name, depth, location)
8867
8857
  end
8868
8858
 
8869
8859
  # Create a new LocalVariableTargetNode node
8870
- def LocalVariableTargetNode(constant_id, depth, location = Location())
8871
- LocalVariableTargetNode.new(constant_id, depth, location)
8860
+ def LocalVariableTargetNode(name, depth, location = Location())
8861
+ LocalVariableTargetNode.new(name, depth, location)
8872
8862
  end
8873
8863
 
8874
8864
  # Create a new LocalVariableWriteNode node
8875
- def LocalVariableWriteNode(constant_id, depth, value, name_loc, operator_loc, location = Location())
8876
- LocalVariableWriteNode.new(constant_id, depth, value, name_loc, operator_loc, location)
8865
+ def LocalVariableWriteNode(name, depth, name_loc, value, operator_loc, location = Location())
8866
+ LocalVariableWriteNode.new(name, depth, name_loc, value, operator_loc, location)
8877
8867
  end
8878
8868
 
8879
8869
  # Create a new MatchPredicateNode node
@@ -8917,13 +8907,13 @@ module YARP
8917
8907
  end
8918
8908
 
8919
8909
  # Create a new NumberedReferenceReadNode node
8920
- def NumberedReferenceReadNode(location = Location())
8921
- NumberedReferenceReadNode.new(location)
8910
+ def NumberedReferenceReadNode(number, location = Location())
8911
+ NumberedReferenceReadNode.new(number, location)
8922
8912
  end
8923
8913
 
8924
8914
  # Create a new OptionalParameterNode node
8925
- def OptionalParameterNode(constant_id, name_loc, operator_loc, value, location = Location())
8926
- OptionalParameterNode.new(constant_id, name_loc, operator_loc, value, location)
8915
+ def OptionalParameterNode(name, name_loc, operator_loc, value, location = Location())
8916
+ OptionalParameterNode.new(name, name_loc, operator_loc, value, location)
8927
8917
  end
8928
8918
 
8929
8919
  # Create a new OrNode node
@@ -8992,8 +8982,8 @@ module YARP
8992
8982
  end
8993
8983
 
8994
8984
  # Create a new RequiredParameterNode node
8995
- def RequiredParameterNode(constant_id, location = Location())
8996
- RequiredParameterNode.new(constant_id, location)
8985
+ def RequiredParameterNode(name, location = Location())
8986
+ RequiredParameterNode.new(name, location)
8997
8987
  end
8998
8988
 
8999
8989
  # Create a new RescueModifierNode node