prism 1.2.0 → 1.3.0

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/prism/node.rb CHANGED
@@ -20,6 +20,11 @@ module Prism
20
20
  # will be consistent across multiple parses of the same source code.
21
21
  attr_reader :node_id
22
22
 
23
+ # Save this node using a saved source so that it can be retrieved later.
24
+ def save(repository)
25
+ repository.enter(node_id, :itself)
26
+ end
27
+
23
28
  # A Location instance that represents the location of this node in the
24
29
  # source.
25
30
  def location
@@ -28,6 +33,21 @@ module Prism
28
33
  @location = Location.new(source, location >> 32, location & 0xFFFFFFFF)
29
34
  end
30
35
 
36
+ # Save the location using a saved source so that it can be retrieved later.
37
+ def save_location(repository)
38
+ repository.enter(node_id, :location)
39
+ end
40
+
41
+ # Delegates to the start_line of the associated location object.
42
+ def start_line
43
+ location.start_line
44
+ end
45
+
46
+ # Delegates to the end_line of the associated location object.
47
+ def end_line
48
+ location.end_line
49
+ end
50
+
31
51
  # The start offset of the node in the source. This method is effectively a
32
52
  # delegate method to the location object.
33
53
  def start_offset
@@ -42,6 +62,75 @@ module Prism
42
62
  location.is_a?(Location) ? location.end_offset : ((location >> 32) + (location & 0xFFFFFFFF))
43
63
  end
44
64
 
65
+ # Delegates to the start_character_offset of the associated location object.
66
+ def start_character_offset
67
+ location.start_character_offset
68
+ end
69
+
70
+ # Delegates to the end_character_offset of the associated location object.
71
+ def end_character_offset
72
+ location.end_character_offset
73
+ end
74
+
75
+ # Delegates to the cached_start_code_units_offset of the associated location
76
+ # object.
77
+ def cached_start_code_units_offset(cache)
78
+ location.cached_start_code_units_offset(cache)
79
+ end
80
+
81
+ # Delegates to the cached_end_code_units_offset of the associated location
82
+ # object.
83
+ def cached_end_code_units_offset(cache)
84
+ location.cached_end_code_units_offset(cache)
85
+ end
86
+
87
+ # Delegates to the start_column of the associated location object.
88
+ def start_column
89
+ location.start_column
90
+ end
91
+
92
+ # Delegates to the end_column of the associated location object.
93
+ def end_column
94
+ location.end_column
95
+ end
96
+
97
+ # Delegates to the start_character_column of the associated location object.
98
+ def start_character_column
99
+ location.start_character_column
100
+ end
101
+
102
+ # Delegates to the end_character_column of the associated location object.
103
+ def end_character_column
104
+ location.end_character_column
105
+ end
106
+
107
+ # Delegates to the cached_start_code_units_column of the associated location
108
+ # object.
109
+ def cached_start_code_units_column(cache)
110
+ location.cached_start_code_units_column(cache)
111
+ end
112
+
113
+ # Delegates to the cached_end_code_units_column of the associated location
114
+ # object.
115
+ def cached_end_code_units_column(cache)
116
+ location.cached_end_code_units_column(cache)
117
+ end
118
+
119
+ # Delegates to the leading_comments of the associated location object.
120
+ def leading_comments
121
+ location.leading_comments
122
+ end
123
+
124
+ # Delegates to the trailing_comments of the associated location object.
125
+ def trailing_comments
126
+ location.trailing_comments
127
+ end
128
+
129
+ # Delegates to the comments of the associated location object.
130
+ def comments
131
+ location.comments
132
+ end
133
+
45
134
  # Returns all of the lines of the source code associated with this node.
46
135
  def source_lines
47
136
  location.source_lines
@@ -101,7 +190,7 @@ module Prism
101
190
  # bytes, as opposed to characters or code units.
102
191
  def tunnel(line, column)
103
192
  queue = [self] #: Array[Prism::node]
104
- result = []
193
+ result = [] #: Array[Prism::node]
105
194
 
106
195
  while (node = queue.shift)
107
196
  result << node
@@ -291,6 +380,12 @@ module Prism
291
380
  @keyword_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
292
381
  end
293
382
 
383
+ # Save the keyword_loc location using the given saved source so that
384
+ # it can be retrieved later.
385
+ def save_keyword_loc(repository)
386
+ repository.enter(node_id, :keyword_loc)
387
+ end
388
+
294
389
  # def keyword: () -> String
295
390
  def keyword
296
391
  keyword_loc.slice
@@ -394,13 +489,22 @@ module Prism
394
489
  # ^^^^^^^^^
395
490
  attr_reader :old_name
396
491
 
397
- # attr_reader keyword_loc: Location
492
+ # Represents the location of the `alias` keyword.
493
+ #
494
+ # alias foo bar
495
+ # ^^^^^
398
496
  def keyword_loc
399
497
  location = @keyword_loc
400
498
  return location if location.is_a?(Location)
401
499
  @keyword_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
402
500
  end
403
501
 
502
+ # Save the keyword_loc location using the given saved source so that
503
+ # it can be retrieved later.
504
+ def save_keyword_loc(repository)
505
+ repository.enter(node_id, :keyword_loc)
506
+ end
507
+
404
508
  # def keyword: () -> String
405
509
  def keyword
406
510
  keyword_loc.slice
@@ -502,6 +606,12 @@ module Prism
502
606
  @operator_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
503
607
  end
504
608
 
609
+ # Save the operator_loc location using the given saved source so that
610
+ # it can be retrieved later.
611
+ def save_operator_loc(repository)
612
+ repository.enter(node_id, :operator_loc)
613
+ end
614
+
505
615
  # def operator: () -> String
506
616
  def operator
507
617
  operator_loc.slice
@@ -609,6 +719,12 @@ module Prism
609
719
  @operator_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
610
720
  end
611
721
 
722
+ # Save the operator_loc location using the given saved source so that
723
+ # it can be retrieved later.
724
+ def save_operator_loc(repository)
725
+ repository.enter(node_id, :operator_loc)
726
+ end
727
+
612
728
  # def operator: () -> String
613
729
  def operator
614
730
  operator_loc.slice
@@ -711,7 +827,10 @@ module Prism
711
827
  flags.anybits?(ArgumentsNodeFlags::CONTAINS_MULTIPLE_SPLATS)
712
828
  end
713
829
 
714
- # attr_reader arguments: Array[Prism::node]
830
+ # The list of arguments, if present. These can be any [non-void expressions](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression).
831
+ #
832
+ # foo(bar, baz)
833
+ # ^^^^^^^^
715
834
  attr_reader :arguments
716
835
 
717
836
  # def inspect -> String
@@ -814,6 +933,12 @@ module Prism
814
933
  end
815
934
  end
816
935
 
936
+ # Save the opening_loc location using the given saved source so that
937
+ # it can be retrieved later.
938
+ def save_opening_loc(repository)
939
+ repository.enter(node_id, :opening_loc) unless @opening_loc.nil?
940
+ end
941
+
817
942
  # Represents the optional source location for the closing token.
818
943
  #
819
944
  # [1,2,3] # "]"
@@ -832,6 +957,12 @@ module Prism
832
957
  end
833
958
  end
834
959
 
960
+ # Save the closing_loc location using the given saved source so that
961
+ # it can be retrieved later.
962
+ def save_closing_loc(repository)
963
+ repository.enter(node_id, :closing_loc) unless @closing_loc.nil?
964
+ end
965
+
835
966
  # def opening: () -> String?
836
967
  def opening
837
968
  opening_loc&.slice
@@ -877,8 +1008,8 @@ module Prism
877
1008
  # foo in [1, 2]
878
1009
  # ^^^^^^^^^^^^^
879
1010
  #
880
- # foo in *1
881
- # ^^^^^^^^^
1011
+ # foo in *bar
1012
+ # ^^^^^^^^^^^
882
1013
  #
883
1014
  # foo in Bar[]
884
1015
  # ^^^^^^^^^^^^
@@ -941,16 +1072,28 @@ module Prism
941
1072
  # attr_reader constant: ConstantReadNode | ConstantPathNode | nil
942
1073
  attr_reader :constant
943
1074
 
944
- # attr_reader requireds: Array[Prism::node]
1075
+ # Represents the required elements of the array pattern.
1076
+ #
1077
+ # foo in [1, 2]
1078
+ # ^ ^
945
1079
  attr_reader :requireds
946
1080
 
947
- # attr_reader rest: Prism::node?
1081
+ # Represents the rest element of the array pattern.
1082
+ #
1083
+ # foo in *bar
1084
+ # ^^^^
948
1085
  attr_reader :rest
949
1086
 
950
- # attr_reader posts: Array[Prism::node]
1087
+ # Represents the elements after the rest element of the array pattern.
1088
+ #
1089
+ # foo in *bar, baz
1090
+ # ^^^
951
1091
  attr_reader :posts
952
1092
 
953
- # attr_reader opening_loc: Location?
1093
+ # Represents the opening location of the array pattern.
1094
+ #
1095
+ # foo in [1, 2]
1096
+ # ^
954
1097
  def opening_loc
955
1098
  location = @opening_loc
956
1099
  case location
@@ -963,7 +1106,16 @@ module Prism
963
1106
  end
964
1107
  end
965
1108
 
966
- # attr_reader closing_loc: Location?
1109
+ # Save the opening_loc location using the given saved source so that
1110
+ # it can be retrieved later.
1111
+ def save_opening_loc(repository)
1112
+ repository.enter(node_id, :opening_loc) unless @opening_loc.nil?
1113
+ end
1114
+
1115
+ # Represents the closing location of the array pattern.
1116
+ #
1117
+ # foo in [1, 2]
1118
+ # ^
967
1119
  def closing_loc
968
1120
  location = @closing_loc
969
1121
  case location
@@ -976,6 +1128,12 @@ module Prism
976
1128
  end
977
1129
  end
978
1130
 
1131
+ # Save the closing_loc location using the given saved source so that
1132
+ # it can be retrieved later.
1133
+ def save_closing_loc(repository)
1134
+ repository.enter(node_id, :closing_loc) unless @closing_loc.nil?
1135
+ end
1136
+
979
1137
  # def opening: () -> String?
980
1138
  def opening
981
1139
  opening_loc&.slice
@@ -1102,6 +1260,12 @@ module Prism
1102
1260
  end
1103
1261
  end
1104
1262
 
1263
+ # Save the operator_loc location using the given saved source so that
1264
+ # it can be retrieved later.
1265
+ def save_operator_loc(repository)
1266
+ repository.enter(node_id, :operator_loc) unless @operator_loc.nil?
1267
+ end
1268
+
1105
1269
  # def operator: () -> String?
1106
1270
  def operator
1107
1271
  operator_loc&.slice
@@ -1198,6 +1362,12 @@ module Prism
1198
1362
  @operator_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
1199
1363
  end
1200
1364
 
1365
+ # Save the operator_loc location using the given saved source so that
1366
+ # it can be retrieved later.
1367
+ def save_operator_loc(repository)
1368
+ repository.enter(node_id, :operator_loc)
1369
+ end
1370
+
1201
1371
  # def operator: () -> String
1202
1372
  def operator
1203
1373
  operator_loc.slice
@@ -1363,7 +1533,10 @@ module Prism
1363
1533
  { node_id: node_id, location: location, begin_keyword_loc: begin_keyword_loc, statements: statements, rescue_clause: rescue_clause, else_clause: else_clause, ensure_clause: ensure_clause, end_keyword_loc: end_keyword_loc }
1364
1534
  end
1365
1535
 
1366
- # attr_reader begin_keyword_loc: Location?
1536
+ # Represents the location of the `begin` keyword.
1537
+ #
1538
+ # begin x end
1539
+ # ^^^^^
1367
1540
  def begin_keyword_loc
1368
1541
  location = @begin_keyword_loc
1369
1542
  case location
@@ -1376,19 +1549,40 @@ module Prism
1376
1549
  end
1377
1550
  end
1378
1551
 
1379
- # attr_reader statements: StatementsNode?
1552
+ # Save the begin_keyword_loc location using the given saved source so that
1553
+ # it can be retrieved later.
1554
+ def save_begin_keyword_loc(repository)
1555
+ repository.enter(node_id, :begin_keyword_loc) unless @begin_keyword_loc.nil?
1556
+ end
1557
+
1558
+ # Represents the statements within the begin block.
1559
+ #
1560
+ # begin x end
1561
+ # ^
1380
1562
  attr_reader :statements
1381
1563
 
1382
- # attr_reader rescue_clause: RescueNode?
1564
+ # Represents the rescue clause within the begin block.
1565
+ #
1566
+ # begin x; rescue y; end
1567
+ # ^^^^^^^^
1383
1568
  attr_reader :rescue_clause
1384
1569
 
1385
- # attr_reader else_clause: ElseNode?
1570
+ # Represents the else clause within the begin block.
1571
+ #
1572
+ # begin x; rescue y; else z; end
1573
+ # ^^^^^^
1386
1574
  attr_reader :else_clause
1387
1575
 
1388
- # attr_reader ensure_clause: EnsureNode?
1576
+ # Represents the ensure clause within the begin block.
1577
+ #
1578
+ # begin x; ensure y; end
1579
+ # ^^^^^^^^
1389
1580
  attr_reader :ensure_clause
1390
1581
 
1391
- # attr_reader end_keyword_loc: Location?
1582
+ # Represents the location of the `end` keyword.
1583
+ #
1584
+ # begin x end
1585
+ # ^^^
1392
1586
  def end_keyword_loc
1393
1587
  location = @end_keyword_loc
1394
1588
  case location
@@ -1401,6 +1595,12 @@ module Prism
1401
1595
  end
1402
1596
  end
1403
1597
 
1598
+ # Save the end_keyword_loc location using the given saved source so that
1599
+ # it can be retrieved later.
1600
+ def save_end_keyword_loc(repository)
1601
+ repository.enter(node_id, :end_keyword_loc) unless @end_keyword_loc.nil?
1602
+ end
1603
+
1404
1604
  # def begin_keyword: () -> String?
1405
1605
  def begin_keyword
1406
1606
  begin_keyword_loc&.slice
@@ -1489,16 +1689,28 @@ module Prism
1489
1689
  { node_id: node_id, location: location, expression: expression, operator_loc: operator_loc }
1490
1690
  end
1491
1691
 
1492
- # attr_reader expression: Prism::node?
1692
+ # The expression that is being passed as a block argument. This can be any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression).
1693
+ #
1694
+ # foo(&args)
1695
+ # ^^^^^
1493
1696
  attr_reader :expression
1494
1697
 
1495
- # attr_reader operator_loc: Location
1698
+ # Represents the location of the `&` operator.
1699
+ #
1700
+ # foo(&args)
1701
+ # ^
1496
1702
  def operator_loc
1497
1703
  location = @operator_loc
1498
1704
  return location if location.is_a?(Location)
1499
1705
  @operator_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
1500
1706
  end
1501
1707
 
1708
+ # Save the operator_loc location using the given saved source so that
1709
+ # it can be retrieved later.
1710
+ def save_operator_loc(repository)
1711
+ repository.enter(node_id, :operator_loc)
1712
+ end
1713
+
1502
1714
  # def operator: () -> String
1503
1715
  def operator
1504
1716
  operator_loc.slice
@@ -1580,7 +1792,10 @@ module Prism
1580
1792
  flags.anybits?(ParameterFlags::REPEATED_PARAMETER)
1581
1793
  end
1582
1794
 
1583
- # attr_reader name: Symbol
1795
+ # The name of the block local variable.
1796
+ #
1797
+ # a { |; b| } # name `:b`
1798
+ # ^
1584
1799
  attr_reader :name
1585
1800
 
1586
1801
  # def inspect -> String
@@ -1661,29 +1876,60 @@ module Prism
1661
1876
  { node_id: node_id, location: location, locals: locals, parameters: parameters, body: body, opening_loc: opening_loc, closing_loc: closing_loc }
1662
1877
  end
1663
1878
 
1664
- # attr_reader locals: Array[Symbol]
1879
+ # The local variables declared in the block.
1880
+ #
1881
+ # [1, 2, 3].each { |i| puts x } # locals: [:i]
1882
+ # ^
1665
1883
  attr_reader :locals
1666
1884
 
1667
- # attr_reader parameters: BlockParametersNode | NumberedParametersNode | ItParametersNode | nil
1885
+ # The parameters of the block.
1886
+ #
1887
+ # [1, 2, 3].each { |i| puts x }
1888
+ # ^^^
1889
+ # [1, 2, 3].each { puts _1 }
1890
+ # ^^^^^^^^^^^
1891
+ # [1, 2, 3].each { puts it }
1892
+ # ^^^^^^^^^^^
1668
1893
  attr_reader :parameters
1669
1894
 
1670
- # attr_reader body: StatementsNode | BeginNode | nil
1895
+ # The body of the block.
1896
+ #
1897
+ # [1, 2, 3].each { |i| puts x }
1898
+ # ^^^^^^
1671
1899
  attr_reader :body
1672
1900
 
1673
- # attr_reader opening_loc: Location
1901
+ # Represents the location of the opening `|`.
1902
+ #
1903
+ # [1, 2, 3].each { |i| puts x }
1904
+ # ^
1674
1905
  def opening_loc
1675
1906
  location = @opening_loc
1676
1907
  return location if location.is_a?(Location)
1677
1908
  @opening_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
1678
1909
  end
1679
1910
 
1680
- # attr_reader closing_loc: Location
1911
+ # Save the opening_loc location using the given saved source so that
1912
+ # it can be retrieved later.
1913
+ def save_opening_loc(repository)
1914
+ repository.enter(node_id, :opening_loc)
1915
+ end
1916
+
1917
+ # Represents the location of the closing `|`.
1918
+ #
1919
+ # [1, 2, 3].each { |i| puts x }
1920
+ # ^
1681
1921
  def closing_loc
1682
1922
  location = @closing_loc
1683
1923
  return location if location.is_a?(Location)
1684
1924
  @closing_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
1685
1925
  end
1686
1926
 
1927
+ # Save the closing_loc location using the given saved source so that
1928
+ # it can be retrieved later.
1929
+ def save_closing_loc(repository)
1930
+ repository.enter(node_id, :closing_loc)
1931
+ end
1932
+
1687
1933
  # def opening: () -> String
1688
1934
  def opening
1689
1935
  opening_loc.slice
@@ -1777,10 +2023,17 @@ module Prism
1777
2023
  flags.anybits?(ParameterFlags::REPEATED_PARAMETER)
1778
2024
  end
1779
2025
 
1780
- # attr_reader name: Symbol?
2026
+ # The name of the block parameter.
2027
+ #
2028
+ # def a(&b) # name `:b`
2029
+ # ^
2030
+ # end
1781
2031
  attr_reader :name
1782
2032
 
1783
- # attr_reader name_loc: Location?
2033
+ # Represents the location of the block parameter name.
2034
+ #
2035
+ # def a(&b)
2036
+ # ^
1784
2037
  def name_loc
1785
2038
  location = @name_loc
1786
2039
  case location
@@ -1793,13 +2046,29 @@ module Prism
1793
2046
  end
1794
2047
  end
1795
2048
 
1796
- # attr_reader operator_loc: Location
2049
+ # Save the name_loc location using the given saved source so that
2050
+ # it can be retrieved later.
2051
+ def save_name_loc(repository)
2052
+ repository.enter(node_id, :name_loc) unless @name_loc.nil?
2053
+ end
2054
+
2055
+ # Represents the location of the `&` operator.
2056
+ #
2057
+ # def a(&b)
2058
+ # ^
2059
+ # end
1797
2060
  def operator_loc
1798
2061
  location = @operator_loc
1799
2062
  return location if location.is_a?(Location)
1800
2063
  @operator_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
1801
2064
  end
1802
2065
 
2066
+ # Save the operator_loc location using the given saved source so that
2067
+ # it can be retrieved later.
2068
+ def save_operator_loc(repository)
2069
+ repository.enter(node_id, :operator_loc)
2070
+ end
2071
+
1803
2072
  # def operator: () -> String
1804
2073
  def operator
1805
2074
  operator_loc.slice
@@ -1888,13 +2157,34 @@ module Prism
1888
2157
  { node_id: node_id, location: location, parameters: parameters, locals: locals, opening_loc: opening_loc, closing_loc: closing_loc }
1889
2158
  end
1890
2159
 
1891
- # attr_reader parameters: ParametersNode?
2160
+ # Represents the parameters of the block.
2161
+ #
2162
+ # -> (a, b = 1; local) { }
2163
+ # ^^^^^^^^
2164
+ #
2165
+ # foo do |a, b = 1; local|
2166
+ # ^^^^^^^^
2167
+ # end
1892
2168
  attr_reader :parameters
1893
2169
 
1894
- # attr_reader locals: Array[BlockLocalVariableNode]
2170
+ # Represents the local variables of the block.
2171
+ #
2172
+ # -> (a, b = 1; local) { }
2173
+ # ^^^^^
2174
+ #
2175
+ # foo do |a, b = 1; local|
2176
+ # ^^^^^
2177
+ # end
1895
2178
  attr_reader :locals
1896
2179
 
1897
- # attr_reader opening_loc: Location?
2180
+ # Represents the opening location of the block parameters.
2181
+ #
2182
+ # -> (a, b = 1; local) { }
2183
+ # ^
2184
+ #
2185
+ # foo do |a, b = 1; local|
2186
+ # ^
2187
+ # end
1898
2188
  def opening_loc
1899
2189
  location = @opening_loc
1900
2190
  case location
@@ -1907,7 +2197,20 @@ module Prism
1907
2197
  end
1908
2198
  end
1909
2199
 
1910
- # attr_reader closing_loc: Location?
2200
+ # Save the opening_loc location using the given saved source so that
2201
+ # it can be retrieved later.
2202
+ def save_opening_loc(repository)
2203
+ repository.enter(node_id, :opening_loc) unless @opening_loc.nil?
2204
+ end
2205
+
2206
+ # Represents the closing location of the block parameters.
2207
+ #
2208
+ # -> (a, b = 1; local) { }
2209
+ # ^
2210
+ #
2211
+ # foo do |a, b = 1; local|
2212
+ # ^
2213
+ # end
1911
2214
  def closing_loc
1912
2215
  location = @closing_loc
1913
2216
  case location
@@ -1920,6 +2223,12 @@ module Prism
1920
2223
  end
1921
2224
  end
1922
2225
 
2226
+ # Save the closing_loc location using the given saved source so that
2227
+ # it can be retrieved later.
2228
+ def save_closing_loc(repository)
2229
+ repository.enter(node_id, :closing_loc) unless @closing_loc.nil?
2230
+ end
2231
+
1923
2232
  # def opening: () -> String?
1924
2233
  def opening
1925
2234
  opening_loc&.slice
@@ -2023,6 +2332,12 @@ module Prism
2023
2332
  @keyword_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
2024
2333
  end
2025
2334
 
2335
+ # Save the keyword_loc location using the given saved source so that
2336
+ # it can be retrieved later.
2337
+ def save_keyword_loc(repository)
2338
+ repository.enter(node_id, :keyword_loc)
2339
+ end
2340
+
2026
2341
  # def keyword: () -> String
2027
2342
  def keyword
2028
2343
  keyword_loc.slice
@@ -2128,10 +2443,16 @@ module Prism
2128
2443
  flags.anybits?(CallNodeFlags::IGNORE_VISIBILITY)
2129
2444
  end
2130
2445
 
2131
- # attr_reader receiver: Prism::node?
2446
+ # The object that the method is being called on. This can be either `nil` or any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression).
2447
+ #
2448
+ # foo.bar &&= value
2449
+ # ^^^
2132
2450
  attr_reader :receiver
2133
2451
 
2134
- # attr_reader call_operator_loc: Location?
2452
+ # Represents the location of the call operator.
2453
+ #
2454
+ # foo.bar &&= value
2455
+ # ^
2135
2456
  def call_operator_loc
2136
2457
  location = @call_operator_loc
2137
2458
  case location
@@ -2144,7 +2465,16 @@ module Prism
2144
2465
  end
2145
2466
  end
2146
2467
 
2147
- # attr_reader message_loc: Location?
2468
+ # Save the call_operator_loc location using the given saved source so that
2469
+ # it can be retrieved later.
2470
+ def save_call_operator_loc(repository)
2471
+ repository.enter(node_id, :call_operator_loc) unless @call_operator_loc.nil?
2472
+ end
2473
+
2474
+ # Represents the location of the message.
2475
+ #
2476
+ # foo.bar &&= value
2477
+ # ^^^
2148
2478
  def message_loc
2149
2479
  location = @message_loc
2150
2480
  case location
@@ -2157,20 +2487,44 @@ module Prism
2157
2487
  end
2158
2488
  end
2159
2489
 
2160
- # attr_reader read_name: Symbol
2490
+ # Save the message_loc location using the given saved source so that
2491
+ # it can be retrieved later.
2492
+ def save_message_loc(repository)
2493
+ repository.enter(node_id, :message_loc) unless @message_loc.nil?
2494
+ end
2495
+
2496
+ # Represents the name of the method being called.
2497
+ #
2498
+ # foo.bar &&= value # read_name `:bar`
2499
+ # ^^^
2161
2500
  attr_reader :read_name
2162
2501
 
2163
- # attr_reader write_name: Symbol
2502
+ # Represents the name of the method being written to.
2503
+ #
2504
+ # foo.bar &&= value # write_name `:bar=`
2505
+ # ^^^
2164
2506
  attr_reader :write_name
2165
2507
 
2166
- # attr_reader operator_loc: Location
2508
+ # Represents the location of the operator.
2509
+ #
2510
+ # foo.bar &&= value
2511
+ # ^^^
2167
2512
  def operator_loc
2168
2513
  location = @operator_loc
2169
2514
  return location if location.is_a?(Location)
2170
2515
  @operator_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
2171
2516
  end
2172
2517
 
2173
- # attr_reader value: Prism::node
2518
+ # Save the operator_loc location using the given saved source so that
2519
+ # it can be retrieved later.
2520
+ def save_operator_loc(repository)
2521
+ repository.enter(node_id, :operator_loc)
2522
+ end
2523
+
2524
+ # Represents the value being assigned.
2525
+ #
2526
+ # foo.bar &&= value
2527
+ # ^^^^^
2174
2528
  attr_reader :value
2175
2529
 
2176
2530
  # def call_operator: () -> String?
@@ -2323,7 +2677,13 @@ module Prism
2323
2677
  # ^^^
2324
2678
  attr_reader :receiver
2325
2679
 
2326
- # attr_reader call_operator_loc: Location?
2680
+ # Represents the location of the call operator.
2681
+ #
2682
+ # foo.bar
2683
+ # ^
2684
+ #
2685
+ # foo&.bar
2686
+ # ^^
2327
2687
  def call_operator_loc
2328
2688
  location = @call_operator_loc
2329
2689
  case location
@@ -2336,10 +2696,22 @@ module Prism
2336
2696
  end
2337
2697
  end
2338
2698
 
2339
- # attr_reader name: Symbol
2699
+ # Save the call_operator_loc location using the given saved source so that
2700
+ # it can be retrieved later.
2701
+ def save_call_operator_loc(repository)
2702
+ repository.enter(node_id, :call_operator_loc) unless @call_operator_loc.nil?
2703
+ end
2704
+
2705
+ # Represents the name of the method being called.
2706
+ #
2707
+ # foo.bar # name `:foo`
2708
+ # ^^^
2340
2709
  attr_reader :name
2341
2710
 
2342
- # attr_reader message_loc: Location?
2711
+ # Represents the location of the message.
2712
+ #
2713
+ # foo.bar
2714
+ # ^^^
2343
2715
  def message_loc
2344
2716
  location = @message_loc
2345
2717
  case location
@@ -2352,7 +2724,15 @@ module Prism
2352
2724
  end
2353
2725
  end
2354
2726
 
2355
- # attr_reader opening_loc: Location?
2727
+ # Save the message_loc location using the given saved source so that
2728
+ # it can be retrieved later.
2729
+ def save_message_loc(repository)
2730
+ repository.enter(node_id, :message_loc) unless @message_loc.nil?
2731
+ end
2732
+
2733
+ # Represents the location of the left parenthesis.
2734
+ # foo(bar)
2735
+ # ^
2356
2736
  def opening_loc
2357
2737
  location = @opening_loc
2358
2738
  case location
@@ -2365,10 +2745,22 @@ module Prism
2365
2745
  end
2366
2746
  end
2367
2747
 
2368
- # attr_reader arguments: ArgumentsNode?
2748
+ # Save the opening_loc location using the given saved source so that
2749
+ # it can be retrieved later.
2750
+ def save_opening_loc(repository)
2751
+ repository.enter(node_id, :opening_loc) unless @opening_loc.nil?
2752
+ end
2753
+
2754
+ # Represents the arguments to the method call. These can be any [non-void expressions](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression).
2755
+ #
2756
+ # foo(bar)
2757
+ # ^^^
2369
2758
  attr_reader :arguments
2370
2759
 
2371
- # attr_reader closing_loc: Location?
2760
+ # Represents the location of the right parenthesis.
2761
+ #
2762
+ # foo(bar)
2763
+ # ^
2372
2764
  def closing_loc
2373
2765
  location = @closing_loc
2374
2766
  case location
@@ -2381,7 +2773,16 @@ module Prism
2381
2773
  end
2382
2774
  end
2383
2775
 
2384
- # attr_reader block: BlockNode | BlockArgumentNode | nil
2776
+ # Save the closing_loc location using the given saved source so that
2777
+ # it can be retrieved later.
2778
+ def save_closing_loc(repository)
2779
+ repository.enter(node_id, :closing_loc) unless @closing_loc.nil?
2780
+ end
2781
+
2782
+ # Represents the block that is being passed to the method.
2783
+ #
2784
+ # foo { |a| a }
2785
+ # ^^^^^^^^^
2385
2786
  attr_reader :block
2386
2787
 
2387
2788
  # def call_operator: () -> String?
@@ -2512,10 +2913,16 @@ module Prism
2512
2913
  flags.anybits?(CallNodeFlags::IGNORE_VISIBILITY)
2513
2914
  end
2514
2915
 
2515
- # attr_reader receiver: Prism::node?
2916
+ # The object that the method is being called on. This can be either `nil` or any [non-void expressions](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression).
2917
+ #
2918
+ # foo.bar += value
2919
+ # ^^^
2516
2920
  attr_reader :receiver
2517
2921
 
2518
- # attr_reader call_operator_loc: Location?
2922
+ # Represents the location of the call operator.
2923
+ #
2924
+ # foo.bar += value
2925
+ # ^
2519
2926
  def call_operator_loc
2520
2927
  location = @call_operator_loc
2521
2928
  case location
@@ -2528,7 +2935,16 @@ module Prism
2528
2935
  end
2529
2936
  end
2530
2937
 
2531
- # attr_reader message_loc: Location?
2938
+ # Save the call_operator_loc location using the given saved source so that
2939
+ # it can be retrieved later.
2940
+ def save_call_operator_loc(repository)
2941
+ repository.enter(node_id, :call_operator_loc) unless @call_operator_loc.nil?
2942
+ end
2943
+
2944
+ # Represents the location of the message.
2945
+ #
2946
+ # foo.bar += value
2947
+ # ^^^
2532
2948
  def message_loc
2533
2949
  location = @message_loc
2534
2950
  case location
@@ -2541,23 +2957,50 @@ module Prism
2541
2957
  end
2542
2958
  end
2543
2959
 
2544
- # attr_reader read_name: Symbol
2960
+ # Save the message_loc location using the given saved source so that
2961
+ # it can be retrieved later.
2962
+ def save_message_loc(repository)
2963
+ repository.enter(node_id, :message_loc) unless @message_loc.nil?
2964
+ end
2965
+
2966
+ # Represents the name of the method being called.
2967
+ #
2968
+ # foo.bar += value # read_name `:bar`
2969
+ # ^^^
2545
2970
  attr_reader :read_name
2546
2971
 
2547
- # attr_reader write_name: Symbol
2972
+ # Represents the name of the method being written to.
2973
+ #
2974
+ # foo.bar += value # write_name `:bar=`
2975
+ # ^^^
2548
2976
  attr_reader :write_name
2549
2977
 
2550
- # attr_reader binary_operator: Symbol
2978
+ # Represents the binary operator being used.
2979
+ #
2980
+ # foo.bar += value # binary_operator `:+`
2981
+ # ^
2551
2982
  attr_reader :binary_operator
2552
2983
 
2553
- # attr_reader binary_operator_loc: Location
2984
+ # Represents the location of the binary operator.
2985
+ #
2986
+ # foo.bar += value
2987
+ # ^^
2554
2988
  def binary_operator_loc
2555
2989
  location = @binary_operator_loc
2556
2990
  return location if location.is_a?(Location)
2557
2991
  @binary_operator_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
2558
2992
  end
2559
2993
 
2560
- # attr_reader value: Prism::node
2994
+ # Save the binary_operator_loc location using the given saved source so that
2995
+ # it can be retrieved later.
2996
+ def save_binary_operator_loc(repository)
2997
+ repository.enter(node_id, :binary_operator_loc)
2998
+ end
2999
+
3000
+ # Represents the value being assigned.
3001
+ #
3002
+ # foo.bar += value
3003
+ # ^^^^^
2561
3004
  attr_reader :value
2562
3005
 
2563
3006
  # def call_operator: () -> String?
@@ -2677,10 +3120,16 @@ module Prism
2677
3120
  flags.anybits?(CallNodeFlags::IGNORE_VISIBILITY)
2678
3121
  end
2679
3122
 
2680
- # attr_reader receiver: Prism::node?
3123
+ # The object that the method is being called on. This can be either `nil` or any [non-void expressions](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression).
3124
+ #
3125
+ # foo.bar ||= value
3126
+ # ^^^
2681
3127
  attr_reader :receiver
2682
3128
 
2683
- # attr_reader call_operator_loc: Location?
3129
+ # Represents the location of the call operator.
3130
+ #
3131
+ # foo.bar ||= value
3132
+ # ^
2684
3133
  def call_operator_loc
2685
3134
  location = @call_operator_loc
2686
3135
  case location
@@ -2693,7 +3142,16 @@ module Prism
2693
3142
  end
2694
3143
  end
2695
3144
 
2696
- # attr_reader message_loc: Location?
3145
+ # Save the call_operator_loc location using the given saved source so that
3146
+ # it can be retrieved later.
3147
+ def save_call_operator_loc(repository)
3148
+ repository.enter(node_id, :call_operator_loc) unless @call_operator_loc.nil?
3149
+ end
3150
+
3151
+ # Represents the location of the message.
3152
+ #
3153
+ # foo.bar ||= value
3154
+ # ^^^
2697
3155
  def message_loc
2698
3156
  location = @message_loc
2699
3157
  case location
@@ -2706,20 +3164,44 @@ module Prism
2706
3164
  end
2707
3165
  end
2708
3166
 
2709
- # attr_reader read_name: Symbol
3167
+ # Save the message_loc location using the given saved source so that
3168
+ # it can be retrieved later.
3169
+ def save_message_loc(repository)
3170
+ repository.enter(node_id, :message_loc) unless @message_loc.nil?
3171
+ end
3172
+
3173
+ # Represents the name of the method being called.
3174
+ #
3175
+ # foo.bar ||= value # read_name `:bar`
3176
+ # ^^^
2710
3177
  attr_reader :read_name
2711
3178
 
2712
- # attr_reader write_name: Symbol
3179
+ # Represents the name of the method being written to.
3180
+ #
3181
+ # foo.bar ||= value # write_name `:bar=`
3182
+ # ^^^
2713
3183
  attr_reader :write_name
2714
3184
 
2715
- # attr_reader operator_loc: Location
3185
+ # Represents the location of the operator.
3186
+ #
3187
+ # foo.bar ||= value
3188
+ # ^^^
2716
3189
  def operator_loc
2717
3190
  location = @operator_loc
2718
3191
  return location if location.is_a?(Location)
2719
3192
  @operator_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
2720
3193
  end
2721
3194
 
2722
- # attr_reader value: Prism::node
3195
+ # Save the operator_loc location using the given saved source so that
3196
+ # it can be retrieved later.
3197
+ def save_operator_loc(repository)
3198
+ repository.enter(node_id, :operator_loc)
3199
+ end
3200
+
3201
+ # Represents the value being assigned.
3202
+ #
3203
+ # foo.bar ||= value
3204
+ # ^^^^^
2723
3205
  attr_reader :value
2724
3206
 
2725
3207
  # def call_operator: () -> String?
@@ -2845,26 +3327,50 @@ module Prism
2845
3327
  flags.anybits?(CallNodeFlags::IGNORE_VISIBILITY)
2846
3328
  end
2847
3329
 
2848
- # attr_reader receiver: Prism::node
3330
+ # The object that the method is being called on. This can be any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression).
3331
+ #
3332
+ # foo.bar = 1
3333
+ # ^^^
2849
3334
  attr_reader :receiver
2850
3335
 
2851
- # attr_reader call_operator_loc: Location
3336
+ # Represents the location of the call operator.
3337
+ #
3338
+ # foo.bar = 1
3339
+ # ^
2852
3340
  def call_operator_loc
2853
3341
  location = @call_operator_loc
2854
3342
  return location if location.is_a?(Location)
2855
3343
  @call_operator_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
2856
3344
  end
2857
3345
 
2858
- # attr_reader name: Symbol
3346
+ # Save the call_operator_loc location using the given saved source so that
3347
+ # it can be retrieved later.
3348
+ def save_call_operator_loc(repository)
3349
+ repository.enter(node_id, :call_operator_loc)
3350
+ end
3351
+
3352
+ # Represents the name of the method being called.
3353
+ #
3354
+ # foo.bar = 1 # name `:foo`
3355
+ # ^^^
2859
3356
  attr_reader :name
2860
3357
 
2861
- # attr_reader message_loc: Location
3358
+ # Represents the location of the message.
3359
+ #
3360
+ # foo.bar = 1
3361
+ # ^^^
2862
3362
  def message_loc
2863
3363
  location = @message_loc
2864
3364
  return location if location.is_a?(Location)
2865
3365
  @message_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
2866
3366
  end
2867
3367
 
3368
+ # Save the message_loc location using the given saved source so that
3369
+ # it can be retrieved later.
3370
+ def save_message_loc(repository)
3371
+ repository.enter(node_id, :message_loc)
3372
+ end
3373
+
2868
3374
  # def call_operator: () -> String
2869
3375
  def call_operator
2870
3376
  call_operator_loc.slice
@@ -2951,19 +3457,34 @@ module Prism
2951
3457
  { node_id: node_id, location: location, value: value, target: target, operator_loc: operator_loc }
2952
3458
  end
2953
3459
 
2954
- # attr_reader value: Prism::node
3460
+ # Represents the value to capture.
3461
+ #
3462
+ # foo => bar
3463
+ # ^^^
2955
3464
  attr_reader :value
2956
3465
 
2957
- # attr_reader target: LocalVariableTargetNode
3466
+ # Represents the target of the capture.
3467
+ #
3468
+ # foo => bar
3469
+ # ^^^
2958
3470
  attr_reader :target
2959
3471
 
2960
- # attr_reader operator_loc: Location
3472
+ # Represents the location of the `=>` operator.
3473
+ #
3474
+ # foo => bar
3475
+ # ^^
2961
3476
  def operator_loc
2962
3477
  location = @operator_loc
2963
3478
  return location if location.is_a?(Location)
2964
3479
  @operator_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
2965
3480
  end
2966
3481
 
3482
+ # Save the operator_loc location using the given saved source so that
3483
+ # it can be retrieved later.
3484
+ def save_operator_loc(repository)
3485
+ repository.enter(node_id, :operator_loc)
3486
+ end
3487
+
2967
3488
  # def operator: () -> String
2968
3489
  def operator
2969
3490
  operator_loc.slice
@@ -3051,29 +3572,56 @@ module Prism
3051
3572
  { node_id: node_id, location: location, predicate: predicate, conditions: conditions, else_clause: else_clause, case_keyword_loc: case_keyword_loc, end_keyword_loc: end_keyword_loc }
3052
3573
  end
3053
3574
 
3054
- # attr_reader predicate: Prism::node?
3575
+ # Represents the predicate of the case match. This can be either `nil` or any [non-void expressions](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression).
3576
+ #
3577
+ # case true; in false; end
3578
+ # ^^^^
3055
3579
  attr_reader :predicate
3056
3580
 
3057
- # attr_reader conditions: Array[InNode]
3581
+ # Represents the conditions of the case match.
3582
+ #
3583
+ # case true; in false; end
3584
+ # ^^^^^^^^
3058
3585
  attr_reader :conditions
3059
3586
 
3060
- # attr_reader else_clause: ElseNode?
3587
+ # Represents the else clause of the case match.
3588
+ #
3589
+ # case true; in false; else; end
3590
+ # ^^^^
3061
3591
  attr_reader :else_clause
3062
3592
 
3063
- # attr_reader case_keyword_loc: Location
3593
+ # Represents the location of the `case` keyword.
3594
+ #
3595
+ # case true; in false; end
3596
+ # ^^^^
3064
3597
  def case_keyword_loc
3065
3598
  location = @case_keyword_loc
3066
3599
  return location if location.is_a?(Location)
3067
3600
  @case_keyword_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
3068
3601
  end
3069
3602
 
3070
- # attr_reader end_keyword_loc: Location
3603
+ # Save the case_keyword_loc location using the given saved source so that
3604
+ # it can be retrieved later.
3605
+ def save_case_keyword_loc(repository)
3606
+ repository.enter(node_id, :case_keyword_loc)
3607
+ end
3608
+
3609
+ # Represents the location of the `end` keyword.
3610
+ #
3611
+ # case true; in false; end
3612
+ # ^^^
3071
3613
  def end_keyword_loc
3072
3614
  location = @end_keyword_loc
3073
3615
  return location if location.is_a?(Location)
3074
3616
  @end_keyword_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
3075
3617
  end
3076
3618
 
3619
+ # Save the end_keyword_loc location using the given saved source so that
3620
+ # it can be retrieved later.
3621
+ def save_end_keyword_loc(repository)
3622
+ repository.enter(node_id, :end_keyword_loc)
3623
+ end
3624
+
3077
3625
  # def case_keyword: () -> String
3078
3626
  def case_keyword
3079
3627
  case_keyword_loc.slice
@@ -3169,29 +3717,56 @@ module Prism
3169
3717
  { node_id: node_id, location: location, predicate: predicate, conditions: conditions, else_clause: else_clause, case_keyword_loc: case_keyword_loc, end_keyword_loc: end_keyword_loc }
3170
3718
  end
3171
3719
 
3172
- # attr_reader predicate: Prism::node?
3720
+ # Represents the predicate of the case statement. This can be either `nil` or any [non-void expressions](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression).
3721
+ #
3722
+ # case true; when false; end
3723
+ # ^^^^
3173
3724
  attr_reader :predicate
3174
3725
 
3175
- # attr_reader conditions: Array[WhenNode]
3726
+ # Represents the conditions of the case statement.
3727
+ #
3728
+ # case true; when false; end
3729
+ # ^^^^^^^^^^
3176
3730
  attr_reader :conditions
3177
3731
 
3178
- # attr_reader else_clause: ElseNode?
3732
+ # Represents the else clause of the case statement.
3733
+ #
3734
+ # case true; when false; else; end
3735
+ # ^^^^
3179
3736
  attr_reader :else_clause
3180
3737
 
3181
- # attr_reader case_keyword_loc: Location
3738
+ # Represents the location of the `case` keyword.
3739
+ #
3740
+ # case true; when false; end
3741
+ # ^^^^
3182
3742
  def case_keyword_loc
3183
3743
  location = @case_keyword_loc
3184
3744
  return location if location.is_a?(Location)
3185
3745
  @case_keyword_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
3186
3746
  end
3187
3747
 
3188
- # attr_reader end_keyword_loc: Location
3748
+ # Save the case_keyword_loc location using the given saved source so that
3749
+ # it can be retrieved later.
3750
+ def save_case_keyword_loc(repository)
3751
+ repository.enter(node_id, :case_keyword_loc)
3752
+ end
3753
+
3754
+ # Represents the location of the `end` keyword.
3755
+ #
3756
+ # case true; when false; end
3757
+ # ^^^
3189
3758
  def end_keyword_loc
3190
3759
  location = @end_keyword_loc
3191
3760
  return location if location.is_a?(Location)
3192
3761
  @end_keyword_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
3193
3762
  end
3194
3763
 
3764
+ # Save the end_keyword_loc location using the given saved source so that
3765
+ # it can be retrieved later.
3766
+ def save_end_keyword_loc(repository)
3767
+ repository.enter(node_id, :end_keyword_loc)
3768
+ end
3769
+
3195
3770
  # def case_keyword: () -> String
3196
3771
  def case_keyword
3197
3772
  case_keyword_loc.slice
@@ -3298,6 +3873,12 @@ module Prism
3298
3873
  @class_keyword_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
3299
3874
  end
3300
3875
 
3876
+ # Save the class_keyword_loc location using the given saved source so that
3877
+ # it can be retrieved later.
3878
+ def save_class_keyword_loc(repository)
3879
+ repository.enter(node_id, :class_keyword_loc)
3880
+ end
3881
+
3301
3882
  # attr_reader constant_path: ConstantReadNode | ConstantPathNode | CallNode
3302
3883
  attr_reader :constant_path
3303
3884
 
@@ -3314,6 +3895,12 @@ module Prism
3314
3895
  end
3315
3896
  end
3316
3897
 
3898
+ # Save the inheritance_operator_loc location using the given saved source so that
3899
+ # it can be retrieved later.
3900
+ def save_inheritance_operator_loc(repository)
3901
+ repository.enter(node_id, :inheritance_operator_loc) unless @inheritance_operator_loc.nil?
3902
+ end
3903
+
3317
3904
  # attr_reader superclass: Prism::node?
3318
3905
  attr_reader :superclass
3319
3906
 
@@ -3327,6 +3914,12 @@ module Prism
3327
3914
  @end_keyword_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
3328
3915
  end
3329
3916
 
3917
+ # Save the end_keyword_loc location using the given saved source so that
3918
+ # it can be retrieved later.
3919
+ def save_end_keyword_loc(repository)
3920
+ repository.enter(node_id, :end_keyword_loc)
3921
+ end
3922
+
3330
3923
  # attr_reader name: Symbol
3331
3924
  attr_reader :name
3332
3925
 
@@ -3426,24 +4019,48 @@ module Prism
3426
4019
  { node_id: node_id, location: location, name: name, name_loc: name_loc, operator_loc: operator_loc, value: value }
3427
4020
  end
3428
4021
 
3429
- # attr_reader name: Symbol
4022
+ # The name of the class variable, which is a `@@` followed by an [identifier](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#identifiers).
4023
+ #
4024
+ # @@target &&= value # name `:@@target`
4025
+ # ^^^^^^^^
3430
4026
  attr_reader :name
3431
4027
 
3432
- # attr_reader name_loc: Location
4028
+ # Represents the location of the variable name.
4029
+ #
4030
+ # @@target &&= value
4031
+ # ^^^^^^^^
3433
4032
  def name_loc
3434
4033
  location = @name_loc
3435
4034
  return location if location.is_a?(Location)
3436
4035
  @name_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
3437
4036
  end
3438
4037
 
3439
- # attr_reader operator_loc: Location
4038
+ # Save the name_loc location using the given saved source so that
4039
+ # it can be retrieved later.
4040
+ def save_name_loc(repository)
4041
+ repository.enter(node_id, :name_loc)
4042
+ end
4043
+
4044
+ # Represents the location of the `&&=` operator.
4045
+ #
4046
+ # @@target &&= value
4047
+ # ^^^
3440
4048
  def operator_loc
3441
4049
  location = @operator_loc
3442
4050
  return location if location.is_a?(Location)
3443
4051
  @operator_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
3444
4052
  end
3445
4053
 
3446
- # attr_reader value: Prism::node
4054
+ # Save the operator_loc location using the given saved source so that
4055
+ # it can be retrieved later.
4056
+ def save_operator_loc(repository)
4057
+ repository.enter(node_id, :operator_loc)
4058
+ end
4059
+
4060
+ # Represents the value being assigned. This can be any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression).
4061
+ #
4062
+ # @@target &&= value
4063
+ # ^^^^^
3447
4064
  attr_reader :value
3448
4065
 
3449
4066
  # def operator: () -> String
@@ -3538,6 +4155,12 @@ module Prism
3538
4155
  @name_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
3539
4156
  end
3540
4157
 
4158
+ # Save the name_loc location using the given saved source so that
4159
+ # it can be retrieved later.
4160
+ def save_name_loc(repository)
4161
+ repository.enter(node_id, :name_loc)
4162
+ end
4163
+
3541
4164
  # attr_reader binary_operator_loc: Location
3542
4165
  def binary_operator_loc
3543
4166
  location = @binary_operator_loc
@@ -3545,6 +4168,12 @@ module Prism
3545
4168
  @binary_operator_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
3546
4169
  end
3547
4170
 
4171
+ # Save the binary_operator_loc location using the given saved source so that
4172
+ # it can be retrieved later.
4173
+ def save_binary_operator_loc(repository)
4174
+ repository.enter(node_id, :binary_operator_loc)
4175
+ end
4176
+
3548
4177
  # attr_reader value: Prism::node
3549
4178
  attr_reader :value
3550
4179
 
@@ -3638,6 +4267,12 @@ module Prism
3638
4267
  @name_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
3639
4268
  end
3640
4269
 
4270
+ # Save the name_loc location using the given saved source so that
4271
+ # it can be retrieved later.
4272
+ def save_name_loc(repository)
4273
+ repository.enter(node_id, :name_loc)
4274
+ end
4275
+
3641
4276
  # attr_reader operator_loc: Location
3642
4277
  def operator_loc
3643
4278
  location = @operator_loc
@@ -3645,6 +4280,12 @@ module Prism
3645
4280
  @operator_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
3646
4281
  end
3647
4282
 
4283
+ # Save the operator_loc location using the given saved source so that
4284
+ # it can be retrieved later.
4285
+ def save_operator_loc(repository)
4286
+ repository.enter(node_id, :operator_loc)
4287
+ end
4288
+
3648
4289
  # attr_reader value: Prism::node
3649
4290
  attr_reader :value
3650
4291
 
@@ -3896,6 +4537,12 @@ module Prism
3896
4537
  @name_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
3897
4538
  end
3898
4539
 
4540
+ # Save the name_loc location using the given saved source so that
4541
+ # it can be retrieved later.
4542
+ def save_name_loc(repository)
4543
+ repository.enter(node_id, :name_loc)
4544
+ end
4545
+
3899
4546
  # The value to write to the class variable. This can be any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression).
3900
4547
  #
3901
4548
  # @@foo = :bar
@@ -3915,6 +4562,12 @@ module Prism
3915
4562
  @operator_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
3916
4563
  end
3917
4564
 
4565
+ # Save the operator_loc location using the given saved source so that
4566
+ # it can be retrieved later.
4567
+ def save_operator_loc(repository)
4568
+ repository.enter(node_id, :operator_loc)
4569
+ end
4570
+
3918
4571
  # def operator: () -> String
3919
4572
  def operator
3920
4573
  operator_loc.slice
@@ -4006,6 +4659,12 @@ module Prism
4006
4659
  @name_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
4007
4660
  end
4008
4661
 
4662
+ # Save the name_loc location using the given saved source so that
4663
+ # it can be retrieved later.
4664
+ def save_name_loc(repository)
4665
+ repository.enter(node_id, :name_loc)
4666
+ end
4667
+
4009
4668
  # attr_reader operator_loc: Location
4010
4669
  def operator_loc
4011
4670
  location = @operator_loc
@@ -4013,6 +4672,12 @@ module Prism
4013
4672
  @operator_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
4014
4673
  end
4015
4674
 
4675
+ # Save the operator_loc location using the given saved source so that
4676
+ # it can be retrieved later.
4677
+ def save_operator_loc(repository)
4678
+ repository.enter(node_id, :operator_loc)
4679
+ end
4680
+
4016
4681
  # attr_reader value: Prism::node
4017
4682
  attr_reader :value
4018
4683
 
@@ -4108,6 +4773,12 @@ module Prism
4108
4773
  @name_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
4109
4774
  end
4110
4775
 
4776
+ # Save the name_loc location using the given saved source so that
4777
+ # it can be retrieved later.
4778
+ def save_name_loc(repository)
4779
+ repository.enter(node_id, :name_loc)
4780
+ end
4781
+
4111
4782
  # attr_reader binary_operator_loc: Location
4112
4783
  def binary_operator_loc
4113
4784
  location = @binary_operator_loc
@@ -4115,6 +4786,12 @@ module Prism
4115
4786
  @binary_operator_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
4116
4787
  end
4117
4788
 
4789
+ # Save the binary_operator_loc location using the given saved source so that
4790
+ # it can be retrieved later.
4791
+ def save_binary_operator_loc(repository)
4792
+ repository.enter(node_id, :binary_operator_loc)
4793
+ end
4794
+
4118
4795
  # attr_reader value: Prism::node
4119
4796
  attr_reader :value
4120
4797
 
@@ -4208,6 +4885,12 @@ module Prism
4208
4885
  @name_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
4209
4886
  end
4210
4887
 
4888
+ # Save the name_loc location using the given saved source so that
4889
+ # it can be retrieved later.
4890
+ def save_name_loc(repository)
4891
+ repository.enter(node_id, :name_loc)
4892
+ end
4893
+
4211
4894
  # attr_reader operator_loc: Location
4212
4895
  def operator_loc
4213
4896
  location = @operator_loc
@@ -4215,6 +4898,12 @@ module Prism
4215
4898
  @operator_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
4216
4899
  end
4217
4900
 
4901
+ # Save the operator_loc location using the given saved source so that
4902
+ # it can be retrieved later.
4903
+ def save_operator_loc(repository)
4904
+ repository.enter(node_id, :operator_loc)
4905
+ end
4906
+
4218
4907
  # attr_reader value: Prism::node
4219
4908
  attr_reader :value
4220
4909
 
@@ -4308,6 +4997,12 @@ module Prism
4308
4997
  @operator_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
4309
4998
  end
4310
4999
 
5000
+ # Save the operator_loc location using the given saved source so that
5001
+ # it can be retrieved later.
5002
+ def save_operator_loc(repository)
5003
+ repository.enter(node_id, :operator_loc)
5004
+ end
5005
+
4311
5006
  # attr_reader value: Prism::node
4312
5007
  attr_reader :value
4313
5008
 
@@ -4421,6 +5116,12 @@ module Prism
4421
5116
  @delimiter_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
4422
5117
  end
4423
5118
 
5119
+ # Save the delimiter_loc location using the given saved source so that
5120
+ # it can be retrieved later.
5121
+ def save_delimiter_loc(repository)
5122
+ repository.enter(node_id, :delimiter_loc)
5123
+ end
5124
+
4424
5125
  # The location of the name of the constant.
4425
5126
  #
4426
5127
  # ::Foo
@@ -4434,6 +5135,12 @@ module Prism
4434
5135
  @name_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
4435
5136
  end
4436
5137
 
5138
+ # Save the name_loc location using the given saved source so that
5139
+ # it can be retrieved later.
5140
+ def save_name_loc(repository)
5141
+ repository.enter(node_id, :name_loc)
5142
+ end
5143
+
4437
5144
  # def delimiter: () -> String
4438
5145
  def delimiter
4439
5146
  delimiter_loc.slice
@@ -4525,6 +5232,12 @@ module Prism
4525
5232
  @binary_operator_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
4526
5233
  end
4527
5234
 
5235
+ # Save the binary_operator_loc location using the given saved source so that
5236
+ # it can be retrieved later.
5237
+ def save_binary_operator_loc(repository)
5238
+ repository.enter(node_id, :binary_operator_loc)
5239
+ end
5240
+
4528
5241
  # attr_reader value: Prism::node
4529
5242
  attr_reader :value
4530
5243
 
@@ -4616,6 +5329,12 @@ module Prism
4616
5329
  @operator_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
4617
5330
  end
4618
5331
 
5332
+ # Save the operator_loc location using the given saved source so that
5333
+ # it can be retrieved later.
5334
+ def save_operator_loc(repository)
5335
+ repository.enter(node_id, :operator_loc)
5336
+ end
5337
+
4619
5338
  # attr_reader value: Prism::node
4620
5339
  attr_reader :value
4621
5340
 
@@ -4714,6 +5433,12 @@ module Prism
4714
5433
  @delimiter_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
4715
5434
  end
4716
5435
 
5436
+ # Save the delimiter_loc location using the given saved source so that
5437
+ # it can be retrieved later.
5438
+ def save_delimiter_loc(repository)
5439
+ repository.enter(node_id, :delimiter_loc)
5440
+ end
5441
+
4717
5442
  # attr_reader name_loc: Location
4718
5443
  def name_loc
4719
5444
  location = @name_loc
@@ -4721,6 +5446,12 @@ module Prism
4721
5446
  @name_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
4722
5447
  end
4723
5448
 
5449
+ # Save the name_loc location using the given saved source so that
5450
+ # it can be retrieved later.
5451
+ def save_name_loc(repository)
5452
+ repository.enter(node_id, :name_loc)
5453
+ end
5454
+
4724
5455
  # def delimiter: () -> String
4725
5456
  def delimiter
4726
5457
  delimiter_loc.slice
@@ -4826,6 +5557,12 @@ module Prism
4826
5557
  @operator_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
4827
5558
  end
4828
5559
 
5560
+ # Save the operator_loc location using the given saved source so that
5561
+ # it can be retrieved later.
5562
+ def save_operator_loc(repository)
5563
+ repository.enter(node_id, :operator_loc)
5564
+ end
5565
+
4829
5566
  # The value to write to the constant path. It can be any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression).
4830
5567
  #
4831
5568
  # FOO::BAR = :abc
@@ -5079,6 +5816,12 @@ module Prism
5079
5816
  @name_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
5080
5817
  end
5081
5818
 
5819
+ # Save the name_loc location using the given saved source so that
5820
+ # it can be retrieved later.
5821
+ def save_name_loc(repository)
5822
+ repository.enter(node_id, :name_loc)
5823
+ end
5824
+
5082
5825
  # The value to write to the constant. It can be any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression).
5083
5826
  #
5084
5827
  # FOO = :bar
@@ -5098,6 +5841,12 @@ module Prism
5098
5841
  @operator_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
5099
5842
  end
5100
5843
 
5844
+ # Save the operator_loc location using the given saved source so that
5845
+ # it can be retrieved later.
5846
+ def save_operator_loc(repository)
5847
+ repository.enter(node_id, :operator_loc)
5848
+ end
5849
+
5101
5850
  # def operator: () -> String
5102
5851
  def operator
5103
5852
  operator_loc.slice
@@ -5202,6 +5951,12 @@ module Prism
5202
5951
  @name_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
5203
5952
  end
5204
5953
 
5954
+ # Save the name_loc location using the given saved source so that
5955
+ # it can be retrieved later.
5956
+ def save_name_loc(repository)
5957
+ repository.enter(node_id, :name_loc)
5958
+ end
5959
+
5205
5960
  # attr_reader receiver: Prism::node?
5206
5961
  attr_reader :receiver
5207
5962
 
@@ -5221,6 +5976,12 @@ module Prism
5221
5976
  @def_keyword_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
5222
5977
  end
5223
5978
 
5979
+ # Save the def_keyword_loc location using the given saved source so that
5980
+ # it can be retrieved later.
5981
+ def save_def_keyword_loc(repository)
5982
+ repository.enter(node_id, :def_keyword_loc)
5983
+ end
5984
+
5224
5985
  # attr_reader operator_loc: Location?
5225
5986
  def operator_loc
5226
5987
  location = @operator_loc
@@ -5234,6 +5995,12 @@ module Prism
5234
5995
  end
5235
5996
  end
5236
5997
 
5998
+ # Save the operator_loc location using the given saved source so that
5999
+ # it can be retrieved later.
6000
+ def save_operator_loc(repository)
6001
+ repository.enter(node_id, :operator_loc) unless @operator_loc.nil?
6002
+ end
6003
+
5237
6004
  # attr_reader lparen_loc: Location?
5238
6005
  def lparen_loc
5239
6006
  location = @lparen_loc
@@ -5247,6 +6014,12 @@ module Prism
5247
6014
  end
5248
6015
  end
5249
6016
 
6017
+ # Save the lparen_loc location using the given saved source so that
6018
+ # it can be retrieved later.
6019
+ def save_lparen_loc(repository)
6020
+ repository.enter(node_id, :lparen_loc) unless @lparen_loc.nil?
6021
+ end
6022
+
5250
6023
  # attr_reader rparen_loc: Location?
5251
6024
  def rparen_loc
5252
6025
  location = @rparen_loc
@@ -5260,6 +6033,12 @@ module Prism
5260
6033
  end
5261
6034
  end
5262
6035
 
6036
+ # Save the rparen_loc location using the given saved source so that
6037
+ # it can be retrieved later.
6038
+ def save_rparen_loc(repository)
6039
+ repository.enter(node_id, :rparen_loc) unless @rparen_loc.nil?
6040
+ end
6041
+
5263
6042
  # attr_reader equal_loc: Location?
5264
6043
  def equal_loc
5265
6044
  location = @equal_loc
@@ -5273,6 +6052,12 @@ module Prism
5273
6052
  end
5274
6053
  end
5275
6054
 
6055
+ # Save the equal_loc location using the given saved source so that
6056
+ # it can be retrieved later.
6057
+ def save_equal_loc(repository)
6058
+ repository.enter(node_id, :equal_loc) unless @equal_loc.nil?
6059
+ end
6060
+
5276
6061
  # attr_reader end_keyword_loc: Location?
5277
6062
  def end_keyword_loc
5278
6063
  location = @end_keyword_loc
@@ -5286,6 +6071,12 @@ module Prism
5286
6071
  end
5287
6072
  end
5288
6073
 
6074
+ # Save the end_keyword_loc location using the given saved source so that
6075
+ # it can be retrieved later.
6076
+ def save_end_keyword_loc(repository)
6077
+ repository.enter(node_id, :end_keyword_loc) unless @end_keyword_loc.nil?
6078
+ end
6079
+
5289
6080
  # def def_keyword: () -> String
5290
6081
  def def_keyword
5291
6082
  def_keyword_loc.slice
@@ -5414,6 +6205,12 @@ module Prism
5414
6205
  end
5415
6206
  end
5416
6207
 
6208
+ # Save the lparen_loc location using the given saved source so that
6209
+ # it can be retrieved later.
6210
+ def save_lparen_loc(repository)
6211
+ repository.enter(node_id, :lparen_loc) unless @lparen_loc.nil?
6212
+ end
6213
+
5417
6214
  # attr_reader value: Prism::node
5418
6215
  attr_reader :value
5419
6216
 
@@ -5430,6 +6227,12 @@ module Prism
5430
6227
  end
5431
6228
  end
5432
6229
 
6230
+ # Save the rparen_loc location using the given saved source so that
6231
+ # it can be retrieved later.
6232
+ def save_rparen_loc(repository)
6233
+ repository.enter(node_id, :rparen_loc) unless @rparen_loc.nil?
6234
+ end
6235
+
5433
6236
  # attr_reader keyword_loc: Location
5434
6237
  def keyword_loc
5435
6238
  location = @keyword_loc
@@ -5437,6 +6240,12 @@ module Prism
5437
6240
  @keyword_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
5438
6241
  end
5439
6242
 
6243
+ # Save the keyword_loc location using the given saved source so that
6244
+ # it can be retrieved later.
6245
+ def save_keyword_loc(repository)
6246
+ repository.enter(node_id, :keyword_loc)
6247
+ end
6248
+
5440
6249
  # def lparen: () -> String?
5441
6250
  def lparen
5442
6251
  lparen_loc&.slice
@@ -5536,6 +6345,12 @@ module Prism
5536
6345
  @else_keyword_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
5537
6346
  end
5538
6347
 
6348
+ # Save the else_keyword_loc location using the given saved source so that
6349
+ # it can be retrieved later.
6350
+ def save_else_keyword_loc(repository)
6351
+ repository.enter(node_id, :else_keyword_loc)
6352
+ end
6353
+
5539
6354
  # attr_reader statements: StatementsNode?
5540
6355
  attr_reader :statements
5541
6356
 
@@ -5552,6 +6367,12 @@ module Prism
5552
6367
  end
5553
6368
  end
5554
6369
 
6370
+ # Save the end_keyword_loc location using the given saved source so that
6371
+ # it can be retrieved later.
6372
+ def save_end_keyword_loc(repository)
6373
+ repository.enter(node_id, :end_keyword_loc) unless @end_keyword_loc.nil?
6374
+ end
6375
+
5555
6376
  # def else_keyword: () -> String
5556
6377
  def else_keyword
5557
6378
  else_keyword_loc.slice
@@ -5645,6 +6466,12 @@ module Prism
5645
6466
  @opening_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
5646
6467
  end
5647
6468
 
6469
+ # Save the opening_loc location using the given saved source so that
6470
+ # it can be retrieved later.
6471
+ def save_opening_loc(repository)
6472
+ repository.enter(node_id, :opening_loc)
6473
+ end
6474
+
5648
6475
  # attr_reader statements: StatementsNode?
5649
6476
  attr_reader :statements
5650
6477
 
@@ -5655,6 +6482,12 @@ module Prism
5655
6482
  @closing_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
5656
6483
  end
5657
6484
 
6485
+ # Save the closing_loc location using the given saved source so that
6486
+ # it can be retrieved later.
6487
+ def save_closing_loc(repository)
6488
+ repository.enter(node_id, :closing_loc)
6489
+ end
6490
+
5658
6491
  # def opening: () -> String
5659
6492
  def opening
5660
6493
  opening_loc.slice
@@ -5745,6 +6578,12 @@ module Prism
5745
6578
  @operator_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
5746
6579
  end
5747
6580
 
6581
+ # Save the operator_loc location using the given saved source so that
6582
+ # it can be retrieved later.
6583
+ def save_operator_loc(repository)
6584
+ repository.enter(node_id, :operator_loc)
6585
+ end
6586
+
5748
6587
  # attr_reader variable: InstanceVariableReadNode | ClassVariableReadNode | GlobalVariableReadNode | BackReferenceReadNode | NumberedReferenceReadNode
5749
6588
  attr_reader :variable
5750
6589
 
@@ -5839,6 +6678,12 @@ module Prism
5839
6678
  @ensure_keyword_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
5840
6679
  end
5841
6680
 
6681
+ # Save the ensure_keyword_loc location using the given saved source so that
6682
+ # it can be retrieved later.
6683
+ def save_ensure_keyword_loc(repository)
6684
+ repository.enter(node_id, :ensure_keyword_loc)
6685
+ end
6686
+
5842
6687
  # attr_reader statements: StatementsNode?
5843
6688
  attr_reader :statements
5844
6689
 
@@ -5849,6 +6694,12 @@ module Prism
5849
6694
  @end_keyword_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
5850
6695
  end
5851
6696
 
6697
+ # Save the end_keyword_loc location using the given saved source so that
6698
+ # it can be retrieved later.
6699
+ def save_end_keyword_loc(repository)
6700
+ repository.enter(node_id, :end_keyword_loc)
6701
+ end
6702
+
5852
6703
  # def ensure_keyword: () -> String
5853
6704
  def ensure_keyword
5854
6705
  ensure_keyword_loc.slice
@@ -6040,6 +6891,12 @@ module Prism
6040
6891
  end
6041
6892
  end
6042
6893
 
6894
+ # Save the opening_loc location using the given saved source so that
6895
+ # it can be retrieved later.
6896
+ def save_opening_loc(repository)
6897
+ repository.enter(node_id, :opening_loc) unless @opening_loc.nil?
6898
+ end
6899
+
6043
6900
  # attr_reader closing_loc: Location?
6044
6901
  def closing_loc
6045
6902
  location = @closing_loc
@@ -6053,6 +6910,12 @@ module Prism
6053
6910
  end
6054
6911
  end
6055
6912
 
6913
+ # Save the closing_loc location using the given saved source so that
6914
+ # it can be retrieved later.
6915
+ def save_closing_loc(repository)
6916
+ repository.enter(node_id, :closing_loc) unless @closing_loc.nil?
6917
+ end
6918
+
6056
6919
  # def opening: () -> String?
6057
6920
  def opening
6058
6921
  opening_loc&.slice
@@ -6162,6 +7025,12 @@ module Prism
6162
7025
  @operator_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
6163
7026
  end
6164
7027
 
7028
+ # Save the operator_loc location using the given saved source so that
7029
+ # it can be retrieved later.
7030
+ def save_operator_loc(repository)
7031
+ repository.enter(node_id, :operator_loc)
7032
+ end
7033
+
6165
7034
  # def operator: () -> String
6166
7035
  def operator
6167
7036
  operator_loc.slice
@@ -6353,6 +7222,12 @@ module Prism
6353
7222
  @for_keyword_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
6354
7223
  end
6355
7224
 
7225
+ # Save the for_keyword_loc location using the given saved source so that
7226
+ # it can be retrieved later.
7227
+ def save_for_keyword_loc(repository)
7228
+ repository.enter(node_id, :for_keyword_loc)
7229
+ end
7230
+
6356
7231
  # The location of the `in` keyword.
6357
7232
  #
6358
7233
  # for i in a end
@@ -6363,6 +7238,12 @@ module Prism
6363
7238
  @in_keyword_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
6364
7239
  end
6365
7240
 
7241
+ # Save the in_keyword_loc location using the given saved source so that
7242
+ # it can be retrieved later.
7243
+ def save_in_keyword_loc(repository)
7244
+ repository.enter(node_id, :in_keyword_loc)
7245
+ end
7246
+
6366
7247
  # The location of the `do` keyword, if present.
6367
7248
  #
6368
7249
  # for i in a do end
@@ -6379,6 +7260,12 @@ module Prism
6379
7260
  end
6380
7261
  end
6381
7262
 
7263
+ # Save the do_keyword_loc location using the given saved source so that
7264
+ # it can be retrieved later.
7265
+ def save_do_keyword_loc(repository)
7266
+ repository.enter(node_id, :do_keyword_loc) unless @do_keyword_loc.nil?
7267
+ end
7268
+
6382
7269
  # The location of the `end` keyword.
6383
7270
  #
6384
7271
  # for i in a end
@@ -6389,6 +7276,12 @@ module Prism
6389
7276
  @end_keyword_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
6390
7277
  end
6391
7278
 
7279
+ # Save the end_keyword_loc location using the given saved source so that
7280
+ # it can be retrieved later.
7281
+ def save_end_keyword_loc(repository)
7282
+ repository.enter(node_id, :end_keyword_loc)
7283
+ end
7284
+
6392
7285
  # def for_keyword: () -> String
6393
7286
  def for_keyword
6394
7287
  for_keyword_loc.slice
@@ -6712,6 +7605,12 @@ module Prism
6712
7605
  @name_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
6713
7606
  end
6714
7607
 
7608
+ # Save the name_loc location using the given saved source so that
7609
+ # it can be retrieved later.
7610
+ def save_name_loc(repository)
7611
+ repository.enter(node_id, :name_loc)
7612
+ end
7613
+
6715
7614
  # attr_reader operator_loc: Location
6716
7615
  def operator_loc
6717
7616
  location = @operator_loc
@@ -6719,6 +7618,12 @@ module Prism
6719
7618
  @operator_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
6720
7619
  end
6721
7620
 
7621
+ # Save the operator_loc location using the given saved source so that
7622
+ # it can be retrieved later.
7623
+ def save_operator_loc(repository)
7624
+ repository.enter(node_id, :operator_loc)
7625
+ end
7626
+
6722
7627
  # attr_reader value: Prism::node
6723
7628
  attr_reader :value
6724
7629
 
@@ -6814,6 +7719,12 @@ module Prism
6814
7719
  @name_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
6815
7720
  end
6816
7721
 
7722
+ # Save the name_loc location using the given saved source so that
7723
+ # it can be retrieved later.
7724
+ def save_name_loc(repository)
7725
+ repository.enter(node_id, :name_loc)
7726
+ end
7727
+
6817
7728
  # attr_reader binary_operator_loc: Location
6818
7729
  def binary_operator_loc
6819
7730
  location = @binary_operator_loc
@@ -6821,6 +7732,12 @@ module Prism
6821
7732
  @binary_operator_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
6822
7733
  end
6823
7734
 
7735
+ # Save the binary_operator_loc location using the given saved source so that
7736
+ # it can be retrieved later.
7737
+ def save_binary_operator_loc(repository)
7738
+ repository.enter(node_id, :binary_operator_loc)
7739
+ end
7740
+
6824
7741
  # attr_reader value: Prism::node
6825
7742
  attr_reader :value
6826
7743
 
@@ -6914,6 +7831,12 @@ module Prism
6914
7831
  @name_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
6915
7832
  end
6916
7833
 
7834
+ # Save the name_loc location using the given saved source so that
7835
+ # it can be retrieved later.
7836
+ def save_name_loc(repository)
7837
+ repository.enter(node_id, :name_loc)
7838
+ end
7839
+
6917
7840
  # attr_reader operator_loc: Location
6918
7841
  def operator_loc
6919
7842
  location = @operator_loc
@@ -6921,6 +7844,12 @@ module Prism
6921
7844
  @operator_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
6922
7845
  end
6923
7846
 
7847
+ # Save the operator_loc location using the given saved source so that
7848
+ # it can be retrieved later.
7849
+ def save_operator_loc(repository)
7850
+ repository.enter(node_id, :operator_loc)
7851
+ end
7852
+
6924
7853
  # attr_reader value: Prism::node
6925
7854
  attr_reader :value
6926
7855
 
@@ -7172,6 +8101,12 @@ module Prism
7172
8101
  @name_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
7173
8102
  end
7174
8103
 
8104
+ # Save the name_loc location using the given saved source so that
8105
+ # it can be retrieved later.
8106
+ def save_name_loc(repository)
8107
+ repository.enter(node_id, :name_loc)
8108
+ end
8109
+
7175
8110
  # The value to write to the global variable. It can be any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression).
7176
8111
  #
7177
8112
  # $foo = :bar
@@ -7191,6 +8126,12 @@ module Prism
7191
8126
  @operator_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
7192
8127
  end
7193
8128
 
8129
+ # Save the operator_loc location using the given saved source so that
8130
+ # it can be retrieved later.
8131
+ def save_operator_loc(repository)
8132
+ repository.enter(node_id, :operator_loc)
8133
+ end
8134
+
7194
8135
  # def operator: () -> String
7195
8136
  def operator
7196
8137
  operator_loc.slice
@@ -7281,6 +8222,12 @@ module Prism
7281
8222
  @opening_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
7282
8223
  end
7283
8224
 
8225
+ # Save the opening_loc location using the given saved source so that
8226
+ # it can be retrieved later.
8227
+ def save_opening_loc(repository)
8228
+ repository.enter(node_id, :opening_loc)
8229
+ end
8230
+
7284
8231
  # The elements of the hash. These can be either `AssocNode`s or `AssocSplatNode`s.
7285
8232
  #
7286
8233
  # { a: b }
@@ -7300,6 +8247,12 @@ module Prism
7300
8247
  @closing_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
7301
8248
  end
7302
8249
 
8250
+ # Save the closing_loc location using the given saved source so that
8251
+ # it can be retrieved later.
8252
+ def save_closing_loc(repository)
8253
+ repository.enter(node_id, :closing_loc)
8254
+ end
8255
+
7303
8256
  # def opening: () -> String
7304
8257
  def opening
7305
8258
  opening_loc.slice
@@ -7416,6 +8369,12 @@ module Prism
7416
8369
  end
7417
8370
  end
7418
8371
 
8372
+ # Save the opening_loc location using the given saved source so that
8373
+ # it can be retrieved later.
8374
+ def save_opening_loc(repository)
8375
+ repository.enter(node_id, :opening_loc) unless @opening_loc.nil?
8376
+ end
8377
+
7419
8378
  # attr_reader closing_loc: Location?
7420
8379
  def closing_loc
7421
8380
  location = @closing_loc
@@ -7429,6 +8388,12 @@ module Prism
7429
8388
  end
7430
8389
  end
7431
8390
 
8391
+ # Save the closing_loc location using the given saved source so that
8392
+ # it can be retrieved later.
8393
+ def save_closing_loc(repository)
8394
+ repository.enter(node_id, :closing_loc) unless @closing_loc.nil?
8395
+ end
8396
+
7432
8397
  # def opening: () -> String?
7433
8398
  def opening
7434
8399
  opening_loc&.slice
@@ -7547,6 +8512,12 @@ module Prism
7547
8512
  end
7548
8513
  end
7549
8514
 
8515
+ # Save the if_keyword_loc location using the given saved source so that
8516
+ # it can be retrieved later.
8517
+ def save_if_keyword_loc(repository)
8518
+ repository.enter(node_id, :if_keyword_loc) unless @if_keyword_loc.nil?
8519
+ end
8520
+
7550
8521
  # The node for the condition the `IfNode` is testing.
7551
8522
  #
7552
8523
  # if foo
@@ -7580,6 +8551,12 @@ module Prism
7580
8551
  end
7581
8552
  end
7582
8553
 
8554
+ # Save the then_keyword_loc location using the given saved source so that
8555
+ # it can be retrieved later.
8556
+ def save_then_keyword_loc(repository)
8557
+ repository.enter(node_id, :then_keyword_loc) unless @then_keyword_loc.nil?
8558
+ end
8559
+
7583
8560
  # Represents the body of statements that will be executed when the predicate is evaluated as truthy. Will be `nil` when no body is provided.
7584
8561
  #
7585
8562
  # if foo
@@ -7623,6 +8600,12 @@ module Prism
7623
8600
  end
7624
8601
  end
7625
8602
 
8603
+ # Save the end_keyword_loc location using the given saved source so that
8604
+ # it can be retrieved later.
8605
+ def save_end_keyword_loc(repository)
8606
+ repository.enter(node_id, :end_keyword_loc) unless @end_keyword_loc.nil?
8607
+ end
8608
+
7626
8609
  # def if_keyword: () -> String?
7627
8610
  def if_keyword
7628
8611
  if_keyword_loc&.slice
@@ -7961,6 +8944,12 @@ module Prism
7961
8944
  @in_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
7962
8945
  end
7963
8946
 
8947
+ # Save the in_loc location using the given saved source so that
8948
+ # it can be retrieved later.
8949
+ def save_in_loc(repository)
8950
+ repository.enter(node_id, :in_loc)
8951
+ end
8952
+
7964
8953
  # attr_reader then_loc: Location?
7965
8954
  def then_loc
7966
8955
  location = @then_loc
@@ -7974,6 +8963,12 @@ module Prism
7974
8963
  end
7975
8964
  end
7976
8965
 
8966
+ # Save the then_loc location using the given saved source so that
8967
+ # it can be retrieved later.
8968
+ def save_then_loc(repository)
8969
+ repository.enter(node_id, :then_loc) unless @then_loc.nil?
8970
+ end
8971
+
7977
8972
  # def in: () -> String
7978
8973
  def in
7979
8974
  in_loc.slice
@@ -8105,6 +9100,12 @@ module Prism
8105
9100
  end
8106
9101
  end
8107
9102
 
9103
+ # Save the call_operator_loc location using the given saved source so that
9104
+ # it can be retrieved later.
9105
+ def save_call_operator_loc(repository)
9106
+ repository.enter(node_id, :call_operator_loc) unless @call_operator_loc.nil?
9107
+ end
9108
+
8108
9109
  # attr_reader opening_loc: Location
8109
9110
  def opening_loc
8110
9111
  location = @opening_loc
@@ -8112,6 +9113,12 @@ module Prism
8112
9113
  @opening_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
8113
9114
  end
8114
9115
 
9116
+ # Save the opening_loc location using the given saved source so that
9117
+ # it can be retrieved later.
9118
+ def save_opening_loc(repository)
9119
+ repository.enter(node_id, :opening_loc)
9120
+ end
9121
+
8115
9122
  # attr_reader arguments: ArgumentsNode?
8116
9123
  attr_reader :arguments
8117
9124
 
@@ -8122,6 +9129,12 @@ module Prism
8122
9129
  @closing_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
8123
9130
  end
8124
9131
 
9132
+ # Save the closing_loc location using the given saved source so that
9133
+ # it can be retrieved later.
9134
+ def save_closing_loc(repository)
9135
+ repository.enter(node_id, :closing_loc)
9136
+ end
9137
+
8125
9138
  # attr_reader block: BlockArgumentNode?
8126
9139
  attr_reader :block
8127
9140
 
@@ -8132,6 +9145,12 @@ module Prism
8132
9145
  @operator_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
8133
9146
  end
8134
9147
 
9148
+ # Save the operator_loc location using the given saved source so that
9149
+ # it can be retrieved later.
9150
+ def save_operator_loc(repository)
9151
+ repository.enter(node_id, :operator_loc)
9152
+ end
9153
+
8135
9154
  # attr_reader value: Prism::node
8136
9155
  attr_reader :value
8137
9156
 
@@ -8282,6 +9301,12 @@ module Prism
8282
9301
  end
8283
9302
  end
8284
9303
 
9304
+ # Save the call_operator_loc location using the given saved source so that
9305
+ # it can be retrieved later.
9306
+ def save_call_operator_loc(repository)
9307
+ repository.enter(node_id, :call_operator_loc) unless @call_operator_loc.nil?
9308
+ end
9309
+
8285
9310
  # attr_reader opening_loc: Location
8286
9311
  def opening_loc
8287
9312
  location = @opening_loc
@@ -8289,6 +9314,12 @@ module Prism
8289
9314
  @opening_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
8290
9315
  end
8291
9316
 
9317
+ # Save the opening_loc location using the given saved source so that
9318
+ # it can be retrieved later.
9319
+ def save_opening_loc(repository)
9320
+ repository.enter(node_id, :opening_loc)
9321
+ end
9322
+
8292
9323
  # attr_reader arguments: ArgumentsNode?
8293
9324
  attr_reader :arguments
8294
9325
 
@@ -8299,6 +9330,12 @@ module Prism
8299
9330
  @closing_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
8300
9331
  end
8301
9332
 
9333
+ # Save the closing_loc location using the given saved source so that
9334
+ # it can be retrieved later.
9335
+ def save_closing_loc(repository)
9336
+ repository.enter(node_id, :closing_loc)
9337
+ end
9338
+
8302
9339
  # attr_reader block: BlockArgumentNode?
8303
9340
  attr_reader :block
8304
9341
 
@@ -8312,6 +9349,12 @@ module Prism
8312
9349
  @binary_operator_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
8313
9350
  end
8314
9351
 
9352
+ # Save the binary_operator_loc location using the given saved source so that
9353
+ # it can be retrieved later.
9354
+ def save_binary_operator_loc(repository)
9355
+ repository.enter(node_id, :binary_operator_loc)
9356
+ end
9357
+
8315
9358
  # attr_reader value: Prism::node
8316
9359
  attr_reader :value
8317
9360
 
@@ -8457,6 +9500,12 @@ module Prism
8457
9500
  end
8458
9501
  end
8459
9502
 
9503
+ # Save the call_operator_loc location using the given saved source so that
9504
+ # it can be retrieved later.
9505
+ def save_call_operator_loc(repository)
9506
+ repository.enter(node_id, :call_operator_loc) unless @call_operator_loc.nil?
9507
+ end
9508
+
8460
9509
  # attr_reader opening_loc: Location
8461
9510
  def opening_loc
8462
9511
  location = @opening_loc
@@ -8464,6 +9513,12 @@ module Prism
8464
9513
  @opening_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
8465
9514
  end
8466
9515
 
9516
+ # Save the opening_loc location using the given saved source so that
9517
+ # it can be retrieved later.
9518
+ def save_opening_loc(repository)
9519
+ repository.enter(node_id, :opening_loc)
9520
+ end
9521
+
8467
9522
  # attr_reader arguments: ArgumentsNode?
8468
9523
  attr_reader :arguments
8469
9524
 
@@ -8474,6 +9529,12 @@ module Prism
8474
9529
  @closing_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
8475
9530
  end
8476
9531
 
9532
+ # Save the closing_loc location using the given saved source so that
9533
+ # it can be retrieved later.
9534
+ def save_closing_loc(repository)
9535
+ repository.enter(node_id, :closing_loc)
9536
+ end
9537
+
8477
9538
  # attr_reader block: BlockArgumentNode?
8478
9539
  attr_reader :block
8479
9540
 
@@ -8484,6 +9545,12 @@ module Prism
8484
9545
  @operator_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
8485
9546
  end
8486
9547
 
9548
+ # Save the operator_loc location using the given saved source so that
9549
+ # it can be retrieved later.
9550
+ def save_operator_loc(repository)
9551
+ repository.enter(node_id, :operator_loc)
9552
+ end
9553
+
8487
9554
  # attr_reader value: Prism::node
8488
9555
  attr_reader :value
8489
9556
 
@@ -8631,6 +9698,12 @@ module Prism
8631
9698
  @opening_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
8632
9699
  end
8633
9700
 
9701
+ # Save the opening_loc location using the given saved source so that
9702
+ # it can be retrieved later.
9703
+ def save_opening_loc(repository)
9704
+ repository.enter(node_id, :opening_loc)
9705
+ end
9706
+
8634
9707
  # attr_reader arguments: ArgumentsNode?
8635
9708
  attr_reader :arguments
8636
9709
 
@@ -8641,6 +9714,12 @@ module Prism
8641
9714
  @closing_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
8642
9715
  end
8643
9716
 
9717
+ # Save the closing_loc location using the given saved source so that
9718
+ # it can be retrieved later.
9719
+ def save_closing_loc(repository)
9720
+ repository.enter(node_id, :closing_loc)
9721
+ end
9722
+
8644
9723
  # attr_reader block: BlockArgumentNode?
8645
9724
  attr_reader :block
8646
9725
 
@@ -8742,6 +9821,12 @@ module Prism
8742
9821
  @name_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
8743
9822
  end
8744
9823
 
9824
+ # Save the name_loc location using the given saved source so that
9825
+ # it can be retrieved later.
9826
+ def save_name_loc(repository)
9827
+ repository.enter(node_id, :name_loc)
9828
+ end
9829
+
8745
9830
  # attr_reader operator_loc: Location
8746
9831
  def operator_loc
8747
9832
  location = @operator_loc
@@ -8749,6 +9834,12 @@ module Prism
8749
9834
  @operator_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
8750
9835
  end
8751
9836
 
9837
+ # Save the operator_loc location using the given saved source so that
9838
+ # it can be retrieved later.
9839
+ def save_operator_loc(repository)
9840
+ repository.enter(node_id, :operator_loc)
9841
+ end
9842
+
8752
9843
  # attr_reader value: Prism::node
8753
9844
  attr_reader :value
8754
9845
 
@@ -8844,6 +9935,12 @@ module Prism
8844
9935
  @name_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
8845
9936
  end
8846
9937
 
9938
+ # Save the name_loc location using the given saved source so that
9939
+ # it can be retrieved later.
9940
+ def save_name_loc(repository)
9941
+ repository.enter(node_id, :name_loc)
9942
+ end
9943
+
8847
9944
  # attr_reader binary_operator_loc: Location
8848
9945
  def binary_operator_loc
8849
9946
  location = @binary_operator_loc
@@ -8851,6 +9948,12 @@ module Prism
8851
9948
  @binary_operator_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
8852
9949
  end
8853
9950
 
9951
+ # Save the binary_operator_loc location using the given saved source so that
9952
+ # it can be retrieved later.
9953
+ def save_binary_operator_loc(repository)
9954
+ repository.enter(node_id, :binary_operator_loc)
9955
+ end
9956
+
8854
9957
  # attr_reader value: Prism::node
8855
9958
  attr_reader :value
8856
9959
 
@@ -8944,6 +10047,12 @@ module Prism
8944
10047
  @name_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
8945
10048
  end
8946
10049
 
10050
+ # Save the name_loc location using the given saved source so that
10051
+ # it can be retrieved later.
10052
+ def save_name_loc(repository)
10053
+ repository.enter(node_id, :name_loc)
10054
+ end
10055
+
8947
10056
  # attr_reader operator_loc: Location
8948
10057
  def operator_loc
8949
10058
  location = @operator_loc
@@ -8951,6 +10060,12 @@ module Prism
8951
10060
  @operator_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
8952
10061
  end
8953
10062
 
10063
+ # Save the operator_loc location using the given saved source so that
10064
+ # it can be retrieved later.
10065
+ def save_operator_loc(repository)
10066
+ repository.enter(node_id, :operator_loc)
10067
+ end
10068
+
8954
10069
  # attr_reader value: Prism::node
8955
10070
  attr_reader :value
8956
10071
 
@@ -9202,6 +10317,12 @@ module Prism
9202
10317
  @name_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
9203
10318
  end
9204
10319
 
10320
+ # Save the name_loc location using the given saved source so that
10321
+ # it can be retrieved later.
10322
+ def save_name_loc(repository)
10323
+ repository.enter(node_id, :name_loc)
10324
+ end
10325
+
9205
10326
  # The value to write to the instance variable. It can be any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression).
9206
10327
  #
9207
10328
  # @foo = :bar
@@ -9221,6 +10342,12 @@ module Prism
9221
10342
  @operator_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
9222
10343
  end
9223
10344
 
10345
+ # Save the operator_loc location using the given saved source so that
10346
+ # it can be retrieved later.
10347
+ def save_operator_loc(repository)
10348
+ repository.enter(node_id, :operator_loc)
10349
+ end
10350
+
9224
10351
  # def operator: () -> String
9225
10352
  def operator
9226
10353
  operator_loc.slice
@@ -9457,6 +10584,12 @@ module Prism
9457
10584
  @opening_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
9458
10585
  end
9459
10586
 
10587
+ # Save the opening_loc location using the given saved source so that
10588
+ # it can be retrieved later.
10589
+ def save_opening_loc(repository)
10590
+ repository.enter(node_id, :opening_loc)
10591
+ end
10592
+
9460
10593
  # attr_reader parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode]
9461
10594
  attr_reader :parts
9462
10595
 
@@ -9467,6 +10600,12 @@ module Prism
9467
10600
  @closing_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
9468
10601
  end
9469
10602
 
10603
+ # Save the closing_loc location using the given saved source so that
10604
+ # it can be retrieved later.
10605
+ def save_closing_loc(repository)
10606
+ repository.enter(node_id, :closing_loc)
10607
+ end
10608
+
9470
10609
  # def opening: () -> String
9471
10610
  def opening
9472
10611
  opening_loc.slice
@@ -9615,6 +10754,12 @@ module Prism
9615
10754
  @opening_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
9616
10755
  end
9617
10756
 
10757
+ # Save the opening_loc location using the given saved source so that
10758
+ # it can be retrieved later.
10759
+ def save_opening_loc(repository)
10760
+ repository.enter(node_id, :opening_loc)
10761
+ end
10762
+
9618
10763
  # attr_reader parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode]
9619
10764
  attr_reader :parts
9620
10765
 
@@ -9625,6 +10770,12 @@ module Prism
9625
10770
  @closing_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
9626
10771
  end
9627
10772
 
10773
+ # Save the closing_loc location using the given saved source so that
10774
+ # it can be retrieved later.
10775
+ def save_closing_loc(repository)
10776
+ repository.enter(node_id, :closing_loc)
10777
+ end
10778
+
9628
10779
  # def opening: () -> String
9629
10780
  def opening
9630
10781
  opening_loc.slice
@@ -9734,6 +10885,12 @@ module Prism
9734
10885
  end
9735
10886
  end
9736
10887
 
10888
+ # Save the opening_loc location using the given saved source so that
10889
+ # it can be retrieved later.
10890
+ def save_opening_loc(repository)
10891
+ repository.enter(node_id, :opening_loc) unless @opening_loc.nil?
10892
+ end
10893
+
9737
10894
  # attr_reader parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode | InterpolatedStringNode]
9738
10895
  attr_reader :parts
9739
10896
 
@@ -9750,6 +10907,12 @@ module Prism
9750
10907
  end
9751
10908
  end
9752
10909
 
10910
+ # Save the closing_loc location using the given saved source so that
10911
+ # it can be retrieved later.
10912
+ def save_closing_loc(repository)
10913
+ repository.enter(node_id, :closing_loc) unless @closing_loc.nil?
10914
+ end
10915
+
9753
10916
  # def opening: () -> String?
9754
10917
  def opening
9755
10918
  opening_loc&.slice
@@ -9849,6 +11012,12 @@ module Prism
9849
11012
  end
9850
11013
  end
9851
11014
 
11015
+ # Save the opening_loc location using the given saved source so that
11016
+ # it can be retrieved later.
11017
+ def save_opening_loc(repository)
11018
+ repository.enter(node_id, :opening_loc) unless @opening_loc.nil?
11019
+ end
11020
+
9852
11021
  # attr_reader parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode]
9853
11022
  attr_reader :parts
9854
11023
 
@@ -9865,6 +11034,12 @@ module Prism
9865
11034
  end
9866
11035
  end
9867
11036
 
11037
+ # Save the closing_loc location using the given saved source so that
11038
+ # it can be retrieved later.
11039
+ def save_closing_loc(repository)
11040
+ repository.enter(node_id, :closing_loc) unless @closing_loc.nil?
11041
+ end
11042
+
9868
11043
  # def opening: () -> String?
9869
11044
  def opening
9870
11045
  opening_loc&.slice
@@ -9957,6 +11132,12 @@ module Prism
9957
11132
  @opening_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
9958
11133
  end
9959
11134
 
11135
+ # Save the opening_loc location using the given saved source so that
11136
+ # it can be retrieved later.
11137
+ def save_opening_loc(repository)
11138
+ repository.enter(node_id, :opening_loc)
11139
+ end
11140
+
9960
11141
  # attr_reader parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode]
9961
11142
  attr_reader :parts
9962
11143
 
@@ -9967,6 +11148,12 @@ module Prism
9967
11148
  @closing_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
9968
11149
  end
9969
11150
 
11151
+ # Save the closing_loc location using the given saved source so that
11152
+ # it can be retrieved later.
11153
+ def save_closing_loc(repository)
11154
+ repository.enter(node_id, :closing_loc)
11155
+ end
11156
+
9970
11157
  # def opening: () -> String
9971
11158
  def opening
9972
11159
  opening_loc.slice
@@ -10290,6 +11477,12 @@ module Prism
10290
11477
  end
10291
11478
  end
10292
11479
 
11480
+ # Save the name_loc location using the given saved source so that
11481
+ # it can be retrieved later.
11482
+ def save_name_loc(repository)
11483
+ repository.enter(node_id, :name_loc) unless @name_loc.nil?
11484
+ end
11485
+
10293
11486
  # attr_reader operator_loc: Location
10294
11487
  def operator_loc
10295
11488
  location = @operator_loc
@@ -10297,6 +11490,12 @@ module Prism
10297
11490
  @operator_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
10298
11491
  end
10299
11492
 
11493
+ # Save the operator_loc location using the given saved source so that
11494
+ # it can be retrieved later.
11495
+ def save_operator_loc(repository)
11496
+ repository.enter(node_id, :operator_loc)
11497
+ end
11498
+
10300
11499
  # def operator: () -> String
10301
11500
  def operator
10302
11501
  operator_loc.slice
@@ -10393,6 +11592,12 @@ module Prism
10393
11592
  @operator_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
10394
11593
  end
10395
11594
 
11595
+ # Save the operator_loc location using the given saved source so that
11596
+ # it can be retrieved later.
11597
+ def save_operator_loc(repository)
11598
+ repository.enter(node_id, :operator_loc)
11599
+ end
11600
+
10396
11601
  # attr_reader opening_loc: Location
10397
11602
  def opening_loc
10398
11603
  location = @opening_loc
@@ -10400,6 +11605,12 @@ module Prism
10400
11605
  @opening_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
10401
11606
  end
10402
11607
 
11608
+ # Save the opening_loc location using the given saved source so that
11609
+ # it can be retrieved later.
11610
+ def save_opening_loc(repository)
11611
+ repository.enter(node_id, :opening_loc)
11612
+ end
11613
+
10403
11614
  # attr_reader closing_loc: Location
10404
11615
  def closing_loc
10405
11616
  location = @closing_loc
@@ -10407,6 +11618,12 @@ module Prism
10407
11618
  @closing_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
10408
11619
  end
10409
11620
 
11621
+ # Save the closing_loc location using the given saved source so that
11622
+ # it can be retrieved later.
11623
+ def save_closing_loc(repository)
11624
+ repository.enter(node_id, :closing_loc)
11625
+ end
11626
+
10410
11627
  # attr_reader parameters: BlockParametersNode | NumberedParametersNode | ItParametersNode | nil
10411
11628
  attr_reader :parameters
10412
11629
 
@@ -10515,6 +11732,12 @@ module Prism
10515
11732
  @name_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
10516
11733
  end
10517
11734
 
11735
+ # Save the name_loc location using the given saved source so that
11736
+ # it can be retrieved later.
11737
+ def save_name_loc(repository)
11738
+ repository.enter(node_id, :name_loc)
11739
+ end
11740
+
10518
11741
  # attr_reader operator_loc: Location
10519
11742
  def operator_loc
10520
11743
  location = @operator_loc
@@ -10522,6 +11745,12 @@ module Prism
10522
11745
  @operator_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
10523
11746
  end
10524
11747
 
11748
+ # Save the operator_loc location using the given saved source so that
11749
+ # it can be retrieved later.
11750
+ def save_operator_loc(repository)
11751
+ repository.enter(node_id, :operator_loc)
11752
+ end
11753
+
10525
11754
  # attr_reader value: Prism::node
10526
11755
  attr_reader :value
10527
11756
 
@@ -10622,6 +11851,12 @@ module Prism
10622
11851
  @name_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
10623
11852
  end
10624
11853
 
11854
+ # Save the name_loc location using the given saved source so that
11855
+ # it can be retrieved later.
11856
+ def save_name_loc(repository)
11857
+ repository.enter(node_id, :name_loc)
11858
+ end
11859
+
10625
11860
  # attr_reader binary_operator_loc: Location
10626
11861
  def binary_operator_loc
10627
11862
  location = @binary_operator_loc
@@ -10629,6 +11864,12 @@ module Prism
10629
11864
  @binary_operator_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
10630
11865
  end
10631
11866
 
11867
+ # Save the binary_operator_loc location using the given saved source so that
11868
+ # it can be retrieved later.
11869
+ def save_binary_operator_loc(repository)
11870
+ repository.enter(node_id, :binary_operator_loc)
11871
+ end
11872
+
10632
11873
  # attr_reader value: Prism::node
10633
11874
  attr_reader :value
10634
11875
 
@@ -10727,6 +11968,12 @@ module Prism
10727
11968
  @name_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
10728
11969
  end
10729
11970
 
11971
+ # Save the name_loc location using the given saved source so that
11972
+ # it can be retrieved later.
11973
+ def save_name_loc(repository)
11974
+ repository.enter(node_id, :name_loc)
11975
+ end
11976
+
10730
11977
  # attr_reader operator_loc: Location
10731
11978
  def operator_loc
10732
11979
  location = @operator_loc
@@ -10734,6 +11981,12 @@ module Prism
10734
11981
  @operator_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
10735
11982
  end
10736
11983
 
11984
+ # Save the operator_loc location using the given saved source so that
11985
+ # it can be retrieved later.
11986
+ def save_operator_loc(repository)
11987
+ repository.enter(node_id, :operator_loc)
11988
+ end
11989
+
10737
11990
  # attr_reader value: Prism::node
10738
11991
  attr_reader :value
10739
11992
 
@@ -11022,6 +12275,12 @@ module Prism
11022
12275
  @name_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
11023
12276
  end
11024
12277
 
12278
+ # Save the name_loc location using the given saved source so that
12279
+ # it can be retrieved later.
12280
+ def save_name_loc(repository)
12281
+ repository.enter(node_id, :name_loc)
12282
+ end
12283
+
11025
12284
  # The value to write to the local variable. It can be any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression).
11026
12285
  #
11027
12286
  # foo = :bar
@@ -11045,6 +12304,12 @@ module Prism
11045
12304
  @operator_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
11046
12305
  end
11047
12306
 
12307
+ # Save the operator_loc location using the given saved source so that
12308
+ # it can be retrieved later.
12309
+ def save_operator_loc(repository)
12310
+ repository.enter(node_id, :operator_loc)
12311
+ end
12312
+
11048
12313
  # def operator: () -> String
11049
12314
  def operator
11050
12315
  operator_loc.slice
@@ -11189,6 +12454,12 @@ module Prism
11189
12454
  @opening_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
11190
12455
  end
11191
12456
 
12457
+ # Save the opening_loc location using the given saved source so that
12458
+ # it can be retrieved later.
12459
+ def save_opening_loc(repository)
12460
+ repository.enter(node_id, :opening_loc)
12461
+ end
12462
+
11192
12463
  # attr_reader content_loc: Location
11193
12464
  def content_loc
11194
12465
  location = @content_loc
@@ -11196,6 +12467,12 @@ module Prism
11196
12467
  @content_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
11197
12468
  end
11198
12469
 
12470
+ # Save the content_loc location using the given saved source so that
12471
+ # it can be retrieved later.
12472
+ def save_content_loc(repository)
12473
+ repository.enter(node_id, :content_loc)
12474
+ end
12475
+
11199
12476
  # attr_reader closing_loc: Location
11200
12477
  def closing_loc
11201
12478
  location = @closing_loc
@@ -11203,6 +12480,12 @@ module Prism
11203
12480
  @closing_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
11204
12481
  end
11205
12482
 
12483
+ # Save the closing_loc location using the given saved source so that
12484
+ # it can be retrieved later.
12485
+ def save_closing_loc(repository)
12486
+ repository.enter(node_id, :closing_loc)
12487
+ end
12488
+
11206
12489
  # attr_reader unescaped: String
11207
12490
  attr_reader :unescaped
11208
12491
 
@@ -11310,6 +12593,12 @@ module Prism
11310
12593
  @operator_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
11311
12594
  end
11312
12595
 
12596
+ # Save the operator_loc location using the given saved source so that
12597
+ # it can be retrieved later.
12598
+ def save_operator_loc(repository)
12599
+ repository.enter(node_id, :operator_loc)
12600
+ end
12601
+
11313
12602
  # def operator: () -> String
11314
12603
  def operator
11315
12604
  operator_loc.slice
@@ -11402,6 +12691,12 @@ module Prism
11402
12691
  @operator_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
11403
12692
  end
11404
12693
 
12694
+ # Save the operator_loc location using the given saved source so that
12695
+ # it can be retrieved later.
12696
+ def save_operator_loc(repository)
12697
+ repository.enter(node_id, :operator_loc)
12698
+ end
12699
+
11405
12700
  # def operator: () -> String
11406
12701
  def operator
11407
12702
  operator_loc.slice
@@ -11641,6 +12936,12 @@ module Prism
11641
12936
  @module_keyword_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
11642
12937
  end
11643
12938
 
12939
+ # Save the module_keyword_loc location using the given saved source so that
12940
+ # it can be retrieved later.
12941
+ def save_module_keyword_loc(repository)
12942
+ repository.enter(node_id, :module_keyword_loc)
12943
+ end
12944
+
11644
12945
  # attr_reader constant_path: ConstantReadNode | ConstantPathNode | MissingNode
11645
12946
  attr_reader :constant_path
11646
12947
 
@@ -11654,6 +12955,12 @@ module Prism
11654
12955
  @end_keyword_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
11655
12956
  end
11656
12957
 
12958
+ # Save the end_keyword_loc location using the given saved source so that
12959
+ # it can be retrieved later.
12960
+ def save_end_keyword_loc(repository)
12961
+ repository.enter(node_id, :end_keyword_loc)
12962
+ end
12963
+
11657
12964
  # attr_reader name: Symbol
11658
12965
  attr_reader :name
11659
12966
 
@@ -11805,6 +13112,12 @@ module Prism
11805
13112
  end
11806
13113
  end
11807
13114
 
13115
+ # Save the lparen_loc location using the given saved source so that
13116
+ # it can be retrieved later.
13117
+ def save_lparen_loc(repository)
13118
+ repository.enter(node_id, :lparen_loc) unless @lparen_loc.nil?
13119
+ end
13120
+
11808
13121
  # The location of the closing parenthesis.
11809
13122
  #
11810
13123
  # a, (b, c) = 1, 2, 3
@@ -11821,6 +13134,12 @@ module Prism
11821
13134
  end
11822
13135
  end
11823
13136
 
13137
+ # Save the rparen_loc location using the given saved source so that
13138
+ # it can be retrieved later.
13139
+ def save_rparen_loc(repository)
13140
+ repository.enter(node_id, :rparen_loc) unless @rparen_loc.nil?
13141
+ end
13142
+
11824
13143
  # def lparen: () -> String?
11825
13144
  def lparen
11826
13145
  lparen_loc&.slice
@@ -11967,6 +13286,12 @@ module Prism
11967
13286
  end
11968
13287
  end
11969
13288
 
13289
+ # Save the lparen_loc location using the given saved source so that
13290
+ # it can be retrieved later.
13291
+ def save_lparen_loc(repository)
13292
+ repository.enter(node_id, :lparen_loc) unless @lparen_loc.nil?
13293
+ end
13294
+
11970
13295
  # The location of the closing parenthesis.
11971
13296
  #
11972
13297
  # (a, b, c) = 1, 2, 3
@@ -11983,6 +13308,12 @@ module Prism
11983
13308
  end
11984
13309
  end
11985
13310
 
13311
+ # Save the rparen_loc location using the given saved source so that
13312
+ # it can be retrieved later.
13313
+ def save_rparen_loc(repository)
13314
+ repository.enter(node_id, :rparen_loc) unless @rparen_loc.nil?
13315
+ end
13316
+
11986
13317
  # The location of the operator.
11987
13318
  #
11988
13319
  # a, b, c = 1, 2, 3
@@ -11993,6 +13324,12 @@ module Prism
11993
13324
  @operator_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
11994
13325
  end
11995
13326
 
13327
+ # Save the operator_loc location using the given saved source so that
13328
+ # it can be retrieved later.
13329
+ def save_operator_loc(repository)
13330
+ repository.enter(node_id, :operator_loc)
13331
+ end
13332
+
11996
13333
  # The value to write to the targets. It can be any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression).
11997
13334
  #
11998
13335
  # a, b, c = 1, 2, 3
@@ -12105,6 +13442,12 @@ module Prism
12105
13442
  @keyword_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
12106
13443
  end
12107
13444
 
13445
+ # Save the keyword_loc location using the given saved source so that
13446
+ # it can be retrieved later.
13447
+ def save_keyword_loc(repository)
13448
+ repository.enter(node_id, :keyword_loc)
13449
+ end
13450
+
12108
13451
  # def keyword: () -> String
12109
13452
  def keyword
12110
13453
  keyword_loc.slice
@@ -12258,6 +13601,12 @@ module Prism
12258
13601
  @operator_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
12259
13602
  end
12260
13603
 
13604
+ # Save the operator_loc location using the given saved source so that
13605
+ # it can be retrieved later.
13606
+ def save_operator_loc(repository)
13607
+ repository.enter(node_id, :operator_loc)
13608
+ end
13609
+
12261
13610
  # attr_reader keyword_loc: Location
12262
13611
  def keyword_loc
12263
13612
  location = @keyword_loc
@@ -12265,6 +13614,12 @@ module Prism
12265
13614
  @keyword_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
12266
13615
  end
12267
13616
 
13617
+ # Save the keyword_loc location using the given saved source so that
13618
+ # it can be retrieved later.
13619
+ def save_keyword_loc(repository)
13620
+ repository.enter(node_id, :keyword_loc)
13621
+ end
13622
+
12268
13623
  # def operator: () -> String
12269
13624
  def operator
12270
13625
  operator_loc.slice
@@ -12516,6 +13871,12 @@ module Prism
12516
13871
  @name_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
12517
13872
  end
12518
13873
 
13874
+ # Save the name_loc location using the given saved source so that
13875
+ # it can be retrieved later.
13876
+ def save_name_loc(repository)
13877
+ repository.enter(node_id, :name_loc)
13878
+ end
13879
+
12519
13880
  # attr_reader value: Prism::node
12520
13881
  attr_reader :value
12521
13882
 
@@ -12611,6 +13972,12 @@ module Prism
12611
13972
  @name_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
12612
13973
  end
12613
13974
 
13975
+ # Save the name_loc location using the given saved source so that
13976
+ # it can be retrieved later.
13977
+ def save_name_loc(repository)
13978
+ repository.enter(node_id, :name_loc)
13979
+ end
13980
+
12614
13981
  # attr_reader operator_loc: Location
12615
13982
  def operator_loc
12616
13983
  location = @operator_loc
@@ -12618,6 +13985,12 @@ module Prism
12618
13985
  @operator_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
12619
13986
  end
12620
13987
 
13988
+ # Save the operator_loc location using the given saved source so that
13989
+ # it can be retrieved later.
13990
+ def save_operator_loc(repository)
13991
+ repository.enter(node_id, :operator_loc)
13992
+ end
13993
+
12621
13994
  # attr_reader value: Prism::node
12622
13995
  attr_reader :value
12623
13996
 
@@ -12730,6 +14103,12 @@ module Prism
12730
14103
  @operator_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
12731
14104
  end
12732
14105
 
14106
+ # Save the operator_loc location using the given saved source so that
14107
+ # it can be retrieved later.
14108
+ def save_operator_loc(repository)
14109
+ repository.enter(node_id, :operator_loc)
14110
+ end
14111
+
12733
14112
  # def operator: () -> String
12734
14113
  def operator
12735
14114
  operator_loc.slice
@@ -12937,6 +14316,12 @@ module Prism
12937
14316
  @opening_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
12938
14317
  end
12939
14318
 
14319
+ # Save the opening_loc location using the given saved source so that
14320
+ # it can be retrieved later.
14321
+ def save_opening_loc(repository)
14322
+ repository.enter(node_id, :opening_loc)
14323
+ end
14324
+
12940
14325
  # attr_reader closing_loc: Location
12941
14326
  def closing_loc
12942
14327
  location = @closing_loc
@@ -12944,6 +14329,12 @@ module Prism
12944
14329
  @closing_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
12945
14330
  end
12946
14331
 
14332
+ # Save the closing_loc location using the given saved source so that
14333
+ # it can be retrieved later.
14334
+ def save_closing_loc(repository)
14335
+ repository.enter(node_id, :closing_loc)
14336
+ end
14337
+
12947
14338
  # def opening: () -> String
12948
14339
  def opening
12949
14340
  opening_loc.slice
@@ -13039,6 +14430,12 @@ module Prism
13039
14430
  @operator_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
13040
14431
  end
13041
14432
 
14433
+ # Save the operator_loc location using the given saved source so that
14434
+ # it can be retrieved later.
14435
+ def save_operator_loc(repository)
14436
+ repository.enter(node_id, :operator_loc)
14437
+ end
14438
+
13042
14439
  # attr_reader lparen_loc: Location
13043
14440
  def lparen_loc
13044
14441
  location = @lparen_loc
@@ -13046,6 +14443,12 @@ module Prism
13046
14443
  @lparen_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
13047
14444
  end
13048
14445
 
14446
+ # Save the lparen_loc location using the given saved source so that
14447
+ # it can be retrieved later.
14448
+ def save_lparen_loc(repository)
14449
+ repository.enter(node_id, :lparen_loc)
14450
+ end
14451
+
13049
14452
  # attr_reader rparen_loc: Location
13050
14453
  def rparen_loc
13051
14454
  location = @rparen_loc
@@ -13053,6 +14456,12 @@ module Prism
13053
14456
  @rparen_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
13054
14457
  end
13055
14458
 
14459
+ # Save the rparen_loc location using the given saved source so that
14460
+ # it can be retrieved later.
14461
+ def save_rparen_loc(repository)
14462
+ repository.enter(node_id, :rparen_loc)
14463
+ end
14464
+
13056
14465
  # def operator: () -> String
13057
14466
  def operator
13058
14467
  operator_loc.slice
@@ -13152,6 +14561,12 @@ module Prism
13152
14561
  @operator_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
13153
14562
  end
13154
14563
 
14564
+ # Save the operator_loc location using the given saved source so that
14565
+ # it can be retrieved later.
14566
+ def save_operator_loc(repository)
14567
+ repository.enter(node_id, :operator_loc)
14568
+ end
14569
+
13155
14570
  # def operator: () -> String
13156
14571
  def operator
13157
14572
  operator_loc.slice
@@ -13243,6 +14658,12 @@ module Prism
13243
14658
  @keyword_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
13244
14659
  end
13245
14660
 
14661
+ # Save the keyword_loc location using the given saved source so that
14662
+ # it can be retrieved later.
14663
+ def save_keyword_loc(repository)
14664
+ repository.enter(node_id, :keyword_loc)
14665
+ end
14666
+
13246
14667
  # attr_reader opening_loc: Location
13247
14668
  def opening_loc
13248
14669
  location = @opening_loc
@@ -13250,6 +14671,12 @@ module Prism
13250
14671
  @opening_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
13251
14672
  end
13252
14673
 
14674
+ # Save the opening_loc location using the given saved source so that
14675
+ # it can be retrieved later.
14676
+ def save_opening_loc(repository)
14677
+ repository.enter(node_id, :opening_loc)
14678
+ end
14679
+
13253
14680
  # attr_reader closing_loc: Location
13254
14681
  def closing_loc
13255
14682
  location = @closing_loc
@@ -13257,6 +14684,12 @@ module Prism
13257
14684
  @closing_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
13258
14685
  end
13259
14686
 
14687
+ # Save the closing_loc location using the given saved source so that
14688
+ # it can be retrieved later.
14689
+ def save_closing_loc(repository)
14690
+ repository.enter(node_id, :closing_loc)
14691
+ end
14692
+
13260
14693
  # def keyword: () -> String
13261
14694
  def keyword
13262
14695
  keyword_loc.slice
@@ -13360,6 +14793,12 @@ module Prism
13360
14793
  @keyword_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
13361
14794
  end
13362
14795
 
14796
+ # Save the keyword_loc location using the given saved source so that
14797
+ # it can be retrieved later.
14798
+ def save_keyword_loc(repository)
14799
+ repository.enter(node_id, :keyword_loc)
14800
+ end
14801
+
13363
14802
  # attr_reader opening_loc: Location
13364
14803
  def opening_loc
13365
14804
  location = @opening_loc
@@ -13367,6 +14806,12 @@ module Prism
13367
14806
  @opening_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
13368
14807
  end
13369
14808
 
14809
+ # Save the opening_loc location using the given saved source so that
14810
+ # it can be retrieved later.
14811
+ def save_opening_loc(repository)
14812
+ repository.enter(node_id, :opening_loc)
14813
+ end
14814
+
13370
14815
  # attr_reader closing_loc: Location
13371
14816
  def closing_loc
13372
14817
  location = @closing_loc
@@ -13374,6 +14819,12 @@ module Prism
13374
14819
  @closing_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
13375
14820
  end
13376
14821
 
14822
+ # Save the closing_loc location using the given saved source so that
14823
+ # it can be retrieved later.
14824
+ def save_closing_loc(repository)
14825
+ repository.enter(node_id, :closing_loc)
14826
+ end
14827
+
13377
14828
  # def keyword: () -> String
13378
14829
  def keyword
13379
14830
  keyword_loc.slice
@@ -13577,6 +15028,12 @@ module Prism
13577
15028
  @operator_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
13578
15029
  end
13579
15030
 
15031
+ # Save the operator_loc location using the given saved source so that
15032
+ # it can be retrieved later.
15033
+ def save_operator_loc(repository)
15034
+ repository.enter(node_id, :operator_loc)
15035
+ end
15036
+
13580
15037
  # def operator: () -> String
13581
15038
  def operator
13582
15039
  operator_loc.slice
@@ -13891,6 +15348,12 @@ module Prism
13891
15348
  @opening_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
13892
15349
  end
13893
15350
 
15351
+ # Save the opening_loc location using the given saved source so that
15352
+ # it can be retrieved later.
15353
+ def save_opening_loc(repository)
15354
+ repository.enter(node_id, :opening_loc)
15355
+ end
15356
+
13894
15357
  # attr_reader content_loc: Location
13895
15358
  def content_loc
13896
15359
  location = @content_loc
@@ -13898,6 +15361,12 @@ module Prism
13898
15361
  @content_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
13899
15362
  end
13900
15363
 
15364
+ # Save the content_loc location using the given saved source so that
15365
+ # it can be retrieved later.
15366
+ def save_content_loc(repository)
15367
+ repository.enter(node_id, :content_loc)
15368
+ end
15369
+
13901
15370
  # attr_reader closing_loc: Location
13902
15371
  def closing_loc
13903
15372
  location = @closing_loc
@@ -13905,6 +15374,12 @@ module Prism
13905
15374
  @closing_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
13906
15375
  end
13907
15376
 
15377
+ # Save the closing_loc location using the given saved source so that
15378
+ # it can be retrieved later.
15379
+ def save_closing_loc(repository)
15380
+ repository.enter(node_id, :closing_loc)
15381
+ end
15382
+
13908
15383
  # attr_reader unescaped: String
13909
15384
  attr_reader :unescaped
13910
15385
 
@@ -14014,6 +15489,12 @@ module Prism
14014
15489
  @name_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
14015
15490
  end
14016
15491
 
15492
+ # Save the name_loc location using the given saved source so that
15493
+ # it can be retrieved later.
15494
+ def save_name_loc(repository)
15495
+ repository.enter(node_id, :name_loc)
15496
+ end
15497
+
14017
15498
  # def inspect -> String
14018
15499
  def inspect
14019
15500
  InspectVisitor.compose(self)
@@ -14178,6 +15659,12 @@ module Prism
14178
15659
  @keyword_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
14179
15660
  end
14180
15661
 
15662
+ # Save the keyword_loc location using the given saved source so that
15663
+ # it can be retrieved later.
15664
+ def save_keyword_loc(repository)
15665
+ repository.enter(node_id, :keyword_loc)
15666
+ end
15667
+
14181
15668
  # attr_reader rescue_expression: Prism::node
14182
15669
  attr_reader :rescue_expression
14183
15670
 
@@ -14280,6 +15767,12 @@ module Prism
14280
15767
  @keyword_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
14281
15768
  end
14282
15769
 
15770
+ # Save the keyword_loc location using the given saved source so that
15771
+ # it can be retrieved later.
15772
+ def save_keyword_loc(repository)
15773
+ repository.enter(node_id, :keyword_loc)
15774
+ end
15775
+
14283
15776
  # attr_reader exceptions: Array[Prism::node]
14284
15777
  attr_reader :exceptions
14285
15778
 
@@ -14296,6 +15789,12 @@ module Prism
14296
15789
  end
14297
15790
  end
14298
15791
 
15792
+ # Save the operator_loc location using the given saved source so that
15793
+ # it can be retrieved later.
15794
+ def save_operator_loc(repository)
15795
+ repository.enter(node_id, :operator_loc) unless @operator_loc.nil?
15796
+ end
15797
+
14299
15798
  # attr_reader reference: LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | BackReferenceReadNode | NumberedReferenceReadNode | MissingNode | nil
14300
15799
  attr_reader :reference
14301
15800
 
@@ -14415,6 +15914,12 @@ module Prism
14415
15914
  end
14416
15915
  end
14417
15916
 
15917
+ # Save the name_loc location using the given saved source so that
15918
+ # it can be retrieved later.
15919
+ def save_name_loc(repository)
15920
+ repository.enter(node_id, :name_loc) unless @name_loc.nil?
15921
+ end
15922
+
14418
15923
  # attr_reader operator_loc: Location
14419
15924
  def operator_loc
14420
15925
  location = @operator_loc
@@ -14422,6 +15927,12 @@ module Prism
14422
15927
  @operator_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
14423
15928
  end
14424
15929
 
15930
+ # Save the operator_loc location using the given saved source so that
15931
+ # it can be retrieved later.
15932
+ def save_operator_loc(repository)
15933
+ repository.enter(node_id, :operator_loc)
15934
+ end
15935
+
14425
15936
  # def operator: () -> String
14426
15937
  def operator
14427
15938
  operator_loc.slice
@@ -14578,6 +16089,12 @@ module Prism
14578
16089
  @keyword_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
14579
16090
  end
14580
16091
 
16092
+ # Save the keyword_loc location using the given saved source so that
16093
+ # it can be retrieved later.
16094
+ def save_keyword_loc(repository)
16095
+ repository.enter(node_id, :keyword_loc)
16096
+ end
16097
+
14581
16098
  # attr_reader arguments: ArgumentsNode?
14582
16099
  attr_reader :arguments
14583
16100
 
@@ -14833,6 +16350,12 @@ module Prism
14833
16350
  @class_keyword_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
14834
16351
  end
14835
16352
 
16353
+ # Save the class_keyword_loc location using the given saved source so that
16354
+ # it can be retrieved later.
16355
+ def save_class_keyword_loc(repository)
16356
+ repository.enter(node_id, :class_keyword_loc)
16357
+ end
16358
+
14836
16359
  # attr_reader operator_loc: Location
14837
16360
  def operator_loc
14838
16361
  location = @operator_loc
@@ -14840,6 +16363,12 @@ module Prism
14840
16363
  @operator_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
14841
16364
  end
14842
16365
 
16366
+ # Save the operator_loc location using the given saved source so that
16367
+ # it can be retrieved later.
16368
+ def save_operator_loc(repository)
16369
+ repository.enter(node_id, :operator_loc)
16370
+ end
16371
+
14843
16372
  # attr_reader expression: Prism::node
14844
16373
  attr_reader :expression
14845
16374
 
@@ -14853,6 +16382,12 @@ module Prism
14853
16382
  @end_keyword_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
14854
16383
  end
14855
16384
 
16385
+ # Save the end_keyword_loc location using the given saved source so that
16386
+ # it can be retrieved later.
16387
+ def save_end_keyword_loc(repository)
16388
+ repository.enter(node_id, :end_keyword_loc)
16389
+ end
16390
+
14856
16391
  # def class_keyword: () -> String
14857
16392
  def class_keyword
14858
16393
  class_keyword_loc.slice
@@ -15184,6 +16719,12 @@ module Prism
15184
16719
  @operator_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
15185
16720
  end
15186
16721
 
16722
+ # Save the operator_loc location using the given saved source so that
16723
+ # it can be retrieved later.
16724
+ def save_operator_loc(repository)
16725
+ repository.enter(node_id, :operator_loc)
16726
+ end
16727
+
15187
16728
  # attr_reader expression: Prism::node?
15188
16729
  attr_reader :expression
15189
16730
 
@@ -15379,6 +16920,12 @@ module Prism
15379
16920
  end
15380
16921
  end
15381
16922
 
16923
+ # Save the opening_loc location using the given saved source so that
16924
+ # it can be retrieved later.
16925
+ def save_opening_loc(repository)
16926
+ repository.enter(node_id, :opening_loc) unless @opening_loc.nil?
16927
+ end
16928
+
15382
16929
  # attr_reader content_loc: Location
15383
16930
  def content_loc
15384
16931
  location = @content_loc
@@ -15386,6 +16933,12 @@ module Prism
15386
16933
  @content_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
15387
16934
  end
15388
16935
 
16936
+ # Save the content_loc location using the given saved source so that
16937
+ # it can be retrieved later.
16938
+ def save_content_loc(repository)
16939
+ repository.enter(node_id, :content_loc)
16940
+ end
16941
+
15389
16942
  # attr_reader closing_loc: Location?
15390
16943
  def closing_loc
15391
16944
  location = @closing_loc
@@ -15399,6 +16952,12 @@ module Prism
15399
16952
  end
15400
16953
  end
15401
16954
 
16955
+ # Save the closing_loc location using the given saved source so that
16956
+ # it can be retrieved later.
16957
+ def save_closing_loc(repository)
16958
+ repository.enter(node_id, :closing_loc) unless @closing_loc.nil?
16959
+ end
16960
+
15402
16961
  # attr_reader unescaped: String
15403
16962
  attr_reader :unescaped
15404
16963
 
@@ -15508,6 +17067,12 @@ module Prism
15508
17067
  @keyword_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
15509
17068
  end
15510
17069
 
17070
+ # Save the keyword_loc location using the given saved source so that
17071
+ # it can be retrieved later.
17072
+ def save_keyword_loc(repository)
17073
+ repository.enter(node_id, :keyword_loc)
17074
+ end
17075
+
15511
17076
  # attr_reader lparen_loc: Location?
15512
17077
  def lparen_loc
15513
17078
  location = @lparen_loc
@@ -15521,6 +17086,12 @@ module Prism
15521
17086
  end
15522
17087
  end
15523
17088
 
17089
+ # Save the lparen_loc location using the given saved source so that
17090
+ # it can be retrieved later.
17091
+ def save_lparen_loc(repository)
17092
+ repository.enter(node_id, :lparen_loc) unless @lparen_loc.nil?
17093
+ end
17094
+
15524
17095
  # attr_reader arguments: ArgumentsNode?
15525
17096
  attr_reader :arguments
15526
17097
 
@@ -15537,6 +17108,12 @@ module Prism
15537
17108
  end
15538
17109
  end
15539
17110
 
17111
+ # Save the rparen_loc location using the given saved source so that
17112
+ # it can be retrieved later.
17113
+ def save_rparen_loc(repository)
17114
+ repository.enter(node_id, :rparen_loc) unless @rparen_loc.nil?
17115
+ end
17116
+
15540
17117
  # attr_reader block: BlockNode | BlockArgumentNode | nil
15541
17118
  attr_reader :block
15542
17119
 
@@ -15663,6 +17240,12 @@ module Prism
15663
17240
  end
15664
17241
  end
15665
17242
 
17243
+ # Save the opening_loc location using the given saved source so that
17244
+ # it can be retrieved later.
17245
+ def save_opening_loc(repository)
17246
+ repository.enter(node_id, :opening_loc) unless @opening_loc.nil?
17247
+ end
17248
+
15666
17249
  # attr_reader value_loc: Location?
15667
17250
  def value_loc
15668
17251
  location = @value_loc
@@ -15676,6 +17259,12 @@ module Prism
15676
17259
  end
15677
17260
  end
15678
17261
 
17262
+ # Save the value_loc location using the given saved source so that
17263
+ # it can be retrieved later.
17264
+ def save_value_loc(repository)
17265
+ repository.enter(node_id, :value_loc) unless @value_loc.nil?
17266
+ end
17267
+
15679
17268
  # attr_reader closing_loc: Location?
15680
17269
  def closing_loc
15681
17270
  location = @closing_loc
@@ -15689,6 +17278,12 @@ module Prism
15689
17278
  end
15690
17279
  end
15691
17280
 
17281
+ # Save the closing_loc location using the given saved source so that
17282
+ # it can be retrieved later.
17283
+ def save_closing_loc(repository)
17284
+ repository.enter(node_id, :closing_loc) unless @closing_loc.nil?
17285
+ end
17286
+
15692
17287
  # attr_reader unescaped: String
15693
17288
  attr_reader :unescaped
15694
17289
 
@@ -15860,6 +17455,12 @@ module Prism
15860
17455
  @keyword_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
15861
17456
  end
15862
17457
 
17458
+ # Save the keyword_loc location using the given saved source so that
17459
+ # it can be retrieved later.
17460
+ def save_keyword_loc(repository)
17461
+ repository.enter(node_id, :keyword_loc)
17462
+ end
17463
+
15863
17464
  # def keyword: () -> String
15864
17465
  def keyword
15865
17466
  keyword_loc.slice
@@ -15962,6 +17563,12 @@ module Prism
15962
17563
  @keyword_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
15963
17564
  end
15964
17565
 
17566
+ # Save the keyword_loc location using the given saved source so that
17567
+ # it can be retrieved later.
17568
+ def save_keyword_loc(repository)
17569
+ repository.enter(node_id, :keyword_loc)
17570
+ end
17571
+
15965
17572
  # The condition to be evaluated for the unless expression. It can be any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression).
15966
17573
  #
15967
17574
  # unless cond then bar end
@@ -15987,6 +17594,12 @@ module Prism
15987
17594
  end
15988
17595
  end
15989
17596
 
17597
+ # Save the then_keyword_loc location using the given saved source so that
17598
+ # it can be retrieved later.
17599
+ def save_then_keyword_loc(repository)
17600
+ repository.enter(node_id, :then_keyword_loc) unless @then_keyword_loc.nil?
17601
+ end
17602
+
15990
17603
  # The body of statements that will executed if the unless condition is
15991
17604
  # falsey. Will be `nil` if no body is provided.
15992
17605
  #
@@ -16016,6 +17629,12 @@ module Prism
16016
17629
  end
16017
17630
  end
16018
17631
 
17632
+ # Save the end_keyword_loc location using the given saved source so that
17633
+ # it can be retrieved later.
17634
+ def save_end_keyword_loc(repository)
17635
+ repository.enter(node_id, :end_keyword_loc) unless @end_keyword_loc.nil?
17636
+ end
17637
+
16019
17638
  # def keyword: () -> String
16020
17639
  def keyword
16021
17640
  keyword_loc.slice
@@ -16068,12 +17687,13 @@ module Prism
16068
17687
  # ^^^^^^^^^^^^^^^^^^^^
16069
17688
  class UntilNode < Node
16070
17689
  # Initialize a new UntilNode node.
16071
- def initialize(source, node_id, location, flags, keyword_loc, closing_loc, predicate, statements)
17690
+ def initialize(source, node_id, location, flags, keyword_loc, do_keyword_loc, closing_loc, predicate, statements)
16072
17691
  @source = source
16073
17692
  @node_id = node_id
16074
17693
  @location = location
16075
17694
  @flags = flags
16076
17695
  @keyword_loc = keyword_loc
17696
+ @do_keyword_loc = do_keyword_loc
16077
17697
  @closing_loc = closing_loc
16078
17698
  @predicate = predicate
16079
17699
  @statements = statements
@@ -16099,20 +17719,20 @@ module Prism
16099
17719
 
16100
17720
  # def comment_targets: () -> Array[Node | Location]
16101
17721
  def comment_targets
16102
- [keyword_loc, *closing_loc, predicate, *statements] #: Array[Prism::node | Location]
17722
+ [keyword_loc, *do_keyword_loc, *closing_loc, predicate, *statements] #: Array[Prism::node | Location]
16103
17723
  end
16104
17724
 
16105
- # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?keyword_loc: Location, ?closing_loc: Location?, ?predicate: Prism::node, ?statements: StatementsNode?) -> UntilNode
16106
- def copy(node_id: self.node_id, location: self.location, flags: self.flags, keyword_loc: self.keyword_loc, closing_loc: self.closing_loc, predicate: self.predicate, statements: self.statements)
16107
- UntilNode.new(source, node_id, location, flags, keyword_loc, closing_loc, predicate, statements)
17725
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?keyword_loc: Location, ?do_keyword_loc: Location?, ?closing_loc: Location?, ?predicate: Prism::node, ?statements: StatementsNode?) -> UntilNode
17726
+ def copy(node_id: self.node_id, location: self.location, flags: self.flags, keyword_loc: self.keyword_loc, do_keyword_loc: self.do_keyword_loc, closing_loc: self.closing_loc, predicate: self.predicate, statements: self.statements)
17727
+ UntilNode.new(source, node_id, location, flags, keyword_loc, do_keyword_loc, closing_loc, predicate, statements)
16108
17728
  end
16109
17729
 
16110
17730
  # def deconstruct: () -> Array[nil | Node]
16111
17731
  alias deconstruct child_nodes
16112
17732
 
16113
- # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, keyword_loc: Location, closing_loc: Location?, predicate: Prism::node, statements: StatementsNode? }
17733
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, keyword_loc: Location, do_keyword_loc: Location?, closing_loc: Location?, predicate: Prism::node, statements: StatementsNode? }
16114
17734
  def deconstruct_keys(keys)
16115
- { node_id: node_id, location: location, keyword_loc: keyword_loc, closing_loc: closing_loc, predicate: predicate, statements: statements }
17735
+ { node_id: node_id, location: location, keyword_loc: keyword_loc, do_keyword_loc: do_keyword_loc, closing_loc: closing_loc, predicate: predicate, statements: statements }
16116
17736
  end
16117
17737
 
16118
17738
  # def begin_modifier?: () -> bool
@@ -16127,6 +17747,31 @@ module Prism
16127
17747
  @keyword_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
16128
17748
  end
16129
17749
 
17750
+ # Save the keyword_loc location using the given saved source so that
17751
+ # it can be retrieved later.
17752
+ def save_keyword_loc(repository)
17753
+ repository.enter(node_id, :keyword_loc)
17754
+ end
17755
+
17756
+ # attr_reader do_keyword_loc: Location?
17757
+ def do_keyword_loc
17758
+ location = @do_keyword_loc
17759
+ case location
17760
+ when nil
17761
+ nil
17762
+ when Location
17763
+ location
17764
+ else
17765
+ @do_keyword_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
17766
+ end
17767
+ end
17768
+
17769
+ # Save the do_keyword_loc location using the given saved source so that
17770
+ # it can be retrieved later.
17771
+ def save_do_keyword_loc(repository)
17772
+ repository.enter(node_id, :do_keyword_loc) unless @do_keyword_loc.nil?
17773
+ end
17774
+
16130
17775
  # attr_reader closing_loc: Location?
16131
17776
  def closing_loc
16132
17777
  location = @closing_loc
@@ -16140,6 +17785,12 @@ module Prism
16140
17785
  end
16141
17786
  end
16142
17787
 
17788
+ # Save the closing_loc location using the given saved source so that
17789
+ # it can be retrieved later.
17790
+ def save_closing_loc(repository)
17791
+ repository.enter(node_id, :closing_loc) unless @closing_loc.nil?
17792
+ end
17793
+
16143
17794
  # attr_reader predicate: Prism::node
16144
17795
  attr_reader :predicate
16145
17796
 
@@ -16151,6 +17802,11 @@ module Prism
16151
17802
  keyword_loc.slice
16152
17803
  end
16153
17804
 
17805
+ # def do_keyword: () -> String?
17806
+ def do_keyword
17807
+ do_keyword_loc&.slice
17808
+ end
17809
+
16154
17810
  # def closing: () -> String?
16155
17811
  def closing
16156
17812
  closing_loc&.slice
@@ -16177,6 +17833,7 @@ module Prism
16177
17833
  other.is_a?(UntilNode) &&
16178
17834
  (flags === other.flags) &&
16179
17835
  (keyword_loc.nil? == other.keyword_loc.nil?) &&
17836
+ (do_keyword_loc.nil? == other.do_keyword_loc.nil?) &&
16180
17837
  (closing_loc.nil? == other.closing_loc.nil?) &&
16181
17838
  (predicate === other.predicate) &&
16182
17839
  (statements === other.statements)
@@ -16245,6 +17902,12 @@ module Prism
16245
17902
  @keyword_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
16246
17903
  end
16247
17904
 
17905
+ # Save the keyword_loc location using the given saved source so that
17906
+ # it can be retrieved later.
17907
+ def save_keyword_loc(repository)
17908
+ repository.enter(node_id, :keyword_loc)
17909
+ end
17910
+
16248
17911
  # attr_reader conditions: Array[Prism::node]
16249
17912
  attr_reader :conditions
16250
17913
 
@@ -16261,6 +17924,12 @@ module Prism
16261
17924
  end
16262
17925
  end
16263
17926
 
17927
+ # Save the then_keyword_loc location using the given saved source so that
17928
+ # it can be retrieved later.
17929
+ def save_then_keyword_loc(repository)
17930
+ repository.enter(node_id, :then_keyword_loc) unless @then_keyword_loc.nil?
17931
+ end
17932
+
16264
17933
  # attr_reader statements: StatementsNode?
16265
17934
  attr_reader :statements
16266
17935
 
@@ -16310,12 +17979,13 @@ module Prism
16310
17979
  # ^^^^^^^^^^^^^^^^^^^^
16311
17980
  class WhileNode < Node
16312
17981
  # Initialize a new WhileNode node.
16313
- def initialize(source, node_id, location, flags, keyword_loc, closing_loc, predicate, statements)
17982
+ def initialize(source, node_id, location, flags, keyword_loc, do_keyword_loc, closing_loc, predicate, statements)
16314
17983
  @source = source
16315
17984
  @node_id = node_id
16316
17985
  @location = location
16317
17986
  @flags = flags
16318
17987
  @keyword_loc = keyword_loc
17988
+ @do_keyword_loc = do_keyword_loc
16319
17989
  @closing_loc = closing_loc
16320
17990
  @predicate = predicate
16321
17991
  @statements = statements
@@ -16341,20 +18011,20 @@ module Prism
16341
18011
 
16342
18012
  # def comment_targets: () -> Array[Node | Location]
16343
18013
  def comment_targets
16344
- [keyword_loc, *closing_loc, predicate, *statements] #: Array[Prism::node | Location]
18014
+ [keyword_loc, *do_keyword_loc, *closing_loc, predicate, *statements] #: Array[Prism::node | Location]
16345
18015
  end
16346
18016
 
16347
- # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?keyword_loc: Location, ?closing_loc: Location?, ?predicate: Prism::node, ?statements: StatementsNode?) -> WhileNode
16348
- def copy(node_id: self.node_id, location: self.location, flags: self.flags, keyword_loc: self.keyword_loc, closing_loc: self.closing_loc, predicate: self.predicate, statements: self.statements)
16349
- WhileNode.new(source, node_id, location, flags, keyword_loc, closing_loc, predicate, statements)
18017
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?keyword_loc: Location, ?do_keyword_loc: Location?, ?closing_loc: Location?, ?predicate: Prism::node, ?statements: StatementsNode?) -> WhileNode
18018
+ def copy(node_id: self.node_id, location: self.location, flags: self.flags, keyword_loc: self.keyword_loc, do_keyword_loc: self.do_keyword_loc, closing_loc: self.closing_loc, predicate: self.predicate, statements: self.statements)
18019
+ WhileNode.new(source, node_id, location, flags, keyword_loc, do_keyword_loc, closing_loc, predicate, statements)
16350
18020
  end
16351
18021
 
16352
18022
  # def deconstruct: () -> Array[nil | Node]
16353
18023
  alias deconstruct child_nodes
16354
18024
 
16355
- # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, keyword_loc: Location, closing_loc: Location?, predicate: Prism::node, statements: StatementsNode? }
18025
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, keyword_loc: Location, do_keyword_loc: Location?, closing_loc: Location?, predicate: Prism::node, statements: StatementsNode? }
16356
18026
  def deconstruct_keys(keys)
16357
- { node_id: node_id, location: location, keyword_loc: keyword_loc, closing_loc: closing_loc, predicate: predicate, statements: statements }
18027
+ { node_id: node_id, location: location, keyword_loc: keyword_loc, do_keyword_loc: do_keyword_loc, closing_loc: closing_loc, predicate: predicate, statements: statements }
16358
18028
  end
16359
18029
 
16360
18030
  # def begin_modifier?: () -> bool
@@ -16369,6 +18039,31 @@ module Prism
16369
18039
  @keyword_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
16370
18040
  end
16371
18041
 
18042
+ # Save the keyword_loc location using the given saved source so that
18043
+ # it can be retrieved later.
18044
+ def save_keyword_loc(repository)
18045
+ repository.enter(node_id, :keyword_loc)
18046
+ end
18047
+
18048
+ # attr_reader do_keyword_loc: Location?
18049
+ def do_keyword_loc
18050
+ location = @do_keyword_loc
18051
+ case location
18052
+ when nil
18053
+ nil
18054
+ when Location
18055
+ location
18056
+ else
18057
+ @do_keyword_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
18058
+ end
18059
+ end
18060
+
18061
+ # Save the do_keyword_loc location using the given saved source so that
18062
+ # it can be retrieved later.
18063
+ def save_do_keyword_loc(repository)
18064
+ repository.enter(node_id, :do_keyword_loc) unless @do_keyword_loc.nil?
18065
+ end
18066
+
16372
18067
  # attr_reader closing_loc: Location?
16373
18068
  def closing_loc
16374
18069
  location = @closing_loc
@@ -16382,6 +18077,12 @@ module Prism
16382
18077
  end
16383
18078
  end
16384
18079
 
18080
+ # Save the closing_loc location using the given saved source so that
18081
+ # it can be retrieved later.
18082
+ def save_closing_loc(repository)
18083
+ repository.enter(node_id, :closing_loc) unless @closing_loc.nil?
18084
+ end
18085
+
16385
18086
  # attr_reader predicate: Prism::node
16386
18087
  attr_reader :predicate
16387
18088
 
@@ -16393,6 +18094,11 @@ module Prism
16393
18094
  keyword_loc.slice
16394
18095
  end
16395
18096
 
18097
+ # def do_keyword: () -> String?
18098
+ def do_keyword
18099
+ do_keyword_loc&.slice
18100
+ end
18101
+
16396
18102
  # def closing: () -> String?
16397
18103
  def closing
16398
18104
  closing_loc&.slice
@@ -16419,6 +18125,7 @@ module Prism
16419
18125
  other.is_a?(WhileNode) &&
16420
18126
  (flags === other.flags) &&
16421
18127
  (keyword_loc.nil? == other.keyword_loc.nil?) &&
18128
+ (do_keyword_loc.nil? == other.do_keyword_loc.nil?) &&
16422
18129
  (closing_loc.nil? == other.closing_loc.nil?) &&
16423
18130
  (predicate === other.predicate) &&
16424
18131
  (statements === other.statements)
@@ -16492,6 +18199,12 @@ module Prism
16492
18199
  @opening_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
16493
18200
  end
16494
18201
 
18202
+ # Save the opening_loc location using the given saved source so that
18203
+ # it can be retrieved later.
18204
+ def save_opening_loc(repository)
18205
+ repository.enter(node_id, :opening_loc)
18206
+ end
18207
+
16495
18208
  # attr_reader content_loc: Location
16496
18209
  def content_loc
16497
18210
  location = @content_loc
@@ -16499,6 +18212,12 @@ module Prism
16499
18212
  @content_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
16500
18213
  end
16501
18214
 
18215
+ # Save the content_loc location using the given saved source so that
18216
+ # it can be retrieved later.
18217
+ def save_content_loc(repository)
18218
+ repository.enter(node_id, :content_loc)
18219
+ end
18220
+
16502
18221
  # attr_reader closing_loc: Location
16503
18222
  def closing_loc
16504
18223
  location = @closing_loc
@@ -16506,6 +18225,12 @@ module Prism
16506
18225
  @closing_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
16507
18226
  end
16508
18227
 
18228
+ # Save the closing_loc location using the given saved source so that
18229
+ # it can be retrieved later.
18230
+ def save_closing_loc(repository)
18231
+ repository.enter(node_id, :closing_loc)
18232
+ end
18233
+
16509
18234
  # attr_reader unescaped: String
16510
18235
  attr_reader :unescaped
16511
18236
 
@@ -16610,6 +18335,12 @@ module Prism
16610
18335
  @keyword_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
16611
18336
  end
16612
18337
 
18338
+ # Save the keyword_loc location using the given saved source so that
18339
+ # it can be retrieved later.
18340
+ def save_keyword_loc(repository)
18341
+ repository.enter(node_id, :keyword_loc)
18342
+ end
18343
+
16613
18344
  # attr_reader lparen_loc: Location?
16614
18345
  def lparen_loc
16615
18346
  location = @lparen_loc
@@ -16623,6 +18354,12 @@ module Prism
16623
18354
  end
16624
18355
  end
16625
18356
 
18357
+ # Save the lparen_loc location using the given saved source so that
18358
+ # it can be retrieved later.
18359
+ def save_lparen_loc(repository)
18360
+ repository.enter(node_id, :lparen_loc) unless @lparen_loc.nil?
18361
+ end
18362
+
16626
18363
  # attr_reader arguments: ArgumentsNode?
16627
18364
  attr_reader :arguments
16628
18365
 
@@ -16639,6 +18376,12 @@ module Prism
16639
18376
  end
16640
18377
  end
16641
18378
 
18379
+ # Save the rparen_loc location using the given saved source so that
18380
+ # it can be retrieved later.
18381
+ def save_rparen_loc(repository)
18382
+ repository.enter(node_id, :rparen_loc) unless @rparen_loc.nil?
18383
+ end
18384
+
16642
18385
  # def keyword: () -> String
16643
18386
  def keyword
16644
18387
  keyword_loc.slice