jruby-prism-parser 0.24.0-java → 1.4.0-java

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.
Files changed (148) hide show
  1. checksums.yaml +4 -4
  2. data/BSDmakefile +58 -0
  3. data/CHANGELOG.md +269 -1
  4. data/CONTRIBUTING.md +0 -4
  5. data/Makefile +25 -18
  6. data/README.md +57 -6
  7. data/config.yml +1724 -140
  8. data/docs/build_system.md +39 -11
  9. data/docs/configuration.md +4 -0
  10. data/docs/cruby_compilation.md +1 -1
  11. data/docs/fuzzing.md +1 -1
  12. data/docs/parser_translation.md +14 -9
  13. data/docs/parsing_rules.md +4 -1
  14. data/docs/releasing.md +8 -10
  15. data/docs/relocation.md +34 -0
  16. data/docs/ripper_translation.md +72 -0
  17. data/docs/ruby_api.md +2 -1
  18. data/docs/serialization.md +29 -5
  19. data/ext/prism/api_node.c +3395 -1999
  20. data/ext/prism/api_pack.c +9 -0
  21. data/ext/prism/extconf.rb +55 -34
  22. data/ext/prism/extension.c +597 -346
  23. data/ext/prism/extension.h +6 -5
  24. data/include/prism/ast.h +2612 -455
  25. data/include/prism/defines.h +160 -2
  26. data/include/prism/diagnostic.h +188 -76
  27. data/include/prism/encoding.h +22 -4
  28. data/include/prism/node.h +89 -17
  29. data/include/prism/options.h +224 -12
  30. data/include/prism/pack.h +11 -0
  31. data/include/prism/parser.h +267 -66
  32. data/include/prism/prettyprint.h +8 -0
  33. data/include/prism/regexp.h +18 -8
  34. data/include/prism/static_literals.h +121 -0
  35. data/include/prism/util/pm_buffer.h +75 -2
  36. data/include/prism/util/pm_char.h +1 -2
  37. data/include/prism/util/pm_constant_pool.h +18 -9
  38. data/include/prism/util/pm_integer.h +126 -0
  39. data/include/prism/util/pm_list.h +1 -1
  40. data/include/prism/util/pm_newline_list.h +19 -0
  41. data/include/prism/util/pm_string.h +48 -8
  42. data/include/prism/version.h +3 -3
  43. data/include/prism.h +99 -5
  44. data/jruby-prism.jar +0 -0
  45. data/lib/prism/compiler.rb +11 -1
  46. data/lib/prism/desugar_compiler.rb +113 -74
  47. data/lib/prism/dispatcher.rb +45 -1
  48. data/lib/prism/dot_visitor.rb +201 -77
  49. data/lib/prism/dsl.rb +673 -461
  50. data/lib/prism/ffi.rb +233 -45
  51. data/lib/prism/inspect_visitor.rb +2389 -0
  52. data/lib/prism/lex_compat.rb +35 -16
  53. data/lib/prism/mutation_compiler.rb +24 -8
  54. data/lib/prism/node.rb +7731 -8460
  55. data/lib/prism/node_ext.rb +328 -32
  56. data/lib/prism/pack.rb +4 -0
  57. data/lib/prism/parse_result/comments.rb +34 -24
  58. data/lib/prism/parse_result/errors.rb +65 -0
  59. data/lib/prism/parse_result/newlines.rb +102 -12
  60. data/lib/prism/parse_result.rb +448 -44
  61. data/lib/prism/pattern.rb +28 -10
  62. data/lib/prism/polyfill/append_as_bytes.rb +15 -0
  63. data/lib/prism/polyfill/byteindex.rb +13 -0
  64. data/lib/prism/polyfill/unpack1.rb +14 -0
  65. data/lib/prism/reflection.rb +413 -0
  66. data/lib/prism/relocation.rb +504 -0
  67. data/lib/prism/serialize.rb +1940 -1198
  68. data/lib/prism/string_query.rb +30 -0
  69. data/lib/prism/translation/parser/builder.rb +61 -0
  70. data/lib/prism/translation/parser/compiler.rb +569 -195
  71. data/lib/prism/translation/parser/lexer.rb +516 -39
  72. data/lib/prism/translation/parser.rb +177 -12
  73. data/lib/prism/translation/parser33.rb +1 -1
  74. data/lib/prism/translation/parser34.rb +1 -1
  75. data/lib/prism/translation/parser35.rb +12 -0
  76. data/lib/prism/translation/ripper/sexp.rb +125 -0
  77. data/lib/prism/translation/ripper/shim.rb +5 -0
  78. data/lib/prism/translation/ripper.rb +3224 -462
  79. data/lib/prism/translation/ruby_parser.rb +194 -69
  80. data/lib/prism/translation.rb +4 -1
  81. data/lib/prism/version.rb +1 -1
  82. data/lib/prism/visitor.rb +13 -0
  83. data/lib/prism.rb +17 -27
  84. data/prism.gemspec +57 -17
  85. data/rbi/prism/compiler.rbi +12 -0
  86. data/rbi/prism/dsl.rbi +524 -0
  87. data/rbi/prism/inspect_visitor.rbi +12 -0
  88. data/rbi/prism/node.rbi +8722 -0
  89. data/rbi/prism/node_ext.rbi +107 -0
  90. data/rbi/prism/parse_result.rbi +404 -0
  91. data/rbi/prism/reflection.rbi +58 -0
  92. data/rbi/prism/string_query.rbi +12 -0
  93. data/rbi/prism/translation/parser.rbi +11 -0
  94. data/rbi/prism/translation/parser33.rbi +6 -0
  95. data/rbi/prism/translation/parser34.rbi +6 -0
  96. data/rbi/prism/translation/parser35.rbi +6 -0
  97. data/rbi/prism/translation/ripper.rbi +15 -0
  98. data/rbi/prism/visitor.rbi +473 -0
  99. data/rbi/prism.rbi +44 -7745
  100. data/sig/prism/compiler.rbs +9 -0
  101. data/sig/prism/dispatcher.rbs +16 -0
  102. data/sig/prism/dot_visitor.rbs +6 -0
  103. data/sig/prism/dsl.rbs +351 -0
  104. data/sig/prism/inspect_visitor.rbs +22 -0
  105. data/sig/prism/lex_compat.rbs +10 -0
  106. data/sig/prism/mutation_compiler.rbs +159 -0
  107. data/sig/prism/node.rbs +3614 -0
  108. data/sig/prism/node_ext.rbs +82 -0
  109. data/sig/prism/pack.rbs +43 -0
  110. data/sig/prism/parse_result.rbs +192 -0
  111. data/sig/prism/pattern.rbs +13 -0
  112. data/sig/prism/reflection.rbs +50 -0
  113. data/sig/prism/relocation.rbs +185 -0
  114. data/sig/prism/serialize.rbs +8 -0
  115. data/sig/prism/string_query.rbs +11 -0
  116. data/sig/prism/visitor.rbs +169 -0
  117. data/sig/prism.rbs +248 -4767
  118. data/src/diagnostic.c +672 -230
  119. data/src/encoding.c +211 -108
  120. data/src/node.c +7541 -1653
  121. data/src/options.c +135 -20
  122. data/src/pack.c +33 -17
  123. data/src/prettyprint.c +1543 -1485
  124. data/src/prism.c +7813 -3050
  125. data/src/regexp.c +225 -73
  126. data/src/serialize.c +101 -77
  127. data/src/static_literals.c +617 -0
  128. data/src/token_type.c +14 -13
  129. data/src/util/pm_buffer.c +187 -20
  130. data/src/util/pm_char.c +5 -5
  131. data/src/util/pm_constant_pool.c +39 -19
  132. data/src/util/pm_integer.c +670 -0
  133. data/src/util/pm_list.c +1 -1
  134. data/src/util/pm_newline_list.c +43 -5
  135. data/src/util/pm_string.c +213 -33
  136. data/src/util/pm_strncasecmp.c +13 -1
  137. data/src/util/pm_strpbrk.c +32 -6
  138. metadata +55 -19
  139. data/docs/ripper.md +0 -36
  140. data/include/prism/util/pm_state_stack.h +0 -42
  141. data/include/prism/util/pm_string_list.h +0 -44
  142. data/lib/prism/debug.rb +0 -206
  143. data/lib/prism/node_inspector.rb +0 -68
  144. data/lib/prism/translation/parser/rubocop.rb +0 -45
  145. data/rbi/prism_static.rbi +0 -207
  146. data/sig/prism_static.rbs +0 -201
  147. data/src/util/pm_state_stack.c +0 -25
  148. data/src/util/pm_string_list.c +0 -28
@@ -0,0 +1,3614 @@
1
+ # This file is generated by the templates/template.rb script and should not be
2
+ # modified manually. See templates/sig/prism/node.rbs.erb
3
+ # if you are looking to modify the template
4
+
5
+ module Prism
6
+ # Methods implemented on every subclass of a singleton of Node
7
+ interface _NodeSingleton
8
+ def type: () -> Symbol
9
+ end
10
+
11
+ class Node
12
+ extend _NodeSingleton
13
+
14
+ attr_reader source: Source
15
+ attr_reader node_id: Integer
16
+ attr_reader location: Location
17
+ attr_reader flags: Integer
18
+
19
+ def newline?: () -> bool
20
+ def static_literal?: () -> bool
21
+
22
+ def start_offset: () -> Integer
23
+ def end_offset: () -> Integer
24
+ def source_lines: () -> Array[String]
25
+ alias script_lines source_lines
26
+ def slice: () -> String
27
+ def slice_lines: () -> String
28
+ def pretty_print: (untyped q) -> untyped
29
+ def to_dot: () -> String
30
+ def tunnel: (Integer line, Integer column) -> Array[Prism::node]
31
+ def breadth_first_search: () { (Prism::node) -> bool } -> Prism::node?
32
+ def deprecated: (*String) -> void
33
+ def newline!: (Array[untyped]) -> void
34
+ end
35
+
36
+ type node_singleton = singleton(Node) & _NodeSingleton
37
+
38
+ # Methods implemented by every subclass of Node
39
+ interface _Node
40
+ def accept: (_Visitor) -> void
41
+ def child_nodes: () -> Array[Prism::node?]
42
+ def deconstruct: () -> Array[Prism::node?]
43
+ def compact_child_nodes: () -> Array[Prism::node]
44
+ def comment_targets: () -> Array[Prism::node | Location]
45
+ def fields: () -> Array[Prism::Reflection::Field]
46
+ def inspect: () -> String
47
+ def type: () -> Symbol
48
+ end
49
+
50
+ type node = Node & _Node
51
+
52
+
53
+ # Represents the use of the `alias` keyword to alias a global variable.
54
+ #
55
+ # alias $foo $bar
56
+ # ^^^^^^^^^^^^^^^
57
+ class AliasGlobalVariableNode < Node
58
+ include _Node
59
+
60
+ attr_reader new_name: GlobalVariableReadNode | BackReferenceReadNode | NumberedReferenceReadNode
61
+ attr_reader old_name: GlobalVariableReadNode | BackReferenceReadNode | NumberedReferenceReadNode
62
+ attr_reader keyword_loc: Location
63
+
64
+ def initialize: (Source source, Integer node_id, Location location, Integer flags, GlobalVariableReadNode | BackReferenceReadNode | NumberedReferenceReadNode new_name, GlobalVariableReadNode | BackReferenceReadNode | NumberedReferenceReadNode old_name, Location keyword_loc) -> void
65
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?new_name: GlobalVariableReadNode | BackReferenceReadNode | NumberedReferenceReadNode, ?old_name: GlobalVariableReadNode | BackReferenceReadNode | NumberedReferenceReadNode, ?keyword_loc: Location) -> AliasGlobalVariableNode
66
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, new_name: GlobalVariableReadNode | BackReferenceReadNode | NumberedReferenceReadNode, old_name: GlobalVariableReadNode | BackReferenceReadNode | NumberedReferenceReadNode, keyword_loc: Location }
67
+ def keyword: () -> String
68
+ def type: () -> :alias_global_variable_node
69
+ | ...
70
+ def self.type: () -> :alias_global_variable_node
71
+ end
72
+
73
+ # Represents the use of the `alias` keyword to alias a method.
74
+ #
75
+ # alias foo bar
76
+ # ^^^^^^^^^^^^^
77
+ class AliasMethodNode < Node
78
+ include _Node
79
+
80
+ attr_reader new_name: SymbolNode | InterpolatedSymbolNode
81
+ attr_reader old_name: SymbolNode | InterpolatedSymbolNode
82
+ attr_reader keyword_loc: Location
83
+
84
+ def initialize: (Source source, Integer node_id, Location location, Integer flags, SymbolNode | InterpolatedSymbolNode new_name, SymbolNode | InterpolatedSymbolNode old_name, Location keyword_loc) -> void
85
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?new_name: SymbolNode | InterpolatedSymbolNode, ?old_name: SymbolNode | InterpolatedSymbolNode, ?keyword_loc: Location) -> AliasMethodNode
86
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, new_name: SymbolNode | InterpolatedSymbolNode, old_name: SymbolNode | InterpolatedSymbolNode, keyword_loc: Location }
87
+ def keyword: () -> String
88
+ def type: () -> :alias_method_node
89
+ | ...
90
+ def self.type: () -> :alias_method_node
91
+ end
92
+
93
+ # Represents an alternation pattern in pattern matching.
94
+ #
95
+ # foo => bar | baz
96
+ # ^^^^^^^^^
97
+ class AlternationPatternNode < Node
98
+ include _Node
99
+
100
+ attr_reader left: Prism::node
101
+ attr_reader right: Prism::node
102
+ attr_reader operator_loc: Location
103
+
104
+ def initialize: (Source source, Integer node_id, Location location, Integer flags, Prism::node left, Prism::node right, Location operator_loc) -> void
105
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?left: Prism::node, ?right: Prism::node, ?operator_loc: Location) -> AlternationPatternNode
106
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, left: Prism::node, right: Prism::node, operator_loc: Location }
107
+ def operator: () -> String
108
+ def type: () -> :alternation_pattern_node
109
+ | ...
110
+ def self.type: () -> :alternation_pattern_node
111
+ end
112
+
113
+ # Represents the use of the `&&` operator or the `and` keyword.
114
+ #
115
+ # left and right
116
+ # ^^^^^^^^^^^^^^
117
+ class AndNode < Node
118
+ include _Node
119
+
120
+ attr_reader left: Prism::node
121
+ attr_reader right: Prism::node
122
+ attr_reader operator_loc: Location
123
+
124
+ def initialize: (Source source, Integer node_id, Location location, Integer flags, Prism::node left, Prism::node right, Location operator_loc) -> void
125
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?left: Prism::node, ?right: Prism::node, ?operator_loc: Location) -> AndNode
126
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, left: Prism::node, right: Prism::node, operator_loc: Location }
127
+ def operator: () -> String
128
+ def type: () -> :and_node
129
+ | ...
130
+ def self.type: () -> :and_node
131
+ end
132
+
133
+ # Represents a set of arguments to a method or a keyword.
134
+ #
135
+ # return foo, bar, baz
136
+ # ^^^^^^^^^^^^^
137
+ class ArgumentsNode < Node
138
+ include _Node
139
+
140
+ def contains_forwarding?: () -> bool
141
+ def contains_keywords?: () -> bool
142
+ def contains_keyword_splat?: () -> bool
143
+ def contains_splat?: () -> bool
144
+ def contains_multiple_splats?: () -> bool
145
+
146
+ attr_reader arguments: Array[Prism::node]
147
+
148
+ def initialize: (Source source, Integer node_id, Location location, Integer flags, Array[Prism::node] arguments) -> void
149
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?arguments: Array[Prism::node]) -> ArgumentsNode
150
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, arguments: Array[Prism::node] }
151
+ def type: () -> :arguments_node
152
+ | ...
153
+ def self.type: () -> :arguments_node
154
+ end
155
+
156
+ # Represents an array literal. This can be a regular array using brackets or a special array using % like %w or %i.
157
+ #
158
+ # [1, 2, 3]
159
+ # ^^^^^^^^^
160
+ class ArrayNode < Node
161
+ include _Node
162
+
163
+ def contains_splat?: () -> bool
164
+
165
+ attr_reader elements: Array[Prism::node]
166
+ attr_reader opening_loc: Location?
167
+ attr_reader closing_loc: Location?
168
+
169
+ def initialize: (Source source, Integer node_id, Location location, Integer flags, Array[Prism::node] elements, Location? opening_loc, Location? closing_loc) -> void
170
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?elements: Array[Prism::node], ?opening_loc: Location?, ?closing_loc: Location?) -> ArrayNode
171
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, elements: Array[Prism::node], opening_loc: Location?, closing_loc: Location? }
172
+ def opening: () -> String?
173
+ def closing: () -> String?
174
+ def type: () -> :array_node
175
+ | ...
176
+ def self.type: () -> :array_node
177
+ end
178
+
179
+ # Represents an array pattern in pattern matching.
180
+ #
181
+ # foo in 1, 2
182
+ # ^^^^^^^^^^^
183
+ #
184
+ # foo in [1, 2]
185
+ # ^^^^^^^^^^^^^
186
+ #
187
+ # foo in *bar
188
+ # ^^^^^^^^^^^
189
+ #
190
+ # foo in Bar[]
191
+ # ^^^^^^^^^^^^
192
+ #
193
+ # foo in Bar[1, 2, 3]
194
+ # ^^^^^^^^^^^^^^^^^^^
195
+ class ArrayPatternNode < Node
196
+ include _Node
197
+
198
+ attr_reader constant: ConstantReadNode | ConstantPathNode | nil
199
+ attr_reader requireds: Array[Prism::node]
200
+ attr_reader rest: Prism::node?
201
+ attr_reader posts: Array[Prism::node]
202
+ attr_reader opening_loc: Location?
203
+ attr_reader closing_loc: Location?
204
+
205
+ def initialize: (Source source, Integer node_id, Location location, Integer flags, ConstantReadNode | ConstantPathNode | nil constant, Array[Prism::node] requireds, Prism::node? rest, Array[Prism::node] posts, Location? opening_loc, Location? closing_loc) -> void
206
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?constant: ConstantReadNode | ConstantPathNode | nil, ?requireds: Array[Prism::node], ?rest: Prism::node?, ?posts: Array[Prism::node], ?opening_loc: Location?, ?closing_loc: Location?) -> ArrayPatternNode
207
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, constant: ConstantReadNode | ConstantPathNode | nil, requireds: Array[Prism::node], rest: Prism::node?, posts: Array[Prism::node], opening_loc: Location?, closing_loc: Location? }
208
+ def opening: () -> String?
209
+ def closing: () -> String?
210
+ def type: () -> :array_pattern_node
211
+ | ...
212
+ def self.type: () -> :array_pattern_node
213
+ end
214
+
215
+ # Represents a hash key/value pair.
216
+ #
217
+ # { a => b }
218
+ # ^^^^^^
219
+ class AssocNode < Node
220
+ include _Node
221
+
222
+ attr_reader key: Prism::node
223
+ attr_reader value: Prism::node
224
+ attr_reader operator_loc: Location?
225
+
226
+ def initialize: (Source source, Integer node_id, Location location, Integer flags, Prism::node key, Prism::node value, Location? operator_loc) -> void
227
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?key: Prism::node, ?value: Prism::node, ?operator_loc: Location?) -> AssocNode
228
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, key: Prism::node, value: Prism::node, operator_loc: Location? }
229
+ def operator: () -> String?
230
+ def type: () -> :assoc_node
231
+ | ...
232
+ def self.type: () -> :assoc_node
233
+ end
234
+
235
+ # Represents a splat in a hash literal.
236
+ #
237
+ # { **foo }
238
+ # ^^^^^
239
+ class AssocSplatNode < Node
240
+ include _Node
241
+
242
+ attr_reader value: Prism::node?
243
+ attr_reader operator_loc: Location
244
+
245
+ def initialize: (Source source, Integer node_id, Location location, Integer flags, Prism::node? value, Location operator_loc) -> void
246
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?value: Prism::node?, ?operator_loc: Location) -> AssocSplatNode
247
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, value: Prism::node?, operator_loc: Location }
248
+ def operator: () -> String
249
+ def type: () -> :assoc_splat_node
250
+ | ...
251
+ def self.type: () -> :assoc_splat_node
252
+ end
253
+
254
+ # Represents reading a reference to a field in the previous match.
255
+ #
256
+ # $'
257
+ # ^^
258
+ class BackReferenceReadNode < Node
259
+ include _Node
260
+
261
+ attr_reader name: Symbol
262
+
263
+ def initialize: (Source source, Integer node_id, Location location, Integer flags, Symbol name) -> void
264
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol) -> BackReferenceReadNode
265
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol }
266
+ def type: () -> :back_reference_read_node
267
+ | ...
268
+ def self.type: () -> :back_reference_read_node
269
+ end
270
+
271
+ # Represents a begin statement.
272
+ #
273
+ # begin
274
+ # foo
275
+ # end
276
+ # ^^^^^
277
+ class BeginNode < Node
278
+ include _Node
279
+
280
+ attr_reader begin_keyword_loc: Location?
281
+ attr_reader statements: StatementsNode?
282
+ attr_reader rescue_clause: RescueNode?
283
+ attr_reader else_clause: ElseNode?
284
+ attr_reader ensure_clause: EnsureNode?
285
+ attr_reader end_keyword_loc: Location?
286
+
287
+ def initialize: (Source source, Integer node_id, Location location, Integer flags, Location? begin_keyword_loc, StatementsNode? statements, RescueNode? rescue_clause, ElseNode? else_clause, EnsureNode? ensure_clause, Location? end_keyword_loc) -> void
288
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?begin_keyword_loc: Location?, ?statements: StatementsNode?, ?rescue_clause: RescueNode?, ?else_clause: ElseNode?, ?ensure_clause: EnsureNode?, ?end_keyword_loc: Location?) -> BeginNode
289
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, begin_keyword_loc: Location?, statements: StatementsNode?, rescue_clause: RescueNode?, else_clause: ElseNode?, ensure_clause: EnsureNode?, end_keyword_loc: Location? }
290
+ def begin_keyword: () -> String?
291
+ def end_keyword: () -> String?
292
+ def type: () -> :begin_node
293
+ | ...
294
+ def self.type: () -> :begin_node
295
+ end
296
+
297
+ # Represents a block argument using `&`.
298
+ #
299
+ # bar(&args)
300
+ # ^^^^^^^^^^
301
+ class BlockArgumentNode < Node
302
+ include _Node
303
+
304
+ attr_reader expression: Prism::node?
305
+ attr_reader operator_loc: Location
306
+
307
+ def initialize: (Source source, Integer node_id, Location location, Integer flags, Prism::node? expression, Location operator_loc) -> void
308
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?expression: Prism::node?, ?operator_loc: Location) -> BlockArgumentNode
309
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, expression: Prism::node?, operator_loc: Location }
310
+ def operator: () -> String
311
+ def type: () -> :block_argument_node
312
+ | ...
313
+ def self.type: () -> :block_argument_node
314
+ end
315
+
316
+ # Represents a block local variable.
317
+ #
318
+ # a { |; b| }
319
+ # ^
320
+ class BlockLocalVariableNode < Node
321
+ include _Node
322
+
323
+ def repeated_parameter?: () -> bool
324
+
325
+ attr_reader name: Symbol
326
+
327
+ def initialize: (Source source, Integer node_id, Location location, Integer flags, Symbol name) -> void
328
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol) -> BlockLocalVariableNode
329
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol }
330
+ def type: () -> :block_local_variable_node
331
+ | ...
332
+ def self.type: () -> :block_local_variable_node
333
+ end
334
+
335
+ # Represents a block of ruby code.
336
+ #
337
+ # [1, 2, 3].each { |i| puts x }
338
+ # ^^^^^^^^^^^^^^
339
+ class BlockNode < Node
340
+ include _Node
341
+
342
+ attr_reader locals: Array[Symbol]
343
+ attr_reader parameters: BlockParametersNode | NumberedParametersNode | ItParametersNode | nil
344
+ attr_reader body: StatementsNode | BeginNode | nil
345
+ attr_reader opening_loc: Location
346
+ attr_reader closing_loc: Location
347
+
348
+ def initialize: (Source source, Integer node_id, Location location, Integer flags, Array[Symbol] locals, BlockParametersNode | NumberedParametersNode | ItParametersNode | nil parameters, StatementsNode | BeginNode | nil body, Location opening_loc, Location closing_loc) -> void
349
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?locals: Array[Symbol], ?parameters: BlockParametersNode | NumberedParametersNode | ItParametersNode | nil, ?body: StatementsNode | BeginNode | nil, ?opening_loc: Location, ?closing_loc: Location) -> BlockNode
350
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, locals: Array[Symbol], parameters: BlockParametersNode | NumberedParametersNode | ItParametersNode | nil, body: StatementsNode | BeginNode | nil, opening_loc: Location, closing_loc: Location }
351
+ def opening: () -> String
352
+ def closing: () -> String
353
+ def type: () -> :block_node
354
+ | ...
355
+ def self.type: () -> :block_node
356
+ end
357
+
358
+ # Represents a block parameter of a method, block, or lambda definition.
359
+ #
360
+ # def a(&b)
361
+ # ^^
362
+ # end
363
+ class BlockParameterNode < Node
364
+ include _Node
365
+
366
+ def repeated_parameter?: () -> bool
367
+
368
+ attr_reader name: Symbol?
369
+ attr_reader name_loc: Location?
370
+ attr_reader operator_loc: Location
371
+
372
+ def initialize: (Source source, Integer node_id, Location location, Integer flags, Symbol? name, Location? name_loc, Location operator_loc) -> void
373
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol?, ?name_loc: Location?, ?operator_loc: Location) -> BlockParameterNode
374
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol?, name_loc: Location?, operator_loc: Location }
375
+ def operator: () -> String
376
+ def type: () -> :block_parameter_node
377
+ | ...
378
+ def self.type: () -> :block_parameter_node
379
+ end
380
+
381
+ # Represents a block's parameters declaration.
382
+ #
383
+ # -> (a, b = 1; local) { }
384
+ # ^^^^^^^^^^^^^^^^^
385
+ #
386
+ # foo do |a, b = 1; local|
387
+ # ^^^^^^^^^^^^^^^^^
388
+ # end
389
+ class BlockParametersNode < Node
390
+ include _Node
391
+
392
+ attr_reader parameters: ParametersNode?
393
+ attr_reader locals: Array[BlockLocalVariableNode]
394
+ attr_reader opening_loc: Location?
395
+ attr_reader closing_loc: Location?
396
+
397
+ def initialize: (Source source, Integer node_id, Location location, Integer flags, ParametersNode? parameters, Array[BlockLocalVariableNode] locals, Location? opening_loc, Location? closing_loc) -> void
398
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?parameters: ParametersNode?, ?locals: Array[BlockLocalVariableNode], ?opening_loc: Location?, ?closing_loc: Location?) -> BlockParametersNode
399
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, parameters: ParametersNode?, locals: Array[BlockLocalVariableNode], opening_loc: Location?, closing_loc: Location? }
400
+ def opening: () -> String?
401
+ def closing: () -> String?
402
+ def type: () -> :block_parameters_node
403
+ | ...
404
+ def self.type: () -> :block_parameters_node
405
+ end
406
+
407
+ # Represents the use of the `break` keyword.
408
+ #
409
+ # break foo
410
+ # ^^^^^^^^^
411
+ class BreakNode < Node
412
+ include _Node
413
+
414
+ attr_reader arguments: ArgumentsNode?
415
+ attr_reader keyword_loc: Location
416
+
417
+ def initialize: (Source source, Integer node_id, Location location, Integer flags, ArgumentsNode? arguments, Location keyword_loc) -> void
418
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?arguments: ArgumentsNode?, ?keyword_loc: Location) -> BreakNode
419
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, arguments: ArgumentsNode?, keyword_loc: Location }
420
+ def keyword: () -> String
421
+ def type: () -> :break_node
422
+ | ...
423
+ def self.type: () -> :break_node
424
+ end
425
+
426
+ # Represents the use of the `&&=` operator on a call.
427
+ #
428
+ # foo.bar &&= value
429
+ # ^^^^^^^^^^^^^^^^^
430
+ class CallAndWriteNode < Node
431
+ include _Node
432
+
433
+ def safe_navigation?: () -> bool
434
+ def variable_call?: () -> bool
435
+ def attribute_write?: () -> bool
436
+ def ignore_visibility?: () -> bool
437
+
438
+ attr_reader receiver: Prism::node?
439
+ attr_reader call_operator_loc: Location?
440
+ attr_reader message_loc: Location?
441
+ attr_reader read_name: Symbol
442
+ attr_reader write_name: Symbol
443
+ attr_reader operator_loc: Location
444
+ attr_reader value: Prism::node
445
+
446
+ def initialize: (Source source, Integer node_id, Location location, Integer flags, Prism::node? receiver, Location? call_operator_loc, Location? message_loc, Symbol read_name, Symbol write_name, Location operator_loc, Prism::node value) -> void
447
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?receiver: Prism::node?, ?call_operator_loc: Location?, ?message_loc: Location?, ?read_name: Symbol, ?write_name: Symbol, ?operator_loc: Location, ?value: Prism::node) -> CallAndWriteNode
448
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, receiver: Prism::node?, call_operator_loc: Location?, message_loc: Location?, read_name: Symbol, write_name: Symbol, operator_loc: Location, value: Prism::node }
449
+ def call_operator: () -> String?
450
+ def message: () -> String?
451
+ def operator: () -> String
452
+ def type: () -> :call_and_write_node
453
+ | ...
454
+ def self.type: () -> :call_and_write_node
455
+ end
456
+
457
+ # Represents a method call, in all of the various forms that can take.
458
+ #
459
+ # foo
460
+ # ^^^
461
+ #
462
+ # foo()
463
+ # ^^^^^
464
+ #
465
+ # +foo
466
+ # ^^^^
467
+ #
468
+ # foo + bar
469
+ # ^^^^^^^^^
470
+ #
471
+ # foo.bar
472
+ # ^^^^^^^
473
+ #
474
+ # foo&.bar
475
+ # ^^^^^^^^
476
+ class CallNode < Node
477
+ include _Node
478
+
479
+ def safe_navigation?: () -> bool
480
+ def variable_call?: () -> bool
481
+ def attribute_write?: () -> bool
482
+ def ignore_visibility?: () -> bool
483
+
484
+ attr_reader receiver: Prism::node?
485
+ attr_reader call_operator_loc: Location?
486
+ attr_reader name: Symbol
487
+ attr_reader message_loc: Location?
488
+ attr_reader opening_loc: Location?
489
+ attr_reader arguments: ArgumentsNode?
490
+ attr_reader closing_loc: Location?
491
+ attr_reader block: BlockNode | BlockArgumentNode | nil
492
+
493
+ def initialize: (Source source, Integer node_id, Location location, Integer flags, Prism::node? receiver, Location? call_operator_loc, Symbol name, Location? message_loc, Location? opening_loc, ArgumentsNode? arguments, Location? closing_loc, BlockNode | BlockArgumentNode | nil block) -> void
494
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?receiver: Prism::node?, ?call_operator_loc: Location?, ?name: Symbol, ?message_loc: Location?, ?opening_loc: Location?, ?arguments: ArgumentsNode?, ?closing_loc: Location?, ?block: BlockNode | BlockArgumentNode | nil) -> CallNode
495
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, receiver: Prism::node?, call_operator_loc: Location?, name: Symbol, message_loc: Location?, opening_loc: Location?, arguments: ArgumentsNode?, closing_loc: Location?, block: BlockNode | BlockArgumentNode | nil }
496
+ def call_operator: () -> String?
497
+ def message: () -> String?
498
+ def opening: () -> String?
499
+ def closing: () -> String?
500
+ def type: () -> :call_node
501
+ | ...
502
+ def self.type: () -> :call_node
503
+ end
504
+
505
+ # Represents the use of an assignment operator on a call.
506
+ #
507
+ # foo.bar += baz
508
+ # ^^^^^^^^^^^^^^
509
+ class CallOperatorWriteNode < Node
510
+ include _Node
511
+
512
+ def safe_navigation?: () -> bool
513
+ def variable_call?: () -> bool
514
+ def attribute_write?: () -> bool
515
+ def ignore_visibility?: () -> bool
516
+
517
+ attr_reader receiver: Prism::node?
518
+ attr_reader call_operator_loc: Location?
519
+ attr_reader message_loc: Location?
520
+ attr_reader read_name: Symbol
521
+ attr_reader write_name: Symbol
522
+ attr_reader binary_operator: Symbol
523
+ attr_reader binary_operator_loc: Location
524
+ attr_reader value: Prism::node
525
+
526
+ def initialize: (Source source, Integer node_id, Location location, Integer flags, Prism::node? receiver, Location? call_operator_loc, Location? message_loc, Symbol read_name, Symbol write_name, Symbol binary_operator, Location binary_operator_loc, Prism::node value) -> void
527
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?receiver: Prism::node?, ?call_operator_loc: Location?, ?message_loc: Location?, ?read_name: Symbol, ?write_name: Symbol, ?binary_operator: Symbol, ?binary_operator_loc: Location, ?value: Prism::node) -> CallOperatorWriteNode
528
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, receiver: Prism::node?, call_operator_loc: Location?, message_loc: Location?, read_name: Symbol, write_name: Symbol, binary_operator: Symbol, binary_operator_loc: Location, value: Prism::node }
529
+ def call_operator: () -> String?
530
+ def message: () -> String?
531
+ def type: () -> :call_operator_write_node
532
+ | ...
533
+ def self.type: () -> :call_operator_write_node
534
+ end
535
+
536
+ # Represents the use of the `||=` operator on a call.
537
+ #
538
+ # foo.bar ||= value
539
+ # ^^^^^^^^^^^^^^^^^
540
+ class CallOrWriteNode < Node
541
+ include _Node
542
+
543
+ def safe_navigation?: () -> bool
544
+ def variable_call?: () -> bool
545
+ def attribute_write?: () -> bool
546
+ def ignore_visibility?: () -> bool
547
+
548
+ attr_reader receiver: Prism::node?
549
+ attr_reader call_operator_loc: Location?
550
+ attr_reader message_loc: Location?
551
+ attr_reader read_name: Symbol
552
+ attr_reader write_name: Symbol
553
+ attr_reader operator_loc: Location
554
+ attr_reader value: Prism::node
555
+
556
+ def initialize: (Source source, Integer node_id, Location location, Integer flags, Prism::node? receiver, Location? call_operator_loc, Location? message_loc, Symbol read_name, Symbol write_name, Location operator_loc, Prism::node value) -> void
557
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?receiver: Prism::node?, ?call_operator_loc: Location?, ?message_loc: Location?, ?read_name: Symbol, ?write_name: Symbol, ?operator_loc: Location, ?value: Prism::node) -> CallOrWriteNode
558
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, receiver: Prism::node?, call_operator_loc: Location?, message_loc: Location?, read_name: Symbol, write_name: Symbol, operator_loc: Location, value: Prism::node }
559
+ def call_operator: () -> String?
560
+ def message: () -> String?
561
+ def operator: () -> String
562
+ def type: () -> :call_or_write_node
563
+ | ...
564
+ def self.type: () -> :call_or_write_node
565
+ end
566
+
567
+ # Represents assigning to a method call.
568
+ #
569
+ # foo.bar, = 1
570
+ # ^^^^^^^
571
+ #
572
+ # begin
573
+ # rescue => foo.bar
574
+ # ^^^^^^^
575
+ # end
576
+ #
577
+ # for foo.bar in baz do end
578
+ # ^^^^^^^
579
+ class CallTargetNode < Node
580
+ include _Node
581
+
582
+ def safe_navigation?: () -> bool
583
+ def variable_call?: () -> bool
584
+ def attribute_write?: () -> bool
585
+ def ignore_visibility?: () -> bool
586
+
587
+ attr_reader receiver: Prism::node
588
+ attr_reader call_operator_loc: Location
589
+ attr_reader name: Symbol
590
+ attr_reader message_loc: Location
591
+
592
+ def initialize: (Source source, Integer node_id, Location location, Integer flags, Prism::node receiver, Location call_operator_loc, Symbol name, Location message_loc) -> void
593
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?receiver: Prism::node, ?call_operator_loc: Location, ?name: Symbol, ?message_loc: Location) -> CallTargetNode
594
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, receiver: Prism::node, call_operator_loc: Location, name: Symbol, message_loc: Location }
595
+ def call_operator: () -> String
596
+ def message: () -> String
597
+ def type: () -> :call_target_node
598
+ | ...
599
+ def self.type: () -> :call_target_node
600
+ end
601
+
602
+ # Represents assigning to a local variable in pattern matching.
603
+ #
604
+ # foo => [bar => baz]
605
+ # ^^^^^^^^^^^^
606
+ class CapturePatternNode < Node
607
+ include _Node
608
+
609
+ attr_reader value: Prism::node
610
+ attr_reader target: LocalVariableTargetNode
611
+ attr_reader operator_loc: Location
612
+
613
+ def initialize: (Source source, Integer node_id, Location location, Integer flags, Prism::node value, LocalVariableTargetNode target, Location operator_loc) -> void
614
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?value: Prism::node, ?target: LocalVariableTargetNode, ?operator_loc: Location) -> CapturePatternNode
615
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, value: Prism::node, target: LocalVariableTargetNode, operator_loc: Location }
616
+ def operator: () -> String
617
+ def type: () -> :capture_pattern_node
618
+ | ...
619
+ def self.type: () -> :capture_pattern_node
620
+ end
621
+
622
+ # Represents the use of a case statement for pattern matching.
623
+ #
624
+ # case true
625
+ # in false
626
+ # end
627
+ # ^^^^^^^^^
628
+ class CaseMatchNode < Node
629
+ include _Node
630
+
631
+ attr_reader predicate: Prism::node?
632
+ attr_reader conditions: Array[InNode]
633
+ attr_reader else_clause: ElseNode?
634
+ attr_reader case_keyword_loc: Location
635
+ attr_reader end_keyword_loc: Location
636
+
637
+ def initialize: (Source source, Integer node_id, Location location, Integer flags, Prism::node? predicate, Array[InNode] conditions, ElseNode? else_clause, Location case_keyword_loc, Location end_keyword_loc) -> void
638
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?predicate: Prism::node?, ?conditions: Array[InNode], ?else_clause: ElseNode?, ?case_keyword_loc: Location, ?end_keyword_loc: Location) -> CaseMatchNode
639
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, predicate: Prism::node?, conditions: Array[InNode], else_clause: ElseNode?, case_keyword_loc: Location, end_keyword_loc: Location }
640
+ def case_keyword: () -> String
641
+ def end_keyword: () -> String
642
+ def type: () -> :case_match_node
643
+ | ...
644
+ def self.type: () -> :case_match_node
645
+ end
646
+
647
+ # Represents the use of a case statement.
648
+ #
649
+ # case true
650
+ # when false
651
+ # end
652
+ # ^^^^^^^^^^
653
+ class CaseNode < Node
654
+ include _Node
655
+
656
+ attr_reader predicate: Prism::node?
657
+ attr_reader conditions: Array[WhenNode]
658
+ attr_reader else_clause: ElseNode?
659
+ attr_reader case_keyword_loc: Location
660
+ attr_reader end_keyword_loc: Location
661
+
662
+ def initialize: (Source source, Integer node_id, Location location, Integer flags, Prism::node? predicate, Array[WhenNode] conditions, ElseNode? else_clause, Location case_keyword_loc, Location end_keyword_loc) -> void
663
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?predicate: Prism::node?, ?conditions: Array[WhenNode], ?else_clause: ElseNode?, ?case_keyword_loc: Location, ?end_keyword_loc: Location) -> CaseNode
664
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, predicate: Prism::node?, conditions: Array[WhenNode], else_clause: ElseNode?, case_keyword_loc: Location, end_keyword_loc: Location }
665
+ def case_keyword: () -> String
666
+ def end_keyword: () -> String
667
+ def type: () -> :case_node
668
+ | ...
669
+ def self.type: () -> :case_node
670
+ end
671
+
672
+ # Represents a class declaration involving the `class` keyword.
673
+ #
674
+ # class Foo end
675
+ # ^^^^^^^^^^^^^
676
+ class ClassNode < Node
677
+ include _Node
678
+
679
+ attr_reader locals: Array[Symbol]
680
+ attr_reader class_keyword_loc: Location
681
+ attr_reader constant_path: ConstantReadNode | ConstantPathNode
682
+ attr_reader inheritance_operator_loc: Location?
683
+ attr_reader superclass: Prism::node?
684
+ attr_reader body: StatementsNode | BeginNode | nil
685
+ attr_reader end_keyword_loc: Location
686
+ attr_reader name: Symbol
687
+
688
+ def initialize: (Source source, Integer node_id, Location location, Integer flags, Array[Symbol] locals, Location class_keyword_loc, ConstantReadNode | ConstantPathNode constant_path, Location? inheritance_operator_loc, Prism::node? superclass, StatementsNode | BeginNode | nil body, Location end_keyword_loc, Symbol name) -> void
689
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?locals: Array[Symbol], ?class_keyword_loc: Location, ?constant_path: ConstantReadNode | ConstantPathNode, ?inheritance_operator_loc: Location?, ?superclass: Prism::node?, ?body: StatementsNode | BeginNode | nil, ?end_keyword_loc: Location, ?name: Symbol) -> ClassNode
690
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, locals: Array[Symbol], class_keyword_loc: Location, constant_path: ConstantReadNode | ConstantPathNode, inheritance_operator_loc: Location?, superclass: Prism::node?, body: StatementsNode | BeginNode | nil, end_keyword_loc: Location, name: Symbol }
691
+ def class_keyword: () -> String
692
+ def inheritance_operator: () -> String?
693
+ def end_keyword: () -> String
694
+ def type: () -> :class_node
695
+ | ...
696
+ def self.type: () -> :class_node
697
+ end
698
+
699
+ # Represents the use of the `&&=` operator for assignment to a class variable.
700
+ #
701
+ # @@target &&= value
702
+ # ^^^^^^^^^^^^^^^^^^
703
+ class ClassVariableAndWriteNode < Node
704
+ include _Node
705
+
706
+ attr_reader name: Symbol
707
+ attr_reader name_loc: Location
708
+ attr_reader operator_loc: Location
709
+ attr_reader value: Prism::node
710
+
711
+ def initialize: (Source source, Integer node_id, Location location, Integer flags, Symbol name, Location name_loc, Location operator_loc, Prism::node value) -> void
712
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node) -> ClassVariableAndWriteNode
713
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol, name_loc: Location, operator_loc: Location, value: Prism::node }
714
+ def operator: () -> String
715
+ def type: () -> :class_variable_and_write_node
716
+ | ...
717
+ def self.type: () -> :class_variable_and_write_node
718
+ end
719
+
720
+ # Represents assigning to a class variable using an operator that isn't `=`.
721
+ #
722
+ # @@target += value
723
+ # ^^^^^^^^^^^^^^^^^
724
+ class ClassVariableOperatorWriteNode < Node
725
+ include _Node
726
+
727
+ attr_reader name: Symbol
728
+ attr_reader name_loc: Location
729
+ attr_reader binary_operator_loc: Location
730
+ attr_reader value: Prism::node
731
+ attr_reader binary_operator: Symbol
732
+
733
+ def initialize: (Source source, Integer node_id, Location location, Integer flags, Symbol name, Location name_loc, Location binary_operator_loc, Prism::node value, Symbol binary_operator) -> void
734
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?binary_operator_loc: Location, ?value: Prism::node, ?binary_operator: Symbol) -> ClassVariableOperatorWriteNode
735
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol, name_loc: Location, binary_operator_loc: Location, value: Prism::node, binary_operator: Symbol }
736
+ def type: () -> :class_variable_operator_write_node
737
+ | ...
738
+ def self.type: () -> :class_variable_operator_write_node
739
+ end
740
+
741
+ # Represents the use of the `||=` operator for assignment to a class variable.
742
+ #
743
+ # @@target ||= value
744
+ # ^^^^^^^^^^^^^^^^^^
745
+ class ClassVariableOrWriteNode < Node
746
+ include _Node
747
+
748
+ attr_reader name: Symbol
749
+ attr_reader name_loc: Location
750
+ attr_reader operator_loc: Location
751
+ attr_reader value: Prism::node
752
+
753
+ def initialize: (Source source, Integer node_id, Location location, Integer flags, Symbol name, Location name_loc, Location operator_loc, Prism::node value) -> void
754
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node) -> ClassVariableOrWriteNode
755
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol, name_loc: Location, operator_loc: Location, value: Prism::node }
756
+ def operator: () -> String
757
+ def type: () -> :class_variable_or_write_node
758
+ | ...
759
+ def self.type: () -> :class_variable_or_write_node
760
+ end
761
+
762
+ # Represents referencing a class variable.
763
+ #
764
+ # @@foo
765
+ # ^^^^^
766
+ class ClassVariableReadNode < Node
767
+ include _Node
768
+
769
+ attr_reader name: Symbol
770
+
771
+ def initialize: (Source source, Integer node_id, Location location, Integer flags, Symbol name) -> void
772
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol) -> ClassVariableReadNode
773
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol }
774
+ def type: () -> :class_variable_read_node
775
+ | ...
776
+ def self.type: () -> :class_variable_read_node
777
+ end
778
+
779
+ # Represents writing to a class variable in a context that doesn't have an explicit value.
780
+ #
781
+ # @@foo, @@bar = baz
782
+ # ^^^^^ ^^^^^
783
+ class ClassVariableTargetNode < Node
784
+ include _Node
785
+
786
+ attr_reader name: Symbol
787
+
788
+ def initialize: (Source source, Integer node_id, Location location, Integer flags, Symbol name) -> void
789
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol) -> ClassVariableTargetNode
790
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol }
791
+ def type: () -> :class_variable_target_node
792
+ | ...
793
+ def self.type: () -> :class_variable_target_node
794
+ end
795
+
796
+ # Represents writing to a class variable.
797
+ #
798
+ # @@foo = 1
799
+ # ^^^^^^^^^
800
+ class ClassVariableWriteNode < Node
801
+ include _Node
802
+
803
+ attr_reader name: Symbol
804
+ attr_reader name_loc: Location
805
+ attr_reader value: Prism::node
806
+ attr_reader operator_loc: Location
807
+
808
+ def initialize: (Source source, Integer node_id, Location location, Integer flags, Symbol name, Location name_loc, Prism::node value, Location operator_loc) -> void
809
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?value: Prism::node, ?operator_loc: Location) -> ClassVariableWriteNode
810
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol, name_loc: Location, value: Prism::node, operator_loc: Location }
811
+ def operator: () -> String
812
+ def type: () -> :class_variable_write_node
813
+ | ...
814
+ def self.type: () -> :class_variable_write_node
815
+ end
816
+
817
+ # Represents the use of the `&&=` operator for assignment to a constant.
818
+ #
819
+ # Target &&= value
820
+ # ^^^^^^^^^^^^^^^^
821
+ class ConstantAndWriteNode < Node
822
+ include _Node
823
+
824
+ attr_reader name: Symbol
825
+ attr_reader name_loc: Location
826
+ attr_reader operator_loc: Location
827
+ attr_reader value: Prism::node
828
+
829
+ def initialize: (Source source, Integer node_id, Location location, Integer flags, Symbol name, Location name_loc, Location operator_loc, Prism::node value) -> void
830
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node) -> ConstantAndWriteNode
831
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol, name_loc: Location, operator_loc: Location, value: Prism::node }
832
+ def operator: () -> String
833
+ def type: () -> :constant_and_write_node
834
+ | ...
835
+ def self.type: () -> :constant_and_write_node
836
+ end
837
+
838
+ # Represents assigning to a constant using an operator that isn't `=`.
839
+ #
840
+ # Target += value
841
+ # ^^^^^^^^^^^^^^^
842
+ class ConstantOperatorWriteNode < Node
843
+ include _Node
844
+
845
+ attr_reader name: Symbol
846
+ attr_reader name_loc: Location
847
+ attr_reader binary_operator_loc: Location
848
+ attr_reader value: Prism::node
849
+ attr_reader binary_operator: Symbol
850
+
851
+ def initialize: (Source source, Integer node_id, Location location, Integer flags, Symbol name, Location name_loc, Location binary_operator_loc, Prism::node value, Symbol binary_operator) -> void
852
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?binary_operator_loc: Location, ?value: Prism::node, ?binary_operator: Symbol) -> ConstantOperatorWriteNode
853
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol, name_loc: Location, binary_operator_loc: Location, value: Prism::node, binary_operator: Symbol }
854
+ def type: () -> :constant_operator_write_node
855
+ | ...
856
+ def self.type: () -> :constant_operator_write_node
857
+ end
858
+
859
+ # Represents the use of the `||=` operator for assignment to a constant.
860
+ #
861
+ # Target ||= value
862
+ # ^^^^^^^^^^^^^^^^
863
+ class ConstantOrWriteNode < Node
864
+ include _Node
865
+
866
+ attr_reader name: Symbol
867
+ attr_reader name_loc: Location
868
+ attr_reader operator_loc: Location
869
+ attr_reader value: Prism::node
870
+
871
+ def initialize: (Source source, Integer node_id, Location location, Integer flags, Symbol name, Location name_loc, Location operator_loc, Prism::node value) -> void
872
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node) -> ConstantOrWriteNode
873
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol, name_loc: Location, operator_loc: Location, value: Prism::node }
874
+ def operator: () -> String
875
+ def type: () -> :constant_or_write_node
876
+ | ...
877
+ def self.type: () -> :constant_or_write_node
878
+ end
879
+
880
+ # Represents the use of the `&&=` operator for assignment to a constant path.
881
+ #
882
+ # Parent::Child &&= value
883
+ # ^^^^^^^^^^^^^^^^^^^^^^^
884
+ class ConstantPathAndWriteNode < Node
885
+ include _Node
886
+
887
+ attr_reader target: ConstantPathNode
888
+ attr_reader operator_loc: Location
889
+ attr_reader value: Prism::node
890
+
891
+ def initialize: (Source source, Integer node_id, Location location, Integer flags, ConstantPathNode target, Location operator_loc, Prism::node value) -> void
892
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?target: ConstantPathNode, ?operator_loc: Location, ?value: Prism::node) -> ConstantPathAndWriteNode
893
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, target: ConstantPathNode, operator_loc: Location, value: Prism::node }
894
+ def operator: () -> String
895
+ def type: () -> :constant_path_and_write_node
896
+ | ...
897
+ def self.type: () -> :constant_path_and_write_node
898
+ end
899
+
900
+ # Represents accessing a constant through a path of `::` operators.
901
+ #
902
+ # Foo::Bar
903
+ # ^^^^^^^^
904
+ class ConstantPathNode < Node
905
+ include _Node
906
+
907
+ attr_reader parent: Prism::node?
908
+ attr_reader name: Symbol?
909
+ attr_reader delimiter_loc: Location
910
+ attr_reader name_loc: Location
911
+
912
+ def initialize: (Source source, Integer node_id, Location location, Integer flags, Prism::node? parent, Symbol? name, Location delimiter_loc, Location name_loc) -> void
913
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?parent: Prism::node?, ?name: Symbol?, ?delimiter_loc: Location, ?name_loc: Location) -> ConstantPathNode
914
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, parent: Prism::node?, name: Symbol?, delimiter_loc: Location, name_loc: Location }
915
+ def delimiter: () -> String
916
+ def type: () -> :constant_path_node
917
+ | ...
918
+ def self.type: () -> :constant_path_node
919
+ end
920
+
921
+ # Represents assigning to a constant path using an operator that isn't `=`.
922
+ #
923
+ # Parent::Child += value
924
+ # ^^^^^^^^^^^^^^^^^^^^^^
925
+ class ConstantPathOperatorWriteNode < Node
926
+ include _Node
927
+
928
+ attr_reader target: ConstantPathNode
929
+ attr_reader binary_operator_loc: Location
930
+ attr_reader value: Prism::node
931
+ attr_reader binary_operator: Symbol
932
+
933
+ def initialize: (Source source, Integer node_id, Location location, Integer flags, ConstantPathNode target, Location binary_operator_loc, Prism::node value, Symbol binary_operator) -> void
934
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?target: ConstantPathNode, ?binary_operator_loc: Location, ?value: Prism::node, ?binary_operator: Symbol) -> ConstantPathOperatorWriteNode
935
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, target: ConstantPathNode, binary_operator_loc: Location, value: Prism::node, binary_operator: Symbol }
936
+ def type: () -> :constant_path_operator_write_node
937
+ | ...
938
+ def self.type: () -> :constant_path_operator_write_node
939
+ end
940
+
941
+ # Represents the use of the `||=` operator for assignment to a constant path.
942
+ #
943
+ # Parent::Child ||= value
944
+ # ^^^^^^^^^^^^^^^^^^^^^^^
945
+ class ConstantPathOrWriteNode < Node
946
+ include _Node
947
+
948
+ attr_reader target: ConstantPathNode
949
+ attr_reader operator_loc: Location
950
+ attr_reader value: Prism::node
951
+
952
+ def initialize: (Source source, Integer node_id, Location location, Integer flags, ConstantPathNode target, Location operator_loc, Prism::node value) -> void
953
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?target: ConstantPathNode, ?operator_loc: Location, ?value: Prism::node) -> ConstantPathOrWriteNode
954
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, target: ConstantPathNode, operator_loc: Location, value: Prism::node }
955
+ def operator: () -> String
956
+ def type: () -> :constant_path_or_write_node
957
+ | ...
958
+ def self.type: () -> :constant_path_or_write_node
959
+ end
960
+
961
+ # Represents writing to a constant path in a context that doesn't have an explicit value.
962
+ #
963
+ # Foo::Foo, Bar::Bar = baz
964
+ # ^^^^^^^^ ^^^^^^^^
965
+ class ConstantPathTargetNode < Node
966
+ include _Node
967
+
968
+ attr_reader parent: Prism::node?
969
+ attr_reader name: Symbol?
970
+ attr_reader delimiter_loc: Location
971
+ attr_reader name_loc: Location
972
+
973
+ def initialize: (Source source, Integer node_id, Location location, Integer flags, Prism::node? parent, Symbol? name, Location delimiter_loc, Location name_loc) -> void
974
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?parent: Prism::node?, ?name: Symbol?, ?delimiter_loc: Location, ?name_loc: Location) -> ConstantPathTargetNode
975
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, parent: Prism::node?, name: Symbol?, delimiter_loc: Location, name_loc: Location }
976
+ def delimiter: () -> String
977
+ def type: () -> :constant_path_target_node
978
+ | ...
979
+ def self.type: () -> :constant_path_target_node
980
+ end
981
+
982
+ # Represents writing to a constant path.
983
+ #
984
+ # ::Foo = 1
985
+ # ^^^^^^^^^
986
+ #
987
+ # Foo::Bar = 1
988
+ # ^^^^^^^^^^^^
989
+ #
990
+ # ::Foo::Bar = 1
991
+ # ^^^^^^^^^^^^^^
992
+ class ConstantPathWriteNode < Node
993
+ include _Node
994
+
995
+ attr_reader target: ConstantPathNode
996
+ attr_reader operator_loc: Location
997
+ attr_reader value: Prism::node
998
+
999
+ def initialize: (Source source, Integer node_id, Location location, Integer flags, ConstantPathNode target, Location operator_loc, Prism::node value) -> void
1000
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?target: ConstantPathNode, ?operator_loc: Location, ?value: Prism::node) -> ConstantPathWriteNode
1001
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, target: ConstantPathNode, operator_loc: Location, value: Prism::node }
1002
+ def operator: () -> String
1003
+ def type: () -> :constant_path_write_node
1004
+ | ...
1005
+ def self.type: () -> :constant_path_write_node
1006
+ end
1007
+
1008
+ # Represents referencing a constant.
1009
+ #
1010
+ # Foo
1011
+ # ^^^
1012
+ class ConstantReadNode < Node
1013
+ include _Node
1014
+
1015
+ attr_reader name: Symbol
1016
+
1017
+ def initialize: (Source source, Integer node_id, Location location, Integer flags, Symbol name) -> void
1018
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol) -> ConstantReadNode
1019
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol }
1020
+ def type: () -> :constant_read_node
1021
+ | ...
1022
+ def self.type: () -> :constant_read_node
1023
+ end
1024
+
1025
+ # Represents writing to a constant in a context that doesn't have an explicit value.
1026
+ #
1027
+ # Foo, Bar = baz
1028
+ # ^^^ ^^^
1029
+ class ConstantTargetNode < Node
1030
+ include _Node
1031
+
1032
+ attr_reader name: Symbol
1033
+
1034
+ def initialize: (Source source, Integer node_id, Location location, Integer flags, Symbol name) -> void
1035
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol) -> ConstantTargetNode
1036
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol }
1037
+ def type: () -> :constant_target_node
1038
+ | ...
1039
+ def self.type: () -> :constant_target_node
1040
+ end
1041
+
1042
+ # Represents writing to a constant.
1043
+ #
1044
+ # Foo = 1
1045
+ # ^^^^^^^
1046
+ class ConstantWriteNode < Node
1047
+ include _Node
1048
+
1049
+ attr_reader name: Symbol
1050
+ attr_reader name_loc: Location
1051
+ attr_reader value: Prism::node
1052
+ attr_reader operator_loc: Location
1053
+
1054
+ def initialize: (Source source, Integer node_id, Location location, Integer flags, Symbol name, Location name_loc, Prism::node value, Location operator_loc) -> void
1055
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?value: Prism::node, ?operator_loc: Location) -> ConstantWriteNode
1056
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol, name_loc: Location, value: Prism::node, operator_loc: Location }
1057
+ def operator: () -> String
1058
+ def type: () -> :constant_write_node
1059
+ | ...
1060
+ def self.type: () -> :constant_write_node
1061
+ end
1062
+
1063
+ # Represents a method definition.
1064
+ #
1065
+ # def method
1066
+ # end
1067
+ # ^^^^^^^^^^
1068
+ class DefNode < Node
1069
+ include _Node
1070
+
1071
+ attr_reader name: Symbol
1072
+ attr_reader name_loc: Location
1073
+ attr_reader receiver: Prism::node?
1074
+ attr_reader parameters: ParametersNode?
1075
+ attr_reader body: StatementsNode | BeginNode | nil
1076
+ attr_reader locals: Array[Symbol]
1077
+ attr_reader def_keyword_loc: Location
1078
+ attr_reader operator_loc: Location?
1079
+ attr_reader lparen_loc: Location?
1080
+ attr_reader rparen_loc: Location?
1081
+ attr_reader equal_loc: Location?
1082
+ attr_reader end_keyword_loc: Location?
1083
+
1084
+ def initialize: (Source source, Integer node_id, Location location, Integer flags, Symbol name, Location name_loc, Prism::node? receiver, ParametersNode? parameters, StatementsNode | BeginNode | nil body, Array[Symbol] locals, Location def_keyword_loc, Location? operator_loc, Location? lparen_loc, Location? rparen_loc, Location? equal_loc, Location? end_keyword_loc) -> void
1085
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?receiver: Prism::node?, ?parameters: ParametersNode?, ?body: StatementsNode | BeginNode | nil, ?locals: Array[Symbol], ?def_keyword_loc: Location, ?operator_loc: Location?, ?lparen_loc: Location?, ?rparen_loc: Location?, ?equal_loc: Location?, ?end_keyword_loc: Location?) -> DefNode
1086
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol, name_loc: Location, receiver: Prism::node?, parameters: ParametersNode?, body: StatementsNode | BeginNode | nil, locals: Array[Symbol], def_keyword_loc: Location, operator_loc: Location?, lparen_loc: Location?, rparen_loc: Location?, equal_loc: Location?, end_keyword_loc: Location? }
1087
+ def def_keyword: () -> String
1088
+ def operator: () -> String?
1089
+ def lparen: () -> String?
1090
+ def rparen: () -> String?
1091
+ def equal: () -> String?
1092
+ def end_keyword: () -> String?
1093
+ def type: () -> :def_node
1094
+ | ...
1095
+ def self.type: () -> :def_node
1096
+ end
1097
+
1098
+ # Represents the use of the `defined?` keyword.
1099
+ #
1100
+ # defined?(a)
1101
+ # ^^^^^^^^^^^
1102
+ class DefinedNode < Node
1103
+ include _Node
1104
+
1105
+ attr_reader lparen_loc: Location?
1106
+ attr_reader value: Prism::node
1107
+ attr_reader rparen_loc: Location?
1108
+ attr_reader keyword_loc: Location
1109
+
1110
+ def initialize: (Source source, Integer node_id, Location location, Integer flags, Location? lparen_loc, Prism::node value, Location? rparen_loc, Location keyword_loc) -> void
1111
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?lparen_loc: Location?, ?value: Prism::node, ?rparen_loc: Location?, ?keyword_loc: Location) -> DefinedNode
1112
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, lparen_loc: Location?, value: Prism::node, rparen_loc: Location?, keyword_loc: Location }
1113
+ def lparen: () -> String?
1114
+ def rparen: () -> String?
1115
+ def keyword: () -> String
1116
+ def type: () -> :defined_node
1117
+ | ...
1118
+ def self.type: () -> :defined_node
1119
+ end
1120
+
1121
+ # Represents an `else` clause in a `case`, `if`, or `unless` statement.
1122
+ #
1123
+ # if a then b else c end
1124
+ # ^^^^^^^^^^
1125
+ class ElseNode < Node
1126
+ include _Node
1127
+
1128
+ attr_reader else_keyword_loc: Location
1129
+ attr_reader statements: StatementsNode?
1130
+ attr_reader end_keyword_loc: Location?
1131
+
1132
+ def initialize: (Source source, Integer node_id, Location location, Integer flags, Location else_keyword_loc, StatementsNode? statements, Location? end_keyword_loc) -> void
1133
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?else_keyword_loc: Location, ?statements: StatementsNode?, ?end_keyword_loc: Location?) -> ElseNode
1134
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, else_keyword_loc: Location, statements: StatementsNode?, end_keyword_loc: Location? }
1135
+ def else_keyword: () -> String
1136
+ def end_keyword: () -> String?
1137
+ def type: () -> :else_node
1138
+ | ...
1139
+ def self.type: () -> :else_node
1140
+ end
1141
+
1142
+ # Represents an interpolated set of statements.
1143
+ #
1144
+ # "foo #{bar}"
1145
+ # ^^^^^^
1146
+ class EmbeddedStatementsNode < Node
1147
+ include _Node
1148
+
1149
+ attr_reader opening_loc: Location
1150
+ attr_reader statements: StatementsNode?
1151
+ attr_reader closing_loc: Location
1152
+
1153
+ def initialize: (Source source, Integer node_id, Location location, Integer flags, Location opening_loc, StatementsNode? statements, Location closing_loc) -> void
1154
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?opening_loc: Location, ?statements: StatementsNode?, ?closing_loc: Location) -> EmbeddedStatementsNode
1155
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, opening_loc: Location, statements: StatementsNode?, closing_loc: Location }
1156
+ def opening: () -> String
1157
+ def closing: () -> String
1158
+ def type: () -> :embedded_statements_node
1159
+ | ...
1160
+ def self.type: () -> :embedded_statements_node
1161
+ end
1162
+
1163
+ # Represents an interpolated variable.
1164
+ #
1165
+ # "foo #@bar"
1166
+ # ^^^^^
1167
+ class EmbeddedVariableNode < Node
1168
+ include _Node
1169
+
1170
+ attr_reader operator_loc: Location
1171
+ attr_reader variable: InstanceVariableReadNode | ClassVariableReadNode | GlobalVariableReadNode | BackReferenceReadNode | NumberedReferenceReadNode
1172
+
1173
+ def initialize: (Source source, Integer node_id, Location location, Integer flags, Location operator_loc, InstanceVariableReadNode | ClassVariableReadNode | GlobalVariableReadNode | BackReferenceReadNode | NumberedReferenceReadNode variable) -> void
1174
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?operator_loc: Location, ?variable: InstanceVariableReadNode | ClassVariableReadNode | GlobalVariableReadNode | BackReferenceReadNode | NumberedReferenceReadNode) -> EmbeddedVariableNode
1175
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, operator_loc: Location, variable: InstanceVariableReadNode | ClassVariableReadNode | GlobalVariableReadNode | BackReferenceReadNode | NumberedReferenceReadNode }
1176
+ def operator: () -> String
1177
+ def type: () -> :embedded_variable_node
1178
+ | ...
1179
+ def self.type: () -> :embedded_variable_node
1180
+ end
1181
+
1182
+ # Represents an `ensure` clause in a `begin` statement.
1183
+ #
1184
+ # begin
1185
+ # foo
1186
+ # ensure
1187
+ # ^^^^^^
1188
+ # bar
1189
+ # end
1190
+ class EnsureNode < Node
1191
+ include _Node
1192
+
1193
+ attr_reader ensure_keyword_loc: Location
1194
+ attr_reader statements: StatementsNode?
1195
+ attr_reader end_keyword_loc: Location
1196
+
1197
+ def initialize: (Source source, Integer node_id, Location location, Integer flags, Location ensure_keyword_loc, StatementsNode? statements, Location end_keyword_loc) -> void
1198
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?ensure_keyword_loc: Location, ?statements: StatementsNode?, ?end_keyword_loc: Location) -> EnsureNode
1199
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, ensure_keyword_loc: Location, statements: StatementsNode?, end_keyword_loc: Location }
1200
+ def ensure_keyword: () -> String
1201
+ def end_keyword: () -> String
1202
+ def type: () -> :ensure_node
1203
+ | ...
1204
+ def self.type: () -> :ensure_node
1205
+ end
1206
+
1207
+ # Represents the use of the literal `false` keyword.
1208
+ #
1209
+ # false
1210
+ # ^^^^^
1211
+ class FalseNode < Node
1212
+ include _Node
1213
+
1214
+
1215
+ def initialize: (Source source, Integer node_id, Location location, Integer flags) -> void
1216
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer) -> FalseNode
1217
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location }
1218
+ def type: () -> :false_node
1219
+ | ...
1220
+ def self.type: () -> :false_node
1221
+ end
1222
+
1223
+ # Represents a find pattern in pattern matching.
1224
+ #
1225
+ # foo in *bar, baz, *qux
1226
+ # ^^^^^^^^^^^^^^^
1227
+ #
1228
+ # foo in [*bar, baz, *qux]
1229
+ # ^^^^^^^^^^^^^^^^^
1230
+ #
1231
+ # foo in Foo(*bar, baz, *qux)
1232
+ # ^^^^^^^^^^^^^^^^^^^^
1233
+ class FindPatternNode < Node
1234
+ include _Node
1235
+
1236
+ attr_reader constant: ConstantReadNode | ConstantPathNode | nil
1237
+ attr_reader left: SplatNode
1238
+ attr_reader requireds: Array[Prism::node]
1239
+ attr_reader right: SplatNode
1240
+ attr_reader opening_loc: Location?
1241
+ attr_reader closing_loc: Location?
1242
+
1243
+ def initialize: (Source source, Integer node_id, Location location, Integer flags, ConstantReadNode | ConstantPathNode | nil constant, SplatNode left, Array[Prism::node] requireds, SplatNode right, Location? opening_loc, Location? closing_loc) -> void
1244
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?constant: ConstantReadNode | ConstantPathNode | nil, ?left: SplatNode, ?requireds: Array[Prism::node], ?right: SplatNode, ?opening_loc: Location?, ?closing_loc: Location?) -> FindPatternNode
1245
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, constant: ConstantReadNode | ConstantPathNode | nil, left: SplatNode, requireds: Array[Prism::node], right: SplatNode, opening_loc: Location?, closing_loc: Location? }
1246
+ def opening: () -> String?
1247
+ def closing: () -> String?
1248
+ def type: () -> :find_pattern_node
1249
+ | ...
1250
+ def self.type: () -> :find_pattern_node
1251
+ end
1252
+
1253
+ # Represents the use of the `..` or `...` operators to create flip flops.
1254
+ #
1255
+ # baz if foo .. bar
1256
+ # ^^^^^^^^^^
1257
+ class FlipFlopNode < Node
1258
+ include _Node
1259
+
1260
+ def exclude_end?: () -> bool
1261
+
1262
+ attr_reader left: Prism::node?
1263
+ attr_reader right: Prism::node?
1264
+ attr_reader operator_loc: Location
1265
+
1266
+ def initialize: (Source source, Integer node_id, Location location, Integer flags, Prism::node? left, Prism::node? right, Location operator_loc) -> void
1267
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?left: Prism::node?, ?right: Prism::node?, ?operator_loc: Location) -> FlipFlopNode
1268
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, left: Prism::node?, right: Prism::node?, operator_loc: Location }
1269
+ def operator: () -> String
1270
+ def type: () -> :flip_flop_node
1271
+ | ...
1272
+ def self.type: () -> :flip_flop_node
1273
+ end
1274
+
1275
+ # Represents a floating point number literal.
1276
+ #
1277
+ # 1.0
1278
+ # ^^^
1279
+ class FloatNode < Node
1280
+ include _Node
1281
+
1282
+ attr_reader value: Float
1283
+
1284
+ def initialize: (Source source, Integer node_id, Location location, Integer flags, Float value) -> void
1285
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?value: Float) -> FloatNode
1286
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, value: Float }
1287
+ def type: () -> :float_node
1288
+ | ...
1289
+ def self.type: () -> :float_node
1290
+ end
1291
+
1292
+ # Represents the use of the `for` keyword.
1293
+ #
1294
+ # for i in a end
1295
+ # ^^^^^^^^^^^^^^
1296
+ class ForNode < Node
1297
+ include _Node
1298
+
1299
+ attr_reader index: LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode
1300
+ attr_reader collection: Prism::node
1301
+ attr_reader statements: StatementsNode?
1302
+ attr_reader for_keyword_loc: Location
1303
+ attr_reader in_keyword_loc: Location
1304
+ attr_reader do_keyword_loc: Location?
1305
+ attr_reader end_keyword_loc: Location
1306
+
1307
+ def initialize: (Source source, Integer node_id, Location location, Integer flags, LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode index, Prism::node collection, StatementsNode? statements, Location for_keyword_loc, Location in_keyword_loc, Location? do_keyword_loc, Location end_keyword_loc) -> void
1308
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?index: LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode, ?collection: Prism::node, ?statements: StatementsNode?, ?for_keyword_loc: Location, ?in_keyword_loc: Location, ?do_keyword_loc: Location?, ?end_keyword_loc: Location) -> ForNode
1309
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, index: LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode, collection: Prism::node, statements: StatementsNode?, for_keyword_loc: Location, in_keyword_loc: Location, do_keyword_loc: Location?, end_keyword_loc: Location }
1310
+ def for_keyword: () -> String
1311
+ def in_keyword: () -> String
1312
+ def do_keyword: () -> String?
1313
+ def end_keyword: () -> String
1314
+ def type: () -> :for_node
1315
+ | ...
1316
+ def self.type: () -> :for_node
1317
+ end
1318
+
1319
+ # Represents forwarding all arguments to this method to another method.
1320
+ #
1321
+ # def foo(...)
1322
+ # bar(...)
1323
+ # ^^^
1324
+ # end
1325
+ class ForwardingArgumentsNode < Node
1326
+ include _Node
1327
+
1328
+
1329
+ def initialize: (Source source, Integer node_id, Location location, Integer flags) -> void
1330
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer) -> ForwardingArgumentsNode
1331
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location }
1332
+ def type: () -> :forwarding_arguments_node
1333
+ | ...
1334
+ def self.type: () -> :forwarding_arguments_node
1335
+ end
1336
+
1337
+ # Represents the use of the forwarding parameter in a method, block, or lambda declaration.
1338
+ #
1339
+ # def foo(...)
1340
+ # ^^^
1341
+ # end
1342
+ class ForwardingParameterNode < Node
1343
+ include _Node
1344
+
1345
+
1346
+ def initialize: (Source source, Integer node_id, Location location, Integer flags) -> void
1347
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer) -> ForwardingParameterNode
1348
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location }
1349
+ def type: () -> :forwarding_parameter_node
1350
+ | ...
1351
+ def self.type: () -> :forwarding_parameter_node
1352
+ end
1353
+
1354
+ # Represents the use of the `super` keyword without parentheses or arguments.
1355
+ #
1356
+ # super
1357
+ # ^^^^^
1358
+ class ForwardingSuperNode < Node
1359
+ include _Node
1360
+
1361
+ attr_reader block: BlockNode?
1362
+
1363
+ def initialize: (Source source, Integer node_id, Location location, Integer flags, BlockNode? block) -> void
1364
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?block: BlockNode?) -> ForwardingSuperNode
1365
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, block: BlockNode? }
1366
+ def type: () -> :forwarding_super_node
1367
+ | ...
1368
+ def self.type: () -> :forwarding_super_node
1369
+ end
1370
+
1371
+ # Represents the use of the `&&=` operator for assignment to a global variable.
1372
+ #
1373
+ # $target &&= value
1374
+ # ^^^^^^^^^^^^^^^^^
1375
+ class GlobalVariableAndWriteNode < Node
1376
+ include _Node
1377
+
1378
+ attr_reader name: Symbol
1379
+ attr_reader name_loc: Location
1380
+ attr_reader operator_loc: Location
1381
+ attr_reader value: Prism::node
1382
+
1383
+ def initialize: (Source source, Integer node_id, Location location, Integer flags, Symbol name, Location name_loc, Location operator_loc, Prism::node value) -> void
1384
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node) -> GlobalVariableAndWriteNode
1385
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol, name_loc: Location, operator_loc: Location, value: Prism::node }
1386
+ def operator: () -> String
1387
+ def type: () -> :global_variable_and_write_node
1388
+ | ...
1389
+ def self.type: () -> :global_variable_and_write_node
1390
+ end
1391
+
1392
+ # Represents assigning to a global variable using an operator that isn't `=`.
1393
+ #
1394
+ # $target += value
1395
+ # ^^^^^^^^^^^^^^^^
1396
+ class GlobalVariableOperatorWriteNode < Node
1397
+ include _Node
1398
+
1399
+ attr_reader name: Symbol
1400
+ attr_reader name_loc: Location
1401
+ attr_reader binary_operator_loc: Location
1402
+ attr_reader value: Prism::node
1403
+ attr_reader binary_operator: Symbol
1404
+
1405
+ def initialize: (Source source, Integer node_id, Location location, Integer flags, Symbol name, Location name_loc, Location binary_operator_loc, Prism::node value, Symbol binary_operator) -> void
1406
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?binary_operator_loc: Location, ?value: Prism::node, ?binary_operator: Symbol) -> GlobalVariableOperatorWriteNode
1407
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol, name_loc: Location, binary_operator_loc: Location, value: Prism::node, binary_operator: Symbol }
1408
+ def type: () -> :global_variable_operator_write_node
1409
+ | ...
1410
+ def self.type: () -> :global_variable_operator_write_node
1411
+ end
1412
+
1413
+ # Represents the use of the `||=` operator for assignment to a global variable.
1414
+ #
1415
+ # $target ||= value
1416
+ # ^^^^^^^^^^^^^^^^^
1417
+ class GlobalVariableOrWriteNode < Node
1418
+ include _Node
1419
+
1420
+ attr_reader name: Symbol
1421
+ attr_reader name_loc: Location
1422
+ attr_reader operator_loc: Location
1423
+ attr_reader value: Prism::node
1424
+
1425
+ def initialize: (Source source, Integer node_id, Location location, Integer flags, Symbol name, Location name_loc, Location operator_loc, Prism::node value) -> void
1426
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node) -> GlobalVariableOrWriteNode
1427
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol, name_loc: Location, operator_loc: Location, value: Prism::node }
1428
+ def operator: () -> String
1429
+ def type: () -> :global_variable_or_write_node
1430
+ | ...
1431
+ def self.type: () -> :global_variable_or_write_node
1432
+ end
1433
+
1434
+ # Represents referencing a global variable.
1435
+ #
1436
+ # $foo
1437
+ # ^^^^
1438
+ class GlobalVariableReadNode < Node
1439
+ include _Node
1440
+
1441
+ attr_reader name: Symbol
1442
+
1443
+ def initialize: (Source source, Integer node_id, Location location, Integer flags, Symbol name) -> void
1444
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol) -> GlobalVariableReadNode
1445
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol }
1446
+ def type: () -> :global_variable_read_node
1447
+ | ...
1448
+ def self.type: () -> :global_variable_read_node
1449
+ end
1450
+
1451
+ # Represents writing to a global variable in a context that doesn't have an explicit value.
1452
+ #
1453
+ # $foo, $bar = baz
1454
+ # ^^^^ ^^^^
1455
+ class GlobalVariableTargetNode < Node
1456
+ include _Node
1457
+
1458
+ attr_reader name: Symbol
1459
+
1460
+ def initialize: (Source source, Integer node_id, Location location, Integer flags, Symbol name) -> void
1461
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol) -> GlobalVariableTargetNode
1462
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol }
1463
+ def type: () -> :global_variable_target_node
1464
+ | ...
1465
+ def self.type: () -> :global_variable_target_node
1466
+ end
1467
+
1468
+ # Represents writing to a global variable.
1469
+ #
1470
+ # $foo = 1
1471
+ # ^^^^^^^^
1472
+ class GlobalVariableWriteNode < Node
1473
+ include _Node
1474
+
1475
+ attr_reader name: Symbol
1476
+ attr_reader name_loc: Location
1477
+ attr_reader value: Prism::node
1478
+ attr_reader operator_loc: Location
1479
+
1480
+ def initialize: (Source source, Integer node_id, Location location, Integer flags, Symbol name, Location name_loc, Prism::node value, Location operator_loc) -> void
1481
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?value: Prism::node, ?operator_loc: Location) -> GlobalVariableWriteNode
1482
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol, name_loc: Location, value: Prism::node, operator_loc: Location }
1483
+ def operator: () -> String
1484
+ def type: () -> :global_variable_write_node
1485
+ | ...
1486
+ def self.type: () -> :global_variable_write_node
1487
+ end
1488
+
1489
+ # Represents a hash literal.
1490
+ #
1491
+ # { a => b }
1492
+ # ^^^^^^^^^^
1493
+ class HashNode < Node
1494
+ include _Node
1495
+
1496
+ attr_reader opening_loc: Location
1497
+ attr_reader elements: Array[AssocNode | AssocSplatNode]
1498
+ attr_reader closing_loc: Location
1499
+
1500
+ def initialize: (Source source, Integer node_id, Location location, Integer flags, Location opening_loc, Array[AssocNode | AssocSplatNode] elements, Location closing_loc) -> void
1501
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?opening_loc: Location, ?elements: Array[AssocNode | AssocSplatNode], ?closing_loc: Location) -> HashNode
1502
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, opening_loc: Location, elements: Array[AssocNode | AssocSplatNode], closing_loc: Location }
1503
+ def opening: () -> String
1504
+ def closing: () -> String
1505
+ def type: () -> :hash_node
1506
+ | ...
1507
+ def self.type: () -> :hash_node
1508
+ end
1509
+
1510
+ # Represents a hash pattern in pattern matching.
1511
+ #
1512
+ # foo => { a: 1, b: 2 }
1513
+ # ^^^^^^^^^^^^^^
1514
+ #
1515
+ # foo => { a: 1, b: 2, **c }
1516
+ # ^^^^^^^^^^^^^^^^^^^
1517
+ class HashPatternNode < Node
1518
+ include _Node
1519
+
1520
+ attr_reader constant: ConstantReadNode | ConstantPathNode | nil
1521
+ attr_reader elements: Array[AssocNode]
1522
+ attr_reader rest: AssocSplatNode | NoKeywordsParameterNode | nil
1523
+ attr_reader opening_loc: Location?
1524
+ attr_reader closing_loc: Location?
1525
+
1526
+ def initialize: (Source source, Integer node_id, Location location, Integer flags, ConstantReadNode | ConstantPathNode | nil constant, Array[AssocNode] elements, AssocSplatNode | NoKeywordsParameterNode | nil rest, Location? opening_loc, Location? closing_loc) -> void
1527
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?constant: ConstantReadNode | ConstantPathNode | nil, ?elements: Array[AssocNode], ?rest: AssocSplatNode | NoKeywordsParameterNode | nil, ?opening_loc: Location?, ?closing_loc: Location?) -> HashPatternNode
1528
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, constant: ConstantReadNode | ConstantPathNode | nil, elements: Array[AssocNode], rest: AssocSplatNode | NoKeywordsParameterNode | nil, opening_loc: Location?, closing_loc: Location? }
1529
+ def opening: () -> String?
1530
+ def closing: () -> String?
1531
+ def type: () -> :hash_pattern_node
1532
+ | ...
1533
+ def self.type: () -> :hash_pattern_node
1534
+ end
1535
+
1536
+ # Represents the use of the `if` keyword, either in the block form or the modifier form, or a ternary expression.
1537
+ #
1538
+ # bar if foo
1539
+ # ^^^^^^^^^^
1540
+ #
1541
+ # if foo then bar end
1542
+ # ^^^^^^^^^^^^^^^^^^^
1543
+ #
1544
+ # foo ? bar : baz
1545
+ # ^^^^^^^^^^^^^^^
1546
+ class IfNode < Node
1547
+ include _Node
1548
+
1549
+ attr_reader if_keyword_loc: Location?
1550
+ attr_reader predicate: Prism::node
1551
+ attr_reader then_keyword_loc: Location?
1552
+ attr_reader statements: StatementsNode?
1553
+ attr_reader subsequent: ElseNode | IfNode | nil
1554
+ attr_reader end_keyword_loc: Location?
1555
+
1556
+ def initialize: (Source source, Integer node_id, Location location, Integer flags, Location? if_keyword_loc, Prism::node predicate, Location? then_keyword_loc, StatementsNode? statements, ElseNode | IfNode | nil subsequent, Location? end_keyword_loc) -> void
1557
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?if_keyword_loc: Location?, ?predicate: Prism::node, ?then_keyword_loc: Location?, ?statements: StatementsNode?, ?subsequent: ElseNode | IfNode | nil, ?end_keyword_loc: Location?) -> IfNode
1558
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, if_keyword_loc: Location?, predicate: Prism::node, then_keyword_loc: Location?, statements: StatementsNode?, subsequent: ElseNode | IfNode | nil, end_keyword_loc: Location? }
1559
+ def if_keyword: () -> String?
1560
+ def then_keyword: () -> String?
1561
+ def end_keyword: () -> String?
1562
+ def type: () -> :if_node
1563
+ | ...
1564
+ def self.type: () -> :if_node
1565
+ end
1566
+
1567
+ # Represents an imaginary number literal.
1568
+ #
1569
+ # 1.0i
1570
+ # ^^^^
1571
+ class ImaginaryNode < Node
1572
+ include _Node
1573
+
1574
+ attr_reader numeric: FloatNode | IntegerNode | RationalNode
1575
+
1576
+ def initialize: (Source source, Integer node_id, Location location, Integer flags, FloatNode | IntegerNode | RationalNode numeric) -> void
1577
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?numeric: FloatNode | IntegerNode | RationalNode) -> ImaginaryNode
1578
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, numeric: FloatNode | IntegerNode | RationalNode }
1579
+ def type: () -> :imaginary_node
1580
+ | ...
1581
+ def self.type: () -> :imaginary_node
1582
+ end
1583
+
1584
+ # Represents a node that is implicitly being added to the tree but doesn't correspond directly to a node in the source.
1585
+ #
1586
+ # { foo: }
1587
+ # ^^^^
1588
+ #
1589
+ # { Foo: }
1590
+ # ^^^^
1591
+ #
1592
+ # foo in { bar: }
1593
+ # ^^^^
1594
+ class ImplicitNode < Node
1595
+ include _Node
1596
+
1597
+ attr_reader value: LocalVariableReadNode | CallNode | ConstantReadNode | LocalVariableTargetNode
1598
+
1599
+ def initialize: (Source source, Integer node_id, Location location, Integer flags, LocalVariableReadNode | CallNode | ConstantReadNode | LocalVariableTargetNode value) -> void
1600
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?value: LocalVariableReadNode | CallNode | ConstantReadNode | LocalVariableTargetNode) -> ImplicitNode
1601
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, value: LocalVariableReadNode | CallNode | ConstantReadNode | LocalVariableTargetNode }
1602
+ def type: () -> :implicit_node
1603
+ | ...
1604
+ def self.type: () -> :implicit_node
1605
+ end
1606
+
1607
+ # Represents using a trailing comma to indicate an implicit rest parameter.
1608
+ #
1609
+ # foo { |bar,| }
1610
+ # ^
1611
+ #
1612
+ # foo in [bar,]
1613
+ # ^
1614
+ #
1615
+ # for foo, in bar do end
1616
+ # ^
1617
+ #
1618
+ # foo, = bar
1619
+ # ^
1620
+ class ImplicitRestNode < Node
1621
+ include _Node
1622
+
1623
+
1624
+ def initialize: (Source source, Integer node_id, Location location, Integer flags) -> void
1625
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer) -> ImplicitRestNode
1626
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location }
1627
+ def type: () -> :implicit_rest_node
1628
+ | ...
1629
+ def self.type: () -> :implicit_rest_node
1630
+ end
1631
+
1632
+ # Represents the use of the `in` keyword in a case statement.
1633
+ #
1634
+ # case a; in b then c end
1635
+ # ^^^^^^^^^^^
1636
+ class InNode < Node
1637
+ include _Node
1638
+
1639
+ attr_reader pattern: Prism::node
1640
+ attr_reader statements: StatementsNode?
1641
+ attr_reader in_loc: Location
1642
+ attr_reader then_loc: Location?
1643
+
1644
+ def initialize: (Source source, Integer node_id, Location location, Integer flags, Prism::node pattern, StatementsNode? statements, Location in_loc, Location? then_loc) -> void
1645
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?pattern: Prism::node, ?statements: StatementsNode?, ?in_loc: Location, ?then_loc: Location?) -> InNode
1646
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, pattern: Prism::node, statements: StatementsNode?, in_loc: Location, then_loc: Location? }
1647
+ def in: () -> String
1648
+ def then: () -> String?
1649
+ def type: () -> :in_node
1650
+ | ...
1651
+ def self.type: () -> :in_node
1652
+ end
1653
+
1654
+ # Represents the use of the `&&=` operator on a call to the `[]` method.
1655
+ #
1656
+ # foo.bar[baz] &&= value
1657
+ # ^^^^^^^^^^^^^^^^^^^^^^
1658
+ class IndexAndWriteNode < Node
1659
+ include _Node
1660
+
1661
+ def safe_navigation?: () -> bool
1662
+ def variable_call?: () -> bool
1663
+ def attribute_write?: () -> bool
1664
+ def ignore_visibility?: () -> bool
1665
+
1666
+ attr_reader receiver: Prism::node?
1667
+ attr_reader call_operator_loc: Location?
1668
+ attr_reader opening_loc: Location
1669
+ attr_reader arguments: ArgumentsNode?
1670
+ attr_reader closing_loc: Location
1671
+ attr_reader block: BlockArgumentNode?
1672
+ attr_reader operator_loc: Location
1673
+ attr_reader value: Prism::node
1674
+
1675
+ def initialize: (Source source, Integer node_id, Location location, Integer flags, Prism::node? receiver, Location? call_operator_loc, Location opening_loc, ArgumentsNode? arguments, Location closing_loc, BlockArgumentNode? block, Location operator_loc, Prism::node value) -> void
1676
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?receiver: Prism::node?, ?call_operator_loc: Location?, ?opening_loc: Location, ?arguments: ArgumentsNode?, ?closing_loc: Location, ?block: BlockArgumentNode?, ?operator_loc: Location, ?value: Prism::node) -> IndexAndWriteNode
1677
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, receiver: Prism::node?, call_operator_loc: Location?, opening_loc: Location, arguments: ArgumentsNode?, closing_loc: Location, block: BlockArgumentNode?, operator_loc: Location, value: Prism::node }
1678
+ def call_operator: () -> String?
1679
+ def opening: () -> String
1680
+ def closing: () -> String
1681
+ def operator: () -> String
1682
+ def type: () -> :index_and_write_node
1683
+ | ...
1684
+ def self.type: () -> :index_and_write_node
1685
+ end
1686
+
1687
+ # Represents the use of an assignment operator on a call to `[]`.
1688
+ #
1689
+ # foo.bar[baz] += value
1690
+ # ^^^^^^^^^^^^^^^^^^^^^
1691
+ class IndexOperatorWriteNode < Node
1692
+ include _Node
1693
+
1694
+ def safe_navigation?: () -> bool
1695
+ def variable_call?: () -> bool
1696
+ def attribute_write?: () -> bool
1697
+ def ignore_visibility?: () -> bool
1698
+
1699
+ attr_reader receiver: Prism::node?
1700
+ attr_reader call_operator_loc: Location?
1701
+ attr_reader opening_loc: Location
1702
+ attr_reader arguments: ArgumentsNode?
1703
+ attr_reader closing_loc: Location
1704
+ attr_reader block: BlockArgumentNode?
1705
+ attr_reader binary_operator: Symbol
1706
+ attr_reader binary_operator_loc: Location
1707
+ attr_reader value: Prism::node
1708
+
1709
+ def initialize: (Source source, Integer node_id, Location location, Integer flags, Prism::node? receiver, Location? call_operator_loc, Location opening_loc, ArgumentsNode? arguments, Location closing_loc, BlockArgumentNode? block, Symbol binary_operator, Location binary_operator_loc, Prism::node value) -> void
1710
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?receiver: Prism::node?, ?call_operator_loc: Location?, ?opening_loc: Location, ?arguments: ArgumentsNode?, ?closing_loc: Location, ?block: BlockArgumentNode?, ?binary_operator: Symbol, ?binary_operator_loc: Location, ?value: Prism::node) -> IndexOperatorWriteNode
1711
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, receiver: Prism::node?, call_operator_loc: Location?, opening_loc: Location, arguments: ArgumentsNode?, closing_loc: Location, block: BlockArgumentNode?, binary_operator: Symbol, binary_operator_loc: Location, value: Prism::node }
1712
+ def call_operator: () -> String?
1713
+ def opening: () -> String
1714
+ def closing: () -> String
1715
+ def type: () -> :index_operator_write_node
1716
+ | ...
1717
+ def self.type: () -> :index_operator_write_node
1718
+ end
1719
+
1720
+ # Represents the use of the `||=` operator on a call to `[]`.
1721
+ #
1722
+ # foo.bar[baz] ||= value
1723
+ # ^^^^^^^^^^^^^^^^^^^^^^
1724
+ class IndexOrWriteNode < Node
1725
+ include _Node
1726
+
1727
+ def safe_navigation?: () -> bool
1728
+ def variable_call?: () -> bool
1729
+ def attribute_write?: () -> bool
1730
+ def ignore_visibility?: () -> bool
1731
+
1732
+ attr_reader receiver: Prism::node?
1733
+ attr_reader call_operator_loc: Location?
1734
+ attr_reader opening_loc: Location
1735
+ attr_reader arguments: ArgumentsNode?
1736
+ attr_reader closing_loc: Location
1737
+ attr_reader block: BlockArgumentNode?
1738
+ attr_reader operator_loc: Location
1739
+ attr_reader value: Prism::node
1740
+
1741
+ def initialize: (Source source, Integer node_id, Location location, Integer flags, Prism::node? receiver, Location? call_operator_loc, Location opening_loc, ArgumentsNode? arguments, Location closing_loc, BlockArgumentNode? block, Location operator_loc, Prism::node value) -> void
1742
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?receiver: Prism::node?, ?call_operator_loc: Location?, ?opening_loc: Location, ?arguments: ArgumentsNode?, ?closing_loc: Location, ?block: BlockArgumentNode?, ?operator_loc: Location, ?value: Prism::node) -> IndexOrWriteNode
1743
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, receiver: Prism::node?, call_operator_loc: Location?, opening_loc: Location, arguments: ArgumentsNode?, closing_loc: Location, block: BlockArgumentNode?, operator_loc: Location, value: Prism::node }
1744
+ def call_operator: () -> String?
1745
+ def opening: () -> String
1746
+ def closing: () -> String
1747
+ def operator: () -> String
1748
+ def type: () -> :index_or_write_node
1749
+ | ...
1750
+ def self.type: () -> :index_or_write_node
1751
+ end
1752
+
1753
+ # Represents assigning to an index.
1754
+ #
1755
+ # foo[bar], = 1
1756
+ # ^^^^^^^^
1757
+ #
1758
+ # begin
1759
+ # rescue => foo[bar]
1760
+ # ^^^^^^^^
1761
+ # end
1762
+ #
1763
+ # for foo[bar] in baz do end
1764
+ # ^^^^^^^^
1765
+ class IndexTargetNode < Node
1766
+ include _Node
1767
+
1768
+ def safe_navigation?: () -> bool
1769
+ def variable_call?: () -> bool
1770
+ def attribute_write?: () -> bool
1771
+ def ignore_visibility?: () -> bool
1772
+
1773
+ attr_reader receiver: Prism::node
1774
+ attr_reader opening_loc: Location
1775
+ attr_reader arguments: ArgumentsNode?
1776
+ attr_reader closing_loc: Location
1777
+ attr_reader block: BlockArgumentNode?
1778
+
1779
+ def initialize: (Source source, Integer node_id, Location location, Integer flags, Prism::node receiver, Location opening_loc, ArgumentsNode? arguments, Location closing_loc, BlockArgumentNode? block) -> void
1780
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?receiver: Prism::node, ?opening_loc: Location, ?arguments: ArgumentsNode?, ?closing_loc: Location, ?block: BlockArgumentNode?) -> IndexTargetNode
1781
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, receiver: Prism::node, opening_loc: Location, arguments: ArgumentsNode?, closing_loc: Location, block: BlockArgumentNode? }
1782
+ def opening: () -> String
1783
+ def closing: () -> String
1784
+ def type: () -> :index_target_node
1785
+ | ...
1786
+ def self.type: () -> :index_target_node
1787
+ end
1788
+
1789
+ # Represents the use of the `&&=` operator for assignment to an instance variable.
1790
+ #
1791
+ # @target &&= value
1792
+ # ^^^^^^^^^^^^^^^^^
1793
+ class InstanceVariableAndWriteNode < Node
1794
+ include _Node
1795
+
1796
+ attr_reader name: Symbol
1797
+ attr_reader name_loc: Location
1798
+ attr_reader operator_loc: Location
1799
+ attr_reader value: Prism::node
1800
+
1801
+ def initialize: (Source source, Integer node_id, Location location, Integer flags, Symbol name, Location name_loc, Location operator_loc, Prism::node value) -> void
1802
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node) -> InstanceVariableAndWriteNode
1803
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol, name_loc: Location, operator_loc: Location, value: Prism::node }
1804
+ def operator: () -> String
1805
+ def type: () -> :instance_variable_and_write_node
1806
+ | ...
1807
+ def self.type: () -> :instance_variable_and_write_node
1808
+ end
1809
+
1810
+ # Represents assigning to an instance variable using an operator that isn't `=`.
1811
+ #
1812
+ # @target += value
1813
+ # ^^^^^^^^^^^^^^^^
1814
+ class InstanceVariableOperatorWriteNode < Node
1815
+ include _Node
1816
+
1817
+ attr_reader name: Symbol
1818
+ attr_reader name_loc: Location
1819
+ attr_reader binary_operator_loc: Location
1820
+ attr_reader value: Prism::node
1821
+ attr_reader binary_operator: Symbol
1822
+
1823
+ def initialize: (Source source, Integer node_id, Location location, Integer flags, Symbol name, Location name_loc, Location binary_operator_loc, Prism::node value, Symbol binary_operator) -> void
1824
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?binary_operator_loc: Location, ?value: Prism::node, ?binary_operator: Symbol) -> InstanceVariableOperatorWriteNode
1825
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol, name_loc: Location, binary_operator_loc: Location, value: Prism::node, binary_operator: Symbol }
1826
+ def type: () -> :instance_variable_operator_write_node
1827
+ | ...
1828
+ def self.type: () -> :instance_variable_operator_write_node
1829
+ end
1830
+
1831
+ # Represents the use of the `||=` operator for assignment to an instance variable.
1832
+ #
1833
+ # @target ||= value
1834
+ # ^^^^^^^^^^^^^^^^^
1835
+ class InstanceVariableOrWriteNode < Node
1836
+ include _Node
1837
+
1838
+ attr_reader name: Symbol
1839
+ attr_reader name_loc: Location
1840
+ attr_reader operator_loc: Location
1841
+ attr_reader value: Prism::node
1842
+
1843
+ def initialize: (Source source, Integer node_id, Location location, Integer flags, Symbol name, Location name_loc, Location operator_loc, Prism::node value) -> void
1844
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node) -> InstanceVariableOrWriteNode
1845
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol, name_loc: Location, operator_loc: Location, value: Prism::node }
1846
+ def operator: () -> String
1847
+ def type: () -> :instance_variable_or_write_node
1848
+ | ...
1849
+ def self.type: () -> :instance_variable_or_write_node
1850
+ end
1851
+
1852
+ # Represents referencing an instance variable.
1853
+ #
1854
+ # @foo
1855
+ # ^^^^
1856
+ class InstanceVariableReadNode < Node
1857
+ include _Node
1858
+
1859
+ attr_reader name: Symbol
1860
+
1861
+ def initialize: (Source source, Integer node_id, Location location, Integer flags, Symbol name) -> void
1862
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol) -> InstanceVariableReadNode
1863
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol }
1864
+ def type: () -> :instance_variable_read_node
1865
+ | ...
1866
+ def self.type: () -> :instance_variable_read_node
1867
+ end
1868
+
1869
+ # Represents writing to an instance variable in a context that doesn't have an explicit value.
1870
+ #
1871
+ # @foo, @bar = baz
1872
+ # ^^^^ ^^^^
1873
+ class InstanceVariableTargetNode < Node
1874
+ include _Node
1875
+
1876
+ attr_reader name: Symbol
1877
+
1878
+ def initialize: (Source source, Integer node_id, Location location, Integer flags, Symbol name) -> void
1879
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol) -> InstanceVariableTargetNode
1880
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol }
1881
+ def type: () -> :instance_variable_target_node
1882
+ | ...
1883
+ def self.type: () -> :instance_variable_target_node
1884
+ end
1885
+
1886
+ # Represents writing to an instance variable.
1887
+ #
1888
+ # @foo = 1
1889
+ # ^^^^^^^^
1890
+ class InstanceVariableWriteNode < Node
1891
+ include _Node
1892
+
1893
+ attr_reader name: Symbol
1894
+ attr_reader name_loc: Location
1895
+ attr_reader value: Prism::node
1896
+ attr_reader operator_loc: Location
1897
+
1898
+ def initialize: (Source source, Integer node_id, Location location, Integer flags, Symbol name, Location name_loc, Prism::node value, Location operator_loc) -> void
1899
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?value: Prism::node, ?operator_loc: Location) -> InstanceVariableWriteNode
1900
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol, name_loc: Location, value: Prism::node, operator_loc: Location }
1901
+ def operator: () -> String
1902
+ def type: () -> :instance_variable_write_node
1903
+ | ...
1904
+ def self.type: () -> :instance_variable_write_node
1905
+ end
1906
+
1907
+ # Represents an integer number literal.
1908
+ #
1909
+ # 1
1910
+ # ^
1911
+ class IntegerNode < Node
1912
+ include _Node
1913
+
1914
+ def binary?: () -> bool
1915
+ def decimal?: () -> bool
1916
+ def octal?: () -> bool
1917
+ def hexadecimal?: () -> bool
1918
+
1919
+ attr_reader value: Integer
1920
+
1921
+ def initialize: (Source source, Integer node_id, Location location, Integer flags, Integer value) -> void
1922
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?value: Integer) -> IntegerNode
1923
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, value: Integer }
1924
+ def type: () -> :integer_node
1925
+ | ...
1926
+ def self.type: () -> :integer_node
1927
+ end
1928
+
1929
+ # Represents a regular expression literal that contains interpolation that is being used in the predicate of a conditional to implicitly match against the last line read by an IO object.
1930
+ #
1931
+ # if /foo #{bar} baz/ then end
1932
+ # ^^^^^^^^^^^^^^^^
1933
+ class InterpolatedMatchLastLineNode < Node
1934
+ include _Node
1935
+
1936
+ def ignore_case?: () -> bool
1937
+ def extended?: () -> bool
1938
+ def multi_line?: () -> bool
1939
+ def once?: () -> bool
1940
+ def euc_jp?: () -> bool
1941
+ def ascii_8bit?: () -> bool
1942
+ def windows_31j?: () -> bool
1943
+ def utf_8?: () -> bool
1944
+ def forced_utf8_encoding?: () -> bool
1945
+ def forced_binary_encoding?: () -> bool
1946
+ def forced_us_ascii_encoding?: () -> bool
1947
+
1948
+ attr_reader opening_loc: Location
1949
+ attr_reader parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode]
1950
+ attr_reader closing_loc: Location
1951
+
1952
+ def initialize: (Source source, Integer node_id, Location location, Integer flags, Location opening_loc, Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode] parts, Location closing_loc) -> void
1953
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?opening_loc: Location, ?parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode], ?closing_loc: Location) -> InterpolatedMatchLastLineNode
1954
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, opening_loc: Location, parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode], closing_loc: Location }
1955
+ def opening: () -> String
1956
+ def closing: () -> String
1957
+ def type: () -> :interpolated_match_last_line_node
1958
+ | ...
1959
+ def self.type: () -> :interpolated_match_last_line_node
1960
+ end
1961
+
1962
+ # Represents a regular expression literal that contains interpolation.
1963
+ #
1964
+ # /foo #{bar} baz/
1965
+ # ^^^^^^^^^^^^^^^^
1966
+ class InterpolatedRegularExpressionNode < Node
1967
+ include _Node
1968
+
1969
+ def ignore_case?: () -> bool
1970
+ def extended?: () -> bool
1971
+ def multi_line?: () -> bool
1972
+ def once?: () -> bool
1973
+ def euc_jp?: () -> bool
1974
+ def ascii_8bit?: () -> bool
1975
+ def windows_31j?: () -> bool
1976
+ def utf_8?: () -> bool
1977
+ def forced_utf8_encoding?: () -> bool
1978
+ def forced_binary_encoding?: () -> bool
1979
+ def forced_us_ascii_encoding?: () -> bool
1980
+
1981
+ attr_reader opening_loc: Location
1982
+ attr_reader parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode]
1983
+ attr_reader closing_loc: Location
1984
+
1985
+ def initialize: (Source source, Integer node_id, Location location, Integer flags, Location opening_loc, Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode] parts, Location closing_loc) -> void
1986
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?opening_loc: Location, ?parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode], ?closing_loc: Location) -> InterpolatedRegularExpressionNode
1987
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, opening_loc: Location, parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode], closing_loc: Location }
1988
+ def opening: () -> String
1989
+ def closing: () -> String
1990
+ def type: () -> :interpolated_regular_expression_node
1991
+ | ...
1992
+ def self.type: () -> :interpolated_regular_expression_node
1993
+ end
1994
+
1995
+ # Represents a string literal that contains interpolation.
1996
+ #
1997
+ # "foo #{bar} baz"
1998
+ # ^^^^^^^^^^^^^^^^
1999
+ class InterpolatedStringNode < Node
2000
+ include _Node
2001
+
2002
+ def frozen?: () -> bool
2003
+ def mutable?: () -> bool
2004
+
2005
+ attr_reader opening_loc: Location?
2006
+ attr_reader parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode | InterpolatedStringNode]
2007
+ attr_reader closing_loc: Location?
2008
+
2009
+ def initialize: (Source source, Integer node_id, Location location, Integer flags, Location? opening_loc, Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode | InterpolatedStringNode] parts, Location? closing_loc) -> void
2010
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?opening_loc: Location?, ?parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode | InterpolatedStringNode], ?closing_loc: Location?) -> InterpolatedStringNode
2011
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, opening_loc: Location?, parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode | InterpolatedStringNode], closing_loc: Location? }
2012
+ def opening: () -> String?
2013
+ def closing: () -> String?
2014
+ def type: () -> :interpolated_string_node
2015
+ | ...
2016
+ def self.type: () -> :interpolated_string_node
2017
+ end
2018
+
2019
+ # Represents a symbol literal that contains interpolation.
2020
+ #
2021
+ # :"foo #{bar} baz"
2022
+ # ^^^^^^^^^^^^^^^^^
2023
+ class InterpolatedSymbolNode < Node
2024
+ include _Node
2025
+
2026
+ attr_reader opening_loc: Location?
2027
+ attr_reader parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode]
2028
+ attr_reader closing_loc: Location?
2029
+
2030
+ def initialize: (Source source, Integer node_id, Location location, Integer flags, Location? opening_loc, Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode] parts, Location? closing_loc) -> void
2031
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?opening_loc: Location?, ?parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode], ?closing_loc: Location?) -> InterpolatedSymbolNode
2032
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, opening_loc: Location?, parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode], closing_loc: Location? }
2033
+ def opening: () -> String?
2034
+ def closing: () -> String?
2035
+ def type: () -> :interpolated_symbol_node
2036
+ | ...
2037
+ def self.type: () -> :interpolated_symbol_node
2038
+ end
2039
+
2040
+ # Represents an xstring literal that contains interpolation.
2041
+ #
2042
+ # `foo #{bar} baz`
2043
+ # ^^^^^^^^^^^^^^^^
2044
+ class InterpolatedXStringNode < Node
2045
+ include _Node
2046
+
2047
+ attr_reader opening_loc: Location
2048
+ attr_reader parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode]
2049
+ attr_reader closing_loc: Location
2050
+
2051
+ def initialize: (Source source, Integer node_id, Location location, Integer flags, Location opening_loc, Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode] parts, Location closing_loc) -> void
2052
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?opening_loc: Location, ?parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode], ?closing_loc: Location) -> InterpolatedXStringNode
2053
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, opening_loc: Location, parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode], closing_loc: Location }
2054
+ def opening: () -> String
2055
+ def closing: () -> String
2056
+ def type: () -> :interpolated_x_string_node
2057
+ | ...
2058
+ def self.type: () -> :interpolated_x_string_node
2059
+ end
2060
+
2061
+ # Represents reading from the implicit `it` local variable.
2062
+ #
2063
+ # -> { it }
2064
+ # ^^
2065
+ class ItLocalVariableReadNode < Node
2066
+ include _Node
2067
+
2068
+
2069
+ def initialize: (Source source, Integer node_id, Location location, Integer flags) -> void
2070
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer) -> ItLocalVariableReadNode
2071
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location }
2072
+ def type: () -> :it_local_variable_read_node
2073
+ | ...
2074
+ def self.type: () -> :it_local_variable_read_node
2075
+ end
2076
+
2077
+ # Represents an implicit set of parameters through the use of the `it` keyword within a block or lambda.
2078
+ #
2079
+ # -> { it + it }
2080
+ # ^^^^^^^^^^^^^^
2081
+ class ItParametersNode < Node
2082
+ include _Node
2083
+
2084
+
2085
+ def initialize: (Source source, Integer node_id, Location location, Integer flags) -> void
2086
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer) -> ItParametersNode
2087
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location }
2088
+ def type: () -> :it_parameters_node
2089
+ | ...
2090
+ def self.type: () -> :it_parameters_node
2091
+ end
2092
+
2093
+ # Represents a hash literal without opening and closing braces.
2094
+ #
2095
+ # foo(a: b)
2096
+ # ^^^^
2097
+ class KeywordHashNode < Node
2098
+ include _Node
2099
+
2100
+ def symbol_keys?: () -> bool
2101
+
2102
+ attr_reader elements: Array[AssocNode | AssocSplatNode]
2103
+
2104
+ def initialize: (Source source, Integer node_id, Location location, Integer flags, Array[AssocNode | AssocSplatNode] elements) -> void
2105
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?elements: Array[AssocNode | AssocSplatNode]) -> KeywordHashNode
2106
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, elements: Array[AssocNode | AssocSplatNode] }
2107
+ def type: () -> :keyword_hash_node
2108
+ | ...
2109
+ def self.type: () -> :keyword_hash_node
2110
+ end
2111
+
2112
+ # Represents a keyword rest parameter to a method, block, or lambda definition.
2113
+ #
2114
+ # def a(**b)
2115
+ # ^^^
2116
+ # end
2117
+ class KeywordRestParameterNode < Node
2118
+ include _Node
2119
+
2120
+ def repeated_parameter?: () -> bool
2121
+
2122
+ attr_reader name: Symbol?
2123
+ attr_reader name_loc: Location?
2124
+ attr_reader operator_loc: Location
2125
+
2126
+ def initialize: (Source source, Integer node_id, Location location, Integer flags, Symbol? name, Location? name_loc, Location operator_loc) -> void
2127
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol?, ?name_loc: Location?, ?operator_loc: Location) -> KeywordRestParameterNode
2128
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol?, name_loc: Location?, operator_loc: Location }
2129
+ def operator: () -> String
2130
+ def type: () -> :keyword_rest_parameter_node
2131
+ | ...
2132
+ def self.type: () -> :keyword_rest_parameter_node
2133
+ end
2134
+
2135
+ # Represents using a lambda literal (not the lambda method call).
2136
+ #
2137
+ # ->(value) { value * 2 }
2138
+ # ^^^^^^^^^^^^^^^^^^^^^^^
2139
+ class LambdaNode < Node
2140
+ include _Node
2141
+
2142
+ attr_reader locals: Array[Symbol]
2143
+ attr_reader operator_loc: Location
2144
+ attr_reader opening_loc: Location
2145
+ attr_reader closing_loc: Location
2146
+ attr_reader parameters: BlockParametersNode | NumberedParametersNode | ItParametersNode | nil
2147
+ attr_reader body: StatementsNode | BeginNode | nil
2148
+
2149
+ def initialize: (Source source, Integer node_id, Location location, Integer flags, Array[Symbol] locals, Location operator_loc, Location opening_loc, Location closing_loc, BlockParametersNode | NumberedParametersNode | ItParametersNode | nil parameters, StatementsNode | BeginNode | nil body) -> void
2150
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?locals: Array[Symbol], ?operator_loc: Location, ?opening_loc: Location, ?closing_loc: Location, ?parameters: BlockParametersNode | NumberedParametersNode | ItParametersNode | nil, ?body: StatementsNode | BeginNode | nil) -> LambdaNode
2151
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, locals: Array[Symbol], operator_loc: Location, opening_loc: Location, closing_loc: Location, parameters: BlockParametersNode | NumberedParametersNode | ItParametersNode | nil, body: StatementsNode | BeginNode | nil }
2152
+ def operator: () -> String
2153
+ def opening: () -> String
2154
+ def closing: () -> String
2155
+ def type: () -> :lambda_node
2156
+ | ...
2157
+ def self.type: () -> :lambda_node
2158
+ end
2159
+
2160
+ # Represents the use of the `&&=` operator for assignment to a local variable.
2161
+ #
2162
+ # target &&= value
2163
+ # ^^^^^^^^^^^^^^^^
2164
+ class LocalVariableAndWriteNode < Node
2165
+ include _Node
2166
+
2167
+ attr_reader name_loc: Location
2168
+ attr_reader operator_loc: Location
2169
+ attr_reader value: Prism::node
2170
+ attr_reader name: Symbol
2171
+ attr_reader depth: Integer
2172
+
2173
+ def initialize: (Source source, Integer node_id, Location location, Integer flags, Location name_loc, Location operator_loc, Prism::node value, Symbol name, Integer depth) -> void
2174
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node, ?name: Symbol, ?depth: Integer) -> LocalVariableAndWriteNode
2175
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name_loc: Location, operator_loc: Location, value: Prism::node, name: Symbol, depth: Integer }
2176
+ def operator: () -> String
2177
+ def type: () -> :local_variable_and_write_node
2178
+ | ...
2179
+ def self.type: () -> :local_variable_and_write_node
2180
+ end
2181
+
2182
+ # Represents assigning to a local variable using an operator that isn't `=`.
2183
+ #
2184
+ # target += value
2185
+ # ^^^^^^^^^^^^^^^
2186
+ class LocalVariableOperatorWriteNode < Node
2187
+ include _Node
2188
+
2189
+ attr_reader name_loc: Location
2190
+ attr_reader binary_operator_loc: Location
2191
+ attr_reader value: Prism::node
2192
+ attr_reader name: Symbol
2193
+ attr_reader binary_operator: Symbol
2194
+ attr_reader depth: Integer
2195
+
2196
+ def initialize: (Source source, Integer node_id, Location location, Integer flags, Location name_loc, Location binary_operator_loc, Prism::node value, Symbol name, Symbol binary_operator, Integer depth) -> void
2197
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name_loc: Location, ?binary_operator_loc: Location, ?value: Prism::node, ?name: Symbol, ?binary_operator: Symbol, ?depth: Integer) -> LocalVariableOperatorWriteNode
2198
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name_loc: Location, binary_operator_loc: Location, value: Prism::node, name: Symbol, binary_operator: Symbol, depth: Integer }
2199
+ def type: () -> :local_variable_operator_write_node
2200
+ | ...
2201
+ def self.type: () -> :local_variable_operator_write_node
2202
+ end
2203
+
2204
+ # Represents the use of the `||=` operator for assignment to a local variable.
2205
+ #
2206
+ # target ||= value
2207
+ # ^^^^^^^^^^^^^^^^
2208
+ class LocalVariableOrWriteNode < Node
2209
+ include _Node
2210
+
2211
+ attr_reader name_loc: Location
2212
+ attr_reader operator_loc: Location
2213
+ attr_reader value: Prism::node
2214
+ attr_reader name: Symbol
2215
+ attr_reader depth: Integer
2216
+
2217
+ def initialize: (Source source, Integer node_id, Location location, Integer flags, Location name_loc, Location operator_loc, Prism::node value, Symbol name, Integer depth) -> void
2218
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node, ?name: Symbol, ?depth: Integer) -> LocalVariableOrWriteNode
2219
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name_loc: Location, operator_loc: Location, value: Prism::node, name: Symbol, depth: Integer }
2220
+ def operator: () -> String
2221
+ def type: () -> :local_variable_or_write_node
2222
+ | ...
2223
+ def self.type: () -> :local_variable_or_write_node
2224
+ end
2225
+
2226
+ # Represents reading a local variable. Note that this requires that a local variable of the same name has already been written to in the same scope, otherwise it is parsed as a method call.
2227
+ #
2228
+ # foo
2229
+ # ^^^
2230
+ class LocalVariableReadNode < Node
2231
+ include _Node
2232
+
2233
+ attr_reader name: Symbol
2234
+ attr_reader depth: Integer
2235
+
2236
+ def initialize: (Source source, Integer node_id, Location location, Integer flags, Symbol name, Integer depth) -> void
2237
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?depth: Integer) -> LocalVariableReadNode
2238
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol, depth: Integer }
2239
+ def type: () -> :local_variable_read_node
2240
+ | ...
2241
+ def self.type: () -> :local_variable_read_node
2242
+ end
2243
+
2244
+ # Represents writing to a local variable in a context that doesn't have an explicit value.
2245
+ #
2246
+ # foo, bar = baz
2247
+ # ^^^ ^^^
2248
+ class LocalVariableTargetNode < Node
2249
+ include _Node
2250
+
2251
+ attr_reader name: Symbol
2252
+ attr_reader depth: Integer
2253
+
2254
+ def initialize: (Source source, Integer node_id, Location location, Integer flags, Symbol name, Integer depth) -> void
2255
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?depth: Integer) -> LocalVariableTargetNode
2256
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol, depth: Integer }
2257
+ def type: () -> :local_variable_target_node
2258
+ | ...
2259
+ def self.type: () -> :local_variable_target_node
2260
+ end
2261
+
2262
+ # Represents writing to a local variable.
2263
+ #
2264
+ # foo = 1
2265
+ # ^^^^^^^
2266
+ class LocalVariableWriteNode < Node
2267
+ include _Node
2268
+
2269
+ attr_reader name: Symbol
2270
+ attr_reader depth: Integer
2271
+ attr_reader name_loc: Location
2272
+ attr_reader value: Prism::node
2273
+ attr_reader operator_loc: Location
2274
+
2275
+ def initialize: (Source source, Integer node_id, Location location, Integer flags, Symbol name, Integer depth, Location name_loc, Prism::node value, Location operator_loc) -> void
2276
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?depth: Integer, ?name_loc: Location, ?value: Prism::node, ?operator_loc: Location) -> LocalVariableWriteNode
2277
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol, depth: Integer, name_loc: Location, value: Prism::node, operator_loc: Location }
2278
+ def operator: () -> String
2279
+ def type: () -> :local_variable_write_node
2280
+ | ...
2281
+ def self.type: () -> :local_variable_write_node
2282
+ end
2283
+
2284
+ # Represents a regular expression literal used in the predicate of a conditional to implicitly match against the last line read by an IO object.
2285
+ #
2286
+ # if /foo/i then end
2287
+ # ^^^^^^
2288
+ class MatchLastLineNode < Node
2289
+ include _Node
2290
+
2291
+ def ignore_case?: () -> bool
2292
+ def extended?: () -> bool
2293
+ def multi_line?: () -> bool
2294
+ def once?: () -> bool
2295
+ def euc_jp?: () -> bool
2296
+ def ascii_8bit?: () -> bool
2297
+ def windows_31j?: () -> bool
2298
+ def utf_8?: () -> bool
2299
+ def forced_utf8_encoding?: () -> bool
2300
+ def forced_binary_encoding?: () -> bool
2301
+ def forced_us_ascii_encoding?: () -> bool
2302
+
2303
+ attr_reader opening_loc: Location
2304
+ attr_reader content_loc: Location
2305
+ attr_reader closing_loc: Location
2306
+ attr_reader unescaped: String
2307
+
2308
+ def initialize: (Source source, Integer node_id, Location location, Integer flags, Location opening_loc, Location content_loc, Location closing_loc, String unescaped) -> void
2309
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?opening_loc: Location, ?content_loc: Location, ?closing_loc: Location, ?unescaped: String) -> MatchLastLineNode
2310
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, opening_loc: Location, content_loc: Location, closing_loc: Location, unescaped: String }
2311
+ def opening: () -> String
2312
+ def content: () -> String
2313
+ def closing: () -> String
2314
+ def type: () -> :match_last_line_node
2315
+ | ...
2316
+ def self.type: () -> :match_last_line_node
2317
+ end
2318
+
2319
+ # Represents the use of the modifier `in` operator.
2320
+ #
2321
+ # foo in bar
2322
+ # ^^^^^^^^^^
2323
+ class MatchPredicateNode < Node
2324
+ include _Node
2325
+
2326
+ attr_reader value: Prism::node
2327
+ attr_reader pattern: Prism::node
2328
+ attr_reader operator_loc: Location
2329
+
2330
+ def initialize: (Source source, Integer node_id, Location location, Integer flags, Prism::node value, Prism::node pattern, Location operator_loc) -> void
2331
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?value: Prism::node, ?pattern: Prism::node, ?operator_loc: Location) -> MatchPredicateNode
2332
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, value: Prism::node, pattern: Prism::node, operator_loc: Location }
2333
+ def operator: () -> String
2334
+ def type: () -> :match_predicate_node
2335
+ | ...
2336
+ def self.type: () -> :match_predicate_node
2337
+ end
2338
+
2339
+ # Represents the use of the `=>` operator.
2340
+ #
2341
+ # foo => bar
2342
+ # ^^^^^^^^^^
2343
+ class MatchRequiredNode < Node
2344
+ include _Node
2345
+
2346
+ attr_reader value: Prism::node
2347
+ attr_reader pattern: Prism::node
2348
+ attr_reader operator_loc: Location
2349
+
2350
+ def initialize: (Source source, Integer node_id, Location location, Integer flags, Prism::node value, Prism::node pattern, Location operator_loc) -> void
2351
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?value: Prism::node, ?pattern: Prism::node, ?operator_loc: Location) -> MatchRequiredNode
2352
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, value: Prism::node, pattern: Prism::node, operator_loc: Location }
2353
+ def operator: () -> String
2354
+ def type: () -> :match_required_node
2355
+ | ...
2356
+ def self.type: () -> :match_required_node
2357
+ end
2358
+
2359
+ # Represents writing local variables using a regular expression match with named capture groups.
2360
+ #
2361
+ # /(?<foo>bar)/ =~ baz
2362
+ # ^^^^^^^^^^^^^^^^^^^^
2363
+ class MatchWriteNode < Node
2364
+ include _Node
2365
+
2366
+ attr_reader call: CallNode
2367
+ attr_reader targets: Array[LocalVariableTargetNode]
2368
+
2369
+ def initialize: (Source source, Integer node_id, Location location, Integer flags, CallNode call, Array[LocalVariableTargetNode] targets) -> void
2370
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?call: CallNode, ?targets: Array[LocalVariableTargetNode]) -> MatchWriteNode
2371
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, call: CallNode, targets: Array[LocalVariableTargetNode] }
2372
+ def type: () -> :match_write_node
2373
+ | ...
2374
+ def self.type: () -> :match_write_node
2375
+ end
2376
+
2377
+ # Represents a node that is missing from the source and results in a syntax error.
2378
+ class MissingNode < Node
2379
+ include _Node
2380
+
2381
+
2382
+ def initialize: (Source source, Integer node_id, Location location, Integer flags) -> void
2383
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer) -> MissingNode
2384
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location }
2385
+ def type: () -> :missing_node
2386
+ | ...
2387
+ def self.type: () -> :missing_node
2388
+ end
2389
+
2390
+ # Represents a module declaration involving the `module` keyword.
2391
+ #
2392
+ # module Foo end
2393
+ # ^^^^^^^^^^^^^^
2394
+ class ModuleNode < Node
2395
+ include _Node
2396
+
2397
+ attr_reader locals: Array[Symbol]
2398
+ attr_reader module_keyword_loc: Location
2399
+ attr_reader constant_path: ConstantReadNode | ConstantPathNode
2400
+ attr_reader body: StatementsNode | BeginNode | nil
2401
+ attr_reader end_keyword_loc: Location
2402
+ attr_reader name: Symbol
2403
+
2404
+ def initialize: (Source source, Integer node_id, Location location, Integer flags, Array[Symbol] locals, Location module_keyword_loc, ConstantReadNode | ConstantPathNode constant_path, StatementsNode | BeginNode | nil body, Location end_keyword_loc, Symbol name) -> void
2405
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?locals: Array[Symbol], ?module_keyword_loc: Location, ?constant_path: ConstantReadNode | ConstantPathNode, ?body: StatementsNode | BeginNode | nil, ?end_keyword_loc: Location, ?name: Symbol) -> ModuleNode
2406
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, locals: Array[Symbol], module_keyword_loc: Location, constant_path: ConstantReadNode | ConstantPathNode, body: StatementsNode | BeginNode | nil, end_keyword_loc: Location, name: Symbol }
2407
+ def module_keyword: () -> String
2408
+ def end_keyword: () -> String
2409
+ def type: () -> :module_node
2410
+ | ...
2411
+ def self.type: () -> :module_node
2412
+ end
2413
+
2414
+ # Represents a multi-target expression.
2415
+ #
2416
+ # a, (b, c) = 1, 2, 3
2417
+ # ^^^^^^
2418
+ #
2419
+ # This can be a part of `MultiWriteNode` as above, or the target of a `for` loop
2420
+ #
2421
+ # for a, b in [[1, 2], [3, 4]]
2422
+ # ^^^^
2423
+ class MultiTargetNode < Node
2424
+ include _Node
2425
+
2426
+ attr_reader lefts: Array[LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode | RequiredParameterNode]
2427
+ attr_reader rest: ImplicitRestNode | SplatNode | nil
2428
+ attr_reader rights: Array[LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode | RequiredParameterNode]
2429
+ attr_reader lparen_loc: Location?
2430
+ attr_reader rparen_loc: Location?
2431
+
2432
+ def initialize: (Source source, Integer node_id, Location location, Integer flags, Array[LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode | RequiredParameterNode] lefts, ImplicitRestNode | SplatNode | nil rest, Array[LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode | RequiredParameterNode] rights, Location? lparen_loc, Location? rparen_loc) -> void
2433
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?lefts: Array[LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode | RequiredParameterNode], ?rest: ImplicitRestNode | SplatNode | nil, ?rights: Array[LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode | RequiredParameterNode], ?lparen_loc: Location?, ?rparen_loc: Location?) -> MultiTargetNode
2434
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, lefts: Array[LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode | RequiredParameterNode], rest: ImplicitRestNode | SplatNode | nil, rights: Array[LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode | RequiredParameterNode], lparen_loc: Location?, rparen_loc: Location? }
2435
+ def lparen: () -> String?
2436
+ def rparen: () -> String?
2437
+ def type: () -> :multi_target_node
2438
+ | ...
2439
+ def self.type: () -> :multi_target_node
2440
+ end
2441
+
2442
+ # Represents a write to a multi-target expression.
2443
+ #
2444
+ # a, b, c = 1, 2, 3
2445
+ # ^^^^^^^^^^^^^^^^^
2446
+ class MultiWriteNode < Node
2447
+ include _Node
2448
+
2449
+ attr_reader lefts: Array[LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode]
2450
+ attr_reader rest: ImplicitRestNode | SplatNode | nil
2451
+ attr_reader rights: Array[LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode]
2452
+ attr_reader lparen_loc: Location?
2453
+ attr_reader rparen_loc: Location?
2454
+ attr_reader operator_loc: Location
2455
+ attr_reader value: Prism::node
2456
+
2457
+ def initialize: (Source source, Integer node_id, Location location, Integer flags, Array[LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode] lefts, ImplicitRestNode | SplatNode | nil rest, Array[LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode] rights, Location? lparen_loc, Location? rparen_loc, Location operator_loc, Prism::node value) -> void
2458
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?lefts: Array[LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode], ?rest: ImplicitRestNode | SplatNode | nil, ?rights: Array[LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode], ?lparen_loc: Location?, ?rparen_loc: Location?, ?operator_loc: Location, ?value: Prism::node) -> MultiWriteNode
2459
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, lefts: Array[LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode], rest: ImplicitRestNode | SplatNode | nil, rights: Array[LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode], lparen_loc: Location?, rparen_loc: Location?, operator_loc: Location, value: Prism::node }
2460
+ def lparen: () -> String?
2461
+ def rparen: () -> String?
2462
+ def operator: () -> String
2463
+ def type: () -> :multi_write_node
2464
+ | ...
2465
+ def self.type: () -> :multi_write_node
2466
+ end
2467
+
2468
+ # Represents the use of the `next` keyword.
2469
+ #
2470
+ # next 1
2471
+ # ^^^^^^
2472
+ class NextNode < Node
2473
+ include _Node
2474
+
2475
+ attr_reader arguments: ArgumentsNode?
2476
+ attr_reader keyword_loc: Location
2477
+
2478
+ def initialize: (Source source, Integer node_id, Location location, Integer flags, ArgumentsNode? arguments, Location keyword_loc) -> void
2479
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?arguments: ArgumentsNode?, ?keyword_loc: Location) -> NextNode
2480
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, arguments: ArgumentsNode?, keyword_loc: Location }
2481
+ def keyword: () -> String
2482
+ def type: () -> :next_node
2483
+ | ...
2484
+ def self.type: () -> :next_node
2485
+ end
2486
+
2487
+ # Represents the use of the `nil` keyword.
2488
+ #
2489
+ # nil
2490
+ # ^^^
2491
+ class NilNode < Node
2492
+ include _Node
2493
+
2494
+
2495
+ def initialize: (Source source, Integer node_id, Location location, Integer flags) -> void
2496
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer) -> NilNode
2497
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location }
2498
+ def type: () -> :nil_node
2499
+ | ...
2500
+ def self.type: () -> :nil_node
2501
+ end
2502
+
2503
+ # Represents the use of `**nil` inside method arguments.
2504
+ #
2505
+ # def a(**nil)
2506
+ # ^^^^^
2507
+ # end
2508
+ class NoKeywordsParameterNode < Node
2509
+ include _Node
2510
+
2511
+ attr_reader operator_loc: Location
2512
+ attr_reader keyword_loc: Location
2513
+
2514
+ def initialize: (Source source, Integer node_id, Location location, Integer flags, Location operator_loc, Location keyword_loc) -> void
2515
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?operator_loc: Location, ?keyword_loc: Location) -> NoKeywordsParameterNode
2516
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, operator_loc: Location, keyword_loc: Location }
2517
+ def operator: () -> String
2518
+ def keyword: () -> String
2519
+ def type: () -> :no_keywords_parameter_node
2520
+ | ...
2521
+ def self.type: () -> :no_keywords_parameter_node
2522
+ end
2523
+
2524
+ # Represents an implicit set of parameters through the use of numbered parameters within a block or lambda.
2525
+ #
2526
+ # -> { _1 + _2 }
2527
+ # ^^^^^^^^^^^^^^
2528
+ class NumberedParametersNode < Node
2529
+ include _Node
2530
+
2531
+ attr_reader maximum: Integer
2532
+
2533
+ def initialize: (Source source, Integer node_id, Location location, Integer flags, Integer maximum) -> void
2534
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?maximum: Integer) -> NumberedParametersNode
2535
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, maximum: Integer }
2536
+ def type: () -> :numbered_parameters_node
2537
+ | ...
2538
+ def self.type: () -> :numbered_parameters_node
2539
+ end
2540
+
2541
+ # Represents reading a numbered reference to a capture in the previous match.
2542
+ #
2543
+ # $1
2544
+ # ^^
2545
+ class NumberedReferenceReadNode < Node
2546
+ include _Node
2547
+
2548
+ attr_reader number: Integer
2549
+
2550
+ def initialize: (Source source, Integer node_id, Location location, Integer flags, Integer number) -> void
2551
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?number: Integer) -> NumberedReferenceReadNode
2552
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, number: Integer }
2553
+ def type: () -> :numbered_reference_read_node
2554
+ | ...
2555
+ def self.type: () -> :numbered_reference_read_node
2556
+ end
2557
+
2558
+ # Represents an optional keyword parameter to a method, block, or lambda definition.
2559
+ #
2560
+ # def a(b: 1)
2561
+ # ^^^^
2562
+ # end
2563
+ class OptionalKeywordParameterNode < Node
2564
+ include _Node
2565
+
2566
+ def repeated_parameter?: () -> bool
2567
+
2568
+ attr_reader name: Symbol
2569
+ attr_reader name_loc: Location
2570
+ attr_reader value: Prism::node
2571
+
2572
+ def initialize: (Source source, Integer node_id, Location location, Integer flags, Symbol name, Location name_loc, Prism::node value) -> void
2573
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?value: Prism::node) -> OptionalKeywordParameterNode
2574
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol, name_loc: Location, value: Prism::node }
2575
+ def type: () -> :optional_keyword_parameter_node
2576
+ | ...
2577
+ def self.type: () -> :optional_keyword_parameter_node
2578
+ end
2579
+
2580
+ # Represents an optional parameter to a method, block, or lambda definition.
2581
+ #
2582
+ # def a(b = 1)
2583
+ # ^^^^^
2584
+ # end
2585
+ class OptionalParameterNode < Node
2586
+ include _Node
2587
+
2588
+ def repeated_parameter?: () -> bool
2589
+
2590
+ attr_reader name: Symbol
2591
+ attr_reader name_loc: Location
2592
+ attr_reader operator_loc: Location
2593
+ attr_reader value: Prism::node
2594
+
2595
+ def initialize: (Source source, Integer node_id, Location location, Integer flags, Symbol name, Location name_loc, Location operator_loc, Prism::node value) -> void
2596
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node) -> OptionalParameterNode
2597
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol, name_loc: Location, operator_loc: Location, value: Prism::node }
2598
+ def operator: () -> String
2599
+ def type: () -> :optional_parameter_node
2600
+ | ...
2601
+ def self.type: () -> :optional_parameter_node
2602
+ end
2603
+
2604
+ # Represents the use of the `||` operator or the `or` keyword.
2605
+ #
2606
+ # left or right
2607
+ # ^^^^^^^^^^^^^
2608
+ class OrNode < Node
2609
+ include _Node
2610
+
2611
+ attr_reader left: Prism::node
2612
+ attr_reader right: Prism::node
2613
+ attr_reader operator_loc: Location
2614
+
2615
+ def initialize: (Source source, Integer node_id, Location location, Integer flags, Prism::node left, Prism::node right, Location operator_loc) -> void
2616
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?left: Prism::node, ?right: Prism::node, ?operator_loc: Location) -> OrNode
2617
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, left: Prism::node, right: Prism::node, operator_loc: Location }
2618
+ def operator: () -> String
2619
+ def type: () -> :or_node
2620
+ | ...
2621
+ def self.type: () -> :or_node
2622
+ end
2623
+
2624
+ # Represents the list of parameters on a method, block, or lambda definition.
2625
+ #
2626
+ # def a(b, c, d)
2627
+ # ^^^^^^^
2628
+ # end
2629
+ class ParametersNode < Node
2630
+ include _Node
2631
+
2632
+ attr_reader requireds: Array[RequiredParameterNode | MultiTargetNode]
2633
+ attr_reader optionals: Array[OptionalParameterNode]
2634
+ attr_reader rest: RestParameterNode | ImplicitRestNode | nil
2635
+ attr_reader posts: Array[RequiredParameterNode | MultiTargetNode]
2636
+ attr_reader keywords: Array[RequiredKeywordParameterNode | OptionalKeywordParameterNode]
2637
+ attr_reader keyword_rest: KeywordRestParameterNode | ForwardingParameterNode | NoKeywordsParameterNode | nil
2638
+ attr_reader block: BlockParameterNode?
2639
+
2640
+ def initialize: (Source source, Integer node_id, Location location, Integer flags, Array[RequiredParameterNode | MultiTargetNode] requireds, Array[OptionalParameterNode] optionals, RestParameterNode | ImplicitRestNode | nil rest, Array[RequiredParameterNode | MultiTargetNode] posts, Array[RequiredKeywordParameterNode | OptionalKeywordParameterNode] keywords, KeywordRestParameterNode | ForwardingParameterNode | NoKeywordsParameterNode | nil keyword_rest, BlockParameterNode? block) -> void
2641
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?requireds: Array[RequiredParameterNode | MultiTargetNode], ?optionals: Array[OptionalParameterNode], ?rest: RestParameterNode | ImplicitRestNode | nil, ?posts: Array[RequiredParameterNode | MultiTargetNode], ?keywords: Array[RequiredKeywordParameterNode | OptionalKeywordParameterNode], ?keyword_rest: KeywordRestParameterNode | ForwardingParameterNode | NoKeywordsParameterNode | nil, ?block: BlockParameterNode?) -> ParametersNode
2642
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, requireds: Array[RequiredParameterNode | MultiTargetNode], optionals: Array[OptionalParameterNode], rest: RestParameterNode | ImplicitRestNode | nil, posts: Array[RequiredParameterNode | MultiTargetNode], keywords: Array[RequiredKeywordParameterNode | OptionalKeywordParameterNode], keyword_rest: KeywordRestParameterNode | ForwardingParameterNode | NoKeywordsParameterNode | nil, block: BlockParameterNode? }
2643
+ def type: () -> :parameters_node
2644
+ | ...
2645
+ def self.type: () -> :parameters_node
2646
+ end
2647
+
2648
+ # Represents a parenthesized expression
2649
+ #
2650
+ # (10 + 34)
2651
+ # ^^^^^^^^^
2652
+ class ParenthesesNode < Node
2653
+ include _Node
2654
+
2655
+ def multiple_statements?: () -> bool
2656
+
2657
+ attr_reader body: Prism::node?
2658
+ attr_reader opening_loc: Location
2659
+ attr_reader closing_loc: Location
2660
+
2661
+ def initialize: (Source source, Integer node_id, Location location, Integer flags, Prism::node? body, Location opening_loc, Location closing_loc) -> void
2662
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?body: Prism::node?, ?opening_loc: Location, ?closing_loc: Location) -> ParenthesesNode
2663
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, body: Prism::node?, opening_loc: Location, closing_loc: Location }
2664
+ def opening: () -> String
2665
+ def closing: () -> String
2666
+ def type: () -> :parentheses_node
2667
+ | ...
2668
+ def self.type: () -> :parentheses_node
2669
+ end
2670
+
2671
+ # Represents the use of the `^` operator for pinning an expression in a pattern matching expression.
2672
+ #
2673
+ # foo in ^(bar)
2674
+ # ^^^^^^
2675
+ class PinnedExpressionNode < Node
2676
+ include _Node
2677
+
2678
+ attr_reader expression: Prism::node
2679
+ attr_reader operator_loc: Location
2680
+ attr_reader lparen_loc: Location
2681
+ attr_reader rparen_loc: Location
2682
+
2683
+ def initialize: (Source source, Integer node_id, Location location, Integer flags, Prism::node expression, Location operator_loc, Location lparen_loc, Location rparen_loc) -> void
2684
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?expression: Prism::node, ?operator_loc: Location, ?lparen_loc: Location, ?rparen_loc: Location) -> PinnedExpressionNode
2685
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, expression: Prism::node, operator_loc: Location, lparen_loc: Location, rparen_loc: Location }
2686
+ def operator: () -> String
2687
+ def lparen: () -> String
2688
+ def rparen: () -> String
2689
+ def type: () -> :pinned_expression_node
2690
+ | ...
2691
+ def self.type: () -> :pinned_expression_node
2692
+ end
2693
+
2694
+ # Represents the use of the `^` operator for pinning a variable in a pattern matching expression.
2695
+ #
2696
+ # foo in ^bar
2697
+ # ^^^^
2698
+ class PinnedVariableNode < Node
2699
+ include _Node
2700
+
2701
+ attr_reader variable: LocalVariableReadNode | InstanceVariableReadNode | ClassVariableReadNode | GlobalVariableReadNode | BackReferenceReadNode | NumberedReferenceReadNode | ItLocalVariableReadNode
2702
+ attr_reader operator_loc: Location
2703
+
2704
+ def initialize: (Source source, Integer node_id, Location location, Integer flags, LocalVariableReadNode | InstanceVariableReadNode | ClassVariableReadNode | GlobalVariableReadNode | BackReferenceReadNode | NumberedReferenceReadNode | ItLocalVariableReadNode variable, Location operator_loc) -> void
2705
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?variable: LocalVariableReadNode | InstanceVariableReadNode | ClassVariableReadNode | GlobalVariableReadNode | BackReferenceReadNode | NumberedReferenceReadNode | ItLocalVariableReadNode, ?operator_loc: Location) -> PinnedVariableNode
2706
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, variable: LocalVariableReadNode | InstanceVariableReadNode | ClassVariableReadNode | GlobalVariableReadNode | BackReferenceReadNode | NumberedReferenceReadNode | ItLocalVariableReadNode, operator_loc: Location }
2707
+ def operator: () -> String
2708
+ def type: () -> :pinned_variable_node
2709
+ | ...
2710
+ def self.type: () -> :pinned_variable_node
2711
+ end
2712
+
2713
+ # Represents the use of the `END` keyword.
2714
+ #
2715
+ # END { foo }
2716
+ # ^^^^^^^^^^^
2717
+ class PostExecutionNode < Node
2718
+ include _Node
2719
+
2720
+ attr_reader statements: StatementsNode?
2721
+ attr_reader keyword_loc: Location
2722
+ attr_reader opening_loc: Location
2723
+ attr_reader closing_loc: Location
2724
+
2725
+ def initialize: (Source source, Integer node_id, Location location, Integer flags, StatementsNode? statements, Location keyword_loc, Location opening_loc, Location closing_loc) -> void
2726
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?statements: StatementsNode?, ?keyword_loc: Location, ?opening_loc: Location, ?closing_loc: Location) -> PostExecutionNode
2727
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, statements: StatementsNode?, keyword_loc: Location, opening_loc: Location, closing_loc: Location }
2728
+ def keyword: () -> String
2729
+ def opening: () -> String
2730
+ def closing: () -> String
2731
+ def type: () -> :post_execution_node
2732
+ | ...
2733
+ def self.type: () -> :post_execution_node
2734
+ end
2735
+
2736
+ # Represents the use of the `BEGIN` keyword.
2737
+ #
2738
+ # BEGIN { foo }
2739
+ # ^^^^^^^^^^^^^
2740
+ class PreExecutionNode < Node
2741
+ include _Node
2742
+
2743
+ attr_reader statements: StatementsNode?
2744
+ attr_reader keyword_loc: Location
2745
+ attr_reader opening_loc: Location
2746
+ attr_reader closing_loc: Location
2747
+
2748
+ def initialize: (Source source, Integer node_id, Location location, Integer flags, StatementsNode? statements, Location keyword_loc, Location opening_loc, Location closing_loc) -> void
2749
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?statements: StatementsNode?, ?keyword_loc: Location, ?opening_loc: Location, ?closing_loc: Location) -> PreExecutionNode
2750
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, statements: StatementsNode?, keyword_loc: Location, opening_loc: Location, closing_loc: Location }
2751
+ def keyword: () -> String
2752
+ def opening: () -> String
2753
+ def closing: () -> String
2754
+ def type: () -> :pre_execution_node
2755
+ | ...
2756
+ def self.type: () -> :pre_execution_node
2757
+ end
2758
+
2759
+ # The top level node of any parse tree.
2760
+ class ProgramNode < Node
2761
+ include _Node
2762
+
2763
+ attr_reader locals: Array[Symbol]
2764
+ attr_reader statements: StatementsNode
2765
+
2766
+ def initialize: (Source source, Integer node_id, Location location, Integer flags, Array[Symbol] locals, StatementsNode statements) -> void
2767
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?locals: Array[Symbol], ?statements: StatementsNode) -> ProgramNode
2768
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, locals: Array[Symbol], statements: StatementsNode }
2769
+ def type: () -> :program_node
2770
+ | ...
2771
+ def self.type: () -> :program_node
2772
+ end
2773
+
2774
+ # Represents the use of the `..` or `...` operators.
2775
+ #
2776
+ # 1..2
2777
+ # ^^^^
2778
+ #
2779
+ # c if a =~ /left/ ... b =~ /right/
2780
+ # ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2781
+ class RangeNode < Node
2782
+ include _Node
2783
+
2784
+ def exclude_end?: () -> bool
2785
+
2786
+ attr_reader left: Prism::node?
2787
+ attr_reader right: Prism::node?
2788
+ attr_reader operator_loc: Location
2789
+
2790
+ def initialize: (Source source, Integer node_id, Location location, Integer flags, Prism::node? left, Prism::node? right, Location operator_loc) -> void
2791
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?left: Prism::node?, ?right: Prism::node?, ?operator_loc: Location) -> RangeNode
2792
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, left: Prism::node?, right: Prism::node?, operator_loc: Location }
2793
+ def operator: () -> String
2794
+ def type: () -> :range_node
2795
+ | ...
2796
+ def self.type: () -> :range_node
2797
+ end
2798
+
2799
+ # Represents a rational number literal.
2800
+ #
2801
+ # 1.0r
2802
+ # ^^^^
2803
+ class RationalNode < Node
2804
+ include _Node
2805
+
2806
+ def binary?: () -> bool
2807
+ def decimal?: () -> bool
2808
+ def octal?: () -> bool
2809
+ def hexadecimal?: () -> bool
2810
+
2811
+ attr_reader numerator: Integer
2812
+ attr_reader denominator: Integer
2813
+
2814
+ def initialize: (Source source, Integer node_id, Location location, Integer flags, Integer numerator, Integer denominator) -> void
2815
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?numerator: Integer, ?denominator: Integer) -> RationalNode
2816
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, numerator: Integer, denominator: Integer }
2817
+ def type: () -> :rational_node
2818
+ | ...
2819
+ def self.type: () -> :rational_node
2820
+ end
2821
+
2822
+ # Represents the use of the `redo` keyword.
2823
+ #
2824
+ # redo
2825
+ # ^^^^
2826
+ class RedoNode < Node
2827
+ include _Node
2828
+
2829
+
2830
+ def initialize: (Source source, Integer node_id, Location location, Integer flags) -> void
2831
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer) -> RedoNode
2832
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location }
2833
+ def type: () -> :redo_node
2834
+ | ...
2835
+ def self.type: () -> :redo_node
2836
+ end
2837
+
2838
+ # Represents a regular expression literal with no interpolation.
2839
+ #
2840
+ # /foo/i
2841
+ # ^^^^^^
2842
+ class RegularExpressionNode < Node
2843
+ include _Node
2844
+
2845
+ def ignore_case?: () -> bool
2846
+ def extended?: () -> bool
2847
+ def multi_line?: () -> bool
2848
+ def once?: () -> bool
2849
+ def euc_jp?: () -> bool
2850
+ def ascii_8bit?: () -> bool
2851
+ def windows_31j?: () -> bool
2852
+ def utf_8?: () -> bool
2853
+ def forced_utf8_encoding?: () -> bool
2854
+ def forced_binary_encoding?: () -> bool
2855
+ def forced_us_ascii_encoding?: () -> bool
2856
+
2857
+ attr_reader opening_loc: Location
2858
+ attr_reader content_loc: Location
2859
+ attr_reader closing_loc: Location
2860
+ attr_reader unescaped: String
2861
+
2862
+ def initialize: (Source source, Integer node_id, Location location, Integer flags, Location opening_loc, Location content_loc, Location closing_loc, String unescaped) -> void
2863
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?opening_loc: Location, ?content_loc: Location, ?closing_loc: Location, ?unescaped: String) -> RegularExpressionNode
2864
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, opening_loc: Location, content_loc: Location, closing_loc: Location, unescaped: String }
2865
+ def opening: () -> String
2866
+ def content: () -> String
2867
+ def closing: () -> String
2868
+ def type: () -> :regular_expression_node
2869
+ | ...
2870
+ def self.type: () -> :regular_expression_node
2871
+ end
2872
+
2873
+ # Represents a required keyword parameter to a method, block, or lambda definition.
2874
+ #
2875
+ # def a(b: )
2876
+ # ^^
2877
+ # end
2878
+ class RequiredKeywordParameterNode < Node
2879
+ include _Node
2880
+
2881
+ def repeated_parameter?: () -> bool
2882
+
2883
+ attr_reader name: Symbol
2884
+ attr_reader name_loc: Location
2885
+
2886
+ def initialize: (Source source, Integer node_id, Location location, Integer flags, Symbol name, Location name_loc) -> void
2887
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location) -> RequiredKeywordParameterNode
2888
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol, name_loc: Location }
2889
+ def type: () -> :required_keyword_parameter_node
2890
+ | ...
2891
+ def self.type: () -> :required_keyword_parameter_node
2892
+ end
2893
+
2894
+ # Represents a required parameter to a method, block, or lambda definition.
2895
+ #
2896
+ # def a(b)
2897
+ # ^
2898
+ # end
2899
+ class RequiredParameterNode < Node
2900
+ include _Node
2901
+
2902
+ def repeated_parameter?: () -> bool
2903
+
2904
+ attr_reader name: Symbol
2905
+
2906
+ def initialize: (Source source, Integer node_id, Location location, Integer flags, Symbol name) -> void
2907
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol) -> RequiredParameterNode
2908
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol }
2909
+ def type: () -> :required_parameter_node
2910
+ | ...
2911
+ def self.type: () -> :required_parameter_node
2912
+ end
2913
+
2914
+ # Represents an expression modified with a rescue.
2915
+ #
2916
+ # foo rescue nil
2917
+ # ^^^^^^^^^^^^^^
2918
+ class RescueModifierNode < Node
2919
+ include _Node
2920
+
2921
+ attr_reader expression: Prism::node
2922
+ attr_reader keyword_loc: Location
2923
+ attr_reader rescue_expression: Prism::node
2924
+
2925
+ def initialize: (Source source, Integer node_id, Location location, Integer flags, Prism::node expression, Location keyword_loc, Prism::node rescue_expression) -> void
2926
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?expression: Prism::node, ?keyword_loc: Location, ?rescue_expression: Prism::node) -> RescueModifierNode
2927
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, expression: Prism::node, keyword_loc: Location, rescue_expression: Prism::node }
2928
+ def keyword: () -> String
2929
+ def type: () -> :rescue_modifier_node
2930
+ | ...
2931
+ def self.type: () -> :rescue_modifier_node
2932
+ end
2933
+
2934
+ # Represents a rescue statement.
2935
+ #
2936
+ # begin
2937
+ # rescue Foo, *splat, Bar => ex
2938
+ # foo
2939
+ # ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2940
+ # end
2941
+ #
2942
+ # `Foo, *splat, Bar` are in the `exceptions` field. `ex` is in the `reference` field.
2943
+ class RescueNode < Node
2944
+ include _Node
2945
+
2946
+ attr_reader keyword_loc: Location
2947
+ attr_reader exceptions: Array[Prism::node]
2948
+ attr_reader operator_loc: Location?
2949
+ attr_reader reference: LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | nil
2950
+ attr_reader then_keyword_loc: Location?
2951
+ attr_reader statements: StatementsNode?
2952
+ attr_reader subsequent: RescueNode?
2953
+
2954
+ def initialize: (Source source, Integer node_id, Location location, Integer flags, Location keyword_loc, Array[Prism::node] exceptions, Location? operator_loc, LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | nil reference, Location? then_keyword_loc, StatementsNode? statements, RescueNode? subsequent) -> void
2955
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?keyword_loc: Location, ?exceptions: Array[Prism::node], ?operator_loc: Location?, ?reference: LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | nil, ?then_keyword_loc: Location?, ?statements: StatementsNode?, ?subsequent: RescueNode?) -> RescueNode
2956
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, keyword_loc: Location, exceptions: Array[Prism::node], operator_loc: Location?, reference: LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | nil, then_keyword_loc: Location?, statements: StatementsNode?, subsequent: RescueNode? }
2957
+ def keyword: () -> String
2958
+ def operator: () -> String?
2959
+ def then_keyword: () -> String?
2960
+ def type: () -> :rescue_node
2961
+ | ...
2962
+ def self.type: () -> :rescue_node
2963
+ end
2964
+
2965
+ # Represents a rest parameter to a method, block, or lambda definition.
2966
+ #
2967
+ # def a(*b)
2968
+ # ^^
2969
+ # end
2970
+ class RestParameterNode < Node
2971
+ include _Node
2972
+
2973
+ def repeated_parameter?: () -> bool
2974
+
2975
+ attr_reader name: Symbol?
2976
+ attr_reader name_loc: Location?
2977
+ attr_reader operator_loc: Location
2978
+
2979
+ def initialize: (Source source, Integer node_id, Location location, Integer flags, Symbol? name, Location? name_loc, Location operator_loc) -> void
2980
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol?, ?name_loc: Location?, ?operator_loc: Location) -> RestParameterNode
2981
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol?, name_loc: Location?, operator_loc: Location }
2982
+ def operator: () -> String
2983
+ def type: () -> :rest_parameter_node
2984
+ | ...
2985
+ def self.type: () -> :rest_parameter_node
2986
+ end
2987
+
2988
+ # Represents the use of the `retry` keyword.
2989
+ #
2990
+ # retry
2991
+ # ^^^^^
2992
+ class RetryNode < Node
2993
+ include _Node
2994
+
2995
+
2996
+ def initialize: (Source source, Integer node_id, Location location, Integer flags) -> void
2997
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer) -> RetryNode
2998
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location }
2999
+ def type: () -> :retry_node
3000
+ | ...
3001
+ def self.type: () -> :retry_node
3002
+ end
3003
+
3004
+ # Represents the use of the `return` keyword.
3005
+ #
3006
+ # return 1
3007
+ # ^^^^^^^^
3008
+ class ReturnNode < Node
3009
+ include _Node
3010
+
3011
+ attr_reader keyword_loc: Location
3012
+ attr_reader arguments: ArgumentsNode?
3013
+
3014
+ def initialize: (Source source, Integer node_id, Location location, Integer flags, Location keyword_loc, ArgumentsNode? arguments) -> void
3015
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?keyword_loc: Location, ?arguments: ArgumentsNode?) -> ReturnNode
3016
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, keyword_loc: Location, arguments: ArgumentsNode? }
3017
+ def keyword: () -> String
3018
+ def type: () -> :return_node
3019
+ | ...
3020
+ def self.type: () -> :return_node
3021
+ end
3022
+
3023
+ # Represents the `self` keyword.
3024
+ #
3025
+ # self
3026
+ # ^^^^
3027
+ class SelfNode < Node
3028
+ include _Node
3029
+
3030
+
3031
+ def initialize: (Source source, Integer node_id, Location location, Integer flags) -> void
3032
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer) -> SelfNode
3033
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location }
3034
+ def type: () -> :self_node
3035
+ | ...
3036
+ def self.type: () -> :self_node
3037
+ end
3038
+
3039
+ # This node wraps a constant write to indicate that when the value is written, it should have its shareability state modified.
3040
+ #
3041
+ # # shareable_constant_value: literal
3042
+ # C = { a: 1 }
3043
+ # ^^^^^^^^^^^^
3044
+ class ShareableConstantNode < Node
3045
+ include _Node
3046
+
3047
+ def literal?: () -> bool
3048
+ def experimental_everything?: () -> bool
3049
+ def experimental_copy?: () -> bool
3050
+
3051
+ attr_reader write: ConstantWriteNode | ConstantAndWriteNode | ConstantOrWriteNode | ConstantOperatorWriteNode | ConstantPathWriteNode | ConstantPathAndWriteNode | ConstantPathOrWriteNode | ConstantPathOperatorWriteNode
3052
+
3053
+ def initialize: (Source source, Integer node_id, Location location, Integer flags, ConstantWriteNode | ConstantAndWriteNode | ConstantOrWriteNode | ConstantOperatorWriteNode | ConstantPathWriteNode | ConstantPathAndWriteNode | ConstantPathOrWriteNode | ConstantPathOperatorWriteNode write) -> void
3054
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?write: ConstantWriteNode | ConstantAndWriteNode | ConstantOrWriteNode | ConstantOperatorWriteNode | ConstantPathWriteNode | ConstantPathAndWriteNode | ConstantPathOrWriteNode | ConstantPathOperatorWriteNode) -> ShareableConstantNode
3055
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, write: ConstantWriteNode | ConstantAndWriteNode | ConstantOrWriteNode | ConstantOperatorWriteNode | ConstantPathWriteNode | ConstantPathAndWriteNode | ConstantPathOrWriteNode | ConstantPathOperatorWriteNode }
3056
+ def type: () -> :shareable_constant_node
3057
+ | ...
3058
+ def self.type: () -> :shareable_constant_node
3059
+ end
3060
+
3061
+ # Represents a singleton class declaration involving the `class` keyword.
3062
+ #
3063
+ # class << self end
3064
+ # ^^^^^^^^^^^^^^^^^
3065
+ class SingletonClassNode < Node
3066
+ include _Node
3067
+
3068
+ attr_reader locals: Array[Symbol]
3069
+ attr_reader class_keyword_loc: Location
3070
+ attr_reader operator_loc: Location
3071
+ attr_reader expression: Prism::node
3072
+ attr_reader body: StatementsNode | BeginNode | nil
3073
+ attr_reader end_keyword_loc: Location
3074
+
3075
+ def initialize: (Source source, Integer node_id, Location location, Integer flags, Array[Symbol] locals, Location class_keyword_loc, Location operator_loc, Prism::node expression, StatementsNode | BeginNode | nil body, Location end_keyword_loc) -> void
3076
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?locals: Array[Symbol], ?class_keyword_loc: Location, ?operator_loc: Location, ?expression: Prism::node, ?body: StatementsNode | BeginNode | nil, ?end_keyword_loc: Location) -> SingletonClassNode
3077
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, locals: Array[Symbol], class_keyword_loc: Location, operator_loc: Location, expression: Prism::node, body: StatementsNode | BeginNode | nil, end_keyword_loc: Location }
3078
+ def class_keyword: () -> String
3079
+ def operator: () -> String
3080
+ def end_keyword: () -> String
3081
+ def type: () -> :singleton_class_node
3082
+ | ...
3083
+ def self.type: () -> :singleton_class_node
3084
+ end
3085
+
3086
+ # Represents the use of the `__ENCODING__` keyword.
3087
+ #
3088
+ # __ENCODING__
3089
+ # ^^^^^^^^^^^^
3090
+ class SourceEncodingNode < Node
3091
+ include _Node
3092
+
3093
+
3094
+ def initialize: (Source source, Integer node_id, Location location, Integer flags) -> void
3095
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer) -> SourceEncodingNode
3096
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location }
3097
+ def type: () -> :source_encoding_node
3098
+ | ...
3099
+ def self.type: () -> :source_encoding_node
3100
+ end
3101
+
3102
+ # Represents the use of the `__FILE__` keyword.
3103
+ #
3104
+ # __FILE__
3105
+ # ^^^^^^^^
3106
+ class SourceFileNode < Node
3107
+ include _Node
3108
+
3109
+ def forced_utf8_encoding?: () -> bool
3110
+ def forced_binary_encoding?: () -> bool
3111
+ def frozen?: () -> bool
3112
+ def mutable?: () -> bool
3113
+
3114
+ attr_reader filepath: String
3115
+
3116
+ def initialize: (Source source, Integer node_id, Location location, Integer flags, String filepath) -> void
3117
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?filepath: String) -> SourceFileNode
3118
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, filepath: String }
3119
+ def type: () -> :source_file_node
3120
+ | ...
3121
+ def self.type: () -> :source_file_node
3122
+ end
3123
+
3124
+ # Represents the use of the `__LINE__` keyword.
3125
+ #
3126
+ # __LINE__
3127
+ # ^^^^^^^^
3128
+ class SourceLineNode < Node
3129
+ include _Node
3130
+
3131
+
3132
+ def initialize: (Source source, Integer node_id, Location location, Integer flags) -> void
3133
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer) -> SourceLineNode
3134
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location }
3135
+ def type: () -> :source_line_node
3136
+ | ...
3137
+ def self.type: () -> :source_line_node
3138
+ end
3139
+
3140
+ # Represents the use of the splat operator.
3141
+ #
3142
+ # [*a]
3143
+ # ^^
3144
+ class SplatNode < Node
3145
+ include _Node
3146
+
3147
+ attr_reader operator_loc: Location
3148
+ attr_reader expression: Prism::node?
3149
+
3150
+ def initialize: (Source source, Integer node_id, Location location, Integer flags, Location operator_loc, Prism::node? expression) -> void
3151
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?operator_loc: Location, ?expression: Prism::node?) -> SplatNode
3152
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, operator_loc: Location, expression: Prism::node? }
3153
+ def operator: () -> String
3154
+ def type: () -> :splat_node
3155
+ | ...
3156
+ def self.type: () -> :splat_node
3157
+ end
3158
+
3159
+ # Represents a set of statements contained within some scope.
3160
+ #
3161
+ # foo; bar; baz
3162
+ # ^^^^^^^^^^^^^
3163
+ class StatementsNode < Node
3164
+ include _Node
3165
+
3166
+ attr_reader body: Array[Prism::node]
3167
+
3168
+ def initialize: (Source source, Integer node_id, Location location, Integer flags, Array[Prism::node] body) -> void
3169
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?body: Array[Prism::node]) -> StatementsNode
3170
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, body: Array[Prism::node] }
3171
+ def type: () -> :statements_node
3172
+ | ...
3173
+ def self.type: () -> :statements_node
3174
+ end
3175
+
3176
+ # Represents a string literal, a string contained within a `%w` list, or plain string content within an interpolated string.
3177
+ #
3178
+ # "foo"
3179
+ # ^^^^^
3180
+ #
3181
+ # %w[foo]
3182
+ # ^^^
3183
+ #
3184
+ # "foo #{bar} baz"
3185
+ # ^^^^ ^^^^
3186
+ class StringNode < Node
3187
+ include _Node
3188
+
3189
+ def forced_utf8_encoding?: () -> bool
3190
+ def forced_binary_encoding?: () -> bool
3191
+ def frozen?: () -> bool
3192
+ def mutable?: () -> bool
3193
+
3194
+ attr_reader opening_loc: Location?
3195
+ attr_reader content_loc: Location
3196
+ attr_reader closing_loc: Location?
3197
+ attr_reader unescaped: String
3198
+
3199
+ def initialize: (Source source, Integer node_id, Location location, Integer flags, Location? opening_loc, Location content_loc, Location? closing_loc, String unescaped) -> void
3200
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?opening_loc: Location?, ?content_loc: Location, ?closing_loc: Location?, ?unescaped: String) -> StringNode
3201
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, opening_loc: Location?, content_loc: Location, closing_loc: Location?, unescaped: String }
3202
+ def opening: () -> String?
3203
+ def content: () -> String
3204
+ def closing: () -> String?
3205
+ def type: () -> :string_node
3206
+ | ...
3207
+ def self.type: () -> :string_node
3208
+ end
3209
+
3210
+ # Represents the use of the `super` keyword with parentheses or arguments.
3211
+ #
3212
+ # super()
3213
+ # ^^^^^^^
3214
+ #
3215
+ # super foo, bar
3216
+ # ^^^^^^^^^^^^^^
3217
+ class SuperNode < Node
3218
+ include _Node
3219
+
3220
+ attr_reader keyword_loc: Location
3221
+ attr_reader lparen_loc: Location?
3222
+ attr_reader arguments: ArgumentsNode?
3223
+ attr_reader rparen_loc: Location?
3224
+ attr_reader block: BlockNode | BlockArgumentNode | nil
3225
+
3226
+ def initialize: (Source source, Integer node_id, Location location, Integer flags, Location keyword_loc, Location? lparen_loc, ArgumentsNode? arguments, Location? rparen_loc, BlockNode | BlockArgumentNode | nil block) -> void
3227
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?keyword_loc: Location, ?lparen_loc: Location?, ?arguments: ArgumentsNode?, ?rparen_loc: Location?, ?block: BlockNode | BlockArgumentNode | nil) -> SuperNode
3228
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, keyword_loc: Location, lparen_loc: Location?, arguments: ArgumentsNode?, rparen_loc: Location?, block: BlockNode | BlockArgumentNode | nil }
3229
+ def keyword: () -> String
3230
+ def lparen: () -> String?
3231
+ def rparen: () -> String?
3232
+ def type: () -> :super_node
3233
+ | ...
3234
+ def self.type: () -> :super_node
3235
+ end
3236
+
3237
+ # Represents a symbol literal or a symbol contained within a `%i` list.
3238
+ #
3239
+ # :foo
3240
+ # ^^^^
3241
+ #
3242
+ # %i[foo]
3243
+ # ^^^
3244
+ class SymbolNode < Node
3245
+ include _Node
3246
+
3247
+ def forced_utf8_encoding?: () -> bool
3248
+ def forced_binary_encoding?: () -> bool
3249
+ def forced_us_ascii_encoding?: () -> bool
3250
+
3251
+ attr_reader opening_loc: Location?
3252
+ attr_reader value_loc: Location?
3253
+ attr_reader closing_loc: Location?
3254
+ attr_reader unescaped: String
3255
+
3256
+ def initialize: (Source source, Integer node_id, Location location, Integer flags, Location? opening_loc, Location? value_loc, Location? closing_loc, String unescaped) -> void
3257
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?opening_loc: Location?, ?value_loc: Location?, ?closing_loc: Location?, ?unescaped: String) -> SymbolNode
3258
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, opening_loc: Location?, value_loc: Location?, closing_loc: Location?, unescaped: String }
3259
+ def opening: () -> String?
3260
+ def value: () -> String?
3261
+ def closing: () -> String?
3262
+ def type: () -> :symbol_node
3263
+ | ...
3264
+ def self.type: () -> :symbol_node
3265
+ end
3266
+
3267
+ # Represents the use of the literal `true` keyword.
3268
+ #
3269
+ # true
3270
+ # ^^^^
3271
+ class TrueNode < Node
3272
+ include _Node
3273
+
3274
+
3275
+ def initialize: (Source source, Integer node_id, Location location, Integer flags) -> void
3276
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer) -> TrueNode
3277
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location }
3278
+ def type: () -> :true_node
3279
+ | ...
3280
+ def self.type: () -> :true_node
3281
+ end
3282
+
3283
+ # Represents the use of the `undef` keyword.
3284
+ #
3285
+ # undef :foo, :bar, :baz
3286
+ # ^^^^^^^^^^^^^^^^^^^^^^
3287
+ class UndefNode < Node
3288
+ include _Node
3289
+
3290
+ attr_reader names: Array[SymbolNode | InterpolatedSymbolNode]
3291
+ attr_reader keyword_loc: Location
3292
+
3293
+ def initialize: (Source source, Integer node_id, Location location, Integer flags, Array[SymbolNode | InterpolatedSymbolNode] names, Location keyword_loc) -> void
3294
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?names: Array[SymbolNode | InterpolatedSymbolNode], ?keyword_loc: Location) -> UndefNode
3295
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, names: Array[SymbolNode | InterpolatedSymbolNode], keyword_loc: Location }
3296
+ def keyword: () -> String
3297
+ def type: () -> :undef_node
3298
+ | ...
3299
+ def self.type: () -> :undef_node
3300
+ end
3301
+
3302
+ # Represents the use of the `unless` keyword, either in the block form or the modifier form.
3303
+ #
3304
+ # bar unless foo
3305
+ # ^^^^^^^^^^^^^^
3306
+ #
3307
+ # unless foo then bar end
3308
+ # ^^^^^^^^^^^^^^^^^^^^^^^
3309
+ class UnlessNode < Node
3310
+ include _Node
3311
+
3312
+ attr_reader keyword_loc: Location
3313
+ attr_reader predicate: Prism::node
3314
+ attr_reader then_keyword_loc: Location?
3315
+ attr_reader statements: StatementsNode?
3316
+ attr_reader else_clause: ElseNode?
3317
+ attr_reader end_keyword_loc: Location?
3318
+
3319
+ def initialize: (Source source, Integer node_id, Location location, Integer flags, Location keyword_loc, Prism::node predicate, Location? then_keyword_loc, StatementsNode? statements, ElseNode? else_clause, Location? end_keyword_loc) -> void
3320
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?keyword_loc: Location, ?predicate: Prism::node, ?then_keyword_loc: Location?, ?statements: StatementsNode?, ?else_clause: ElseNode?, ?end_keyword_loc: Location?) -> UnlessNode
3321
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, keyword_loc: Location, predicate: Prism::node, then_keyword_loc: Location?, statements: StatementsNode?, else_clause: ElseNode?, end_keyword_loc: Location? }
3322
+ def keyword: () -> String
3323
+ def then_keyword: () -> String?
3324
+ def end_keyword: () -> String?
3325
+ def type: () -> :unless_node
3326
+ | ...
3327
+ def self.type: () -> :unless_node
3328
+ end
3329
+
3330
+ # Represents the use of the `until` keyword, either in the block form or the modifier form.
3331
+ #
3332
+ # bar until foo
3333
+ # ^^^^^^^^^^^^^
3334
+ #
3335
+ # until foo do bar end
3336
+ # ^^^^^^^^^^^^^^^^^^^^
3337
+ class UntilNode < Node
3338
+ include _Node
3339
+
3340
+ def begin_modifier?: () -> bool
3341
+
3342
+ attr_reader keyword_loc: Location
3343
+ attr_reader do_keyword_loc: Location?
3344
+ attr_reader closing_loc: Location?
3345
+ attr_reader predicate: Prism::node
3346
+ attr_reader statements: StatementsNode?
3347
+
3348
+ def initialize: (Source source, Integer node_id, Location location, Integer flags, Location keyword_loc, Location? do_keyword_loc, Location? closing_loc, Prism::node predicate, StatementsNode? statements) -> void
3349
+ 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
3350
+ 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? }
3351
+ def keyword: () -> String
3352
+ def do_keyword: () -> String?
3353
+ def closing: () -> String?
3354
+ def type: () -> :until_node
3355
+ | ...
3356
+ def self.type: () -> :until_node
3357
+ end
3358
+
3359
+ # Represents the use of the `when` keyword within a case statement.
3360
+ #
3361
+ # case true
3362
+ # when true
3363
+ # ^^^^^^^^^
3364
+ # end
3365
+ class WhenNode < Node
3366
+ include _Node
3367
+
3368
+ attr_reader keyword_loc: Location
3369
+ attr_reader conditions: Array[Prism::node]
3370
+ attr_reader then_keyword_loc: Location?
3371
+ attr_reader statements: StatementsNode?
3372
+
3373
+ def initialize: (Source source, Integer node_id, Location location, Integer flags, Location keyword_loc, Array[Prism::node] conditions, Location? then_keyword_loc, StatementsNode? statements) -> void
3374
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?keyword_loc: Location, ?conditions: Array[Prism::node], ?then_keyword_loc: Location?, ?statements: StatementsNode?) -> WhenNode
3375
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, keyword_loc: Location, conditions: Array[Prism::node], then_keyword_loc: Location?, statements: StatementsNode? }
3376
+ def keyword: () -> String
3377
+ def then_keyword: () -> String?
3378
+ def type: () -> :when_node
3379
+ | ...
3380
+ def self.type: () -> :when_node
3381
+ end
3382
+
3383
+ # Represents the use of the `while` keyword, either in the block form or the modifier form.
3384
+ #
3385
+ # bar while foo
3386
+ # ^^^^^^^^^^^^^
3387
+ #
3388
+ # while foo do bar end
3389
+ # ^^^^^^^^^^^^^^^^^^^^
3390
+ class WhileNode < Node
3391
+ include _Node
3392
+
3393
+ def begin_modifier?: () -> bool
3394
+
3395
+ attr_reader keyword_loc: Location
3396
+ attr_reader do_keyword_loc: Location?
3397
+ attr_reader closing_loc: Location?
3398
+ attr_reader predicate: Prism::node
3399
+ attr_reader statements: StatementsNode?
3400
+
3401
+ def initialize: (Source source, Integer node_id, Location location, Integer flags, Location keyword_loc, Location? do_keyword_loc, Location? closing_loc, Prism::node predicate, StatementsNode? statements) -> void
3402
+ 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
3403
+ 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? }
3404
+ def keyword: () -> String
3405
+ def do_keyword: () -> String?
3406
+ def closing: () -> String?
3407
+ def type: () -> :while_node
3408
+ | ...
3409
+ def self.type: () -> :while_node
3410
+ end
3411
+
3412
+ # Represents an xstring literal with no interpolation.
3413
+ #
3414
+ # `foo`
3415
+ # ^^^^^
3416
+ class XStringNode < Node
3417
+ include _Node
3418
+
3419
+ def forced_utf8_encoding?: () -> bool
3420
+ def forced_binary_encoding?: () -> bool
3421
+
3422
+ attr_reader opening_loc: Location
3423
+ attr_reader content_loc: Location
3424
+ attr_reader closing_loc: Location
3425
+ attr_reader unescaped: String
3426
+
3427
+ def initialize: (Source source, Integer node_id, Location location, Integer flags, Location opening_loc, Location content_loc, Location closing_loc, String unescaped) -> void
3428
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?opening_loc: Location, ?content_loc: Location, ?closing_loc: Location, ?unescaped: String) -> XStringNode
3429
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, opening_loc: Location, content_loc: Location, closing_loc: Location, unescaped: String }
3430
+ def opening: () -> String
3431
+ def content: () -> String
3432
+ def closing: () -> String
3433
+ def type: () -> :x_string_node
3434
+ | ...
3435
+ def self.type: () -> :x_string_node
3436
+ end
3437
+
3438
+ # Represents the use of the `yield` keyword.
3439
+ #
3440
+ # yield 1
3441
+ # ^^^^^^^
3442
+ class YieldNode < Node
3443
+ include _Node
3444
+
3445
+ attr_reader keyword_loc: Location
3446
+ attr_reader lparen_loc: Location?
3447
+ attr_reader arguments: ArgumentsNode?
3448
+ attr_reader rparen_loc: Location?
3449
+
3450
+ def initialize: (Source source, Integer node_id, Location location, Integer flags, Location keyword_loc, Location? lparen_loc, ArgumentsNode? arguments, Location? rparen_loc) -> void
3451
+ def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?keyword_loc: Location, ?lparen_loc: Location?, ?arguments: ArgumentsNode?, ?rparen_loc: Location?) -> YieldNode
3452
+ def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, keyword_loc: Location, lparen_loc: Location?, arguments: ArgumentsNode?, rparen_loc: Location? }
3453
+ def keyword: () -> String
3454
+ def lparen: () -> String?
3455
+ def rparen: () -> String?
3456
+ def type: () -> :yield_node
3457
+ | ...
3458
+ def self.type: () -> :yield_node
3459
+ end
3460
+
3461
+ # Flags for arguments nodes.
3462
+ module ArgumentsNodeFlags
3463
+ # if the arguments contain forwarding
3464
+ CONTAINS_FORWARDING: Integer
3465
+ # if the arguments contain keywords
3466
+ CONTAINS_KEYWORDS: Integer
3467
+ # if the arguments contain a keyword splat
3468
+ CONTAINS_KEYWORD_SPLAT: Integer
3469
+ # if the arguments contain a splat
3470
+ CONTAINS_SPLAT: Integer
3471
+ # if the arguments contain multiple splats
3472
+ CONTAINS_MULTIPLE_SPLATS: Integer
3473
+ end
3474
+
3475
+ # Flags for array nodes.
3476
+ module ArrayNodeFlags
3477
+ # if array contains splat nodes
3478
+ CONTAINS_SPLAT: Integer
3479
+ end
3480
+
3481
+ # Flags for call nodes.
3482
+ module CallNodeFlags
3483
+ # &. operator
3484
+ SAFE_NAVIGATION: Integer
3485
+ # a call that could have been a local variable
3486
+ VARIABLE_CALL: Integer
3487
+ # a call that is an attribute write, so the value being written should be returned
3488
+ ATTRIBUTE_WRITE: Integer
3489
+ # a call that ignores method visibility
3490
+ IGNORE_VISIBILITY: Integer
3491
+ end
3492
+
3493
+ # Flags for nodes that have unescaped content.
3494
+ module EncodingFlags
3495
+ # internal bytes forced the encoding to UTF-8
3496
+ FORCED_UTF8_ENCODING: Integer
3497
+ # internal bytes forced the encoding to binary
3498
+ FORCED_BINARY_ENCODING: Integer
3499
+ end
3500
+
3501
+ # Flags for integer nodes that correspond to the base of the integer.
3502
+ module IntegerBaseFlags
3503
+ # 0b prefix
3504
+ BINARY: Integer
3505
+ # 0d or no prefix
3506
+ DECIMAL: Integer
3507
+ # 0o or 0 prefix
3508
+ OCTAL: Integer
3509
+ # 0x prefix
3510
+ HEXADECIMAL: Integer
3511
+ end
3512
+
3513
+ # Flags for interpolated string nodes that indicated mutability if they are also marked as literals.
3514
+ module InterpolatedStringNodeFlags
3515
+ # frozen by virtue of a `frozen_string_literal: true` comment or `--enable-frozen-string-literal`; only for adjacent string literals like `'a' 'b'`
3516
+ FROZEN: Integer
3517
+ # mutable by virtue of a `frozen_string_literal: false` comment or `--disable-frozen-string-literal`; only for adjacent string literals like `'a' 'b'`
3518
+ MUTABLE: Integer
3519
+ end
3520
+
3521
+ # Flags for keyword hash nodes.
3522
+ module KeywordHashNodeFlags
3523
+ # a keyword hash which only has `AssocNode` elements all with symbol keys, which means the elements can be treated as keyword arguments
3524
+ SYMBOL_KEYS: Integer
3525
+ end
3526
+
3527
+ # Flags for while and until loop nodes.
3528
+ module LoopFlags
3529
+ # a loop after a begin statement, so the body is executed first before the condition
3530
+ BEGIN_MODIFIER: Integer
3531
+ end
3532
+
3533
+ # Flags for parameter nodes.
3534
+ module ParameterFlags
3535
+ # a parameter name that has been repeated in the method signature
3536
+ REPEATED_PARAMETER: Integer
3537
+ end
3538
+
3539
+ # Flags for parentheses nodes.
3540
+ module ParenthesesNodeFlags
3541
+ # parentheses that contain multiple potentially void statements
3542
+ MULTIPLE_STATEMENTS: Integer
3543
+ end
3544
+
3545
+ # Flags for range and flip-flop nodes.
3546
+ module RangeFlags
3547
+ # ... operator
3548
+ EXCLUDE_END: Integer
3549
+ end
3550
+
3551
+ # Flags for regular expression and match last line nodes.
3552
+ module RegularExpressionFlags
3553
+ # i - ignores the case of characters when matching
3554
+ IGNORE_CASE: Integer
3555
+ # x - ignores whitespace and allows comments in regular expressions
3556
+ EXTENDED: Integer
3557
+ # m - allows $ to match the end of lines within strings
3558
+ MULTI_LINE: Integer
3559
+ # o - only interpolates values into the regular expression once
3560
+ ONCE: Integer
3561
+ # e - forces the EUC-JP encoding
3562
+ EUC_JP: Integer
3563
+ # n - forces the ASCII-8BIT encoding
3564
+ ASCII_8BIT: Integer
3565
+ # s - forces the Windows-31J encoding
3566
+ WINDOWS_31J: Integer
3567
+ # u - forces the UTF-8 encoding
3568
+ UTF_8: Integer
3569
+ # internal bytes forced the encoding to UTF-8
3570
+ FORCED_UTF8_ENCODING: Integer
3571
+ # internal bytes forced the encoding to binary
3572
+ FORCED_BINARY_ENCODING: Integer
3573
+ # internal bytes forced the encoding to US-ASCII
3574
+ FORCED_US_ASCII_ENCODING: Integer
3575
+ end
3576
+
3577
+ # Flags for shareable constant nodes.
3578
+ module ShareableConstantNodeFlags
3579
+ # constant writes that should be modified with shareable constant value literal
3580
+ LITERAL: Integer
3581
+ # constant writes that should be modified with shareable constant value experimental everything
3582
+ EXPERIMENTAL_EVERYTHING: Integer
3583
+ # constant writes that should be modified with shareable constant value experimental copy
3584
+ EXPERIMENTAL_COPY: Integer
3585
+ end
3586
+
3587
+ # Flags for string nodes.
3588
+ module StringFlags
3589
+ # internal bytes forced the encoding to UTF-8
3590
+ FORCED_UTF8_ENCODING: Integer
3591
+ # internal bytes forced the encoding to binary
3592
+ FORCED_BINARY_ENCODING: Integer
3593
+ # frozen by virtue of a `frozen_string_literal: true` comment or `--enable-frozen-string-literal`
3594
+ FROZEN: Integer
3595
+ # mutable by virtue of a `frozen_string_literal: false` comment or `--disable-frozen-string-literal`
3596
+ MUTABLE: Integer
3597
+ end
3598
+
3599
+ # Flags for symbol nodes.
3600
+ module SymbolFlags
3601
+ # internal bytes forced the encoding to UTF-8
3602
+ FORCED_UTF8_ENCODING: Integer
3603
+ # internal bytes forced the encoding to binary
3604
+ FORCED_BINARY_ENCODING: Integer
3605
+ # internal bytes forced the encoding to US-ASCII
3606
+ FORCED_US_ASCII_ENCODING: Integer
3607
+ end
3608
+
3609
+ # The flags that are common to all nodes.
3610
+ module NodeFlags
3611
+ NEWLINE: Integer
3612
+ STATIC_LITERAL: Integer
3613
+ end
3614
+ end