prism 0.13.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (95) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG.md +172 -0
  3. data/CODE_OF_CONDUCT.md +76 -0
  4. data/CONTRIBUTING.md +62 -0
  5. data/LICENSE.md +7 -0
  6. data/Makefile +84 -0
  7. data/README.md +89 -0
  8. data/config.yml +2481 -0
  9. data/docs/build_system.md +74 -0
  10. data/docs/building.md +22 -0
  11. data/docs/configuration.md +60 -0
  12. data/docs/design.md +53 -0
  13. data/docs/encoding.md +117 -0
  14. data/docs/fuzzing.md +93 -0
  15. data/docs/heredocs.md +36 -0
  16. data/docs/mapping.md +117 -0
  17. data/docs/ripper.md +36 -0
  18. data/docs/ruby_api.md +25 -0
  19. data/docs/serialization.md +181 -0
  20. data/docs/testing.md +55 -0
  21. data/ext/prism/api_node.c +4725 -0
  22. data/ext/prism/api_pack.c +256 -0
  23. data/ext/prism/extconf.rb +136 -0
  24. data/ext/prism/extension.c +626 -0
  25. data/ext/prism/extension.h +18 -0
  26. data/include/prism/ast.h +1932 -0
  27. data/include/prism/defines.h +45 -0
  28. data/include/prism/diagnostic.h +231 -0
  29. data/include/prism/enc/pm_encoding.h +95 -0
  30. data/include/prism/node.h +41 -0
  31. data/include/prism/pack.h +141 -0
  32. data/include/prism/parser.h +418 -0
  33. data/include/prism/regexp.h +19 -0
  34. data/include/prism/unescape.h +48 -0
  35. data/include/prism/util/pm_buffer.h +51 -0
  36. data/include/prism/util/pm_char.h +91 -0
  37. data/include/prism/util/pm_constant_pool.h +78 -0
  38. data/include/prism/util/pm_list.h +67 -0
  39. data/include/prism/util/pm_memchr.h +14 -0
  40. data/include/prism/util/pm_newline_list.h +61 -0
  41. data/include/prism/util/pm_state_stack.h +24 -0
  42. data/include/prism/util/pm_string.h +61 -0
  43. data/include/prism/util/pm_string_list.h +25 -0
  44. data/include/prism/util/pm_strpbrk.h +29 -0
  45. data/include/prism/version.h +4 -0
  46. data/include/prism.h +82 -0
  47. data/lib/prism/compiler.rb +465 -0
  48. data/lib/prism/debug.rb +157 -0
  49. data/lib/prism/desugar_compiler.rb +206 -0
  50. data/lib/prism/dispatcher.rb +2051 -0
  51. data/lib/prism/dsl.rb +750 -0
  52. data/lib/prism/ffi.rb +251 -0
  53. data/lib/prism/lex_compat.rb +838 -0
  54. data/lib/prism/mutation_compiler.rb +718 -0
  55. data/lib/prism/node.rb +14540 -0
  56. data/lib/prism/node_ext.rb +55 -0
  57. data/lib/prism/node_inspector.rb +68 -0
  58. data/lib/prism/pack.rb +185 -0
  59. data/lib/prism/parse_result/comments.rb +172 -0
  60. data/lib/prism/parse_result/newlines.rb +60 -0
  61. data/lib/prism/parse_result.rb +266 -0
  62. data/lib/prism/pattern.rb +239 -0
  63. data/lib/prism/ripper_compat.rb +174 -0
  64. data/lib/prism/serialize.rb +662 -0
  65. data/lib/prism/visitor.rb +470 -0
  66. data/lib/prism.rb +64 -0
  67. data/prism.gemspec +113 -0
  68. data/src/diagnostic.c +287 -0
  69. data/src/enc/pm_big5.c +52 -0
  70. data/src/enc/pm_euc_jp.c +58 -0
  71. data/src/enc/pm_gbk.c +61 -0
  72. data/src/enc/pm_shift_jis.c +56 -0
  73. data/src/enc/pm_tables.c +507 -0
  74. data/src/enc/pm_unicode.c +2324 -0
  75. data/src/enc/pm_windows_31j.c +56 -0
  76. data/src/node.c +2633 -0
  77. data/src/pack.c +493 -0
  78. data/src/prettyprint.c +2136 -0
  79. data/src/prism.c +14587 -0
  80. data/src/regexp.c +580 -0
  81. data/src/serialize.c +1899 -0
  82. data/src/token_type.c +349 -0
  83. data/src/unescape.c +637 -0
  84. data/src/util/pm_buffer.c +103 -0
  85. data/src/util/pm_char.c +272 -0
  86. data/src/util/pm_constant_pool.c +252 -0
  87. data/src/util/pm_list.c +41 -0
  88. data/src/util/pm_memchr.c +33 -0
  89. data/src/util/pm_newline_list.c +134 -0
  90. data/src/util/pm_state_stack.c +19 -0
  91. data/src/util/pm_string.c +200 -0
  92. data/src/util/pm_string_list.c +29 -0
  93. data/src/util/pm_strncasecmp.c +17 -0
  94. data/src/util/pm_strpbrk.c +66 -0
  95. metadata +138 -0
@@ -0,0 +1,2051 @@
1
+ # frozen_string_literal: true
2
+ =begin
3
+ This file is generated by the templates/template.rb script and should not be
4
+ modified manually. See templates/lib/prism/dispatcher.rb.erb
5
+ if you are looking to modify the template
6
+ =end
7
+
8
+ module Prism
9
+ # The dispatcher class fires events for nodes that are found while walking an
10
+ # AST to all registered listeners. It's useful for performing different types
11
+ # of analysis on the AST while only having to walk the tree once.
12
+ #
13
+ # To use the dispatcher, you would first instantiate it and register listeners
14
+ # for the events you're interested in:
15
+ #
16
+ # class OctalListener
17
+ # def on_integer_node_enter(node)
18
+ # if node.octal? && !node.slice.start_with?("0o")
19
+ # warn("Octal integers should be written with the 0o prefix")
20
+ # end
21
+ # end
22
+ # end
23
+ #
24
+ # dispatcher = Dispatcher.new
25
+ # dispatcher.register(listener, :on_integer_node_enter)
26
+ #
27
+ # Then, you can walk any number of trees and dispatch events to the listeners:
28
+ #
29
+ # result = Prism.parse("001 + 002 + 003")
30
+ # dispatcher.dispatch(result.value)
31
+ #
32
+ # Optionally, you can also use `#dispatch_once` to dispatch enter and leave
33
+ # events for a single node without recursing further down the tree. This can
34
+ # be useful in circumstances where you want to reuse the listeners you already
35
+ # have registers but want to stop walking the tree at a certain point.
36
+ #
37
+ # integer = result.value.statements.body.first.receiver.receiver
38
+ # dispatcher.dispatch_once(integer)
39
+ #
40
+ class Dispatcher < Visitor
41
+ # attr_reader listeners: Hash[Symbol, Array[Listener]]
42
+ attr_reader :listeners
43
+
44
+ def initialize
45
+ @listeners = {}
46
+ end
47
+
48
+ # Register a listener for one or more events
49
+ #
50
+ # def register: (Listener, *Symbol) -> void
51
+ def register(listener, *events)
52
+ events.each { |event| (listeners[event] ||= []) << listener }
53
+ end
54
+
55
+ # Walks `root` dispatching events to all registered listeners
56
+ #
57
+ # def dispatch: (Node) -> void
58
+ alias dispatch visit
59
+
60
+ # Dispatches a single event for `node` to all registered listeners
61
+ #
62
+ # def dispatch_once: (Node) -> void
63
+ def dispatch_once(node)
64
+ node.accept(DispatchOnce.new(listeners))
65
+ end
66
+
67
+ # Dispatch enter and leave events for AliasGlobalVariableNode nodes and continue
68
+ # walking the tree.
69
+ def visit_alias_global_variable_node(node)
70
+ listeners[:on_alias_global_variable_node_enter]&.each { |listener| listener.on_alias_global_variable_node_enter(node) }
71
+ super
72
+ listeners[:on_alias_global_variable_node_leave]&.each { |listener| listener.on_alias_global_variable_node_leave(node) }
73
+ end
74
+
75
+ # Dispatch enter and leave events for AliasMethodNode nodes and continue
76
+ # walking the tree.
77
+ def visit_alias_method_node(node)
78
+ listeners[:on_alias_method_node_enter]&.each { |listener| listener.on_alias_method_node_enter(node) }
79
+ super
80
+ listeners[:on_alias_method_node_leave]&.each { |listener| listener.on_alias_method_node_leave(node) }
81
+ end
82
+
83
+ # Dispatch enter and leave events for AlternationPatternNode nodes and continue
84
+ # walking the tree.
85
+ def visit_alternation_pattern_node(node)
86
+ listeners[:on_alternation_pattern_node_enter]&.each { |listener| listener.on_alternation_pattern_node_enter(node) }
87
+ super
88
+ listeners[:on_alternation_pattern_node_leave]&.each { |listener| listener.on_alternation_pattern_node_leave(node) }
89
+ end
90
+
91
+ # Dispatch enter and leave events for AndNode nodes and continue
92
+ # walking the tree.
93
+ def visit_and_node(node)
94
+ listeners[:on_and_node_enter]&.each { |listener| listener.on_and_node_enter(node) }
95
+ super
96
+ listeners[:on_and_node_leave]&.each { |listener| listener.on_and_node_leave(node) }
97
+ end
98
+
99
+ # Dispatch enter and leave events for ArgumentsNode nodes and continue
100
+ # walking the tree.
101
+ def visit_arguments_node(node)
102
+ listeners[:on_arguments_node_enter]&.each { |listener| listener.on_arguments_node_enter(node) }
103
+ super
104
+ listeners[:on_arguments_node_leave]&.each { |listener| listener.on_arguments_node_leave(node) }
105
+ end
106
+
107
+ # Dispatch enter and leave events for ArrayNode nodes and continue
108
+ # walking the tree.
109
+ def visit_array_node(node)
110
+ listeners[:on_array_node_enter]&.each { |listener| listener.on_array_node_enter(node) }
111
+ super
112
+ listeners[:on_array_node_leave]&.each { |listener| listener.on_array_node_leave(node) }
113
+ end
114
+
115
+ # Dispatch enter and leave events for ArrayPatternNode nodes and continue
116
+ # walking the tree.
117
+ def visit_array_pattern_node(node)
118
+ listeners[:on_array_pattern_node_enter]&.each { |listener| listener.on_array_pattern_node_enter(node) }
119
+ super
120
+ listeners[:on_array_pattern_node_leave]&.each { |listener| listener.on_array_pattern_node_leave(node) }
121
+ end
122
+
123
+ # Dispatch enter and leave events for AssocNode nodes and continue
124
+ # walking the tree.
125
+ def visit_assoc_node(node)
126
+ listeners[:on_assoc_node_enter]&.each { |listener| listener.on_assoc_node_enter(node) }
127
+ super
128
+ listeners[:on_assoc_node_leave]&.each { |listener| listener.on_assoc_node_leave(node) }
129
+ end
130
+
131
+ # Dispatch enter and leave events for AssocSplatNode nodes and continue
132
+ # walking the tree.
133
+ def visit_assoc_splat_node(node)
134
+ listeners[:on_assoc_splat_node_enter]&.each { |listener| listener.on_assoc_splat_node_enter(node) }
135
+ super
136
+ listeners[:on_assoc_splat_node_leave]&.each { |listener| listener.on_assoc_splat_node_leave(node) }
137
+ end
138
+
139
+ # Dispatch enter and leave events for BackReferenceReadNode nodes and continue
140
+ # walking the tree.
141
+ def visit_back_reference_read_node(node)
142
+ listeners[:on_back_reference_read_node_enter]&.each { |listener| listener.on_back_reference_read_node_enter(node) }
143
+ super
144
+ listeners[:on_back_reference_read_node_leave]&.each { |listener| listener.on_back_reference_read_node_leave(node) }
145
+ end
146
+
147
+ # Dispatch enter and leave events for BeginNode nodes and continue
148
+ # walking the tree.
149
+ def visit_begin_node(node)
150
+ listeners[:on_begin_node_enter]&.each { |listener| listener.on_begin_node_enter(node) }
151
+ super
152
+ listeners[:on_begin_node_leave]&.each { |listener| listener.on_begin_node_leave(node) }
153
+ end
154
+
155
+ # Dispatch enter and leave events for BlockArgumentNode nodes and continue
156
+ # walking the tree.
157
+ def visit_block_argument_node(node)
158
+ listeners[:on_block_argument_node_enter]&.each { |listener| listener.on_block_argument_node_enter(node) }
159
+ super
160
+ listeners[:on_block_argument_node_leave]&.each { |listener| listener.on_block_argument_node_leave(node) }
161
+ end
162
+
163
+ # Dispatch enter and leave events for BlockLocalVariableNode nodes and continue
164
+ # walking the tree.
165
+ def visit_block_local_variable_node(node)
166
+ listeners[:on_block_local_variable_node_enter]&.each { |listener| listener.on_block_local_variable_node_enter(node) }
167
+ super
168
+ listeners[:on_block_local_variable_node_leave]&.each { |listener| listener.on_block_local_variable_node_leave(node) }
169
+ end
170
+
171
+ # Dispatch enter and leave events for BlockNode nodes and continue
172
+ # walking the tree.
173
+ def visit_block_node(node)
174
+ listeners[:on_block_node_enter]&.each { |listener| listener.on_block_node_enter(node) }
175
+ super
176
+ listeners[:on_block_node_leave]&.each { |listener| listener.on_block_node_leave(node) }
177
+ end
178
+
179
+ # Dispatch enter and leave events for BlockParameterNode nodes and continue
180
+ # walking the tree.
181
+ def visit_block_parameter_node(node)
182
+ listeners[:on_block_parameter_node_enter]&.each { |listener| listener.on_block_parameter_node_enter(node) }
183
+ super
184
+ listeners[:on_block_parameter_node_leave]&.each { |listener| listener.on_block_parameter_node_leave(node) }
185
+ end
186
+
187
+ # Dispatch enter and leave events for BlockParametersNode nodes and continue
188
+ # walking the tree.
189
+ def visit_block_parameters_node(node)
190
+ listeners[:on_block_parameters_node_enter]&.each { |listener| listener.on_block_parameters_node_enter(node) }
191
+ super
192
+ listeners[:on_block_parameters_node_leave]&.each { |listener| listener.on_block_parameters_node_leave(node) }
193
+ end
194
+
195
+ # Dispatch enter and leave events for BreakNode nodes and continue
196
+ # walking the tree.
197
+ def visit_break_node(node)
198
+ listeners[:on_break_node_enter]&.each { |listener| listener.on_break_node_enter(node) }
199
+ super
200
+ listeners[:on_break_node_leave]&.each { |listener| listener.on_break_node_leave(node) }
201
+ end
202
+
203
+ # Dispatch enter and leave events for CallAndWriteNode nodes and continue
204
+ # walking the tree.
205
+ def visit_call_and_write_node(node)
206
+ listeners[:on_call_and_write_node_enter]&.each { |listener| listener.on_call_and_write_node_enter(node) }
207
+ super
208
+ listeners[:on_call_and_write_node_leave]&.each { |listener| listener.on_call_and_write_node_leave(node) }
209
+ end
210
+
211
+ # Dispatch enter and leave events for CallNode nodes and continue
212
+ # walking the tree.
213
+ def visit_call_node(node)
214
+ listeners[:on_call_node_enter]&.each { |listener| listener.on_call_node_enter(node) }
215
+ super
216
+ listeners[:on_call_node_leave]&.each { |listener| listener.on_call_node_leave(node) }
217
+ end
218
+
219
+ # Dispatch enter and leave events for CallOperatorWriteNode nodes and continue
220
+ # walking the tree.
221
+ def visit_call_operator_write_node(node)
222
+ listeners[:on_call_operator_write_node_enter]&.each { |listener| listener.on_call_operator_write_node_enter(node) }
223
+ super
224
+ listeners[:on_call_operator_write_node_leave]&.each { |listener| listener.on_call_operator_write_node_leave(node) }
225
+ end
226
+
227
+ # Dispatch enter and leave events for CallOrWriteNode nodes and continue
228
+ # walking the tree.
229
+ def visit_call_or_write_node(node)
230
+ listeners[:on_call_or_write_node_enter]&.each { |listener| listener.on_call_or_write_node_enter(node) }
231
+ super
232
+ listeners[:on_call_or_write_node_leave]&.each { |listener| listener.on_call_or_write_node_leave(node) }
233
+ end
234
+
235
+ # Dispatch enter and leave events for CapturePatternNode nodes and continue
236
+ # walking the tree.
237
+ def visit_capture_pattern_node(node)
238
+ listeners[:on_capture_pattern_node_enter]&.each { |listener| listener.on_capture_pattern_node_enter(node) }
239
+ super
240
+ listeners[:on_capture_pattern_node_leave]&.each { |listener| listener.on_capture_pattern_node_leave(node) }
241
+ end
242
+
243
+ # Dispatch enter and leave events for CaseNode nodes and continue
244
+ # walking the tree.
245
+ def visit_case_node(node)
246
+ listeners[:on_case_node_enter]&.each { |listener| listener.on_case_node_enter(node) }
247
+ super
248
+ listeners[:on_case_node_leave]&.each { |listener| listener.on_case_node_leave(node) }
249
+ end
250
+
251
+ # Dispatch enter and leave events for ClassNode nodes and continue
252
+ # walking the tree.
253
+ def visit_class_node(node)
254
+ listeners[:on_class_node_enter]&.each { |listener| listener.on_class_node_enter(node) }
255
+ super
256
+ listeners[:on_class_node_leave]&.each { |listener| listener.on_class_node_leave(node) }
257
+ end
258
+
259
+ # Dispatch enter and leave events for ClassVariableAndWriteNode nodes and continue
260
+ # walking the tree.
261
+ def visit_class_variable_and_write_node(node)
262
+ listeners[:on_class_variable_and_write_node_enter]&.each { |listener| listener.on_class_variable_and_write_node_enter(node) }
263
+ super
264
+ listeners[:on_class_variable_and_write_node_leave]&.each { |listener| listener.on_class_variable_and_write_node_leave(node) }
265
+ end
266
+
267
+ # Dispatch enter and leave events for ClassVariableOperatorWriteNode nodes and continue
268
+ # walking the tree.
269
+ def visit_class_variable_operator_write_node(node)
270
+ listeners[:on_class_variable_operator_write_node_enter]&.each { |listener| listener.on_class_variable_operator_write_node_enter(node) }
271
+ super
272
+ listeners[:on_class_variable_operator_write_node_leave]&.each { |listener| listener.on_class_variable_operator_write_node_leave(node) }
273
+ end
274
+
275
+ # Dispatch enter and leave events for ClassVariableOrWriteNode nodes and continue
276
+ # walking the tree.
277
+ def visit_class_variable_or_write_node(node)
278
+ listeners[:on_class_variable_or_write_node_enter]&.each { |listener| listener.on_class_variable_or_write_node_enter(node) }
279
+ super
280
+ listeners[:on_class_variable_or_write_node_leave]&.each { |listener| listener.on_class_variable_or_write_node_leave(node) }
281
+ end
282
+
283
+ # Dispatch enter and leave events for ClassVariableReadNode nodes and continue
284
+ # walking the tree.
285
+ def visit_class_variable_read_node(node)
286
+ listeners[:on_class_variable_read_node_enter]&.each { |listener| listener.on_class_variable_read_node_enter(node) }
287
+ super
288
+ listeners[:on_class_variable_read_node_leave]&.each { |listener| listener.on_class_variable_read_node_leave(node) }
289
+ end
290
+
291
+ # Dispatch enter and leave events for ClassVariableTargetNode nodes and continue
292
+ # walking the tree.
293
+ def visit_class_variable_target_node(node)
294
+ listeners[:on_class_variable_target_node_enter]&.each { |listener| listener.on_class_variable_target_node_enter(node) }
295
+ super
296
+ listeners[:on_class_variable_target_node_leave]&.each { |listener| listener.on_class_variable_target_node_leave(node) }
297
+ end
298
+
299
+ # Dispatch enter and leave events for ClassVariableWriteNode nodes and continue
300
+ # walking the tree.
301
+ def visit_class_variable_write_node(node)
302
+ listeners[:on_class_variable_write_node_enter]&.each { |listener| listener.on_class_variable_write_node_enter(node) }
303
+ super
304
+ listeners[:on_class_variable_write_node_leave]&.each { |listener| listener.on_class_variable_write_node_leave(node) }
305
+ end
306
+
307
+ # Dispatch enter and leave events for ConstantAndWriteNode nodes and continue
308
+ # walking the tree.
309
+ def visit_constant_and_write_node(node)
310
+ listeners[:on_constant_and_write_node_enter]&.each { |listener| listener.on_constant_and_write_node_enter(node) }
311
+ super
312
+ listeners[:on_constant_and_write_node_leave]&.each { |listener| listener.on_constant_and_write_node_leave(node) }
313
+ end
314
+
315
+ # Dispatch enter and leave events for ConstantOperatorWriteNode nodes and continue
316
+ # walking the tree.
317
+ def visit_constant_operator_write_node(node)
318
+ listeners[:on_constant_operator_write_node_enter]&.each { |listener| listener.on_constant_operator_write_node_enter(node) }
319
+ super
320
+ listeners[:on_constant_operator_write_node_leave]&.each { |listener| listener.on_constant_operator_write_node_leave(node) }
321
+ end
322
+
323
+ # Dispatch enter and leave events for ConstantOrWriteNode nodes and continue
324
+ # walking the tree.
325
+ def visit_constant_or_write_node(node)
326
+ listeners[:on_constant_or_write_node_enter]&.each { |listener| listener.on_constant_or_write_node_enter(node) }
327
+ super
328
+ listeners[:on_constant_or_write_node_leave]&.each { |listener| listener.on_constant_or_write_node_leave(node) }
329
+ end
330
+
331
+ # Dispatch enter and leave events for ConstantPathAndWriteNode nodes and continue
332
+ # walking the tree.
333
+ def visit_constant_path_and_write_node(node)
334
+ listeners[:on_constant_path_and_write_node_enter]&.each { |listener| listener.on_constant_path_and_write_node_enter(node) }
335
+ super
336
+ listeners[:on_constant_path_and_write_node_leave]&.each { |listener| listener.on_constant_path_and_write_node_leave(node) }
337
+ end
338
+
339
+ # Dispatch enter and leave events for ConstantPathNode nodes and continue
340
+ # walking the tree.
341
+ def visit_constant_path_node(node)
342
+ listeners[:on_constant_path_node_enter]&.each { |listener| listener.on_constant_path_node_enter(node) }
343
+ super
344
+ listeners[:on_constant_path_node_leave]&.each { |listener| listener.on_constant_path_node_leave(node) }
345
+ end
346
+
347
+ # Dispatch enter and leave events for ConstantPathOperatorWriteNode nodes and continue
348
+ # walking the tree.
349
+ def visit_constant_path_operator_write_node(node)
350
+ listeners[:on_constant_path_operator_write_node_enter]&.each { |listener| listener.on_constant_path_operator_write_node_enter(node) }
351
+ super
352
+ listeners[:on_constant_path_operator_write_node_leave]&.each { |listener| listener.on_constant_path_operator_write_node_leave(node) }
353
+ end
354
+
355
+ # Dispatch enter and leave events for ConstantPathOrWriteNode nodes and continue
356
+ # walking the tree.
357
+ def visit_constant_path_or_write_node(node)
358
+ listeners[:on_constant_path_or_write_node_enter]&.each { |listener| listener.on_constant_path_or_write_node_enter(node) }
359
+ super
360
+ listeners[:on_constant_path_or_write_node_leave]&.each { |listener| listener.on_constant_path_or_write_node_leave(node) }
361
+ end
362
+
363
+ # Dispatch enter and leave events for ConstantPathTargetNode nodes and continue
364
+ # walking the tree.
365
+ def visit_constant_path_target_node(node)
366
+ listeners[:on_constant_path_target_node_enter]&.each { |listener| listener.on_constant_path_target_node_enter(node) }
367
+ super
368
+ listeners[:on_constant_path_target_node_leave]&.each { |listener| listener.on_constant_path_target_node_leave(node) }
369
+ end
370
+
371
+ # Dispatch enter and leave events for ConstantPathWriteNode nodes and continue
372
+ # walking the tree.
373
+ def visit_constant_path_write_node(node)
374
+ listeners[:on_constant_path_write_node_enter]&.each { |listener| listener.on_constant_path_write_node_enter(node) }
375
+ super
376
+ listeners[:on_constant_path_write_node_leave]&.each { |listener| listener.on_constant_path_write_node_leave(node) }
377
+ end
378
+
379
+ # Dispatch enter and leave events for ConstantReadNode nodes and continue
380
+ # walking the tree.
381
+ def visit_constant_read_node(node)
382
+ listeners[:on_constant_read_node_enter]&.each { |listener| listener.on_constant_read_node_enter(node) }
383
+ super
384
+ listeners[:on_constant_read_node_leave]&.each { |listener| listener.on_constant_read_node_leave(node) }
385
+ end
386
+
387
+ # Dispatch enter and leave events for ConstantTargetNode nodes and continue
388
+ # walking the tree.
389
+ def visit_constant_target_node(node)
390
+ listeners[:on_constant_target_node_enter]&.each { |listener| listener.on_constant_target_node_enter(node) }
391
+ super
392
+ listeners[:on_constant_target_node_leave]&.each { |listener| listener.on_constant_target_node_leave(node) }
393
+ end
394
+
395
+ # Dispatch enter and leave events for ConstantWriteNode nodes and continue
396
+ # walking the tree.
397
+ def visit_constant_write_node(node)
398
+ listeners[:on_constant_write_node_enter]&.each { |listener| listener.on_constant_write_node_enter(node) }
399
+ super
400
+ listeners[:on_constant_write_node_leave]&.each { |listener| listener.on_constant_write_node_leave(node) }
401
+ end
402
+
403
+ # Dispatch enter and leave events for DefNode nodes and continue
404
+ # walking the tree.
405
+ def visit_def_node(node)
406
+ listeners[:on_def_node_enter]&.each { |listener| listener.on_def_node_enter(node) }
407
+ super
408
+ listeners[:on_def_node_leave]&.each { |listener| listener.on_def_node_leave(node) }
409
+ end
410
+
411
+ # Dispatch enter and leave events for DefinedNode nodes and continue
412
+ # walking the tree.
413
+ def visit_defined_node(node)
414
+ listeners[:on_defined_node_enter]&.each { |listener| listener.on_defined_node_enter(node) }
415
+ super
416
+ listeners[:on_defined_node_leave]&.each { |listener| listener.on_defined_node_leave(node) }
417
+ end
418
+
419
+ # Dispatch enter and leave events for ElseNode nodes and continue
420
+ # walking the tree.
421
+ def visit_else_node(node)
422
+ listeners[:on_else_node_enter]&.each { |listener| listener.on_else_node_enter(node) }
423
+ super
424
+ listeners[:on_else_node_leave]&.each { |listener| listener.on_else_node_leave(node) }
425
+ end
426
+
427
+ # Dispatch enter and leave events for EmbeddedStatementsNode nodes and continue
428
+ # walking the tree.
429
+ def visit_embedded_statements_node(node)
430
+ listeners[:on_embedded_statements_node_enter]&.each { |listener| listener.on_embedded_statements_node_enter(node) }
431
+ super
432
+ listeners[:on_embedded_statements_node_leave]&.each { |listener| listener.on_embedded_statements_node_leave(node) }
433
+ end
434
+
435
+ # Dispatch enter and leave events for EmbeddedVariableNode nodes and continue
436
+ # walking the tree.
437
+ def visit_embedded_variable_node(node)
438
+ listeners[:on_embedded_variable_node_enter]&.each { |listener| listener.on_embedded_variable_node_enter(node) }
439
+ super
440
+ listeners[:on_embedded_variable_node_leave]&.each { |listener| listener.on_embedded_variable_node_leave(node) }
441
+ end
442
+
443
+ # Dispatch enter and leave events for EnsureNode nodes and continue
444
+ # walking the tree.
445
+ def visit_ensure_node(node)
446
+ listeners[:on_ensure_node_enter]&.each { |listener| listener.on_ensure_node_enter(node) }
447
+ super
448
+ listeners[:on_ensure_node_leave]&.each { |listener| listener.on_ensure_node_leave(node) }
449
+ end
450
+
451
+ # Dispatch enter and leave events for FalseNode nodes and continue
452
+ # walking the tree.
453
+ def visit_false_node(node)
454
+ listeners[:on_false_node_enter]&.each { |listener| listener.on_false_node_enter(node) }
455
+ super
456
+ listeners[:on_false_node_leave]&.each { |listener| listener.on_false_node_leave(node) }
457
+ end
458
+
459
+ # Dispatch enter and leave events for FindPatternNode nodes and continue
460
+ # walking the tree.
461
+ def visit_find_pattern_node(node)
462
+ listeners[:on_find_pattern_node_enter]&.each { |listener| listener.on_find_pattern_node_enter(node) }
463
+ super
464
+ listeners[:on_find_pattern_node_leave]&.each { |listener| listener.on_find_pattern_node_leave(node) }
465
+ end
466
+
467
+ # Dispatch enter and leave events for FlipFlopNode nodes and continue
468
+ # walking the tree.
469
+ def visit_flip_flop_node(node)
470
+ listeners[:on_flip_flop_node_enter]&.each { |listener| listener.on_flip_flop_node_enter(node) }
471
+ super
472
+ listeners[:on_flip_flop_node_leave]&.each { |listener| listener.on_flip_flop_node_leave(node) }
473
+ end
474
+
475
+ # Dispatch enter and leave events for FloatNode nodes and continue
476
+ # walking the tree.
477
+ def visit_float_node(node)
478
+ listeners[:on_float_node_enter]&.each { |listener| listener.on_float_node_enter(node) }
479
+ super
480
+ listeners[:on_float_node_leave]&.each { |listener| listener.on_float_node_leave(node) }
481
+ end
482
+
483
+ # Dispatch enter and leave events for ForNode nodes and continue
484
+ # walking the tree.
485
+ def visit_for_node(node)
486
+ listeners[:on_for_node_enter]&.each { |listener| listener.on_for_node_enter(node) }
487
+ super
488
+ listeners[:on_for_node_leave]&.each { |listener| listener.on_for_node_leave(node) }
489
+ end
490
+
491
+ # Dispatch enter and leave events for ForwardingArgumentsNode nodes and continue
492
+ # walking the tree.
493
+ def visit_forwarding_arguments_node(node)
494
+ listeners[:on_forwarding_arguments_node_enter]&.each { |listener| listener.on_forwarding_arguments_node_enter(node) }
495
+ super
496
+ listeners[:on_forwarding_arguments_node_leave]&.each { |listener| listener.on_forwarding_arguments_node_leave(node) }
497
+ end
498
+
499
+ # Dispatch enter and leave events for ForwardingParameterNode nodes and continue
500
+ # walking the tree.
501
+ def visit_forwarding_parameter_node(node)
502
+ listeners[:on_forwarding_parameter_node_enter]&.each { |listener| listener.on_forwarding_parameter_node_enter(node) }
503
+ super
504
+ listeners[:on_forwarding_parameter_node_leave]&.each { |listener| listener.on_forwarding_parameter_node_leave(node) }
505
+ end
506
+
507
+ # Dispatch enter and leave events for ForwardingSuperNode nodes and continue
508
+ # walking the tree.
509
+ def visit_forwarding_super_node(node)
510
+ listeners[:on_forwarding_super_node_enter]&.each { |listener| listener.on_forwarding_super_node_enter(node) }
511
+ super
512
+ listeners[:on_forwarding_super_node_leave]&.each { |listener| listener.on_forwarding_super_node_leave(node) }
513
+ end
514
+
515
+ # Dispatch enter and leave events for GlobalVariableAndWriteNode nodes and continue
516
+ # walking the tree.
517
+ def visit_global_variable_and_write_node(node)
518
+ listeners[:on_global_variable_and_write_node_enter]&.each { |listener| listener.on_global_variable_and_write_node_enter(node) }
519
+ super
520
+ listeners[:on_global_variable_and_write_node_leave]&.each { |listener| listener.on_global_variable_and_write_node_leave(node) }
521
+ end
522
+
523
+ # Dispatch enter and leave events for GlobalVariableOperatorWriteNode nodes and continue
524
+ # walking the tree.
525
+ def visit_global_variable_operator_write_node(node)
526
+ listeners[:on_global_variable_operator_write_node_enter]&.each { |listener| listener.on_global_variable_operator_write_node_enter(node) }
527
+ super
528
+ listeners[:on_global_variable_operator_write_node_leave]&.each { |listener| listener.on_global_variable_operator_write_node_leave(node) }
529
+ end
530
+
531
+ # Dispatch enter and leave events for GlobalVariableOrWriteNode nodes and continue
532
+ # walking the tree.
533
+ def visit_global_variable_or_write_node(node)
534
+ listeners[:on_global_variable_or_write_node_enter]&.each { |listener| listener.on_global_variable_or_write_node_enter(node) }
535
+ super
536
+ listeners[:on_global_variable_or_write_node_leave]&.each { |listener| listener.on_global_variable_or_write_node_leave(node) }
537
+ end
538
+
539
+ # Dispatch enter and leave events for GlobalVariableReadNode nodes and continue
540
+ # walking the tree.
541
+ def visit_global_variable_read_node(node)
542
+ listeners[:on_global_variable_read_node_enter]&.each { |listener| listener.on_global_variable_read_node_enter(node) }
543
+ super
544
+ listeners[:on_global_variable_read_node_leave]&.each { |listener| listener.on_global_variable_read_node_leave(node) }
545
+ end
546
+
547
+ # Dispatch enter and leave events for GlobalVariableTargetNode nodes and continue
548
+ # walking the tree.
549
+ def visit_global_variable_target_node(node)
550
+ listeners[:on_global_variable_target_node_enter]&.each { |listener| listener.on_global_variable_target_node_enter(node) }
551
+ super
552
+ listeners[:on_global_variable_target_node_leave]&.each { |listener| listener.on_global_variable_target_node_leave(node) }
553
+ end
554
+
555
+ # Dispatch enter and leave events for GlobalVariableWriteNode nodes and continue
556
+ # walking the tree.
557
+ def visit_global_variable_write_node(node)
558
+ listeners[:on_global_variable_write_node_enter]&.each { |listener| listener.on_global_variable_write_node_enter(node) }
559
+ super
560
+ listeners[:on_global_variable_write_node_leave]&.each { |listener| listener.on_global_variable_write_node_leave(node) }
561
+ end
562
+
563
+ # Dispatch enter and leave events for HashNode nodes and continue
564
+ # walking the tree.
565
+ def visit_hash_node(node)
566
+ listeners[:on_hash_node_enter]&.each { |listener| listener.on_hash_node_enter(node) }
567
+ super
568
+ listeners[:on_hash_node_leave]&.each { |listener| listener.on_hash_node_leave(node) }
569
+ end
570
+
571
+ # Dispatch enter and leave events for HashPatternNode nodes and continue
572
+ # walking the tree.
573
+ def visit_hash_pattern_node(node)
574
+ listeners[:on_hash_pattern_node_enter]&.each { |listener| listener.on_hash_pattern_node_enter(node) }
575
+ super
576
+ listeners[:on_hash_pattern_node_leave]&.each { |listener| listener.on_hash_pattern_node_leave(node) }
577
+ end
578
+
579
+ # Dispatch enter and leave events for IfNode nodes and continue
580
+ # walking the tree.
581
+ def visit_if_node(node)
582
+ listeners[:on_if_node_enter]&.each { |listener| listener.on_if_node_enter(node) }
583
+ super
584
+ listeners[:on_if_node_leave]&.each { |listener| listener.on_if_node_leave(node) }
585
+ end
586
+
587
+ # Dispatch enter and leave events for ImaginaryNode nodes and continue
588
+ # walking the tree.
589
+ def visit_imaginary_node(node)
590
+ listeners[:on_imaginary_node_enter]&.each { |listener| listener.on_imaginary_node_enter(node) }
591
+ super
592
+ listeners[:on_imaginary_node_leave]&.each { |listener| listener.on_imaginary_node_leave(node) }
593
+ end
594
+
595
+ # Dispatch enter and leave events for ImplicitNode nodes and continue
596
+ # walking the tree.
597
+ def visit_implicit_node(node)
598
+ listeners[:on_implicit_node_enter]&.each { |listener| listener.on_implicit_node_enter(node) }
599
+ super
600
+ listeners[:on_implicit_node_leave]&.each { |listener| listener.on_implicit_node_leave(node) }
601
+ end
602
+
603
+ # Dispatch enter and leave events for InNode nodes and continue
604
+ # walking the tree.
605
+ def visit_in_node(node)
606
+ listeners[:on_in_node_enter]&.each { |listener| listener.on_in_node_enter(node) }
607
+ super
608
+ listeners[:on_in_node_leave]&.each { |listener| listener.on_in_node_leave(node) }
609
+ end
610
+
611
+ # Dispatch enter and leave events for InstanceVariableAndWriteNode nodes and continue
612
+ # walking the tree.
613
+ def visit_instance_variable_and_write_node(node)
614
+ listeners[:on_instance_variable_and_write_node_enter]&.each { |listener| listener.on_instance_variable_and_write_node_enter(node) }
615
+ super
616
+ listeners[:on_instance_variable_and_write_node_leave]&.each { |listener| listener.on_instance_variable_and_write_node_leave(node) }
617
+ end
618
+
619
+ # Dispatch enter and leave events for InstanceVariableOperatorWriteNode nodes and continue
620
+ # walking the tree.
621
+ def visit_instance_variable_operator_write_node(node)
622
+ listeners[:on_instance_variable_operator_write_node_enter]&.each { |listener| listener.on_instance_variable_operator_write_node_enter(node) }
623
+ super
624
+ listeners[:on_instance_variable_operator_write_node_leave]&.each { |listener| listener.on_instance_variable_operator_write_node_leave(node) }
625
+ end
626
+
627
+ # Dispatch enter and leave events for InstanceVariableOrWriteNode nodes and continue
628
+ # walking the tree.
629
+ def visit_instance_variable_or_write_node(node)
630
+ listeners[:on_instance_variable_or_write_node_enter]&.each { |listener| listener.on_instance_variable_or_write_node_enter(node) }
631
+ super
632
+ listeners[:on_instance_variable_or_write_node_leave]&.each { |listener| listener.on_instance_variable_or_write_node_leave(node) }
633
+ end
634
+
635
+ # Dispatch enter and leave events for InstanceVariableReadNode nodes and continue
636
+ # walking the tree.
637
+ def visit_instance_variable_read_node(node)
638
+ listeners[:on_instance_variable_read_node_enter]&.each { |listener| listener.on_instance_variable_read_node_enter(node) }
639
+ super
640
+ listeners[:on_instance_variable_read_node_leave]&.each { |listener| listener.on_instance_variable_read_node_leave(node) }
641
+ end
642
+
643
+ # Dispatch enter and leave events for InstanceVariableTargetNode nodes and continue
644
+ # walking the tree.
645
+ def visit_instance_variable_target_node(node)
646
+ listeners[:on_instance_variable_target_node_enter]&.each { |listener| listener.on_instance_variable_target_node_enter(node) }
647
+ super
648
+ listeners[:on_instance_variable_target_node_leave]&.each { |listener| listener.on_instance_variable_target_node_leave(node) }
649
+ end
650
+
651
+ # Dispatch enter and leave events for InstanceVariableWriteNode nodes and continue
652
+ # walking the tree.
653
+ def visit_instance_variable_write_node(node)
654
+ listeners[:on_instance_variable_write_node_enter]&.each { |listener| listener.on_instance_variable_write_node_enter(node) }
655
+ super
656
+ listeners[:on_instance_variable_write_node_leave]&.each { |listener| listener.on_instance_variable_write_node_leave(node) }
657
+ end
658
+
659
+ # Dispatch enter and leave events for IntegerNode nodes and continue
660
+ # walking the tree.
661
+ def visit_integer_node(node)
662
+ listeners[:on_integer_node_enter]&.each { |listener| listener.on_integer_node_enter(node) }
663
+ super
664
+ listeners[:on_integer_node_leave]&.each { |listener| listener.on_integer_node_leave(node) }
665
+ end
666
+
667
+ # Dispatch enter and leave events for InterpolatedMatchLastLineNode nodes and continue
668
+ # walking the tree.
669
+ def visit_interpolated_match_last_line_node(node)
670
+ listeners[:on_interpolated_match_last_line_node_enter]&.each { |listener| listener.on_interpolated_match_last_line_node_enter(node) }
671
+ super
672
+ listeners[:on_interpolated_match_last_line_node_leave]&.each { |listener| listener.on_interpolated_match_last_line_node_leave(node) }
673
+ end
674
+
675
+ # Dispatch enter and leave events for InterpolatedRegularExpressionNode nodes and continue
676
+ # walking the tree.
677
+ def visit_interpolated_regular_expression_node(node)
678
+ listeners[:on_interpolated_regular_expression_node_enter]&.each { |listener| listener.on_interpolated_regular_expression_node_enter(node) }
679
+ super
680
+ listeners[:on_interpolated_regular_expression_node_leave]&.each { |listener| listener.on_interpolated_regular_expression_node_leave(node) }
681
+ end
682
+
683
+ # Dispatch enter and leave events for InterpolatedStringNode nodes and continue
684
+ # walking the tree.
685
+ def visit_interpolated_string_node(node)
686
+ listeners[:on_interpolated_string_node_enter]&.each { |listener| listener.on_interpolated_string_node_enter(node) }
687
+ super
688
+ listeners[:on_interpolated_string_node_leave]&.each { |listener| listener.on_interpolated_string_node_leave(node) }
689
+ end
690
+
691
+ # Dispatch enter and leave events for InterpolatedSymbolNode nodes and continue
692
+ # walking the tree.
693
+ def visit_interpolated_symbol_node(node)
694
+ listeners[:on_interpolated_symbol_node_enter]&.each { |listener| listener.on_interpolated_symbol_node_enter(node) }
695
+ super
696
+ listeners[:on_interpolated_symbol_node_leave]&.each { |listener| listener.on_interpolated_symbol_node_leave(node) }
697
+ end
698
+
699
+ # Dispatch enter and leave events for InterpolatedXStringNode nodes and continue
700
+ # walking the tree.
701
+ def visit_interpolated_x_string_node(node)
702
+ listeners[:on_interpolated_x_string_node_enter]&.each { |listener| listener.on_interpolated_x_string_node_enter(node) }
703
+ super
704
+ listeners[:on_interpolated_x_string_node_leave]&.each { |listener| listener.on_interpolated_x_string_node_leave(node) }
705
+ end
706
+
707
+ # Dispatch enter and leave events for KeywordHashNode nodes and continue
708
+ # walking the tree.
709
+ def visit_keyword_hash_node(node)
710
+ listeners[:on_keyword_hash_node_enter]&.each { |listener| listener.on_keyword_hash_node_enter(node) }
711
+ super
712
+ listeners[:on_keyword_hash_node_leave]&.each { |listener| listener.on_keyword_hash_node_leave(node) }
713
+ end
714
+
715
+ # Dispatch enter and leave events for KeywordParameterNode nodes and continue
716
+ # walking the tree.
717
+ def visit_keyword_parameter_node(node)
718
+ listeners[:on_keyword_parameter_node_enter]&.each { |listener| listener.on_keyword_parameter_node_enter(node) }
719
+ super
720
+ listeners[:on_keyword_parameter_node_leave]&.each { |listener| listener.on_keyword_parameter_node_leave(node) }
721
+ end
722
+
723
+ # Dispatch enter and leave events for KeywordRestParameterNode nodes and continue
724
+ # walking the tree.
725
+ def visit_keyword_rest_parameter_node(node)
726
+ listeners[:on_keyword_rest_parameter_node_enter]&.each { |listener| listener.on_keyword_rest_parameter_node_enter(node) }
727
+ super
728
+ listeners[:on_keyword_rest_parameter_node_leave]&.each { |listener| listener.on_keyword_rest_parameter_node_leave(node) }
729
+ end
730
+
731
+ # Dispatch enter and leave events for LambdaNode nodes and continue
732
+ # walking the tree.
733
+ def visit_lambda_node(node)
734
+ listeners[:on_lambda_node_enter]&.each { |listener| listener.on_lambda_node_enter(node) }
735
+ super
736
+ listeners[:on_lambda_node_leave]&.each { |listener| listener.on_lambda_node_leave(node) }
737
+ end
738
+
739
+ # Dispatch enter and leave events for LocalVariableAndWriteNode nodes and continue
740
+ # walking the tree.
741
+ def visit_local_variable_and_write_node(node)
742
+ listeners[:on_local_variable_and_write_node_enter]&.each { |listener| listener.on_local_variable_and_write_node_enter(node) }
743
+ super
744
+ listeners[:on_local_variable_and_write_node_leave]&.each { |listener| listener.on_local_variable_and_write_node_leave(node) }
745
+ end
746
+
747
+ # Dispatch enter and leave events for LocalVariableOperatorWriteNode nodes and continue
748
+ # walking the tree.
749
+ def visit_local_variable_operator_write_node(node)
750
+ listeners[:on_local_variable_operator_write_node_enter]&.each { |listener| listener.on_local_variable_operator_write_node_enter(node) }
751
+ super
752
+ listeners[:on_local_variable_operator_write_node_leave]&.each { |listener| listener.on_local_variable_operator_write_node_leave(node) }
753
+ end
754
+
755
+ # Dispatch enter and leave events for LocalVariableOrWriteNode nodes and continue
756
+ # walking the tree.
757
+ def visit_local_variable_or_write_node(node)
758
+ listeners[:on_local_variable_or_write_node_enter]&.each { |listener| listener.on_local_variable_or_write_node_enter(node) }
759
+ super
760
+ listeners[:on_local_variable_or_write_node_leave]&.each { |listener| listener.on_local_variable_or_write_node_leave(node) }
761
+ end
762
+
763
+ # Dispatch enter and leave events for LocalVariableReadNode nodes and continue
764
+ # walking the tree.
765
+ def visit_local_variable_read_node(node)
766
+ listeners[:on_local_variable_read_node_enter]&.each { |listener| listener.on_local_variable_read_node_enter(node) }
767
+ super
768
+ listeners[:on_local_variable_read_node_leave]&.each { |listener| listener.on_local_variable_read_node_leave(node) }
769
+ end
770
+
771
+ # Dispatch enter and leave events for LocalVariableTargetNode nodes and continue
772
+ # walking the tree.
773
+ def visit_local_variable_target_node(node)
774
+ listeners[:on_local_variable_target_node_enter]&.each { |listener| listener.on_local_variable_target_node_enter(node) }
775
+ super
776
+ listeners[:on_local_variable_target_node_leave]&.each { |listener| listener.on_local_variable_target_node_leave(node) }
777
+ end
778
+
779
+ # Dispatch enter and leave events for LocalVariableWriteNode nodes and continue
780
+ # walking the tree.
781
+ def visit_local_variable_write_node(node)
782
+ listeners[:on_local_variable_write_node_enter]&.each { |listener| listener.on_local_variable_write_node_enter(node) }
783
+ super
784
+ listeners[:on_local_variable_write_node_leave]&.each { |listener| listener.on_local_variable_write_node_leave(node) }
785
+ end
786
+
787
+ # Dispatch enter and leave events for MatchLastLineNode nodes and continue
788
+ # walking the tree.
789
+ def visit_match_last_line_node(node)
790
+ listeners[:on_match_last_line_node_enter]&.each { |listener| listener.on_match_last_line_node_enter(node) }
791
+ super
792
+ listeners[:on_match_last_line_node_leave]&.each { |listener| listener.on_match_last_line_node_leave(node) }
793
+ end
794
+
795
+ # Dispatch enter and leave events for MatchPredicateNode nodes and continue
796
+ # walking the tree.
797
+ def visit_match_predicate_node(node)
798
+ listeners[:on_match_predicate_node_enter]&.each { |listener| listener.on_match_predicate_node_enter(node) }
799
+ super
800
+ listeners[:on_match_predicate_node_leave]&.each { |listener| listener.on_match_predicate_node_leave(node) }
801
+ end
802
+
803
+ # Dispatch enter and leave events for MatchRequiredNode nodes and continue
804
+ # walking the tree.
805
+ def visit_match_required_node(node)
806
+ listeners[:on_match_required_node_enter]&.each { |listener| listener.on_match_required_node_enter(node) }
807
+ super
808
+ listeners[:on_match_required_node_leave]&.each { |listener| listener.on_match_required_node_leave(node) }
809
+ end
810
+
811
+ # Dispatch enter and leave events for MatchWriteNode nodes and continue
812
+ # walking the tree.
813
+ def visit_match_write_node(node)
814
+ listeners[:on_match_write_node_enter]&.each { |listener| listener.on_match_write_node_enter(node) }
815
+ super
816
+ listeners[:on_match_write_node_leave]&.each { |listener| listener.on_match_write_node_leave(node) }
817
+ end
818
+
819
+ # Dispatch enter and leave events for MissingNode nodes and continue
820
+ # walking the tree.
821
+ def visit_missing_node(node)
822
+ listeners[:on_missing_node_enter]&.each { |listener| listener.on_missing_node_enter(node) }
823
+ super
824
+ listeners[:on_missing_node_leave]&.each { |listener| listener.on_missing_node_leave(node) }
825
+ end
826
+
827
+ # Dispatch enter and leave events for ModuleNode nodes and continue
828
+ # walking the tree.
829
+ def visit_module_node(node)
830
+ listeners[:on_module_node_enter]&.each { |listener| listener.on_module_node_enter(node) }
831
+ super
832
+ listeners[:on_module_node_leave]&.each { |listener| listener.on_module_node_leave(node) }
833
+ end
834
+
835
+ # Dispatch enter and leave events for MultiTargetNode nodes and continue
836
+ # walking the tree.
837
+ def visit_multi_target_node(node)
838
+ listeners[:on_multi_target_node_enter]&.each { |listener| listener.on_multi_target_node_enter(node) }
839
+ super
840
+ listeners[:on_multi_target_node_leave]&.each { |listener| listener.on_multi_target_node_leave(node) }
841
+ end
842
+
843
+ # Dispatch enter and leave events for MultiWriteNode nodes and continue
844
+ # walking the tree.
845
+ def visit_multi_write_node(node)
846
+ listeners[:on_multi_write_node_enter]&.each { |listener| listener.on_multi_write_node_enter(node) }
847
+ super
848
+ listeners[:on_multi_write_node_leave]&.each { |listener| listener.on_multi_write_node_leave(node) }
849
+ end
850
+
851
+ # Dispatch enter and leave events for NextNode nodes and continue
852
+ # walking the tree.
853
+ def visit_next_node(node)
854
+ listeners[:on_next_node_enter]&.each { |listener| listener.on_next_node_enter(node) }
855
+ super
856
+ listeners[:on_next_node_leave]&.each { |listener| listener.on_next_node_leave(node) }
857
+ end
858
+
859
+ # Dispatch enter and leave events for NilNode nodes and continue
860
+ # walking the tree.
861
+ def visit_nil_node(node)
862
+ listeners[:on_nil_node_enter]&.each { |listener| listener.on_nil_node_enter(node) }
863
+ super
864
+ listeners[:on_nil_node_leave]&.each { |listener| listener.on_nil_node_leave(node) }
865
+ end
866
+
867
+ # Dispatch enter and leave events for NoKeywordsParameterNode nodes and continue
868
+ # walking the tree.
869
+ def visit_no_keywords_parameter_node(node)
870
+ listeners[:on_no_keywords_parameter_node_enter]&.each { |listener| listener.on_no_keywords_parameter_node_enter(node) }
871
+ super
872
+ listeners[:on_no_keywords_parameter_node_leave]&.each { |listener| listener.on_no_keywords_parameter_node_leave(node) }
873
+ end
874
+
875
+ # Dispatch enter and leave events for NumberedReferenceReadNode nodes and continue
876
+ # walking the tree.
877
+ def visit_numbered_reference_read_node(node)
878
+ listeners[:on_numbered_reference_read_node_enter]&.each { |listener| listener.on_numbered_reference_read_node_enter(node) }
879
+ super
880
+ listeners[:on_numbered_reference_read_node_leave]&.each { |listener| listener.on_numbered_reference_read_node_leave(node) }
881
+ end
882
+
883
+ # Dispatch enter and leave events for OptionalParameterNode nodes and continue
884
+ # walking the tree.
885
+ def visit_optional_parameter_node(node)
886
+ listeners[:on_optional_parameter_node_enter]&.each { |listener| listener.on_optional_parameter_node_enter(node) }
887
+ super
888
+ listeners[:on_optional_parameter_node_leave]&.each { |listener| listener.on_optional_parameter_node_leave(node) }
889
+ end
890
+
891
+ # Dispatch enter and leave events for OrNode nodes and continue
892
+ # walking the tree.
893
+ def visit_or_node(node)
894
+ listeners[:on_or_node_enter]&.each { |listener| listener.on_or_node_enter(node) }
895
+ super
896
+ listeners[:on_or_node_leave]&.each { |listener| listener.on_or_node_leave(node) }
897
+ end
898
+
899
+ # Dispatch enter and leave events for ParametersNode nodes and continue
900
+ # walking the tree.
901
+ def visit_parameters_node(node)
902
+ listeners[:on_parameters_node_enter]&.each { |listener| listener.on_parameters_node_enter(node) }
903
+ super
904
+ listeners[:on_parameters_node_leave]&.each { |listener| listener.on_parameters_node_leave(node) }
905
+ end
906
+
907
+ # Dispatch enter and leave events for ParenthesesNode nodes and continue
908
+ # walking the tree.
909
+ def visit_parentheses_node(node)
910
+ listeners[:on_parentheses_node_enter]&.each { |listener| listener.on_parentheses_node_enter(node) }
911
+ super
912
+ listeners[:on_parentheses_node_leave]&.each { |listener| listener.on_parentheses_node_leave(node) }
913
+ end
914
+
915
+ # Dispatch enter and leave events for PinnedExpressionNode nodes and continue
916
+ # walking the tree.
917
+ def visit_pinned_expression_node(node)
918
+ listeners[:on_pinned_expression_node_enter]&.each { |listener| listener.on_pinned_expression_node_enter(node) }
919
+ super
920
+ listeners[:on_pinned_expression_node_leave]&.each { |listener| listener.on_pinned_expression_node_leave(node) }
921
+ end
922
+
923
+ # Dispatch enter and leave events for PinnedVariableNode nodes and continue
924
+ # walking the tree.
925
+ def visit_pinned_variable_node(node)
926
+ listeners[:on_pinned_variable_node_enter]&.each { |listener| listener.on_pinned_variable_node_enter(node) }
927
+ super
928
+ listeners[:on_pinned_variable_node_leave]&.each { |listener| listener.on_pinned_variable_node_leave(node) }
929
+ end
930
+
931
+ # Dispatch enter and leave events for PostExecutionNode nodes and continue
932
+ # walking the tree.
933
+ def visit_post_execution_node(node)
934
+ listeners[:on_post_execution_node_enter]&.each { |listener| listener.on_post_execution_node_enter(node) }
935
+ super
936
+ listeners[:on_post_execution_node_leave]&.each { |listener| listener.on_post_execution_node_leave(node) }
937
+ end
938
+
939
+ # Dispatch enter and leave events for PreExecutionNode nodes and continue
940
+ # walking the tree.
941
+ def visit_pre_execution_node(node)
942
+ listeners[:on_pre_execution_node_enter]&.each { |listener| listener.on_pre_execution_node_enter(node) }
943
+ super
944
+ listeners[:on_pre_execution_node_leave]&.each { |listener| listener.on_pre_execution_node_leave(node) }
945
+ end
946
+
947
+ # Dispatch enter and leave events for ProgramNode nodes and continue
948
+ # walking the tree.
949
+ def visit_program_node(node)
950
+ listeners[:on_program_node_enter]&.each { |listener| listener.on_program_node_enter(node) }
951
+ super
952
+ listeners[:on_program_node_leave]&.each { |listener| listener.on_program_node_leave(node) }
953
+ end
954
+
955
+ # Dispatch enter and leave events for RangeNode nodes and continue
956
+ # walking the tree.
957
+ def visit_range_node(node)
958
+ listeners[:on_range_node_enter]&.each { |listener| listener.on_range_node_enter(node) }
959
+ super
960
+ listeners[:on_range_node_leave]&.each { |listener| listener.on_range_node_leave(node) }
961
+ end
962
+
963
+ # Dispatch enter and leave events for RationalNode nodes and continue
964
+ # walking the tree.
965
+ def visit_rational_node(node)
966
+ listeners[:on_rational_node_enter]&.each { |listener| listener.on_rational_node_enter(node) }
967
+ super
968
+ listeners[:on_rational_node_leave]&.each { |listener| listener.on_rational_node_leave(node) }
969
+ end
970
+
971
+ # Dispatch enter and leave events for RedoNode nodes and continue
972
+ # walking the tree.
973
+ def visit_redo_node(node)
974
+ listeners[:on_redo_node_enter]&.each { |listener| listener.on_redo_node_enter(node) }
975
+ super
976
+ listeners[:on_redo_node_leave]&.each { |listener| listener.on_redo_node_leave(node) }
977
+ end
978
+
979
+ # Dispatch enter and leave events for RegularExpressionNode nodes and continue
980
+ # walking the tree.
981
+ def visit_regular_expression_node(node)
982
+ listeners[:on_regular_expression_node_enter]&.each { |listener| listener.on_regular_expression_node_enter(node) }
983
+ super
984
+ listeners[:on_regular_expression_node_leave]&.each { |listener| listener.on_regular_expression_node_leave(node) }
985
+ end
986
+
987
+ # Dispatch enter and leave events for RequiredDestructuredParameterNode nodes and continue
988
+ # walking the tree.
989
+ def visit_required_destructured_parameter_node(node)
990
+ listeners[:on_required_destructured_parameter_node_enter]&.each { |listener| listener.on_required_destructured_parameter_node_enter(node) }
991
+ super
992
+ listeners[:on_required_destructured_parameter_node_leave]&.each { |listener| listener.on_required_destructured_parameter_node_leave(node) }
993
+ end
994
+
995
+ # Dispatch enter and leave events for RequiredParameterNode nodes and continue
996
+ # walking the tree.
997
+ def visit_required_parameter_node(node)
998
+ listeners[:on_required_parameter_node_enter]&.each { |listener| listener.on_required_parameter_node_enter(node) }
999
+ super
1000
+ listeners[:on_required_parameter_node_leave]&.each { |listener| listener.on_required_parameter_node_leave(node) }
1001
+ end
1002
+
1003
+ # Dispatch enter and leave events for RescueModifierNode nodes and continue
1004
+ # walking the tree.
1005
+ def visit_rescue_modifier_node(node)
1006
+ listeners[:on_rescue_modifier_node_enter]&.each { |listener| listener.on_rescue_modifier_node_enter(node) }
1007
+ super
1008
+ listeners[:on_rescue_modifier_node_leave]&.each { |listener| listener.on_rescue_modifier_node_leave(node) }
1009
+ end
1010
+
1011
+ # Dispatch enter and leave events for RescueNode nodes and continue
1012
+ # walking the tree.
1013
+ def visit_rescue_node(node)
1014
+ listeners[:on_rescue_node_enter]&.each { |listener| listener.on_rescue_node_enter(node) }
1015
+ super
1016
+ listeners[:on_rescue_node_leave]&.each { |listener| listener.on_rescue_node_leave(node) }
1017
+ end
1018
+
1019
+ # Dispatch enter and leave events for RestParameterNode nodes and continue
1020
+ # walking the tree.
1021
+ def visit_rest_parameter_node(node)
1022
+ listeners[:on_rest_parameter_node_enter]&.each { |listener| listener.on_rest_parameter_node_enter(node) }
1023
+ super
1024
+ listeners[:on_rest_parameter_node_leave]&.each { |listener| listener.on_rest_parameter_node_leave(node) }
1025
+ end
1026
+
1027
+ # Dispatch enter and leave events for RetryNode nodes and continue
1028
+ # walking the tree.
1029
+ def visit_retry_node(node)
1030
+ listeners[:on_retry_node_enter]&.each { |listener| listener.on_retry_node_enter(node) }
1031
+ super
1032
+ listeners[:on_retry_node_leave]&.each { |listener| listener.on_retry_node_leave(node) }
1033
+ end
1034
+
1035
+ # Dispatch enter and leave events for ReturnNode nodes and continue
1036
+ # walking the tree.
1037
+ def visit_return_node(node)
1038
+ listeners[:on_return_node_enter]&.each { |listener| listener.on_return_node_enter(node) }
1039
+ super
1040
+ listeners[:on_return_node_leave]&.each { |listener| listener.on_return_node_leave(node) }
1041
+ end
1042
+
1043
+ # Dispatch enter and leave events for SelfNode nodes and continue
1044
+ # walking the tree.
1045
+ def visit_self_node(node)
1046
+ listeners[:on_self_node_enter]&.each { |listener| listener.on_self_node_enter(node) }
1047
+ super
1048
+ listeners[:on_self_node_leave]&.each { |listener| listener.on_self_node_leave(node) }
1049
+ end
1050
+
1051
+ # Dispatch enter and leave events for SingletonClassNode nodes and continue
1052
+ # walking the tree.
1053
+ def visit_singleton_class_node(node)
1054
+ listeners[:on_singleton_class_node_enter]&.each { |listener| listener.on_singleton_class_node_enter(node) }
1055
+ super
1056
+ listeners[:on_singleton_class_node_leave]&.each { |listener| listener.on_singleton_class_node_leave(node) }
1057
+ end
1058
+
1059
+ # Dispatch enter and leave events for SourceEncodingNode nodes and continue
1060
+ # walking the tree.
1061
+ def visit_source_encoding_node(node)
1062
+ listeners[:on_source_encoding_node_enter]&.each { |listener| listener.on_source_encoding_node_enter(node) }
1063
+ super
1064
+ listeners[:on_source_encoding_node_leave]&.each { |listener| listener.on_source_encoding_node_leave(node) }
1065
+ end
1066
+
1067
+ # Dispatch enter and leave events for SourceFileNode nodes and continue
1068
+ # walking the tree.
1069
+ def visit_source_file_node(node)
1070
+ listeners[:on_source_file_node_enter]&.each { |listener| listener.on_source_file_node_enter(node) }
1071
+ super
1072
+ listeners[:on_source_file_node_leave]&.each { |listener| listener.on_source_file_node_leave(node) }
1073
+ end
1074
+
1075
+ # Dispatch enter and leave events for SourceLineNode nodes and continue
1076
+ # walking the tree.
1077
+ def visit_source_line_node(node)
1078
+ listeners[:on_source_line_node_enter]&.each { |listener| listener.on_source_line_node_enter(node) }
1079
+ super
1080
+ listeners[:on_source_line_node_leave]&.each { |listener| listener.on_source_line_node_leave(node) }
1081
+ end
1082
+
1083
+ # Dispatch enter and leave events for SplatNode nodes and continue
1084
+ # walking the tree.
1085
+ def visit_splat_node(node)
1086
+ listeners[:on_splat_node_enter]&.each { |listener| listener.on_splat_node_enter(node) }
1087
+ super
1088
+ listeners[:on_splat_node_leave]&.each { |listener| listener.on_splat_node_leave(node) }
1089
+ end
1090
+
1091
+ # Dispatch enter and leave events for StatementsNode nodes and continue
1092
+ # walking the tree.
1093
+ def visit_statements_node(node)
1094
+ listeners[:on_statements_node_enter]&.each { |listener| listener.on_statements_node_enter(node) }
1095
+ super
1096
+ listeners[:on_statements_node_leave]&.each { |listener| listener.on_statements_node_leave(node) }
1097
+ end
1098
+
1099
+ # Dispatch enter and leave events for StringConcatNode nodes and continue
1100
+ # walking the tree.
1101
+ def visit_string_concat_node(node)
1102
+ listeners[:on_string_concat_node_enter]&.each { |listener| listener.on_string_concat_node_enter(node) }
1103
+ super
1104
+ listeners[:on_string_concat_node_leave]&.each { |listener| listener.on_string_concat_node_leave(node) }
1105
+ end
1106
+
1107
+ # Dispatch enter and leave events for StringNode nodes and continue
1108
+ # walking the tree.
1109
+ def visit_string_node(node)
1110
+ listeners[:on_string_node_enter]&.each { |listener| listener.on_string_node_enter(node) }
1111
+ super
1112
+ listeners[:on_string_node_leave]&.each { |listener| listener.on_string_node_leave(node) }
1113
+ end
1114
+
1115
+ # Dispatch enter and leave events for SuperNode nodes and continue
1116
+ # walking the tree.
1117
+ def visit_super_node(node)
1118
+ listeners[:on_super_node_enter]&.each { |listener| listener.on_super_node_enter(node) }
1119
+ super
1120
+ listeners[:on_super_node_leave]&.each { |listener| listener.on_super_node_leave(node) }
1121
+ end
1122
+
1123
+ # Dispatch enter and leave events for SymbolNode nodes and continue
1124
+ # walking the tree.
1125
+ def visit_symbol_node(node)
1126
+ listeners[:on_symbol_node_enter]&.each { |listener| listener.on_symbol_node_enter(node) }
1127
+ super
1128
+ listeners[:on_symbol_node_leave]&.each { |listener| listener.on_symbol_node_leave(node) }
1129
+ end
1130
+
1131
+ # Dispatch enter and leave events for TrueNode nodes and continue
1132
+ # walking the tree.
1133
+ def visit_true_node(node)
1134
+ listeners[:on_true_node_enter]&.each { |listener| listener.on_true_node_enter(node) }
1135
+ super
1136
+ listeners[:on_true_node_leave]&.each { |listener| listener.on_true_node_leave(node) }
1137
+ end
1138
+
1139
+ # Dispatch enter and leave events for UndefNode nodes and continue
1140
+ # walking the tree.
1141
+ def visit_undef_node(node)
1142
+ listeners[:on_undef_node_enter]&.each { |listener| listener.on_undef_node_enter(node) }
1143
+ super
1144
+ listeners[:on_undef_node_leave]&.each { |listener| listener.on_undef_node_leave(node) }
1145
+ end
1146
+
1147
+ # Dispatch enter and leave events for UnlessNode nodes and continue
1148
+ # walking the tree.
1149
+ def visit_unless_node(node)
1150
+ listeners[:on_unless_node_enter]&.each { |listener| listener.on_unless_node_enter(node) }
1151
+ super
1152
+ listeners[:on_unless_node_leave]&.each { |listener| listener.on_unless_node_leave(node) }
1153
+ end
1154
+
1155
+ # Dispatch enter and leave events for UntilNode nodes and continue
1156
+ # walking the tree.
1157
+ def visit_until_node(node)
1158
+ listeners[:on_until_node_enter]&.each { |listener| listener.on_until_node_enter(node) }
1159
+ super
1160
+ listeners[:on_until_node_leave]&.each { |listener| listener.on_until_node_leave(node) }
1161
+ end
1162
+
1163
+ # Dispatch enter and leave events for WhenNode nodes and continue
1164
+ # walking the tree.
1165
+ def visit_when_node(node)
1166
+ listeners[:on_when_node_enter]&.each { |listener| listener.on_when_node_enter(node) }
1167
+ super
1168
+ listeners[:on_when_node_leave]&.each { |listener| listener.on_when_node_leave(node) }
1169
+ end
1170
+
1171
+ # Dispatch enter and leave events for WhileNode nodes and continue
1172
+ # walking the tree.
1173
+ def visit_while_node(node)
1174
+ listeners[:on_while_node_enter]&.each { |listener| listener.on_while_node_enter(node) }
1175
+ super
1176
+ listeners[:on_while_node_leave]&.each { |listener| listener.on_while_node_leave(node) }
1177
+ end
1178
+
1179
+ # Dispatch enter and leave events for XStringNode nodes and continue
1180
+ # walking the tree.
1181
+ def visit_x_string_node(node)
1182
+ listeners[:on_x_string_node_enter]&.each { |listener| listener.on_x_string_node_enter(node) }
1183
+ super
1184
+ listeners[:on_x_string_node_leave]&.each { |listener| listener.on_x_string_node_leave(node) }
1185
+ end
1186
+
1187
+ # Dispatch enter and leave events for YieldNode nodes and continue
1188
+ # walking the tree.
1189
+ def visit_yield_node(node)
1190
+ listeners[:on_yield_node_enter]&.each { |listener| listener.on_yield_node_enter(node) }
1191
+ super
1192
+ listeners[:on_yield_node_leave]&.each { |listener| listener.on_yield_node_leave(node) }
1193
+ end
1194
+
1195
+ class DispatchOnce < Visitor
1196
+ attr_reader :listeners
1197
+
1198
+ def initialize(listeners)
1199
+ @listeners = listeners
1200
+ end
1201
+
1202
+ # Dispatch enter and leave events for AliasGlobalVariableNode nodes.
1203
+ def visit_alias_global_variable_node(node)
1204
+ listeners[:on_alias_global_variable_node_enter]&.each { |listener| listener.on_alias_global_variable_node_enter(node) }
1205
+ listeners[:on_alias_global_variable_node_leave]&.each { |listener| listener.on_alias_global_variable_node_leave(node) }
1206
+ end
1207
+
1208
+ # Dispatch enter and leave events for AliasMethodNode nodes.
1209
+ def visit_alias_method_node(node)
1210
+ listeners[:on_alias_method_node_enter]&.each { |listener| listener.on_alias_method_node_enter(node) }
1211
+ listeners[:on_alias_method_node_leave]&.each { |listener| listener.on_alias_method_node_leave(node) }
1212
+ end
1213
+
1214
+ # Dispatch enter and leave events for AlternationPatternNode nodes.
1215
+ def visit_alternation_pattern_node(node)
1216
+ listeners[:on_alternation_pattern_node_enter]&.each { |listener| listener.on_alternation_pattern_node_enter(node) }
1217
+ listeners[:on_alternation_pattern_node_leave]&.each { |listener| listener.on_alternation_pattern_node_leave(node) }
1218
+ end
1219
+
1220
+ # Dispatch enter and leave events for AndNode nodes.
1221
+ def visit_and_node(node)
1222
+ listeners[:on_and_node_enter]&.each { |listener| listener.on_and_node_enter(node) }
1223
+ listeners[:on_and_node_leave]&.each { |listener| listener.on_and_node_leave(node) }
1224
+ end
1225
+
1226
+ # Dispatch enter and leave events for ArgumentsNode nodes.
1227
+ def visit_arguments_node(node)
1228
+ listeners[:on_arguments_node_enter]&.each { |listener| listener.on_arguments_node_enter(node) }
1229
+ listeners[:on_arguments_node_leave]&.each { |listener| listener.on_arguments_node_leave(node) }
1230
+ end
1231
+
1232
+ # Dispatch enter and leave events for ArrayNode nodes.
1233
+ def visit_array_node(node)
1234
+ listeners[:on_array_node_enter]&.each { |listener| listener.on_array_node_enter(node) }
1235
+ listeners[:on_array_node_leave]&.each { |listener| listener.on_array_node_leave(node) }
1236
+ end
1237
+
1238
+ # Dispatch enter and leave events for ArrayPatternNode nodes.
1239
+ def visit_array_pattern_node(node)
1240
+ listeners[:on_array_pattern_node_enter]&.each { |listener| listener.on_array_pattern_node_enter(node) }
1241
+ listeners[:on_array_pattern_node_leave]&.each { |listener| listener.on_array_pattern_node_leave(node) }
1242
+ end
1243
+
1244
+ # Dispatch enter and leave events for AssocNode nodes.
1245
+ def visit_assoc_node(node)
1246
+ listeners[:on_assoc_node_enter]&.each { |listener| listener.on_assoc_node_enter(node) }
1247
+ listeners[:on_assoc_node_leave]&.each { |listener| listener.on_assoc_node_leave(node) }
1248
+ end
1249
+
1250
+ # Dispatch enter and leave events for AssocSplatNode nodes.
1251
+ def visit_assoc_splat_node(node)
1252
+ listeners[:on_assoc_splat_node_enter]&.each { |listener| listener.on_assoc_splat_node_enter(node) }
1253
+ listeners[:on_assoc_splat_node_leave]&.each { |listener| listener.on_assoc_splat_node_leave(node) }
1254
+ end
1255
+
1256
+ # Dispatch enter and leave events for BackReferenceReadNode nodes.
1257
+ def visit_back_reference_read_node(node)
1258
+ listeners[:on_back_reference_read_node_enter]&.each { |listener| listener.on_back_reference_read_node_enter(node) }
1259
+ listeners[:on_back_reference_read_node_leave]&.each { |listener| listener.on_back_reference_read_node_leave(node) }
1260
+ end
1261
+
1262
+ # Dispatch enter and leave events for BeginNode nodes.
1263
+ def visit_begin_node(node)
1264
+ listeners[:on_begin_node_enter]&.each { |listener| listener.on_begin_node_enter(node) }
1265
+ listeners[:on_begin_node_leave]&.each { |listener| listener.on_begin_node_leave(node) }
1266
+ end
1267
+
1268
+ # Dispatch enter and leave events for BlockArgumentNode nodes.
1269
+ def visit_block_argument_node(node)
1270
+ listeners[:on_block_argument_node_enter]&.each { |listener| listener.on_block_argument_node_enter(node) }
1271
+ listeners[:on_block_argument_node_leave]&.each { |listener| listener.on_block_argument_node_leave(node) }
1272
+ end
1273
+
1274
+ # Dispatch enter and leave events for BlockLocalVariableNode nodes.
1275
+ def visit_block_local_variable_node(node)
1276
+ listeners[:on_block_local_variable_node_enter]&.each { |listener| listener.on_block_local_variable_node_enter(node) }
1277
+ listeners[:on_block_local_variable_node_leave]&.each { |listener| listener.on_block_local_variable_node_leave(node) }
1278
+ end
1279
+
1280
+ # Dispatch enter and leave events for BlockNode nodes.
1281
+ def visit_block_node(node)
1282
+ listeners[:on_block_node_enter]&.each { |listener| listener.on_block_node_enter(node) }
1283
+ listeners[:on_block_node_leave]&.each { |listener| listener.on_block_node_leave(node) }
1284
+ end
1285
+
1286
+ # Dispatch enter and leave events for BlockParameterNode nodes.
1287
+ def visit_block_parameter_node(node)
1288
+ listeners[:on_block_parameter_node_enter]&.each { |listener| listener.on_block_parameter_node_enter(node) }
1289
+ listeners[:on_block_parameter_node_leave]&.each { |listener| listener.on_block_parameter_node_leave(node) }
1290
+ end
1291
+
1292
+ # Dispatch enter and leave events for BlockParametersNode nodes.
1293
+ def visit_block_parameters_node(node)
1294
+ listeners[:on_block_parameters_node_enter]&.each { |listener| listener.on_block_parameters_node_enter(node) }
1295
+ listeners[:on_block_parameters_node_leave]&.each { |listener| listener.on_block_parameters_node_leave(node) }
1296
+ end
1297
+
1298
+ # Dispatch enter and leave events for BreakNode nodes.
1299
+ def visit_break_node(node)
1300
+ listeners[:on_break_node_enter]&.each { |listener| listener.on_break_node_enter(node) }
1301
+ listeners[:on_break_node_leave]&.each { |listener| listener.on_break_node_leave(node) }
1302
+ end
1303
+
1304
+ # Dispatch enter and leave events for CallAndWriteNode nodes.
1305
+ def visit_call_and_write_node(node)
1306
+ listeners[:on_call_and_write_node_enter]&.each { |listener| listener.on_call_and_write_node_enter(node) }
1307
+ listeners[:on_call_and_write_node_leave]&.each { |listener| listener.on_call_and_write_node_leave(node) }
1308
+ end
1309
+
1310
+ # Dispatch enter and leave events for CallNode nodes.
1311
+ def visit_call_node(node)
1312
+ listeners[:on_call_node_enter]&.each { |listener| listener.on_call_node_enter(node) }
1313
+ listeners[:on_call_node_leave]&.each { |listener| listener.on_call_node_leave(node) }
1314
+ end
1315
+
1316
+ # Dispatch enter and leave events for CallOperatorWriteNode nodes.
1317
+ def visit_call_operator_write_node(node)
1318
+ listeners[:on_call_operator_write_node_enter]&.each { |listener| listener.on_call_operator_write_node_enter(node) }
1319
+ listeners[:on_call_operator_write_node_leave]&.each { |listener| listener.on_call_operator_write_node_leave(node) }
1320
+ end
1321
+
1322
+ # Dispatch enter and leave events for CallOrWriteNode nodes.
1323
+ def visit_call_or_write_node(node)
1324
+ listeners[:on_call_or_write_node_enter]&.each { |listener| listener.on_call_or_write_node_enter(node) }
1325
+ listeners[:on_call_or_write_node_leave]&.each { |listener| listener.on_call_or_write_node_leave(node) }
1326
+ end
1327
+
1328
+ # Dispatch enter and leave events for CapturePatternNode nodes.
1329
+ def visit_capture_pattern_node(node)
1330
+ listeners[:on_capture_pattern_node_enter]&.each { |listener| listener.on_capture_pattern_node_enter(node) }
1331
+ listeners[:on_capture_pattern_node_leave]&.each { |listener| listener.on_capture_pattern_node_leave(node) }
1332
+ end
1333
+
1334
+ # Dispatch enter and leave events for CaseNode nodes.
1335
+ def visit_case_node(node)
1336
+ listeners[:on_case_node_enter]&.each { |listener| listener.on_case_node_enter(node) }
1337
+ listeners[:on_case_node_leave]&.each { |listener| listener.on_case_node_leave(node) }
1338
+ end
1339
+
1340
+ # Dispatch enter and leave events for ClassNode nodes.
1341
+ def visit_class_node(node)
1342
+ listeners[:on_class_node_enter]&.each { |listener| listener.on_class_node_enter(node) }
1343
+ listeners[:on_class_node_leave]&.each { |listener| listener.on_class_node_leave(node) }
1344
+ end
1345
+
1346
+ # Dispatch enter and leave events for ClassVariableAndWriteNode nodes.
1347
+ def visit_class_variable_and_write_node(node)
1348
+ listeners[:on_class_variable_and_write_node_enter]&.each { |listener| listener.on_class_variable_and_write_node_enter(node) }
1349
+ listeners[:on_class_variable_and_write_node_leave]&.each { |listener| listener.on_class_variable_and_write_node_leave(node) }
1350
+ end
1351
+
1352
+ # Dispatch enter and leave events for ClassVariableOperatorWriteNode nodes.
1353
+ def visit_class_variable_operator_write_node(node)
1354
+ listeners[:on_class_variable_operator_write_node_enter]&.each { |listener| listener.on_class_variable_operator_write_node_enter(node) }
1355
+ listeners[:on_class_variable_operator_write_node_leave]&.each { |listener| listener.on_class_variable_operator_write_node_leave(node) }
1356
+ end
1357
+
1358
+ # Dispatch enter and leave events for ClassVariableOrWriteNode nodes.
1359
+ def visit_class_variable_or_write_node(node)
1360
+ listeners[:on_class_variable_or_write_node_enter]&.each { |listener| listener.on_class_variable_or_write_node_enter(node) }
1361
+ listeners[:on_class_variable_or_write_node_leave]&.each { |listener| listener.on_class_variable_or_write_node_leave(node) }
1362
+ end
1363
+
1364
+ # Dispatch enter and leave events for ClassVariableReadNode nodes.
1365
+ def visit_class_variable_read_node(node)
1366
+ listeners[:on_class_variable_read_node_enter]&.each { |listener| listener.on_class_variable_read_node_enter(node) }
1367
+ listeners[:on_class_variable_read_node_leave]&.each { |listener| listener.on_class_variable_read_node_leave(node) }
1368
+ end
1369
+
1370
+ # Dispatch enter and leave events for ClassVariableTargetNode nodes.
1371
+ def visit_class_variable_target_node(node)
1372
+ listeners[:on_class_variable_target_node_enter]&.each { |listener| listener.on_class_variable_target_node_enter(node) }
1373
+ listeners[:on_class_variable_target_node_leave]&.each { |listener| listener.on_class_variable_target_node_leave(node) }
1374
+ end
1375
+
1376
+ # Dispatch enter and leave events for ClassVariableWriteNode nodes.
1377
+ def visit_class_variable_write_node(node)
1378
+ listeners[:on_class_variable_write_node_enter]&.each { |listener| listener.on_class_variable_write_node_enter(node) }
1379
+ listeners[:on_class_variable_write_node_leave]&.each { |listener| listener.on_class_variable_write_node_leave(node) }
1380
+ end
1381
+
1382
+ # Dispatch enter and leave events for ConstantAndWriteNode nodes.
1383
+ def visit_constant_and_write_node(node)
1384
+ listeners[:on_constant_and_write_node_enter]&.each { |listener| listener.on_constant_and_write_node_enter(node) }
1385
+ listeners[:on_constant_and_write_node_leave]&.each { |listener| listener.on_constant_and_write_node_leave(node) }
1386
+ end
1387
+
1388
+ # Dispatch enter and leave events for ConstantOperatorWriteNode nodes.
1389
+ def visit_constant_operator_write_node(node)
1390
+ listeners[:on_constant_operator_write_node_enter]&.each { |listener| listener.on_constant_operator_write_node_enter(node) }
1391
+ listeners[:on_constant_operator_write_node_leave]&.each { |listener| listener.on_constant_operator_write_node_leave(node) }
1392
+ end
1393
+
1394
+ # Dispatch enter and leave events for ConstantOrWriteNode nodes.
1395
+ def visit_constant_or_write_node(node)
1396
+ listeners[:on_constant_or_write_node_enter]&.each { |listener| listener.on_constant_or_write_node_enter(node) }
1397
+ listeners[:on_constant_or_write_node_leave]&.each { |listener| listener.on_constant_or_write_node_leave(node) }
1398
+ end
1399
+
1400
+ # Dispatch enter and leave events for ConstantPathAndWriteNode nodes.
1401
+ def visit_constant_path_and_write_node(node)
1402
+ listeners[:on_constant_path_and_write_node_enter]&.each { |listener| listener.on_constant_path_and_write_node_enter(node) }
1403
+ listeners[:on_constant_path_and_write_node_leave]&.each { |listener| listener.on_constant_path_and_write_node_leave(node) }
1404
+ end
1405
+
1406
+ # Dispatch enter and leave events for ConstantPathNode nodes.
1407
+ def visit_constant_path_node(node)
1408
+ listeners[:on_constant_path_node_enter]&.each { |listener| listener.on_constant_path_node_enter(node) }
1409
+ listeners[:on_constant_path_node_leave]&.each { |listener| listener.on_constant_path_node_leave(node) }
1410
+ end
1411
+
1412
+ # Dispatch enter and leave events for ConstantPathOperatorWriteNode nodes.
1413
+ def visit_constant_path_operator_write_node(node)
1414
+ listeners[:on_constant_path_operator_write_node_enter]&.each { |listener| listener.on_constant_path_operator_write_node_enter(node) }
1415
+ listeners[:on_constant_path_operator_write_node_leave]&.each { |listener| listener.on_constant_path_operator_write_node_leave(node) }
1416
+ end
1417
+
1418
+ # Dispatch enter and leave events for ConstantPathOrWriteNode nodes.
1419
+ def visit_constant_path_or_write_node(node)
1420
+ listeners[:on_constant_path_or_write_node_enter]&.each { |listener| listener.on_constant_path_or_write_node_enter(node) }
1421
+ listeners[:on_constant_path_or_write_node_leave]&.each { |listener| listener.on_constant_path_or_write_node_leave(node) }
1422
+ end
1423
+
1424
+ # Dispatch enter and leave events for ConstantPathTargetNode nodes.
1425
+ def visit_constant_path_target_node(node)
1426
+ listeners[:on_constant_path_target_node_enter]&.each { |listener| listener.on_constant_path_target_node_enter(node) }
1427
+ listeners[:on_constant_path_target_node_leave]&.each { |listener| listener.on_constant_path_target_node_leave(node) }
1428
+ end
1429
+
1430
+ # Dispatch enter and leave events for ConstantPathWriteNode nodes.
1431
+ def visit_constant_path_write_node(node)
1432
+ listeners[:on_constant_path_write_node_enter]&.each { |listener| listener.on_constant_path_write_node_enter(node) }
1433
+ listeners[:on_constant_path_write_node_leave]&.each { |listener| listener.on_constant_path_write_node_leave(node) }
1434
+ end
1435
+
1436
+ # Dispatch enter and leave events for ConstantReadNode nodes.
1437
+ def visit_constant_read_node(node)
1438
+ listeners[:on_constant_read_node_enter]&.each { |listener| listener.on_constant_read_node_enter(node) }
1439
+ listeners[:on_constant_read_node_leave]&.each { |listener| listener.on_constant_read_node_leave(node) }
1440
+ end
1441
+
1442
+ # Dispatch enter and leave events for ConstantTargetNode nodes.
1443
+ def visit_constant_target_node(node)
1444
+ listeners[:on_constant_target_node_enter]&.each { |listener| listener.on_constant_target_node_enter(node) }
1445
+ listeners[:on_constant_target_node_leave]&.each { |listener| listener.on_constant_target_node_leave(node) }
1446
+ end
1447
+
1448
+ # Dispatch enter and leave events for ConstantWriteNode nodes.
1449
+ def visit_constant_write_node(node)
1450
+ listeners[:on_constant_write_node_enter]&.each { |listener| listener.on_constant_write_node_enter(node) }
1451
+ listeners[:on_constant_write_node_leave]&.each { |listener| listener.on_constant_write_node_leave(node) }
1452
+ end
1453
+
1454
+ # Dispatch enter and leave events for DefNode nodes.
1455
+ def visit_def_node(node)
1456
+ listeners[:on_def_node_enter]&.each { |listener| listener.on_def_node_enter(node) }
1457
+ listeners[:on_def_node_leave]&.each { |listener| listener.on_def_node_leave(node) }
1458
+ end
1459
+
1460
+ # Dispatch enter and leave events for DefinedNode nodes.
1461
+ def visit_defined_node(node)
1462
+ listeners[:on_defined_node_enter]&.each { |listener| listener.on_defined_node_enter(node) }
1463
+ listeners[:on_defined_node_leave]&.each { |listener| listener.on_defined_node_leave(node) }
1464
+ end
1465
+
1466
+ # Dispatch enter and leave events for ElseNode nodes.
1467
+ def visit_else_node(node)
1468
+ listeners[:on_else_node_enter]&.each { |listener| listener.on_else_node_enter(node) }
1469
+ listeners[:on_else_node_leave]&.each { |listener| listener.on_else_node_leave(node) }
1470
+ end
1471
+
1472
+ # Dispatch enter and leave events for EmbeddedStatementsNode nodes.
1473
+ def visit_embedded_statements_node(node)
1474
+ listeners[:on_embedded_statements_node_enter]&.each { |listener| listener.on_embedded_statements_node_enter(node) }
1475
+ listeners[:on_embedded_statements_node_leave]&.each { |listener| listener.on_embedded_statements_node_leave(node) }
1476
+ end
1477
+
1478
+ # Dispatch enter and leave events for EmbeddedVariableNode nodes.
1479
+ def visit_embedded_variable_node(node)
1480
+ listeners[:on_embedded_variable_node_enter]&.each { |listener| listener.on_embedded_variable_node_enter(node) }
1481
+ listeners[:on_embedded_variable_node_leave]&.each { |listener| listener.on_embedded_variable_node_leave(node) }
1482
+ end
1483
+
1484
+ # Dispatch enter and leave events for EnsureNode nodes.
1485
+ def visit_ensure_node(node)
1486
+ listeners[:on_ensure_node_enter]&.each { |listener| listener.on_ensure_node_enter(node) }
1487
+ listeners[:on_ensure_node_leave]&.each { |listener| listener.on_ensure_node_leave(node) }
1488
+ end
1489
+
1490
+ # Dispatch enter and leave events for FalseNode nodes.
1491
+ def visit_false_node(node)
1492
+ listeners[:on_false_node_enter]&.each { |listener| listener.on_false_node_enter(node) }
1493
+ listeners[:on_false_node_leave]&.each { |listener| listener.on_false_node_leave(node) }
1494
+ end
1495
+
1496
+ # Dispatch enter and leave events for FindPatternNode nodes.
1497
+ def visit_find_pattern_node(node)
1498
+ listeners[:on_find_pattern_node_enter]&.each { |listener| listener.on_find_pattern_node_enter(node) }
1499
+ listeners[:on_find_pattern_node_leave]&.each { |listener| listener.on_find_pattern_node_leave(node) }
1500
+ end
1501
+
1502
+ # Dispatch enter and leave events for FlipFlopNode nodes.
1503
+ def visit_flip_flop_node(node)
1504
+ listeners[:on_flip_flop_node_enter]&.each { |listener| listener.on_flip_flop_node_enter(node) }
1505
+ listeners[:on_flip_flop_node_leave]&.each { |listener| listener.on_flip_flop_node_leave(node) }
1506
+ end
1507
+
1508
+ # Dispatch enter and leave events for FloatNode nodes.
1509
+ def visit_float_node(node)
1510
+ listeners[:on_float_node_enter]&.each { |listener| listener.on_float_node_enter(node) }
1511
+ listeners[:on_float_node_leave]&.each { |listener| listener.on_float_node_leave(node) }
1512
+ end
1513
+
1514
+ # Dispatch enter and leave events for ForNode nodes.
1515
+ def visit_for_node(node)
1516
+ listeners[:on_for_node_enter]&.each { |listener| listener.on_for_node_enter(node) }
1517
+ listeners[:on_for_node_leave]&.each { |listener| listener.on_for_node_leave(node) }
1518
+ end
1519
+
1520
+ # Dispatch enter and leave events for ForwardingArgumentsNode nodes.
1521
+ def visit_forwarding_arguments_node(node)
1522
+ listeners[:on_forwarding_arguments_node_enter]&.each { |listener| listener.on_forwarding_arguments_node_enter(node) }
1523
+ listeners[:on_forwarding_arguments_node_leave]&.each { |listener| listener.on_forwarding_arguments_node_leave(node) }
1524
+ end
1525
+
1526
+ # Dispatch enter and leave events for ForwardingParameterNode nodes.
1527
+ def visit_forwarding_parameter_node(node)
1528
+ listeners[:on_forwarding_parameter_node_enter]&.each { |listener| listener.on_forwarding_parameter_node_enter(node) }
1529
+ listeners[:on_forwarding_parameter_node_leave]&.each { |listener| listener.on_forwarding_parameter_node_leave(node) }
1530
+ end
1531
+
1532
+ # Dispatch enter and leave events for ForwardingSuperNode nodes.
1533
+ def visit_forwarding_super_node(node)
1534
+ listeners[:on_forwarding_super_node_enter]&.each { |listener| listener.on_forwarding_super_node_enter(node) }
1535
+ listeners[:on_forwarding_super_node_leave]&.each { |listener| listener.on_forwarding_super_node_leave(node) }
1536
+ end
1537
+
1538
+ # Dispatch enter and leave events for GlobalVariableAndWriteNode nodes.
1539
+ def visit_global_variable_and_write_node(node)
1540
+ listeners[:on_global_variable_and_write_node_enter]&.each { |listener| listener.on_global_variable_and_write_node_enter(node) }
1541
+ listeners[:on_global_variable_and_write_node_leave]&.each { |listener| listener.on_global_variable_and_write_node_leave(node) }
1542
+ end
1543
+
1544
+ # Dispatch enter and leave events for GlobalVariableOperatorWriteNode nodes.
1545
+ def visit_global_variable_operator_write_node(node)
1546
+ listeners[:on_global_variable_operator_write_node_enter]&.each { |listener| listener.on_global_variable_operator_write_node_enter(node) }
1547
+ listeners[:on_global_variable_operator_write_node_leave]&.each { |listener| listener.on_global_variable_operator_write_node_leave(node) }
1548
+ end
1549
+
1550
+ # Dispatch enter and leave events for GlobalVariableOrWriteNode nodes.
1551
+ def visit_global_variable_or_write_node(node)
1552
+ listeners[:on_global_variable_or_write_node_enter]&.each { |listener| listener.on_global_variable_or_write_node_enter(node) }
1553
+ listeners[:on_global_variable_or_write_node_leave]&.each { |listener| listener.on_global_variable_or_write_node_leave(node) }
1554
+ end
1555
+
1556
+ # Dispatch enter and leave events for GlobalVariableReadNode nodes.
1557
+ def visit_global_variable_read_node(node)
1558
+ listeners[:on_global_variable_read_node_enter]&.each { |listener| listener.on_global_variable_read_node_enter(node) }
1559
+ listeners[:on_global_variable_read_node_leave]&.each { |listener| listener.on_global_variable_read_node_leave(node) }
1560
+ end
1561
+
1562
+ # Dispatch enter and leave events for GlobalVariableTargetNode nodes.
1563
+ def visit_global_variable_target_node(node)
1564
+ listeners[:on_global_variable_target_node_enter]&.each { |listener| listener.on_global_variable_target_node_enter(node) }
1565
+ listeners[:on_global_variable_target_node_leave]&.each { |listener| listener.on_global_variable_target_node_leave(node) }
1566
+ end
1567
+
1568
+ # Dispatch enter and leave events for GlobalVariableWriteNode nodes.
1569
+ def visit_global_variable_write_node(node)
1570
+ listeners[:on_global_variable_write_node_enter]&.each { |listener| listener.on_global_variable_write_node_enter(node) }
1571
+ listeners[:on_global_variable_write_node_leave]&.each { |listener| listener.on_global_variable_write_node_leave(node) }
1572
+ end
1573
+
1574
+ # Dispatch enter and leave events for HashNode nodes.
1575
+ def visit_hash_node(node)
1576
+ listeners[:on_hash_node_enter]&.each { |listener| listener.on_hash_node_enter(node) }
1577
+ listeners[:on_hash_node_leave]&.each { |listener| listener.on_hash_node_leave(node) }
1578
+ end
1579
+
1580
+ # Dispatch enter and leave events for HashPatternNode nodes.
1581
+ def visit_hash_pattern_node(node)
1582
+ listeners[:on_hash_pattern_node_enter]&.each { |listener| listener.on_hash_pattern_node_enter(node) }
1583
+ listeners[:on_hash_pattern_node_leave]&.each { |listener| listener.on_hash_pattern_node_leave(node) }
1584
+ end
1585
+
1586
+ # Dispatch enter and leave events for IfNode nodes.
1587
+ def visit_if_node(node)
1588
+ listeners[:on_if_node_enter]&.each { |listener| listener.on_if_node_enter(node) }
1589
+ listeners[:on_if_node_leave]&.each { |listener| listener.on_if_node_leave(node) }
1590
+ end
1591
+
1592
+ # Dispatch enter and leave events for ImaginaryNode nodes.
1593
+ def visit_imaginary_node(node)
1594
+ listeners[:on_imaginary_node_enter]&.each { |listener| listener.on_imaginary_node_enter(node) }
1595
+ listeners[:on_imaginary_node_leave]&.each { |listener| listener.on_imaginary_node_leave(node) }
1596
+ end
1597
+
1598
+ # Dispatch enter and leave events for ImplicitNode nodes.
1599
+ def visit_implicit_node(node)
1600
+ listeners[:on_implicit_node_enter]&.each { |listener| listener.on_implicit_node_enter(node) }
1601
+ listeners[:on_implicit_node_leave]&.each { |listener| listener.on_implicit_node_leave(node) }
1602
+ end
1603
+
1604
+ # Dispatch enter and leave events for InNode nodes.
1605
+ def visit_in_node(node)
1606
+ listeners[:on_in_node_enter]&.each { |listener| listener.on_in_node_enter(node) }
1607
+ listeners[:on_in_node_leave]&.each { |listener| listener.on_in_node_leave(node) }
1608
+ end
1609
+
1610
+ # Dispatch enter and leave events for InstanceVariableAndWriteNode nodes.
1611
+ def visit_instance_variable_and_write_node(node)
1612
+ listeners[:on_instance_variable_and_write_node_enter]&.each { |listener| listener.on_instance_variable_and_write_node_enter(node) }
1613
+ listeners[:on_instance_variable_and_write_node_leave]&.each { |listener| listener.on_instance_variable_and_write_node_leave(node) }
1614
+ end
1615
+
1616
+ # Dispatch enter and leave events for InstanceVariableOperatorWriteNode nodes.
1617
+ def visit_instance_variable_operator_write_node(node)
1618
+ listeners[:on_instance_variable_operator_write_node_enter]&.each { |listener| listener.on_instance_variable_operator_write_node_enter(node) }
1619
+ listeners[:on_instance_variable_operator_write_node_leave]&.each { |listener| listener.on_instance_variable_operator_write_node_leave(node) }
1620
+ end
1621
+
1622
+ # Dispatch enter and leave events for InstanceVariableOrWriteNode nodes.
1623
+ def visit_instance_variable_or_write_node(node)
1624
+ listeners[:on_instance_variable_or_write_node_enter]&.each { |listener| listener.on_instance_variable_or_write_node_enter(node) }
1625
+ listeners[:on_instance_variable_or_write_node_leave]&.each { |listener| listener.on_instance_variable_or_write_node_leave(node) }
1626
+ end
1627
+
1628
+ # Dispatch enter and leave events for InstanceVariableReadNode nodes.
1629
+ def visit_instance_variable_read_node(node)
1630
+ listeners[:on_instance_variable_read_node_enter]&.each { |listener| listener.on_instance_variable_read_node_enter(node) }
1631
+ listeners[:on_instance_variable_read_node_leave]&.each { |listener| listener.on_instance_variable_read_node_leave(node) }
1632
+ end
1633
+
1634
+ # Dispatch enter and leave events for InstanceVariableTargetNode nodes.
1635
+ def visit_instance_variable_target_node(node)
1636
+ listeners[:on_instance_variable_target_node_enter]&.each { |listener| listener.on_instance_variable_target_node_enter(node) }
1637
+ listeners[:on_instance_variable_target_node_leave]&.each { |listener| listener.on_instance_variable_target_node_leave(node) }
1638
+ end
1639
+
1640
+ # Dispatch enter and leave events for InstanceVariableWriteNode nodes.
1641
+ def visit_instance_variable_write_node(node)
1642
+ listeners[:on_instance_variable_write_node_enter]&.each { |listener| listener.on_instance_variable_write_node_enter(node) }
1643
+ listeners[:on_instance_variable_write_node_leave]&.each { |listener| listener.on_instance_variable_write_node_leave(node) }
1644
+ end
1645
+
1646
+ # Dispatch enter and leave events for IntegerNode nodes.
1647
+ def visit_integer_node(node)
1648
+ listeners[:on_integer_node_enter]&.each { |listener| listener.on_integer_node_enter(node) }
1649
+ listeners[:on_integer_node_leave]&.each { |listener| listener.on_integer_node_leave(node) }
1650
+ end
1651
+
1652
+ # Dispatch enter and leave events for InterpolatedMatchLastLineNode nodes.
1653
+ def visit_interpolated_match_last_line_node(node)
1654
+ listeners[:on_interpolated_match_last_line_node_enter]&.each { |listener| listener.on_interpolated_match_last_line_node_enter(node) }
1655
+ listeners[:on_interpolated_match_last_line_node_leave]&.each { |listener| listener.on_interpolated_match_last_line_node_leave(node) }
1656
+ end
1657
+
1658
+ # Dispatch enter and leave events for InterpolatedRegularExpressionNode nodes.
1659
+ def visit_interpolated_regular_expression_node(node)
1660
+ listeners[:on_interpolated_regular_expression_node_enter]&.each { |listener| listener.on_interpolated_regular_expression_node_enter(node) }
1661
+ listeners[:on_interpolated_regular_expression_node_leave]&.each { |listener| listener.on_interpolated_regular_expression_node_leave(node) }
1662
+ end
1663
+
1664
+ # Dispatch enter and leave events for InterpolatedStringNode nodes.
1665
+ def visit_interpolated_string_node(node)
1666
+ listeners[:on_interpolated_string_node_enter]&.each { |listener| listener.on_interpolated_string_node_enter(node) }
1667
+ listeners[:on_interpolated_string_node_leave]&.each { |listener| listener.on_interpolated_string_node_leave(node) }
1668
+ end
1669
+
1670
+ # Dispatch enter and leave events for InterpolatedSymbolNode nodes.
1671
+ def visit_interpolated_symbol_node(node)
1672
+ listeners[:on_interpolated_symbol_node_enter]&.each { |listener| listener.on_interpolated_symbol_node_enter(node) }
1673
+ listeners[:on_interpolated_symbol_node_leave]&.each { |listener| listener.on_interpolated_symbol_node_leave(node) }
1674
+ end
1675
+
1676
+ # Dispatch enter and leave events for InterpolatedXStringNode nodes.
1677
+ def visit_interpolated_x_string_node(node)
1678
+ listeners[:on_interpolated_x_string_node_enter]&.each { |listener| listener.on_interpolated_x_string_node_enter(node) }
1679
+ listeners[:on_interpolated_x_string_node_leave]&.each { |listener| listener.on_interpolated_x_string_node_leave(node) }
1680
+ end
1681
+
1682
+ # Dispatch enter and leave events for KeywordHashNode nodes.
1683
+ def visit_keyword_hash_node(node)
1684
+ listeners[:on_keyword_hash_node_enter]&.each { |listener| listener.on_keyword_hash_node_enter(node) }
1685
+ listeners[:on_keyword_hash_node_leave]&.each { |listener| listener.on_keyword_hash_node_leave(node) }
1686
+ end
1687
+
1688
+ # Dispatch enter and leave events for KeywordParameterNode nodes.
1689
+ def visit_keyword_parameter_node(node)
1690
+ listeners[:on_keyword_parameter_node_enter]&.each { |listener| listener.on_keyword_parameter_node_enter(node) }
1691
+ listeners[:on_keyword_parameter_node_leave]&.each { |listener| listener.on_keyword_parameter_node_leave(node) }
1692
+ end
1693
+
1694
+ # Dispatch enter and leave events for KeywordRestParameterNode nodes.
1695
+ def visit_keyword_rest_parameter_node(node)
1696
+ listeners[:on_keyword_rest_parameter_node_enter]&.each { |listener| listener.on_keyword_rest_parameter_node_enter(node) }
1697
+ listeners[:on_keyword_rest_parameter_node_leave]&.each { |listener| listener.on_keyword_rest_parameter_node_leave(node) }
1698
+ end
1699
+
1700
+ # Dispatch enter and leave events for LambdaNode nodes.
1701
+ def visit_lambda_node(node)
1702
+ listeners[:on_lambda_node_enter]&.each { |listener| listener.on_lambda_node_enter(node) }
1703
+ listeners[:on_lambda_node_leave]&.each { |listener| listener.on_lambda_node_leave(node) }
1704
+ end
1705
+
1706
+ # Dispatch enter and leave events for LocalVariableAndWriteNode nodes.
1707
+ def visit_local_variable_and_write_node(node)
1708
+ listeners[:on_local_variable_and_write_node_enter]&.each { |listener| listener.on_local_variable_and_write_node_enter(node) }
1709
+ listeners[:on_local_variable_and_write_node_leave]&.each { |listener| listener.on_local_variable_and_write_node_leave(node) }
1710
+ end
1711
+
1712
+ # Dispatch enter and leave events for LocalVariableOperatorWriteNode nodes.
1713
+ def visit_local_variable_operator_write_node(node)
1714
+ listeners[:on_local_variable_operator_write_node_enter]&.each { |listener| listener.on_local_variable_operator_write_node_enter(node) }
1715
+ listeners[:on_local_variable_operator_write_node_leave]&.each { |listener| listener.on_local_variable_operator_write_node_leave(node) }
1716
+ end
1717
+
1718
+ # Dispatch enter and leave events for LocalVariableOrWriteNode nodes.
1719
+ def visit_local_variable_or_write_node(node)
1720
+ listeners[:on_local_variable_or_write_node_enter]&.each { |listener| listener.on_local_variable_or_write_node_enter(node) }
1721
+ listeners[:on_local_variable_or_write_node_leave]&.each { |listener| listener.on_local_variable_or_write_node_leave(node) }
1722
+ end
1723
+
1724
+ # Dispatch enter and leave events for LocalVariableReadNode nodes.
1725
+ def visit_local_variable_read_node(node)
1726
+ listeners[:on_local_variable_read_node_enter]&.each { |listener| listener.on_local_variable_read_node_enter(node) }
1727
+ listeners[:on_local_variable_read_node_leave]&.each { |listener| listener.on_local_variable_read_node_leave(node) }
1728
+ end
1729
+
1730
+ # Dispatch enter and leave events for LocalVariableTargetNode nodes.
1731
+ def visit_local_variable_target_node(node)
1732
+ listeners[:on_local_variable_target_node_enter]&.each { |listener| listener.on_local_variable_target_node_enter(node) }
1733
+ listeners[:on_local_variable_target_node_leave]&.each { |listener| listener.on_local_variable_target_node_leave(node) }
1734
+ end
1735
+
1736
+ # Dispatch enter and leave events for LocalVariableWriteNode nodes.
1737
+ def visit_local_variable_write_node(node)
1738
+ listeners[:on_local_variable_write_node_enter]&.each { |listener| listener.on_local_variable_write_node_enter(node) }
1739
+ listeners[:on_local_variable_write_node_leave]&.each { |listener| listener.on_local_variable_write_node_leave(node) }
1740
+ end
1741
+
1742
+ # Dispatch enter and leave events for MatchLastLineNode nodes.
1743
+ def visit_match_last_line_node(node)
1744
+ listeners[:on_match_last_line_node_enter]&.each { |listener| listener.on_match_last_line_node_enter(node) }
1745
+ listeners[:on_match_last_line_node_leave]&.each { |listener| listener.on_match_last_line_node_leave(node) }
1746
+ end
1747
+
1748
+ # Dispatch enter and leave events for MatchPredicateNode nodes.
1749
+ def visit_match_predicate_node(node)
1750
+ listeners[:on_match_predicate_node_enter]&.each { |listener| listener.on_match_predicate_node_enter(node) }
1751
+ listeners[:on_match_predicate_node_leave]&.each { |listener| listener.on_match_predicate_node_leave(node) }
1752
+ end
1753
+
1754
+ # Dispatch enter and leave events for MatchRequiredNode nodes.
1755
+ def visit_match_required_node(node)
1756
+ listeners[:on_match_required_node_enter]&.each { |listener| listener.on_match_required_node_enter(node) }
1757
+ listeners[:on_match_required_node_leave]&.each { |listener| listener.on_match_required_node_leave(node) }
1758
+ end
1759
+
1760
+ # Dispatch enter and leave events for MatchWriteNode nodes.
1761
+ def visit_match_write_node(node)
1762
+ listeners[:on_match_write_node_enter]&.each { |listener| listener.on_match_write_node_enter(node) }
1763
+ listeners[:on_match_write_node_leave]&.each { |listener| listener.on_match_write_node_leave(node) }
1764
+ end
1765
+
1766
+ # Dispatch enter and leave events for MissingNode nodes.
1767
+ def visit_missing_node(node)
1768
+ listeners[:on_missing_node_enter]&.each { |listener| listener.on_missing_node_enter(node) }
1769
+ listeners[:on_missing_node_leave]&.each { |listener| listener.on_missing_node_leave(node) }
1770
+ end
1771
+
1772
+ # Dispatch enter and leave events for ModuleNode nodes.
1773
+ def visit_module_node(node)
1774
+ listeners[:on_module_node_enter]&.each { |listener| listener.on_module_node_enter(node) }
1775
+ listeners[:on_module_node_leave]&.each { |listener| listener.on_module_node_leave(node) }
1776
+ end
1777
+
1778
+ # Dispatch enter and leave events for MultiTargetNode nodes.
1779
+ def visit_multi_target_node(node)
1780
+ listeners[:on_multi_target_node_enter]&.each { |listener| listener.on_multi_target_node_enter(node) }
1781
+ listeners[:on_multi_target_node_leave]&.each { |listener| listener.on_multi_target_node_leave(node) }
1782
+ end
1783
+
1784
+ # Dispatch enter and leave events for MultiWriteNode nodes.
1785
+ def visit_multi_write_node(node)
1786
+ listeners[:on_multi_write_node_enter]&.each { |listener| listener.on_multi_write_node_enter(node) }
1787
+ listeners[:on_multi_write_node_leave]&.each { |listener| listener.on_multi_write_node_leave(node) }
1788
+ end
1789
+
1790
+ # Dispatch enter and leave events for NextNode nodes.
1791
+ def visit_next_node(node)
1792
+ listeners[:on_next_node_enter]&.each { |listener| listener.on_next_node_enter(node) }
1793
+ listeners[:on_next_node_leave]&.each { |listener| listener.on_next_node_leave(node) }
1794
+ end
1795
+
1796
+ # Dispatch enter and leave events for NilNode nodes.
1797
+ def visit_nil_node(node)
1798
+ listeners[:on_nil_node_enter]&.each { |listener| listener.on_nil_node_enter(node) }
1799
+ listeners[:on_nil_node_leave]&.each { |listener| listener.on_nil_node_leave(node) }
1800
+ end
1801
+
1802
+ # Dispatch enter and leave events for NoKeywordsParameterNode nodes.
1803
+ def visit_no_keywords_parameter_node(node)
1804
+ listeners[:on_no_keywords_parameter_node_enter]&.each { |listener| listener.on_no_keywords_parameter_node_enter(node) }
1805
+ listeners[:on_no_keywords_parameter_node_leave]&.each { |listener| listener.on_no_keywords_parameter_node_leave(node) }
1806
+ end
1807
+
1808
+ # Dispatch enter and leave events for NumberedReferenceReadNode nodes.
1809
+ def visit_numbered_reference_read_node(node)
1810
+ listeners[:on_numbered_reference_read_node_enter]&.each { |listener| listener.on_numbered_reference_read_node_enter(node) }
1811
+ listeners[:on_numbered_reference_read_node_leave]&.each { |listener| listener.on_numbered_reference_read_node_leave(node) }
1812
+ end
1813
+
1814
+ # Dispatch enter and leave events for OptionalParameterNode nodes.
1815
+ def visit_optional_parameter_node(node)
1816
+ listeners[:on_optional_parameter_node_enter]&.each { |listener| listener.on_optional_parameter_node_enter(node) }
1817
+ listeners[:on_optional_parameter_node_leave]&.each { |listener| listener.on_optional_parameter_node_leave(node) }
1818
+ end
1819
+
1820
+ # Dispatch enter and leave events for OrNode nodes.
1821
+ def visit_or_node(node)
1822
+ listeners[:on_or_node_enter]&.each { |listener| listener.on_or_node_enter(node) }
1823
+ listeners[:on_or_node_leave]&.each { |listener| listener.on_or_node_leave(node) }
1824
+ end
1825
+
1826
+ # Dispatch enter and leave events for ParametersNode nodes.
1827
+ def visit_parameters_node(node)
1828
+ listeners[:on_parameters_node_enter]&.each { |listener| listener.on_parameters_node_enter(node) }
1829
+ listeners[:on_parameters_node_leave]&.each { |listener| listener.on_parameters_node_leave(node) }
1830
+ end
1831
+
1832
+ # Dispatch enter and leave events for ParenthesesNode nodes.
1833
+ def visit_parentheses_node(node)
1834
+ listeners[:on_parentheses_node_enter]&.each { |listener| listener.on_parentheses_node_enter(node) }
1835
+ listeners[:on_parentheses_node_leave]&.each { |listener| listener.on_parentheses_node_leave(node) }
1836
+ end
1837
+
1838
+ # Dispatch enter and leave events for PinnedExpressionNode nodes.
1839
+ def visit_pinned_expression_node(node)
1840
+ listeners[:on_pinned_expression_node_enter]&.each { |listener| listener.on_pinned_expression_node_enter(node) }
1841
+ listeners[:on_pinned_expression_node_leave]&.each { |listener| listener.on_pinned_expression_node_leave(node) }
1842
+ end
1843
+
1844
+ # Dispatch enter and leave events for PinnedVariableNode nodes.
1845
+ def visit_pinned_variable_node(node)
1846
+ listeners[:on_pinned_variable_node_enter]&.each { |listener| listener.on_pinned_variable_node_enter(node) }
1847
+ listeners[:on_pinned_variable_node_leave]&.each { |listener| listener.on_pinned_variable_node_leave(node) }
1848
+ end
1849
+
1850
+ # Dispatch enter and leave events for PostExecutionNode nodes.
1851
+ def visit_post_execution_node(node)
1852
+ listeners[:on_post_execution_node_enter]&.each { |listener| listener.on_post_execution_node_enter(node) }
1853
+ listeners[:on_post_execution_node_leave]&.each { |listener| listener.on_post_execution_node_leave(node) }
1854
+ end
1855
+
1856
+ # Dispatch enter and leave events for PreExecutionNode nodes.
1857
+ def visit_pre_execution_node(node)
1858
+ listeners[:on_pre_execution_node_enter]&.each { |listener| listener.on_pre_execution_node_enter(node) }
1859
+ listeners[:on_pre_execution_node_leave]&.each { |listener| listener.on_pre_execution_node_leave(node) }
1860
+ end
1861
+
1862
+ # Dispatch enter and leave events for ProgramNode nodes.
1863
+ def visit_program_node(node)
1864
+ listeners[:on_program_node_enter]&.each { |listener| listener.on_program_node_enter(node) }
1865
+ listeners[:on_program_node_leave]&.each { |listener| listener.on_program_node_leave(node) }
1866
+ end
1867
+
1868
+ # Dispatch enter and leave events for RangeNode nodes.
1869
+ def visit_range_node(node)
1870
+ listeners[:on_range_node_enter]&.each { |listener| listener.on_range_node_enter(node) }
1871
+ listeners[:on_range_node_leave]&.each { |listener| listener.on_range_node_leave(node) }
1872
+ end
1873
+
1874
+ # Dispatch enter and leave events for RationalNode nodes.
1875
+ def visit_rational_node(node)
1876
+ listeners[:on_rational_node_enter]&.each { |listener| listener.on_rational_node_enter(node) }
1877
+ listeners[:on_rational_node_leave]&.each { |listener| listener.on_rational_node_leave(node) }
1878
+ end
1879
+
1880
+ # Dispatch enter and leave events for RedoNode nodes.
1881
+ def visit_redo_node(node)
1882
+ listeners[:on_redo_node_enter]&.each { |listener| listener.on_redo_node_enter(node) }
1883
+ listeners[:on_redo_node_leave]&.each { |listener| listener.on_redo_node_leave(node) }
1884
+ end
1885
+
1886
+ # Dispatch enter and leave events for RegularExpressionNode nodes.
1887
+ def visit_regular_expression_node(node)
1888
+ listeners[:on_regular_expression_node_enter]&.each { |listener| listener.on_regular_expression_node_enter(node) }
1889
+ listeners[:on_regular_expression_node_leave]&.each { |listener| listener.on_regular_expression_node_leave(node) }
1890
+ end
1891
+
1892
+ # Dispatch enter and leave events for RequiredDestructuredParameterNode nodes.
1893
+ def visit_required_destructured_parameter_node(node)
1894
+ listeners[:on_required_destructured_parameter_node_enter]&.each { |listener| listener.on_required_destructured_parameter_node_enter(node) }
1895
+ listeners[:on_required_destructured_parameter_node_leave]&.each { |listener| listener.on_required_destructured_parameter_node_leave(node) }
1896
+ end
1897
+
1898
+ # Dispatch enter and leave events for RequiredParameterNode nodes.
1899
+ def visit_required_parameter_node(node)
1900
+ listeners[:on_required_parameter_node_enter]&.each { |listener| listener.on_required_parameter_node_enter(node) }
1901
+ listeners[:on_required_parameter_node_leave]&.each { |listener| listener.on_required_parameter_node_leave(node) }
1902
+ end
1903
+
1904
+ # Dispatch enter and leave events for RescueModifierNode nodes.
1905
+ def visit_rescue_modifier_node(node)
1906
+ listeners[:on_rescue_modifier_node_enter]&.each { |listener| listener.on_rescue_modifier_node_enter(node) }
1907
+ listeners[:on_rescue_modifier_node_leave]&.each { |listener| listener.on_rescue_modifier_node_leave(node) }
1908
+ end
1909
+
1910
+ # Dispatch enter and leave events for RescueNode nodes.
1911
+ def visit_rescue_node(node)
1912
+ listeners[:on_rescue_node_enter]&.each { |listener| listener.on_rescue_node_enter(node) }
1913
+ listeners[:on_rescue_node_leave]&.each { |listener| listener.on_rescue_node_leave(node) }
1914
+ end
1915
+
1916
+ # Dispatch enter and leave events for RestParameterNode nodes.
1917
+ def visit_rest_parameter_node(node)
1918
+ listeners[:on_rest_parameter_node_enter]&.each { |listener| listener.on_rest_parameter_node_enter(node) }
1919
+ listeners[:on_rest_parameter_node_leave]&.each { |listener| listener.on_rest_parameter_node_leave(node) }
1920
+ end
1921
+
1922
+ # Dispatch enter and leave events for RetryNode nodes.
1923
+ def visit_retry_node(node)
1924
+ listeners[:on_retry_node_enter]&.each { |listener| listener.on_retry_node_enter(node) }
1925
+ listeners[:on_retry_node_leave]&.each { |listener| listener.on_retry_node_leave(node) }
1926
+ end
1927
+
1928
+ # Dispatch enter and leave events for ReturnNode nodes.
1929
+ def visit_return_node(node)
1930
+ listeners[:on_return_node_enter]&.each { |listener| listener.on_return_node_enter(node) }
1931
+ listeners[:on_return_node_leave]&.each { |listener| listener.on_return_node_leave(node) }
1932
+ end
1933
+
1934
+ # Dispatch enter and leave events for SelfNode nodes.
1935
+ def visit_self_node(node)
1936
+ listeners[:on_self_node_enter]&.each { |listener| listener.on_self_node_enter(node) }
1937
+ listeners[:on_self_node_leave]&.each { |listener| listener.on_self_node_leave(node) }
1938
+ end
1939
+
1940
+ # Dispatch enter and leave events for SingletonClassNode nodes.
1941
+ def visit_singleton_class_node(node)
1942
+ listeners[:on_singleton_class_node_enter]&.each { |listener| listener.on_singleton_class_node_enter(node) }
1943
+ listeners[:on_singleton_class_node_leave]&.each { |listener| listener.on_singleton_class_node_leave(node) }
1944
+ end
1945
+
1946
+ # Dispatch enter and leave events for SourceEncodingNode nodes.
1947
+ def visit_source_encoding_node(node)
1948
+ listeners[:on_source_encoding_node_enter]&.each { |listener| listener.on_source_encoding_node_enter(node) }
1949
+ listeners[:on_source_encoding_node_leave]&.each { |listener| listener.on_source_encoding_node_leave(node) }
1950
+ end
1951
+
1952
+ # Dispatch enter and leave events for SourceFileNode nodes.
1953
+ def visit_source_file_node(node)
1954
+ listeners[:on_source_file_node_enter]&.each { |listener| listener.on_source_file_node_enter(node) }
1955
+ listeners[:on_source_file_node_leave]&.each { |listener| listener.on_source_file_node_leave(node) }
1956
+ end
1957
+
1958
+ # Dispatch enter and leave events for SourceLineNode nodes.
1959
+ def visit_source_line_node(node)
1960
+ listeners[:on_source_line_node_enter]&.each { |listener| listener.on_source_line_node_enter(node) }
1961
+ listeners[:on_source_line_node_leave]&.each { |listener| listener.on_source_line_node_leave(node) }
1962
+ end
1963
+
1964
+ # Dispatch enter and leave events for SplatNode nodes.
1965
+ def visit_splat_node(node)
1966
+ listeners[:on_splat_node_enter]&.each { |listener| listener.on_splat_node_enter(node) }
1967
+ listeners[:on_splat_node_leave]&.each { |listener| listener.on_splat_node_leave(node) }
1968
+ end
1969
+
1970
+ # Dispatch enter and leave events for StatementsNode nodes.
1971
+ def visit_statements_node(node)
1972
+ listeners[:on_statements_node_enter]&.each { |listener| listener.on_statements_node_enter(node) }
1973
+ listeners[:on_statements_node_leave]&.each { |listener| listener.on_statements_node_leave(node) }
1974
+ end
1975
+
1976
+ # Dispatch enter and leave events for StringConcatNode nodes.
1977
+ def visit_string_concat_node(node)
1978
+ listeners[:on_string_concat_node_enter]&.each { |listener| listener.on_string_concat_node_enter(node) }
1979
+ listeners[:on_string_concat_node_leave]&.each { |listener| listener.on_string_concat_node_leave(node) }
1980
+ end
1981
+
1982
+ # Dispatch enter and leave events for StringNode nodes.
1983
+ def visit_string_node(node)
1984
+ listeners[:on_string_node_enter]&.each { |listener| listener.on_string_node_enter(node) }
1985
+ listeners[:on_string_node_leave]&.each { |listener| listener.on_string_node_leave(node) }
1986
+ end
1987
+
1988
+ # Dispatch enter and leave events for SuperNode nodes.
1989
+ def visit_super_node(node)
1990
+ listeners[:on_super_node_enter]&.each { |listener| listener.on_super_node_enter(node) }
1991
+ listeners[:on_super_node_leave]&.each { |listener| listener.on_super_node_leave(node) }
1992
+ end
1993
+
1994
+ # Dispatch enter and leave events for SymbolNode nodes.
1995
+ def visit_symbol_node(node)
1996
+ listeners[:on_symbol_node_enter]&.each { |listener| listener.on_symbol_node_enter(node) }
1997
+ listeners[:on_symbol_node_leave]&.each { |listener| listener.on_symbol_node_leave(node) }
1998
+ end
1999
+
2000
+ # Dispatch enter and leave events for TrueNode nodes.
2001
+ def visit_true_node(node)
2002
+ listeners[:on_true_node_enter]&.each { |listener| listener.on_true_node_enter(node) }
2003
+ listeners[:on_true_node_leave]&.each { |listener| listener.on_true_node_leave(node) }
2004
+ end
2005
+
2006
+ # Dispatch enter and leave events for UndefNode nodes.
2007
+ def visit_undef_node(node)
2008
+ listeners[:on_undef_node_enter]&.each { |listener| listener.on_undef_node_enter(node) }
2009
+ listeners[:on_undef_node_leave]&.each { |listener| listener.on_undef_node_leave(node) }
2010
+ end
2011
+
2012
+ # Dispatch enter and leave events for UnlessNode nodes.
2013
+ def visit_unless_node(node)
2014
+ listeners[:on_unless_node_enter]&.each { |listener| listener.on_unless_node_enter(node) }
2015
+ listeners[:on_unless_node_leave]&.each { |listener| listener.on_unless_node_leave(node) }
2016
+ end
2017
+
2018
+ # Dispatch enter and leave events for UntilNode nodes.
2019
+ def visit_until_node(node)
2020
+ listeners[:on_until_node_enter]&.each { |listener| listener.on_until_node_enter(node) }
2021
+ listeners[:on_until_node_leave]&.each { |listener| listener.on_until_node_leave(node) }
2022
+ end
2023
+
2024
+ # Dispatch enter and leave events for WhenNode nodes.
2025
+ def visit_when_node(node)
2026
+ listeners[:on_when_node_enter]&.each { |listener| listener.on_when_node_enter(node) }
2027
+ listeners[:on_when_node_leave]&.each { |listener| listener.on_when_node_leave(node) }
2028
+ end
2029
+
2030
+ # Dispatch enter and leave events for WhileNode nodes.
2031
+ def visit_while_node(node)
2032
+ listeners[:on_while_node_enter]&.each { |listener| listener.on_while_node_enter(node) }
2033
+ listeners[:on_while_node_leave]&.each { |listener| listener.on_while_node_leave(node) }
2034
+ end
2035
+
2036
+ # Dispatch enter and leave events for XStringNode nodes.
2037
+ def visit_x_string_node(node)
2038
+ listeners[:on_x_string_node_enter]&.each { |listener| listener.on_x_string_node_enter(node) }
2039
+ listeners[:on_x_string_node_leave]&.each { |listener| listener.on_x_string_node_leave(node) }
2040
+ end
2041
+
2042
+ # Dispatch enter and leave events for YieldNode nodes.
2043
+ def visit_yield_node(node)
2044
+ listeners[:on_yield_node_enter]&.each { |listener| listener.on_yield_node_enter(node) }
2045
+ listeners[:on_yield_node_leave]&.each { |listener| listener.on_yield_node_leave(node) }
2046
+ end
2047
+ end
2048
+
2049
+ private_constant :DispatchOnce
2050
+ end
2051
+ end