Debian Codegraph @

sig/prism/node.rbs

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