prism 0.23.0 → 0.25.0

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