Class: Prism::Dispatcher

Inherits:
Visitor show all
Defined in:
lib/prism/dispatcher.rb

Overview

The dispatcher class fires events for nodes that are found while walking an AST to all registered listeners. It’s useful for performing different types of analysis on the AST while only having to walk the tree once.

To use the dispatcher, you would first instantiate it and register listeners for the events you’re interested in:

class OctalListener
  def on_integer_node_enter(node)
    if node.octal? && !node.slice.start_with?("0o")
      warn("Octal integers should be written with the 0o prefix")
    end
  end
end

listener = OctalListener.new
dispatcher = Prism::Dispatcher.new
dispatcher.register(listener, :on_integer_node_enter)

Then, you can walk any number of trees and dispatch events to the listeners:

result = Prism.parse("001 + 002 + 003")
dispatcher.dispatch(result.value)

Optionally, you can also use ‘#dispatch_once` to dispatch enter and leave events for a single node without recursing further down the tree. This can be useful in circumstances where you want to reuse the listeners you already have registers but want to stop walking the tree at a certain point.

integer = result.value.statements.body.first.receiver.receiver
dispatcher.dispatch_once(integer)

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from BasicVisitor

#visit, #visit_all, #visit_child_nodes

Constructor Details

#initializeDispatcher

Initialize a new dispatcher.



47
48
49
# File 'lib/prism/dispatcher.rb', line 47

def initialize
  @listeners = {}
end

Instance Attribute Details

#listenersObject (readonly)

attr_reader listeners: Hash[Symbol, Array]



44
45
46
# File 'lib/prism/dispatcher.rb', line 44

def listeners
  @listeners
end

Instance Method Details

#dispatch_once(node) ⇒ Object

Dispatches a single event for ‘node` to all registered listeners.

def dispatch_once: (Node) -> void



66
67
68
# File 'lib/prism/dispatcher.rb', line 66

def dispatch_once(node)
  node.accept(DispatchOnce.new(listeners))
end

#register(listener, *events) ⇒ Object

Register a listener for one or more events.

def register: (Listener, *Symbol) -> void



54
55
56
# File 'lib/prism/dispatcher.rb', line 54

def register(listener, *events)
  events.each { |event| (listeners[event] ||= []) << listener }
end

#visit_alias_global_variable_node(node) ⇒ Object

Dispatch enter and leave events for AliasGlobalVariableNode nodes and continue walking the tree.



72
73
74
75
76
# File 'lib/prism/dispatcher.rb', line 72

def visit_alias_global_variable_node(node)
  listeners[:on_alias_global_variable_node_enter]&.each { |listener| listener.on_alias_global_variable_node_enter(node) }
  super
  listeners[:on_alias_global_variable_node_leave]&.each { |listener| listener.on_alias_global_variable_node_leave(node) }
end

#visit_alias_method_node(node) ⇒ Object

Dispatch enter and leave events for AliasMethodNode nodes and continue walking the tree.



80
81
82
83
84
# File 'lib/prism/dispatcher.rb', line 80

def visit_alias_method_node(node)
  listeners[:on_alias_method_node_enter]&.each { |listener| listener.on_alias_method_node_enter(node) }
  super
  listeners[:on_alias_method_node_leave]&.each { |listener| listener.on_alias_method_node_leave(node) }
end

#visit_alternation_pattern_node(node) ⇒ Object

Dispatch enter and leave events for AlternationPatternNode nodes and continue walking the tree.



88
89
90
91
92
# File 'lib/prism/dispatcher.rb', line 88

def visit_alternation_pattern_node(node)
  listeners[:on_alternation_pattern_node_enter]&.each { |listener| listener.on_alternation_pattern_node_enter(node) }
  super
  listeners[:on_alternation_pattern_node_leave]&.each { |listener| listener.on_alternation_pattern_node_leave(node) }
end

#visit_and_node(node) ⇒ Object

Dispatch enter and leave events for AndNode nodes and continue walking the tree.



96
97
98
99
100
# File 'lib/prism/dispatcher.rb', line 96

def visit_and_node(node)
  listeners[:on_and_node_enter]&.each { |listener| listener.on_and_node_enter(node) }
  super
  listeners[:on_and_node_leave]&.each { |listener| listener.on_and_node_leave(node) }
end

#visit_arguments_node(node) ⇒ Object

Dispatch enter and leave events for ArgumentsNode nodes and continue walking the tree.



104
105
106
107
108
# File 'lib/prism/dispatcher.rb', line 104

def visit_arguments_node(node)
  listeners[:on_arguments_node_enter]&.each { |listener| listener.on_arguments_node_enter(node) }
  super
  listeners[:on_arguments_node_leave]&.each { |listener| listener.on_arguments_node_leave(node) }
end

#visit_array_node(node) ⇒ Object

Dispatch enter and leave events for ArrayNode nodes and continue walking the tree.



112
113
114
115
116
# File 'lib/prism/dispatcher.rb', line 112

def visit_array_node(node)
  listeners[:on_array_node_enter]&.each { |listener| listener.on_array_node_enter(node) }
  super
  listeners[:on_array_node_leave]&.each { |listener| listener.on_array_node_leave(node) }
end

#visit_array_pattern_node(node) ⇒ Object

Dispatch enter and leave events for ArrayPatternNode nodes and continue walking the tree.



120
121
122
123
124
# File 'lib/prism/dispatcher.rb', line 120

def visit_array_pattern_node(node)
  listeners[:on_array_pattern_node_enter]&.each { |listener| listener.on_array_pattern_node_enter(node) }
  super
  listeners[:on_array_pattern_node_leave]&.each { |listener| listener.on_array_pattern_node_leave(node) }
end

#visit_assoc_node(node) ⇒ Object

Dispatch enter and leave events for AssocNode nodes and continue walking the tree.



128
129
130
131
132
# File 'lib/prism/dispatcher.rb', line 128

def visit_assoc_node(node)
  listeners[:on_assoc_node_enter]&.each { |listener| listener.on_assoc_node_enter(node) }
  super
  listeners[:on_assoc_node_leave]&.each { |listener| listener.on_assoc_node_leave(node) }
end

#visit_assoc_splat_node(node) ⇒ Object

Dispatch enter and leave events for AssocSplatNode nodes and continue walking the tree.



136
137
138
139
140
# File 'lib/prism/dispatcher.rb', line 136

def visit_assoc_splat_node(node)
  listeners[:on_assoc_splat_node_enter]&.each { |listener| listener.on_assoc_splat_node_enter(node) }
  super
  listeners[:on_assoc_splat_node_leave]&.each { |listener| listener.on_assoc_splat_node_leave(node) }
end

#visit_back_reference_read_node(node) ⇒ Object

Dispatch enter and leave events for BackReferenceReadNode nodes and continue walking the tree.



144
145
146
147
148
# File 'lib/prism/dispatcher.rb', line 144

def visit_back_reference_read_node(node)
  listeners[:on_back_reference_read_node_enter]&.each { |listener| listener.on_back_reference_read_node_enter(node) }
  super
  listeners[:on_back_reference_read_node_leave]&.each { |listener| listener.on_back_reference_read_node_leave(node) }
end

#visit_begin_node(node) ⇒ Object

Dispatch enter and leave events for BeginNode nodes and continue walking the tree.



152
153
154
155
156
# File 'lib/prism/dispatcher.rb', line 152

def visit_begin_node(node)
  listeners[:on_begin_node_enter]&.each { |listener| listener.on_begin_node_enter(node) }
  super
  listeners[:on_begin_node_leave]&.each { |listener| listener.on_begin_node_leave(node) }
end

#visit_block_argument_node(node) ⇒ Object

Dispatch enter and leave events for BlockArgumentNode nodes and continue walking the tree.



160
161
162
163
164
# File 'lib/prism/dispatcher.rb', line 160

def visit_block_argument_node(node)
  listeners[:on_block_argument_node_enter]&.each { |listener| listener.on_block_argument_node_enter(node) }
  super
  listeners[:on_block_argument_node_leave]&.each { |listener| listener.on_block_argument_node_leave(node) }
end

#visit_block_local_variable_node(node) ⇒ Object

Dispatch enter and leave events for BlockLocalVariableNode nodes and continue walking the tree.



168
169
170
171
172
# File 'lib/prism/dispatcher.rb', line 168

def visit_block_local_variable_node(node)
  listeners[:on_block_local_variable_node_enter]&.each { |listener| listener.on_block_local_variable_node_enter(node) }
  super
  listeners[:on_block_local_variable_node_leave]&.each { |listener| listener.on_block_local_variable_node_leave(node) }
end

#visit_block_node(node) ⇒ Object

Dispatch enter and leave events for BlockNode nodes and continue walking the tree.



176
177
178
179
180
# File 'lib/prism/dispatcher.rb', line 176

def visit_block_node(node)
  listeners[:on_block_node_enter]&.each { |listener| listener.on_block_node_enter(node) }
  super
  listeners[:on_block_node_leave]&.each { |listener| listener.on_block_node_leave(node) }
end

#visit_block_parameter_node(node) ⇒ Object

Dispatch enter and leave events for BlockParameterNode nodes and continue walking the tree.



184
185
186
187
188
# File 'lib/prism/dispatcher.rb', line 184

def visit_block_parameter_node(node)
  listeners[:on_block_parameter_node_enter]&.each { |listener| listener.on_block_parameter_node_enter(node) }
  super
  listeners[:on_block_parameter_node_leave]&.each { |listener| listener.on_block_parameter_node_leave(node) }
end

#visit_block_parameters_node(node) ⇒ Object

Dispatch enter and leave events for BlockParametersNode nodes and continue walking the tree.



192
193
194
195
196
# File 'lib/prism/dispatcher.rb', line 192

def visit_block_parameters_node(node)
  listeners[:on_block_parameters_node_enter]&.each { |listener| listener.on_block_parameters_node_enter(node) }
  super
  listeners[:on_block_parameters_node_leave]&.each { |listener| listener.on_block_parameters_node_leave(node) }
end

#visit_break_node(node) ⇒ Object

Dispatch enter and leave events for BreakNode nodes and continue walking the tree.



200
201
202
203
204
# File 'lib/prism/dispatcher.rb', line 200

def visit_break_node(node)
  listeners[:on_break_node_enter]&.each { |listener| listener.on_break_node_enter(node) }
  super
  listeners[:on_break_node_leave]&.each { |listener| listener.on_break_node_leave(node) }
end

#visit_call_and_write_node(node) ⇒ Object

Dispatch enter and leave events for CallAndWriteNode nodes and continue walking the tree.



208
209
210
211
212
# File 'lib/prism/dispatcher.rb', line 208

def visit_call_and_write_node(node)
  listeners[:on_call_and_write_node_enter]&.each { |listener| listener.on_call_and_write_node_enter(node) }
  super
  listeners[:on_call_and_write_node_leave]&.each { |listener| listener.on_call_and_write_node_leave(node) }
end

#visit_call_node(node) ⇒ Object

Dispatch enter and leave events for CallNode nodes and continue walking the tree.



216
217
218
219
220
# File 'lib/prism/dispatcher.rb', line 216

def visit_call_node(node)
  listeners[:on_call_node_enter]&.each { |listener| listener.on_call_node_enter(node) }
  super
  listeners[:on_call_node_leave]&.each { |listener| listener.on_call_node_leave(node) }
end

#visit_call_operator_write_node(node) ⇒ Object

Dispatch enter and leave events for CallOperatorWriteNode nodes and continue walking the tree.



224
225
226
227
228
# File 'lib/prism/dispatcher.rb', line 224

def visit_call_operator_write_node(node)
  listeners[:on_call_operator_write_node_enter]&.each { |listener| listener.on_call_operator_write_node_enter(node) }
  super
  listeners[:on_call_operator_write_node_leave]&.each { |listener| listener.on_call_operator_write_node_leave(node) }
end

#visit_call_or_write_node(node) ⇒ Object

Dispatch enter and leave events for CallOrWriteNode nodes and continue walking the tree.



232
233
234
235
236
# File 'lib/prism/dispatcher.rb', line 232

def visit_call_or_write_node(node)
  listeners[:on_call_or_write_node_enter]&.each { |listener| listener.on_call_or_write_node_enter(node) }
  super
  listeners[:on_call_or_write_node_leave]&.each { |listener| listener.on_call_or_write_node_leave(node) }
end

#visit_call_target_node(node) ⇒ Object

Dispatch enter and leave events for CallTargetNode nodes and continue walking the tree.



240
241
242
243
244
# File 'lib/prism/dispatcher.rb', line 240

def visit_call_target_node(node)
  listeners[:on_call_target_node_enter]&.each { |listener| listener.on_call_target_node_enter(node) }
  super
  listeners[:on_call_target_node_leave]&.each { |listener| listener.on_call_target_node_leave(node) }
end

#visit_capture_pattern_node(node) ⇒ Object

Dispatch enter and leave events for CapturePatternNode nodes and continue walking the tree.



248
249
250
251
252
# File 'lib/prism/dispatcher.rb', line 248

def visit_capture_pattern_node(node)
  listeners[:on_capture_pattern_node_enter]&.each { |listener| listener.on_capture_pattern_node_enter(node) }
  super
  listeners[:on_capture_pattern_node_leave]&.each { |listener| listener.on_capture_pattern_node_leave(node) }
end

#visit_case_match_node(node) ⇒ Object

Dispatch enter and leave events for CaseMatchNode nodes and continue walking the tree.



256
257
258
259
260
# File 'lib/prism/dispatcher.rb', line 256

def visit_case_match_node(node)
  listeners[:on_case_match_node_enter]&.each { |listener| listener.on_case_match_node_enter(node) }
  super
  listeners[:on_case_match_node_leave]&.each { |listener| listener.on_case_match_node_leave(node) }
end

#visit_case_node(node) ⇒ Object

Dispatch enter and leave events for CaseNode nodes and continue walking the tree.



264
265
266
267
268
# File 'lib/prism/dispatcher.rb', line 264

def visit_case_node(node)
  listeners[:on_case_node_enter]&.each { |listener| listener.on_case_node_enter(node) }
  super
  listeners[:on_case_node_leave]&.each { |listener| listener.on_case_node_leave(node) }
end

#visit_class_node(node) ⇒ Object

Dispatch enter and leave events for ClassNode nodes and continue walking the tree.



272
273
274
275
276
# File 'lib/prism/dispatcher.rb', line 272

def visit_class_node(node)
  listeners[:on_class_node_enter]&.each { |listener| listener.on_class_node_enter(node) }
  super
  listeners[:on_class_node_leave]&.each { |listener| listener.on_class_node_leave(node) }
end

#visit_class_variable_and_write_node(node) ⇒ Object

Dispatch enter and leave events for ClassVariableAndWriteNode nodes and continue walking the tree.



280
281
282
283
284
# File 'lib/prism/dispatcher.rb', line 280

def visit_class_variable_and_write_node(node)
  listeners[:on_class_variable_and_write_node_enter]&.each { |listener| listener.on_class_variable_and_write_node_enter(node) }
  super
  listeners[:on_class_variable_and_write_node_leave]&.each { |listener| listener.on_class_variable_and_write_node_leave(node) }
end

#visit_class_variable_operator_write_node(node) ⇒ Object

Dispatch enter and leave events for ClassVariableOperatorWriteNode nodes and continue walking the tree.



288
289
290
291
292
# File 'lib/prism/dispatcher.rb', line 288

def visit_class_variable_operator_write_node(node)
  listeners[:on_class_variable_operator_write_node_enter]&.each { |listener| listener.on_class_variable_operator_write_node_enter(node) }
  super
  listeners[:on_class_variable_operator_write_node_leave]&.each { |listener| listener.on_class_variable_operator_write_node_leave(node) }
end

#visit_class_variable_or_write_node(node) ⇒ Object

Dispatch enter and leave events for ClassVariableOrWriteNode nodes and continue walking the tree.



296
297
298
299
300
# File 'lib/prism/dispatcher.rb', line 296

def visit_class_variable_or_write_node(node)
  listeners[:on_class_variable_or_write_node_enter]&.each { |listener| listener.on_class_variable_or_write_node_enter(node) }
  super
  listeners[:on_class_variable_or_write_node_leave]&.each { |listener| listener.on_class_variable_or_write_node_leave(node) }
end

#visit_class_variable_read_node(node) ⇒ Object

Dispatch enter and leave events for ClassVariableReadNode nodes and continue walking the tree.



304
305
306
307
308
# File 'lib/prism/dispatcher.rb', line 304

def visit_class_variable_read_node(node)
  listeners[:on_class_variable_read_node_enter]&.each { |listener| listener.on_class_variable_read_node_enter(node) }
  super
  listeners[:on_class_variable_read_node_leave]&.each { |listener| listener.on_class_variable_read_node_leave(node) }
end

#visit_class_variable_target_node(node) ⇒ Object

Dispatch enter and leave events for ClassVariableTargetNode nodes and continue walking the tree.



312
313
314
315
316
# File 'lib/prism/dispatcher.rb', line 312

def visit_class_variable_target_node(node)
  listeners[:on_class_variable_target_node_enter]&.each { |listener| listener.on_class_variable_target_node_enter(node) }
  super
  listeners[:on_class_variable_target_node_leave]&.each { |listener| listener.on_class_variable_target_node_leave(node) }
end

#visit_class_variable_write_node(node) ⇒ Object

Dispatch enter and leave events for ClassVariableWriteNode nodes and continue walking the tree.



320
321
322
323
324
# File 'lib/prism/dispatcher.rb', line 320

def visit_class_variable_write_node(node)
  listeners[:on_class_variable_write_node_enter]&.each { |listener| listener.on_class_variable_write_node_enter(node) }
  super
  listeners[:on_class_variable_write_node_leave]&.each { |listener| listener.on_class_variable_write_node_leave(node) }
end

#visit_constant_and_write_node(node) ⇒ Object

Dispatch enter and leave events for ConstantAndWriteNode nodes and continue walking the tree.



328
329
330
331
332
# File 'lib/prism/dispatcher.rb', line 328

def visit_constant_and_write_node(node)
  listeners[:on_constant_and_write_node_enter]&.each { |listener| listener.on_constant_and_write_node_enter(node) }
  super
  listeners[:on_constant_and_write_node_leave]&.each { |listener| listener.on_constant_and_write_node_leave(node) }
end

#visit_constant_operator_write_node(node) ⇒ Object

Dispatch enter and leave events for ConstantOperatorWriteNode nodes and continue walking the tree.



336
337
338
339
340
# File 'lib/prism/dispatcher.rb', line 336

def visit_constant_operator_write_node(node)
  listeners[:on_constant_operator_write_node_enter]&.each { |listener| listener.on_constant_operator_write_node_enter(node) }
  super
  listeners[:on_constant_operator_write_node_leave]&.each { |listener| listener.on_constant_operator_write_node_leave(node) }
end

#visit_constant_or_write_node(node) ⇒ Object

Dispatch enter and leave events for ConstantOrWriteNode nodes and continue walking the tree.



344
345
346
347
348
# File 'lib/prism/dispatcher.rb', line 344

def visit_constant_or_write_node(node)
  listeners[:on_constant_or_write_node_enter]&.each { |listener| listener.on_constant_or_write_node_enter(node) }
  super
  listeners[:on_constant_or_write_node_leave]&.each { |listener| listener.on_constant_or_write_node_leave(node) }
end

#visit_constant_path_and_write_node(node) ⇒ Object

Dispatch enter and leave events for ConstantPathAndWriteNode nodes and continue walking the tree.



352
353
354
355
356
# File 'lib/prism/dispatcher.rb', line 352

def visit_constant_path_and_write_node(node)
  listeners[:on_constant_path_and_write_node_enter]&.each { |listener| listener.on_constant_path_and_write_node_enter(node) }
  super
  listeners[:on_constant_path_and_write_node_leave]&.each { |listener| listener.on_constant_path_and_write_node_leave(node) }
end

#visit_constant_path_node(node) ⇒ Object

Dispatch enter and leave events for ConstantPathNode nodes and continue walking the tree.



360
361
362
363
364
# File 'lib/prism/dispatcher.rb', line 360

def visit_constant_path_node(node)
  listeners[:on_constant_path_node_enter]&.each { |listener| listener.on_constant_path_node_enter(node) }
  super
  listeners[:on_constant_path_node_leave]&.each { |listener| listener.on_constant_path_node_leave(node) }
end

#visit_constant_path_operator_write_node(node) ⇒ Object

Dispatch enter and leave events for ConstantPathOperatorWriteNode nodes and continue walking the tree.



368
369
370
371
372
# File 'lib/prism/dispatcher.rb', line 368

def visit_constant_path_operator_write_node(node)
  listeners[:on_constant_path_operator_write_node_enter]&.each { |listener| listener.on_constant_path_operator_write_node_enter(node) }
  super
  listeners[:on_constant_path_operator_write_node_leave]&.each { |listener| listener.on_constant_path_operator_write_node_leave(node) }
end

#visit_constant_path_or_write_node(node) ⇒ Object

Dispatch enter and leave events for ConstantPathOrWriteNode nodes and continue walking the tree.



376
377
378
379
380
# File 'lib/prism/dispatcher.rb', line 376

def visit_constant_path_or_write_node(node)
  listeners[:on_constant_path_or_write_node_enter]&.each { |listener| listener.on_constant_path_or_write_node_enter(node) }
  super
  listeners[:on_constant_path_or_write_node_leave]&.each { |listener| listener.on_constant_path_or_write_node_leave(node) }
end

#visit_constant_path_target_node(node) ⇒ Object

Dispatch enter and leave events for ConstantPathTargetNode nodes and continue walking the tree.



384
385
386
387
388
# File 'lib/prism/dispatcher.rb', line 384

def visit_constant_path_target_node(node)
  listeners[:on_constant_path_target_node_enter]&.each { |listener| listener.on_constant_path_target_node_enter(node) }
  super
  listeners[:on_constant_path_target_node_leave]&.each { |listener| listener.on_constant_path_target_node_leave(node) }
end

#visit_constant_path_write_node(node) ⇒ Object

Dispatch enter and leave events for ConstantPathWriteNode nodes and continue walking the tree.



392
393
394
395
396
# File 'lib/prism/dispatcher.rb', line 392

def visit_constant_path_write_node(node)
  listeners[:on_constant_path_write_node_enter]&.each { |listener| listener.on_constant_path_write_node_enter(node) }
  super
  listeners[:on_constant_path_write_node_leave]&.each { |listener| listener.on_constant_path_write_node_leave(node) }
end

#visit_constant_read_node(node) ⇒ Object

Dispatch enter and leave events for ConstantReadNode nodes and continue walking the tree.



400
401
402
403
404
# File 'lib/prism/dispatcher.rb', line 400

def visit_constant_read_node(node)
  listeners[:on_constant_read_node_enter]&.each { |listener| listener.on_constant_read_node_enter(node) }
  super
  listeners[:on_constant_read_node_leave]&.each { |listener| listener.on_constant_read_node_leave(node) }
end

#visit_constant_target_node(node) ⇒ Object

Dispatch enter and leave events for ConstantTargetNode nodes and continue walking the tree.



408
409
410
411
412
# File 'lib/prism/dispatcher.rb', line 408

def visit_constant_target_node(node)
  listeners[:on_constant_target_node_enter]&.each { |listener| listener.on_constant_target_node_enter(node) }
  super
  listeners[:on_constant_target_node_leave]&.each { |listener| listener.on_constant_target_node_leave(node) }
end

#visit_constant_write_node(node) ⇒ Object

Dispatch enter and leave events for ConstantWriteNode nodes and continue walking the tree.



416
417
418
419
420
# File 'lib/prism/dispatcher.rb', line 416

def visit_constant_write_node(node)
  listeners[:on_constant_write_node_enter]&.each { |listener| listener.on_constant_write_node_enter(node) }
  super
  listeners[:on_constant_write_node_leave]&.each { |listener| listener.on_constant_write_node_leave(node) }
end

#visit_def_node(node) ⇒ Object

Dispatch enter and leave events for DefNode nodes and continue walking the tree.



424
425
426
427
428
# File 'lib/prism/dispatcher.rb', line 424

def visit_def_node(node)
  listeners[:on_def_node_enter]&.each { |listener| listener.on_def_node_enter(node) }
  super
  listeners[:on_def_node_leave]&.each { |listener| listener.on_def_node_leave(node) }
end

#visit_defined_node(node) ⇒ Object

Dispatch enter and leave events for DefinedNode nodes and continue walking the tree.



432
433
434
435
436
# File 'lib/prism/dispatcher.rb', line 432

def visit_defined_node(node)
  listeners[:on_defined_node_enter]&.each { |listener| listener.on_defined_node_enter(node) }
  super
  listeners[:on_defined_node_leave]&.each { |listener| listener.on_defined_node_leave(node) }
end

#visit_else_node(node) ⇒ Object

Dispatch enter and leave events for ElseNode nodes and continue walking the tree.



440
441
442
443
444
# File 'lib/prism/dispatcher.rb', line 440

def visit_else_node(node)
  listeners[:on_else_node_enter]&.each { |listener| listener.on_else_node_enter(node) }
  super
  listeners[:on_else_node_leave]&.each { |listener| listener.on_else_node_leave(node) }
end

#visit_embedded_statements_node(node) ⇒ Object

Dispatch enter and leave events for EmbeddedStatementsNode nodes and continue walking the tree.



448
449
450
451
452
# File 'lib/prism/dispatcher.rb', line 448

def visit_embedded_statements_node(node)
  listeners[:on_embedded_statements_node_enter]&.each { |listener| listener.on_embedded_statements_node_enter(node) }
  super
  listeners[:on_embedded_statements_node_leave]&.each { |listener| listener.on_embedded_statements_node_leave(node) }
end

#visit_embedded_variable_node(node) ⇒ Object

Dispatch enter and leave events for EmbeddedVariableNode nodes and continue walking the tree.



456
457
458
459
460
# File 'lib/prism/dispatcher.rb', line 456

def visit_embedded_variable_node(node)
  listeners[:on_embedded_variable_node_enter]&.each { |listener| listener.on_embedded_variable_node_enter(node) }
  super
  listeners[:on_embedded_variable_node_leave]&.each { |listener| listener.on_embedded_variable_node_leave(node) }
end

#visit_ensure_node(node) ⇒ Object

Dispatch enter and leave events for EnsureNode nodes and continue walking the tree.



464
465
466
467
468
# File 'lib/prism/dispatcher.rb', line 464

def visit_ensure_node(node)
  listeners[:on_ensure_node_enter]&.each { |listener| listener.on_ensure_node_enter(node) }
  super
  listeners[:on_ensure_node_leave]&.each { |listener| listener.on_ensure_node_leave(node) }
end

#visit_false_node(node) ⇒ Object

Dispatch enter and leave events for FalseNode nodes and continue walking the tree.



472
473
474
475
476
# File 'lib/prism/dispatcher.rb', line 472

def visit_false_node(node)
  listeners[:on_false_node_enter]&.each { |listener| listener.on_false_node_enter(node) }
  super
  listeners[:on_false_node_leave]&.each { |listener| listener.on_false_node_leave(node) }
end

#visit_find_pattern_node(node) ⇒ Object

Dispatch enter and leave events for FindPatternNode nodes and continue walking the tree.



480
481
482
483
484
# File 'lib/prism/dispatcher.rb', line 480

def visit_find_pattern_node(node)
  listeners[:on_find_pattern_node_enter]&.each { |listener| listener.on_find_pattern_node_enter(node) }
  super
  listeners[:on_find_pattern_node_leave]&.each { |listener| listener.on_find_pattern_node_leave(node) }
end

#visit_flip_flop_node(node) ⇒ Object

Dispatch enter and leave events for FlipFlopNode nodes and continue walking the tree.



488
489
490
491
492
# File 'lib/prism/dispatcher.rb', line 488

def visit_flip_flop_node(node)
  listeners[:on_flip_flop_node_enter]&.each { |listener| listener.on_flip_flop_node_enter(node) }
  super
  listeners[:on_flip_flop_node_leave]&.each { |listener| listener.on_flip_flop_node_leave(node) }
end

#visit_float_node(node) ⇒ Object

Dispatch enter and leave events for FloatNode nodes and continue walking the tree.



496
497
498
499
500
# File 'lib/prism/dispatcher.rb', line 496

def visit_float_node(node)
  listeners[:on_float_node_enter]&.each { |listener| listener.on_float_node_enter(node) }
  super
  listeners[:on_float_node_leave]&.each { |listener| listener.on_float_node_leave(node) }
end

#visit_for_node(node) ⇒ Object

Dispatch enter and leave events for ForNode nodes and continue walking the tree.



504
505
506
507
508
# File 'lib/prism/dispatcher.rb', line 504

def visit_for_node(node)
  listeners[:on_for_node_enter]&.each { |listener| listener.on_for_node_enter(node) }
  super
  listeners[:on_for_node_leave]&.each { |listener| listener.on_for_node_leave(node) }
end

#visit_forwarding_arguments_node(node) ⇒ Object

Dispatch enter and leave events for ForwardingArgumentsNode nodes and continue walking the tree.



512
513
514
515
516
# File 'lib/prism/dispatcher.rb', line 512

def visit_forwarding_arguments_node(node)
  listeners[:on_forwarding_arguments_node_enter]&.each { |listener| listener.on_forwarding_arguments_node_enter(node) }
  super
  listeners[:on_forwarding_arguments_node_leave]&.each { |listener| listener.on_forwarding_arguments_node_leave(node) }
end

#visit_forwarding_parameter_node(node) ⇒ Object

Dispatch enter and leave events for ForwardingParameterNode nodes and continue walking the tree.



520
521
522
523
524
# File 'lib/prism/dispatcher.rb', line 520

def visit_forwarding_parameter_node(node)
  listeners[:on_forwarding_parameter_node_enter]&.each { |listener| listener.on_forwarding_parameter_node_enter(node) }
  super
  listeners[:on_forwarding_parameter_node_leave]&.each { |listener| listener.on_forwarding_parameter_node_leave(node) }
end

#visit_forwarding_super_node(node) ⇒ Object

Dispatch enter and leave events for ForwardingSuperNode nodes and continue walking the tree.



528
529
530
531
532
# File 'lib/prism/dispatcher.rb', line 528

def visit_forwarding_super_node(node)
  listeners[:on_forwarding_super_node_enter]&.each { |listener| listener.on_forwarding_super_node_enter(node) }
  super
  listeners[:on_forwarding_super_node_leave]&.each { |listener| listener.on_forwarding_super_node_leave(node) }
end

#visit_global_variable_and_write_node(node) ⇒ Object

Dispatch enter and leave events for GlobalVariableAndWriteNode nodes and continue walking the tree.



536
537
538
539
540
# File 'lib/prism/dispatcher.rb', line 536

def visit_global_variable_and_write_node(node)
  listeners[:on_global_variable_and_write_node_enter]&.each { |listener| listener.on_global_variable_and_write_node_enter(node) }
  super
  listeners[:on_global_variable_and_write_node_leave]&.each { |listener| listener.on_global_variable_and_write_node_leave(node) }
end

#visit_global_variable_operator_write_node(node) ⇒ Object

Dispatch enter and leave events for GlobalVariableOperatorWriteNode nodes and continue walking the tree.



544
545
546
547
548
# File 'lib/prism/dispatcher.rb', line 544

def visit_global_variable_operator_write_node(node)
  listeners[:on_global_variable_operator_write_node_enter]&.each { |listener| listener.on_global_variable_operator_write_node_enter(node) }
  super
  listeners[:on_global_variable_operator_write_node_leave]&.each { |listener| listener.on_global_variable_operator_write_node_leave(node) }
end

#visit_global_variable_or_write_node(node) ⇒ Object

Dispatch enter and leave events for GlobalVariableOrWriteNode nodes and continue walking the tree.



552
553
554
555
556
# File 'lib/prism/dispatcher.rb', line 552

def visit_global_variable_or_write_node(node)
  listeners[:on_global_variable_or_write_node_enter]&.each { |listener| listener.on_global_variable_or_write_node_enter(node) }
  super
  listeners[:on_global_variable_or_write_node_leave]&.each { |listener| listener.on_global_variable_or_write_node_leave(node) }
end

#visit_global_variable_read_node(node) ⇒ Object

Dispatch enter and leave events for GlobalVariableReadNode nodes and continue walking the tree.



560
561
562
563
564
# File 'lib/prism/dispatcher.rb', line 560

def visit_global_variable_read_node(node)
  listeners[:on_global_variable_read_node_enter]&.each { |listener| listener.on_global_variable_read_node_enter(node) }
  super
  listeners[:on_global_variable_read_node_leave]&.each { |listener| listener.on_global_variable_read_node_leave(node) }
end

#visit_global_variable_target_node(node) ⇒ Object

Dispatch enter and leave events for GlobalVariableTargetNode nodes and continue walking the tree.



568
569
570
571
572
# File 'lib/prism/dispatcher.rb', line 568

def visit_global_variable_target_node(node)
  listeners[:on_global_variable_target_node_enter]&.each { |listener| listener.on_global_variable_target_node_enter(node) }
  super
  listeners[:on_global_variable_target_node_leave]&.each { |listener| listener.on_global_variable_target_node_leave(node) }
end

#visit_global_variable_write_node(node) ⇒ Object

Dispatch enter and leave events for GlobalVariableWriteNode nodes and continue walking the tree.



576
577
578
579
580
# File 'lib/prism/dispatcher.rb', line 576

def visit_global_variable_write_node(node)
  listeners[:on_global_variable_write_node_enter]&.each { |listener| listener.on_global_variable_write_node_enter(node) }
  super
  listeners[:on_global_variable_write_node_leave]&.each { |listener| listener.on_global_variable_write_node_leave(node) }
end

#visit_hash_node(node) ⇒ Object

Dispatch enter and leave events for HashNode nodes and continue walking the tree.



584
585
586
587
588
# File 'lib/prism/dispatcher.rb', line 584

def visit_hash_node(node)
  listeners[:on_hash_node_enter]&.each { |listener| listener.on_hash_node_enter(node) }
  super
  listeners[:on_hash_node_leave]&.each { |listener| listener.on_hash_node_leave(node) }
end

#visit_hash_pattern_node(node) ⇒ Object

Dispatch enter and leave events for HashPatternNode nodes and continue walking the tree.



592
593
594
595
596
# File 'lib/prism/dispatcher.rb', line 592

def visit_hash_pattern_node(node)
  listeners[:on_hash_pattern_node_enter]&.each { |listener| listener.on_hash_pattern_node_enter(node) }
  super
  listeners[:on_hash_pattern_node_leave]&.each { |listener| listener.on_hash_pattern_node_leave(node) }
end

#visit_if_node(node) ⇒ Object

Dispatch enter and leave events for IfNode nodes and continue walking the tree.



600
601
602
603
604
# File 'lib/prism/dispatcher.rb', line 600

def visit_if_node(node)
  listeners[:on_if_node_enter]&.each { |listener| listener.on_if_node_enter(node) }
  super
  listeners[:on_if_node_leave]&.each { |listener| listener.on_if_node_leave(node) }
end

#visit_imaginary_node(node) ⇒ Object

Dispatch enter and leave events for ImaginaryNode nodes and continue walking the tree.



608
609
610
611
612
# File 'lib/prism/dispatcher.rb', line 608

def visit_imaginary_node(node)
  listeners[:on_imaginary_node_enter]&.each { |listener| listener.on_imaginary_node_enter(node) }
  super
  listeners[:on_imaginary_node_leave]&.each { |listener| listener.on_imaginary_node_leave(node) }
end

#visit_implicit_node(node) ⇒ Object

Dispatch enter and leave events for ImplicitNode nodes and continue walking the tree.



616
617
618
619
620
# File 'lib/prism/dispatcher.rb', line 616

def visit_implicit_node(node)
  listeners[:on_implicit_node_enter]&.each { |listener| listener.on_implicit_node_enter(node) }
  super
  listeners[:on_implicit_node_leave]&.each { |listener| listener.on_implicit_node_leave(node) }
end

#visit_implicit_rest_node(node) ⇒ Object

Dispatch enter and leave events for ImplicitRestNode nodes and continue walking the tree.



624
625
626
627
628
# File 'lib/prism/dispatcher.rb', line 624

def visit_implicit_rest_node(node)
  listeners[:on_implicit_rest_node_enter]&.each { |listener| listener.on_implicit_rest_node_enter(node) }
  super
  listeners[:on_implicit_rest_node_leave]&.each { |listener| listener.on_implicit_rest_node_leave(node) }
end

#visit_in_node(node) ⇒ Object

Dispatch enter and leave events for InNode nodes and continue walking the tree.



632
633
634
635
636
# File 'lib/prism/dispatcher.rb', line 632

def visit_in_node(node)
  listeners[:on_in_node_enter]&.each { |listener| listener.on_in_node_enter(node) }
  super
  listeners[:on_in_node_leave]&.each { |listener| listener.on_in_node_leave(node) }
end

#visit_index_and_write_node(node) ⇒ Object

Dispatch enter and leave events for IndexAndWriteNode nodes and continue walking the tree.



640
641
642
643
644
# File 'lib/prism/dispatcher.rb', line 640

def visit_index_and_write_node(node)
  listeners[:on_index_and_write_node_enter]&.each { |listener| listener.on_index_and_write_node_enter(node) }
  super
  listeners[:on_index_and_write_node_leave]&.each { |listener| listener.on_index_and_write_node_leave(node) }
end

#visit_index_operator_write_node(node) ⇒ Object

Dispatch enter and leave events for IndexOperatorWriteNode nodes and continue walking the tree.



648
649
650
651
652
# File 'lib/prism/dispatcher.rb', line 648

def visit_index_operator_write_node(node)
  listeners[:on_index_operator_write_node_enter]&.each { |listener| listener.on_index_operator_write_node_enter(node) }
  super
  listeners[:on_index_operator_write_node_leave]&.each { |listener| listener.on_index_operator_write_node_leave(node) }
end

#visit_index_or_write_node(node) ⇒ Object

Dispatch enter and leave events for IndexOrWriteNode nodes and continue walking the tree.



656
657
658
659
660
# File 'lib/prism/dispatcher.rb', line 656

def visit_index_or_write_node(node)
  listeners[:on_index_or_write_node_enter]&.each { |listener| listener.on_index_or_write_node_enter(node) }
  super
  listeners[:on_index_or_write_node_leave]&.each { |listener| listener.on_index_or_write_node_leave(node) }
end

#visit_index_target_node(node) ⇒ Object

Dispatch enter and leave events for IndexTargetNode nodes and continue walking the tree.



664
665
666
667
668
# File 'lib/prism/dispatcher.rb', line 664

def visit_index_target_node(node)
  listeners[:on_index_target_node_enter]&.each { |listener| listener.on_index_target_node_enter(node) }
  super
  listeners[:on_index_target_node_leave]&.each { |listener| listener.on_index_target_node_leave(node) }
end

#visit_instance_variable_and_write_node(node) ⇒ Object

Dispatch enter and leave events for InstanceVariableAndWriteNode nodes and continue walking the tree.



672
673
674
675
676
# File 'lib/prism/dispatcher.rb', line 672

def visit_instance_variable_and_write_node(node)
  listeners[:on_instance_variable_and_write_node_enter]&.each { |listener| listener.on_instance_variable_and_write_node_enter(node) }
  super
  listeners[:on_instance_variable_and_write_node_leave]&.each { |listener| listener.on_instance_variable_and_write_node_leave(node) }
end

#visit_instance_variable_operator_write_node(node) ⇒ Object

Dispatch enter and leave events for InstanceVariableOperatorWriteNode nodes and continue walking the tree.



680
681
682
683
684
# File 'lib/prism/dispatcher.rb', line 680

def visit_instance_variable_operator_write_node(node)
  listeners[:on_instance_variable_operator_write_node_enter]&.each { |listener| listener.on_instance_variable_operator_write_node_enter(node) }
  super
  listeners[:on_instance_variable_operator_write_node_leave]&.each { |listener| listener.on_instance_variable_operator_write_node_leave(node) }
end

#visit_instance_variable_or_write_node(node) ⇒ Object

Dispatch enter and leave events for InstanceVariableOrWriteNode nodes and continue walking the tree.



688
689
690
691
692
# File 'lib/prism/dispatcher.rb', line 688

def visit_instance_variable_or_write_node(node)
  listeners[:on_instance_variable_or_write_node_enter]&.each { |listener| listener.on_instance_variable_or_write_node_enter(node) }
  super
  listeners[:on_instance_variable_or_write_node_leave]&.each { |listener| listener.on_instance_variable_or_write_node_leave(node) }
end

#visit_instance_variable_read_node(node) ⇒ Object

Dispatch enter and leave events for InstanceVariableReadNode nodes and continue walking the tree.



696
697
698
699
700
# File 'lib/prism/dispatcher.rb', line 696

def visit_instance_variable_read_node(node)
  listeners[:on_instance_variable_read_node_enter]&.each { |listener| listener.on_instance_variable_read_node_enter(node) }
  super
  listeners[:on_instance_variable_read_node_leave]&.each { |listener| listener.on_instance_variable_read_node_leave(node) }
end

#visit_instance_variable_target_node(node) ⇒ Object

Dispatch enter and leave events for InstanceVariableTargetNode nodes and continue walking the tree.



704
705
706
707
708
# File 'lib/prism/dispatcher.rb', line 704

def visit_instance_variable_target_node(node)
  listeners[:on_instance_variable_target_node_enter]&.each { |listener| listener.on_instance_variable_target_node_enter(node) }
  super
  listeners[:on_instance_variable_target_node_leave]&.each { |listener| listener.on_instance_variable_target_node_leave(node) }
end

#visit_instance_variable_write_node(node) ⇒ Object

Dispatch enter and leave events for InstanceVariableWriteNode nodes and continue walking the tree.



712
713
714
715
716
# File 'lib/prism/dispatcher.rb', line 712

def visit_instance_variable_write_node(node)
  listeners[:on_instance_variable_write_node_enter]&.each { |listener| listener.on_instance_variable_write_node_enter(node) }
  super
  listeners[:on_instance_variable_write_node_leave]&.each { |listener| listener.on_instance_variable_write_node_leave(node) }
end

#visit_integer_node(node) ⇒ Object

Dispatch enter and leave events for IntegerNode nodes and continue walking the tree.



720
721
722
723
724
# File 'lib/prism/dispatcher.rb', line 720

def visit_integer_node(node)
  listeners[:on_integer_node_enter]&.each { |listener| listener.on_integer_node_enter(node) }
  super
  listeners[:on_integer_node_leave]&.each { |listener| listener.on_integer_node_leave(node) }
end

#visit_interpolated_match_last_line_node(node) ⇒ Object

Dispatch enter and leave events for InterpolatedMatchLastLineNode nodes and continue walking the tree.



728
729
730
731
732
# File 'lib/prism/dispatcher.rb', line 728

def visit_interpolated_match_last_line_node(node)
  listeners[:on_interpolated_match_last_line_node_enter]&.each { |listener| listener.on_interpolated_match_last_line_node_enter(node) }
  super
  listeners[:on_interpolated_match_last_line_node_leave]&.each { |listener| listener.on_interpolated_match_last_line_node_leave(node) }
end

#visit_interpolated_regular_expression_node(node) ⇒ Object

Dispatch enter and leave events for InterpolatedRegularExpressionNode nodes and continue walking the tree.



736
737
738
739
740
# File 'lib/prism/dispatcher.rb', line 736

def visit_interpolated_regular_expression_node(node)
  listeners[:on_interpolated_regular_expression_node_enter]&.each { |listener| listener.on_interpolated_regular_expression_node_enter(node) }
  super
  listeners[:on_interpolated_regular_expression_node_leave]&.each { |listener| listener.on_interpolated_regular_expression_node_leave(node) }
end

#visit_interpolated_string_node(node) ⇒ Object

Dispatch enter and leave events for InterpolatedStringNode nodes and continue walking the tree.



744
745
746
747
748
# File 'lib/prism/dispatcher.rb', line 744

def visit_interpolated_string_node(node)
  listeners[:on_interpolated_string_node_enter]&.each { |listener| listener.on_interpolated_string_node_enter(node) }
  super
  listeners[:on_interpolated_string_node_leave]&.each { |listener| listener.on_interpolated_string_node_leave(node) }
end

#visit_interpolated_symbol_node(node) ⇒ Object

Dispatch enter and leave events for InterpolatedSymbolNode nodes and continue walking the tree.



752
753
754
755
756
# File 'lib/prism/dispatcher.rb', line 752

def visit_interpolated_symbol_node(node)
  listeners[:on_interpolated_symbol_node_enter]&.each { |listener| listener.on_interpolated_symbol_node_enter(node) }
  super
  listeners[:on_interpolated_symbol_node_leave]&.each { |listener| listener.on_interpolated_symbol_node_leave(node) }
end

#visit_interpolated_x_string_node(node) ⇒ Object

Dispatch enter and leave events for InterpolatedXStringNode nodes and continue walking the tree.



760
761
762
763
764
# File 'lib/prism/dispatcher.rb', line 760

def visit_interpolated_x_string_node(node)
  listeners[:on_interpolated_x_string_node_enter]&.each { |listener| listener.on_interpolated_x_string_node_enter(node) }
  super
  listeners[:on_interpolated_x_string_node_leave]&.each { |listener| listener.on_interpolated_x_string_node_leave(node) }
end

#visit_it_local_variable_read_node(node) ⇒ Object

Dispatch enter and leave events for ItLocalVariableReadNode nodes and continue walking the tree.



768
769
770
771
772
# File 'lib/prism/dispatcher.rb', line 768

def visit_it_local_variable_read_node(node)
  listeners[:on_it_local_variable_read_node_enter]&.each { |listener| listener.on_it_local_variable_read_node_enter(node) }
  super
  listeners[:on_it_local_variable_read_node_leave]&.each { |listener| listener.on_it_local_variable_read_node_leave(node) }
end

#visit_it_parameters_node(node) ⇒ Object

Dispatch enter and leave events for ItParametersNode nodes and continue walking the tree.



776
777
778
779
780
# File 'lib/prism/dispatcher.rb', line 776

def visit_it_parameters_node(node)
  listeners[:on_it_parameters_node_enter]&.each { |listener| listener.on_it_parameters_node_enter(node) }
  super
  listeners[:on_it_parameters_node_leave]&.each { |listener| listener.on_it_parameters_node_leave(node) }
end

#visit_keyword_hash_node(node) ⇒ Object

Dispatch enter and leave events for KeywordHashNode nodes and continue walking the tree.



784
785
786
787
788
# File 'lib/prism/dispatcher.rb', line 784

def visit_keyword_hash_node(node)
  listeners[:on_keyword_hash_node_enter]&.each { |listener| listener.on_keyword_hash_node_enter(node) }
  super
  listeners[:on_keyword_hash_node_leave]&.each { |listener| listener.on_keyword_hash_node_leave(node) }
end

#visit_keyword_rest_parameter_node(node) ⇒ Object

Dispatch enter and leave events for KeywordRestParameterNode nodes and continue walking the tree.



792
793
794
795
796
# File 'lib/prism/dispatcher.rb', line 792

def visit_keyword_rest_parameter_node(node)
  listeners[:on_keyword_rest_parameter_node_enter]&.each { |listener| listener.on_keyword_rest_parameter_node_enter(node) }
  super
  listeners[:on_keyword_rest_parameter_node_leave]&.each { |listener| listener.on_keyword_rest_parameter_node_leave(node) }
end

#visit_lambda_node(node) ⇒ Object

Dispatch enter and leave events for LambdaNode nodes and continue walking the tree.



800
801
802
803
804
# File 'lib/prism/dispatcher.rb', line 800

def visit_lambda_node(node)
  listeners[:on_lambda_node_enter]&.each { |listener| listener.on_lambda_node_enter(node) }
  super
  listeners[:on_lambda_node_leave]&.each { |listener| listener.on_lambda_node_leave(node) }
end

#visit_local_variable_and_write_node(node) ⇒ Object

Dispatch enter and leave events for LocalVariableAndWriteNode nodes and continue walking the tree.



808
809
810
811
812
# File 'lib/prism/dispatcher.rb', line 808

def visit_local_variable_and_write_node(node)
  listeners[:on_local_variable_and_write_node_enter]&.each { |listener| listener.on_local_variable_and_write_node_enter(node) }
  super
  listeners[:on_local_variable_and_write_node_leave]&.each { |listener| listener.on_local_variable_and_write_node_leave(node) }
end

#visit_local_variable_operator_write_node(node) ⇒ Object

Dispatch enter and leave events for LocalVariableOperatorWriteNode nodes and continue walking the tree.



816
817
818
819
820
# File 'lib/prism/dispatcher.rb', line 816

def visit_local_variable_operator_write_node(node)
  listeners[:on_local_variable_operator_write_node_enter]&.each { |listener| listener.on_local_variable_operator_write_node_enter(node) }
  super
  listeners[:on_local_variable_operator_write_node_leave]&.each { |listener| listener.on_local_variable_operator_write_node_leave(node) }
end

#visit_local_variable_or_write_node(node) ⇒ Object

Dispatch enter and leave events for LocalVariableOrWriteNode nodes and continue walking the tree.



824
825
826
827
828
# File 'lib/prism/dispatcher.rb', line 824

def visit_local_variable_or_write_node(node)
  listeners[:on_local_variable_or_write_node_enter]&.each { |listener| listener.on_local_variable_or_write_node_enter(node) }
  super
  listeners[:on_local_variable_or_write_node_leave]&.each { |listener| listener.on_local_variable_or_write_node_leave(node) }
end

#visit_local_variable_read_node(node) ⇒ Object

Dispatch enter and leave events for LocalVariableReadNode nodes and continue walking the tree.



832
833
834
835
836
# File 'lib/prism/dispatcher.rb', line 832

def visit_local_variable_read_node(node)
  listeners[:on_local_variable_read_node_enter]&.each { |listener| listener.on_local_variable_read_node_enter(node) }
  super
  listeners[:on_local_variable_read_node_leave]&.each { |listener| listener.on_local_variable_read_node_leave(node) }
end

#visit_local_variable_target_node(node) ⇒ Object

Dispatch enter and leave events for LocalVariableTargetNode nodes and continue walking the tree.



840
841
842
843
844
# File 'lib/prism/dispatcher.rb', line 840

def visit_local_variable_target_node(node)
  listeners[:on_local_variable_target_node_enter]&.each { |listener| listener.on_local_variable_target_node_enter(node) }
  super
  listeners[:on_local_variable_target_node_leave]&.each { |listener| listener.on_local_variable_target_node_leave(node) }
end

#visit_local_variable_write_node(node) ⇒ Object

Dispatch enter and leave events for LocalVariableWriteNode nodes and continue walking the tree.



848
849
850
851
852
# File 'lib/prism/dispatcher.rb', line 848

def visit_local_variable_write_node(node)
  listeners[:on_local_variable_write_node_enter]&.each { |listener| listener.on_local_variable_write_node_enter(node) }
  super
  listeners[:on_local_variable_write_node_leave]&.each { |listener| listener.on_local_variable_write_node_leave(node) }
end

#visit_match_last_line_node(node) ⇒ Object

Dispatch enter and leave events for MatchLastLineNode nodes and continue walking the tree.



856
857
858
859
860
# File 'lib/prism/dispatcher.rb', line 856

def visit_match_last_line_node(node)
  listeners[:on_match_last_line_node_enter]&.each { |listener| listener.on_match_last_line_node_enter(node) }
  super
  listeners[:on_match_last_line_node_leave]&.each { |listener| listener.on_match_last_line_node_leave(node) }
end

#visit_match_predicate_node(node) ⇒ Object

Dispatch enter and leave events for MatchPredicateNode nodes and continue walking the tree.



864
865
866
867
868
# File 'lib/prism/dispatcher.rb', line 864

def visit_match_predicate_node(node)
  listeners[:on_match_predicate_node_enter]&.each { |listener| listener.on_match_predicate_node_enter(node) }
  super
  listeners[:on_match_predicate_node_leave]&.each { |listener| listener.on_match_predicate_node_leave(node) }
end

#visit_match_required_node(node) ⇒ Object

Dispatch enter and leave events for MatchRequiredNode nodes and continue walking the tree.



872
873
874
875
876
# File 'lib/prism/dispatcher.rb', line 872

def visit_match_required_node(node)
  listeners[:on_match_required_node_enter]&.each { |listener| listener.on_match_required_node_enter(node) }
  super
  listeners[:on_match_required_node_leave]&.each { |listener| listener.on_match_required_node_leave(node) }
end

#visit_match_write_node(node) ⇒ Object

Dispatch enter and leave events for MatchWriteNode nodes and continue walking the tree.



880
881
882
883
884
# File 'lib/prism/dispatcher.rb', line 880

def visit_match_write_node(node)
  listeners[:on_match_write_node_enter]&.each { |listener| listener.on_match_write_node_enter(node) }
  super
  listeners[:on_match_write_node_leave]&.each { |listener| listener.on_match_write_node_leave(node) }
end

#visit_missing_node(node) ⇒ Object

Dispatch enter and leave events for MissingNode nodes and continue walking the tree.



888
889
890
891
892
# File 'lib/prism/dispatcher.rb', line 888

def visit_missing_node(node)
  listeners[:on_missing_node_enter]&.each { |listener| listener.on_missing_node_enter(node) }
  super
  listeners[:on_missing_node_leave]&.each { |listener| listener.on_missing_node_leave(node) }
end

#visit_module_node(node) ⇒ Object

Dispatch enter and leave events for ModuleNode nodes and continue walking the tree.



896
897
898
899
900
# File 'lib/prism/dispatcher.rb', line 896

def visit_module_node(node)
  listeners[:on_module_node_enter]&.each { |listener| listener.on_module_node_enter(node) }
  super
  listeners[:on_module_node_leave]&.each { |listener| listener.on_module_node_leave(node) }
end

#visit_multi_target_node(node) ⇒ Object

Dispatch enter and leave events for MultiTargetNode nodes and continue walking the tree.



904
905
906
907
908
# File 'lib/prism/dispatcher.rb', line 904

def visit_multi_target_node(node)
  listeners[:on_multi_target_node_enter]&.each { |listener| listener.on_multi_target_node_enter(node) }
  super
  listeners[:on_multi_target_node_leave]&.each { |listener| listener.on_multi_target_node_leave(node) }
end

#visit_multi_write_node(node) ⇒ Object

Dispatch enter and leave events for MultiWriteNode nodes and continue walking the tree.



912
913
914
915
916
# File 'lib/prism/dispatcher.rb', line 912

def visit_multi_write_node(node)
  listeners[:on_multi_write_node_enter]&.each { |listener| listener.on_multi_write_node_enter(node) }
  super
  listeners[:on_multi_write_node_leave]&.each { |listener| listener.on_multi_write_node_leave(node) }
end

#visit_next_node(node) ⇒ Object

Dispatch enter and leave events for NextNode nodes and continue walking the tree.



920
921
922
923
924
# File 'lib/prism/dispatcher.rb', line 920

def visit_next_node(node)
  listeners[:on_next_node_enter]&.each { |listener| listener.on_next_node_enter(node) }
  super
  listeners[:on_next_node_leave]&.each { |listener| listener.on_next_node_leave(node) }
end

#visit_nil_node(node) ⇒ Object

Dispatch enter and leave events for NilNode nodes and continue walking the tree.



928
929
930
931
932
# File 'lib/prism/dispatcher.rb', line 928

def visit_nil_node(node)
  listeners[:on_nil_node_enter]&.each { |listener| listener.on_nil_node_enter(node) }
  super
  listeners[:on_nil_node_leave]&.each { |listener| listener.on_nil_node_leave(node) }
end

#visit_no_keywords_parameter_node(node) ⇒ Object

Dispatch enter and leave events for NoKeywordsParameterNode nodes and continue walking the tree.



936
937
938
939
940
# File 'lib/prism/dispatcher.rb', line 936

def visit_no_keywords_parameter_node(node)
  listeners[:on_no_keywords_parameter_node_enter]&.each { |listener| listener.on_no_keywords_parameter_node_enter(node) }
  super
  listeners[:on_no_keywords_parameter_node_leave]&.each { |listener| listener.on_no_keywords_parameter_node_leave(node) }
end

#visit_numbered_parameters_node(node) ⇒ Object

Dispatch enter and leave events for NumberedParametersNode nodes and continue walking the tree.



944
945
946
947
948
# File 'lib/prism/dispatcher.rb', line 944

def visit_numbered_parameters_node(node)
  listeners[:on_numbered_parameters_node_enter]&.each { |listener| listener.on_numbered_parameters_node_enter(node) }
  super
  listeners[:on_numbered_parameters_node_leave]&.each { |listener| listener.on_numbered_parameters_node_leave(node) }
end

#visit_numbered_reference_read_node(node) ⇒ Object

Dispatch enter and leave events for NumberedReferenceReadNode nodes and continue walking the tree.



952
953
954
955
956
# File 'lib/prism/dispatcher.rb', line 952

def visit_numbered_reference_read_node(node)
  listeners[:on_numbered_reference_read_node_enter]&.each { |listener| listener.on_numbered_reference_read_node_enter(node) }
  super
  listeners[:on_numbered_reference_read_node_leave]&.each { |listener| listener.on_numbered_reference_read_node_leave(node) }
end

#visit_optional_keyword_parameter_node(node) ⇒ Object

Dispatch enter and leave events for OptionalKeywordParameterNode nodes and continue walking the tree.



960
961
962
963
964
# File 'lib/prism/dispatcher.rb', line 960

def visit_optional_keyword_parameter_node(node)
  listeners[:on_optional_keyword_parameter_node_enter]&.each { |listener| listener.on_optional_keyword_parameter_node_enter(node) }
  super
  listeners[:on_optional_keyword_parameter_node_leave]&.each { |listener| listener.on_optional_keyword_parameter_node_leave(node) }
end

#visit_optional_parameter_node(node) ⇒ Object

Dispatch enter and leave events for OptionalParameterNode nodes and continue walking the tree.



968
969
970
971
972
# File 'lib/prism/dispatcher.rb', line 968

def visit_optional_parameter_node(node)
  listeners[:on_optional_parameter_node_enter]&.each { |listener| listener.on_optional_parameter_node_enter(node) }
  super
  listeners[:on_optional_parameter_node_leave]&.each { |listener| listener.on_optional_parameter_node_leave(node) }
end

#visit_or_node(node) ⇒ Object

Dispatch enter and leave events for OrNode nodes and continue walking the tree.



976
977
978
979
980
# File 'lib/prism/dispatcher.rb', line 976

def visit_or_node(node)
  listeners[:on_or_node_enter]&.each { |listener| listener.on_or_node_enter(node) }
  super
  listeners[:on_or_node_leave]&.each { |listener| listener.on_or_node_leave(node) }
end

#visit_parameters_node(node) ⇒ Object

Dispatch enter and leave events for ParametersNode nodes and continue walking the tree.



984
985
986
987
988
# File 'lib/prism/dispatcher.rb', line 984

def visit_parameters_node(node)
  listeners[:on_parameters_node_enter]&.each { |listener| listener.on_parameters_node_enter(node) }
  super
  listeners[:on_parameters_node_leave]&.each { |listener| listener.on_parameters_node_leave(node) }
end

#visit_parentheses_node(node) ⇒ Object

Dispatch enter and leave events for ParenthesesNode nodes and continue walking the tree.



992
993
994
995
996
# File 'lib/prism/dispatcher.rb', line 992

def visit_parentheses_node(node)
  listeners[:on_parentheses_node_enter]&.each { |listener| listener.on_parentheses_node_enter(node) }
  super
  listeners[:on_parentheses_node_leave]&.each { |listener| listener.on_parentheses_node_leave(node) }
end

#visit_pinned_expression_node(node) ⇒ Object

Dispatch enter and leave events for PinnedExpressionNode nodes and continue walking the tree.



1000
1001
1002
1003
1004
# File 'lib/prism/dispatcher.rb', line 1000

def visit_pinned_expression_node(node)
  listeners[:on_pinned_expression_node_enter]&.each { |listener| listener.on_pinned_expression_node_enter(node) }
  super
  listeners[:on_pinned_expression_node_leave]&.each { |listener| listener.on_pinned_expression_node_leave(node) }
end

#visit_pinned_variable_node(node) ⇒ Object

Dispatch enter and leave events for PinnedVariableNode nodes and continue walking the tree.



1008
1009
1010
1011
1012
# File 'lib/prism/dispatcher.rb', line 1008

def visit_pinned_variable_node(node)
  listeners[:on_pinned_variable_node_enter]&.each { |listener| listener.on_pinned_variable_node_enter(node) }
  super
  listeners[:on_pinned_variable_node_leave]&.each { |listener| listener.on_pinned_variable_node_leave(node) }
end

#visit_post_execution_node(node) ⇒ Object

Dispatch enter and leave events for PostExecutionNode nodes and continue walking the tree.



1016
1017
1018
1019
1020
# File 'lib/prism/dispatcher.rb', line 1016

def visit_post_execution_node(node)
  listeners[:on_post_execution_node_enter]&.each { |listener| listener.on_post_execution_node_enter(node) }
  super
  listeners[:on_post_execution_node_leave]&.each { |listener| listener.on_post_execution_node_leave(node) }
end

#visit_pre_execution_node(node) ⇒ Object

Dispatch enter and leave events for PreExecutionNode nodes and continue walking the tree.



1024
1025
1026
1027
1028
# File 'lib/prism/dispatcher.rb', line 1024

def visit_pre_execution_node(node)
  listeners[:on_pre_execution_node_enter]&.each { |listener| listener.on_pre_execution_node_enter(node) }
  super
  listeners[:on_pre_execution_node_leave]&.each { |listener| listener.on_pre_execution_node_leave(node) }
end

#visit_program_node(node) ⇒ Object

Dispatch enter and leave events for ProgramNode nodes and continue walking the tree.



1032
1033
1034
1035
1036
# File 'lib/prism/dispatcher.rb', line 1032

def visit_program_node(node)
  listeners[:on_program_node_enter]&.each { |listener| listener.on_program_node_enter(node) }
  super
  listeners[:on_program_node_leave]&.each { |listener| listener.on_program_node_leave(node) }
end

#visit_range_node(node) ⇒ Object

Dispatch enter and leave events for RangeNode nodes and continue walking the tree.



1040
1041
1042
1043
1044
# File 'lib/prism/dispatcher.rb', line 1040

def visit_range_node(node)
  listeners[:on_range_node_enter]&.each { |listener| listener.on_range_node_enter(node) }
  super
  listeners[:on_range_node_leave]&.each { |listener| listener.on_range_node_leave(node) }
end

#visit_rational_node(node) ⇒ Object

Dispatch enter and leave events for RationalNode nodes and continue walking the tree.



1048
1049
1050
1051
1052
# File 'lib/prism/dispatcher.rb', line 1048

def visit_rational_node(node)
  listeners[:on_rational_node_enter]&.each { |listener| listener.on_rational_node_enter(node) }
  super
  listeners[:on_rational_node_leave]&.each { |listener| listener.on_rational_node_leave(node) }
end

#visit_redo_node(node) ⇒ Object

Dispatch enter and leave events for RedoNode nodes and continue walking the tree.



1056
1057
1058
1059
1060
# File 'lib/prism/dispatcher.rb', line 1056

def visit_redo_node(node)
  listeners[:on_redo_node_enter]&.each { |listener| listener.on_redo_node_enter(node) }
  super
  listeners[:on_redo_node_leave]&.each { |listener| listener.on_redo_node_leave(node) }
end

#visit_regular_expression_node(node) ⇒ Object

Dispatch enter and leave events for RegularExpressionNode nodes and continue walking the tree.



1064
1065
1066
1067
1068
# File 'lib/prism/dispatcher.rb', line 1064

def visit_regular_expression_node(node)
  listeners[:on_regular_expression_node_enter]&.each { |listener| listener.on_regular_expression_node_enter(node) }
  super
  listeners[:on_regular_expression_node_leave]&.each { |listener| listener.on_regular_expression_node_leave(node) }
end

#visit_required_keyword_parameter_node(node) ⇒ Object

Dispatch enter and leave events for RequiredKeywordParameterNode nodes and continue walking the tree.



1072
1073
1074
1075
1076
# File 'lib/prism/dispatcher.rb', line 1072

def visit_required_keyword_parameter_node(node)
  listeners[:on_required_keyword_parameter_node_enter]&.each { |listener| listener.on_required_keyword_parameter_node_enter(node) }
  super
  listeners[:on_required_keyword_parameter_node_leave]&.each { |listener| listener.on_required_keyword_parameter_node_leave(node) }
end

#visit_required_parameter_node(node) ⇒ Object

Dispatch enter and leave events for RequiredParameterNode nodes and continue walking the tree.



1080
1081
1082
1083
1084
# File 'lib/prism/dispatcher.rb', line 1080

def visit_required_parameter_node(node)
  listeners[:on_required_parameter_node_enter]&.each { |listener| listener.on_required_parameter_node_enter(node) }
  super
  listeners[:on_required_parameter_node_leave]&.each { |listener| listener.on_required_parameter_node_leave(node) }
end

#visit_rescue_modifier_node(node) ⇒ Object

Dispatch enter and leave events for RescueModifierNode nodes and continue walking the tree.



1088
1089
1090
1091
1092
# File 'lib/prism/dispatcher.rb', line 1088

def visit_rescue_modifier_node(node)
  listeners[:on_rescue_modifier_node_enter]&.each { |listener| listener.on_rescue_modifier_node_enter(node) }
  super
  listeners[:on_rescue_modifier_node_leave]&.each { |listener| listener.on_rescue_modifier_node_leave(node) }
end

#visit_rescue_node(node) ⇒ Object

Dispatch enter and leave events for RescueNode nodes and continue walking the tree.



1096
1097
1098
1099
1100
# File 'lib/prism/dispatcher.rb', line 1096

def visit_rescue_node(node)
  listeners[:on_rescue_node_enter]&.each { |listener| listener.on_rescue_node_enter(node) }
  super
  listeners[:on_rescue_node_leave]&.each { |listener| listener.on_rescue_node_leave(node) }
end

#visit_rest_parameter_node(node) ⇒ Object

Dispatch enter and leave events for RestParameterNode nodes and continue walking the tree.



1104
1105
1106
1107
1108
# File 'lib/prism/dispatcher.rb', line 1104

def visit_rest_parameter_node(node)
  listeners[:on_rest_parameter_node_enter]&.each { |listener| listener.on_rest_parameter_node_enter(node) }
  super
  listeners[:on_rest_parameter_node_leave]&.each { |listener| listener.on_rest_parameter_node_leave(node) }
end

#visit_retry_node(node) ⇒ Object

Dispatch enter and leave events for RetryNode nodes and continue walking the tree.



1112
1113
1114
1115
1116
# File 'lib/prism/dispatcher.rb', line 1112

def visit_retry_node(node)
  listeners[:on_retry_node_enter]&.each { |listener| listener.on_retry_node_enter(node) }
  super
  listeners[:on_retry_node_leave]&.each { |listener| listener.on_retry_node_leave(node) }
end

#visit_return_node(node) ⇒ Object

Dispatch enter and leave events for ReturnNode nodes and continue walking the tree.



1120
1121
1122
1123
1124
# File 'lib/prism/dispatcher.rb', line 1120

def visit_return_node(node)
  listeners[:on_return_node_enter]&.each { |listener| listener.on_return_node_enter(node) }
  super
  listeners[:on_return_node_leave]&.each { |listener| listener.on_return_node_leave(node) }
end

#visit_self_node(node) ⇒ Object

Dispatch enter and leave events for SelfNode nodes and continue walking the tree.



1128
1129
1130
1131
1132
# File 'lib/prism/dispatcher.rb', line 1128

def visit_self_node(node)
  listeners[:on_self_node_enter]&.each { |listener| listener.on_self_node_enter(node) }
  super
  listeners[:on_self_node_leave]&.each { |listener| listener.on_self_node_leave(node) }
end

#visit_shareable_constant_node(node) ⇒ Object

Dispatch enter and leave events for ShareableConstantNode nodes and continue walking the tree.



1136
1137
1138
1139
1140
# File 'lib/prism/dispatcher.rb', line 1136

def visit_shareable_constant_node(node)
  listeners[:on_shareable_constant_node_enter]&.each { |listener| listener.on_shareable_constant_node_enter(node) }
  super
  listeners[:on_shareable_constant_node_leave]&.each { |listener| listener.on_shareable_constant_node_leave(node) }
end

#visit_singleton_class_node(node) ⇒ Object

Dispatch enter and leave events for SingletonClassNode nodes and continue walking the tree.



1144
1145
1146
1147
1148
# File 'lib/prism/dispatcher.rb', line 1144

def visit_singleton_class_node(node)
  listeners[:on_singleton_class_node_enter]&.each { |listener| listener.on_singleton_class_node_enter(node) }
  super
  listeners[:on_singleton_class_node_leave]&.each { |listener| listener.on_singleton_class_node_leave(node) }
end

#visit_source_encoding_node(node) ⇒ Object

Dispatch enter and leave events for SourceEncodingNode nodes and continue walking the tree.



1152
1153
1154
1155
1156
# File 'lib/prism/dispatcher.rb', line 1152

def visit_source_encoding_node(node)
  listeners[:on_source_encoding_node_enter]&.each { |listener| listener.on_source_encoding_node_enter(node) }
  super
  listeners[:on_source_encoding_node_leave]&.each { |listener| listener.on_source_encoding_node_leave(node) }
end

#visit_source_file_node(node) ⇒ Object

Dispatch enter and leave events for SourceFileNode nodes and continue walking the tree.



1160
1161
1162
1163
1164
# File 'lib/prism/dispatcher.rb', line 1160

def visit_source_file_node(node)
  listeners[:on_source_file_node_enter]&.each { |listener| listener.on_source_file_node_enter(node) }
  super
  listeners[:on_source_file_node_leave]&.each { |listener| listener.on_source_file_node_leave(node) }
end

#visit_source_line_node(node) ⇒ Object

Dispatch enter and leave events for SourceLineNode nodes and continue walking the tree.



1168
1169
1170
1171
1172
# File 'lib/prism/dispatcher.rb', line 1168

def visit_source_line_node(node)
  listeners[:on_source_line_node_enter]&.each { |listener| listener.on_source_line_node_enter(node) }
  super
  listeners[:on_source_line_node_leave]&.each { |listener| listener.on_source_line_node_leave(node) }
end

#visit_splat_node(node) ⇒ Object

Dispatch enter and leave events for SplatNode nodes and continue walking the tree.



1176
1177
1178
1179
1180
# File 'lib/prism/dispatcher.rb', line 1176

def visit_splat_node(node)
  listeners[:on_splat_node_enter]&.each { |listener| listener.on_splat_node_enter(node) }
  super
  listeners[:on_splat_node_leave]&.each { |listener| listener.on_splat_node_leave(node) }
end

#visit_statements_node(node) ⇒ Object

Dispatch enter and leave events for StatementsNode nodes and continue walking the tree.



1184
1185
1186
1187
1188
# File 'lib/prism/dispatcher.rb', line 1184

def visit_statements_node(node)
  listeners[:on_statements_node_enter]&.each { |listener| listener.on_statements_node_enter(node) }
  super
  listeners[:on_statements_node_leave]&.each { |listener| listener.on_statements_node_leave(node) }
end

#visit_string_node(node) ⇒ Object

Dispatch enter and leave events for StringNode nodes and continue walking the tree.



1192
1193
1194
1195
1196
# File 'lib/prism/dispatcher.rb', line 1192

def visit_string_node(node)
  listeners[:on_string_node_enter]&.each { |listener| listener.on_string_node_enter(node) }
  super
  listeners[:on_string_node_leave]&.each { |listener| listener.on_string_node_leave(node) }
end

#visit_super_node(node) ⇒ Object

Dispatch enter and leave events for SuperNode nodes and continue walking the tree.



1200
1201
1202
1203
1204
# File 'lib/prism/dispatcher.rb', line 1200

def visit_super_node(node)
  listeners[:on_super_node_enter]&.each { |listener| listener.on_super_node_enter(node) }
  super
  listeners[:on_super_node_leave]&.each { |listener| listener.on_super_node_leave(node) }
end

#visit_symbol_node(node) ⇒ Object

Dispatch enter and leave events for SymbolNode nodes and continue walking the tree.



1208
1209
1210
1211
1212
# File 'lib/prism/dispatcher.rb', line 1208

def visit_symbol_node(node)
  listeners[:on_symbol_node_enter]&.each { |listener| listener.on_symbol_node_enter(node) }
  super
  listeners[:on_symbol_node_leave]&.each { |listener| listener.on_symbol_node_leave(node) }
end

#visit_true_node(node) ⇒ Object

Dispatch enter and leave events for TrueNode nodes and continue walking the tree.



1216
1217
1218
1219
1220
# File 'lib/prism/dispatcher.rb', line 1216

def visit_true_node(node)
  listeners[:on_true_node_enter]&.each { |listener| listener.on_true_node_enter(node) }
  super
  listeners[:on_true_node_leave]&.each { |listener| listener.on_true_node_leave(node) }
end

#visit_undef_node(node) ⇒ Object

Dispatch enter and leave events for UndefNode nodes and continue walking the tree.



1224
1225
1226
1227
1228
# File 'lib/prism/dispatcher.rb', line 1224

def visit_undef_node(node)
  listeners[:on_undef_node_enter]&.each { |listener| listener.on_undef_node_enter(node) }
  super
  listeners[:on_undef_node_leave]&.each { |listener| listener.on_undef_node_leave(node) }
end

#visit_unless_node(node) ⇒ Object

Dispatch enter and leave events for UnlessNode nodes and continue walking the tree.



1232
1233
1234
1235
1236
# File 'lib/prism/dispatcher.rb', line 1232

def visit_unless_node(node)
  listeners[:on_unless_node_enter]&.each { |listener| listener.on_unless_node_enter(node) }
  super
  listeners[:on_unless_node_leave]&.each { |listener| listener.on_unless_node_leave(node) }
end

#visit_until_node(node) ⇒ Object

Dispatch enter and leave events for UntilNode nodes and continue walking the tree.



1240
1241
1242
1243
1244
# File 'lib/prism/dispatcher.rb', line 1240

def visit_until_node(node)
  listeners[:on_until_node_enter]&.each { |listener| listener.on_until_node_enter(node) }
  super
  listeners[:on_until_node_leave]&.each { |listener| listener.on_until_node_leave(node) }
end

#visit_when_node(node) ⇒ Object

Dispatch enter and leave events for WhenNode nodes and continue walking the tree.



1248
1249
1250
1251
1252
# File 'lib/prism/dispatcher.rb', line 1248

def visit_when_node(node)
  listeners[:on_when_node_enter]&.each { |listener| listener.on_when_node_enter(node) }
  super
  listeners[:on_when_node_leave]&.each { |listener| listener.on_when_node_leave(node) }
end

#visit_while_node(node) ⇒ Object

Dispatch enter and leave events for WhileNode nodes and continue walking the tree.



1256
1257
1258
1259
1260
# File 'lib/prism/dispatcher.rb', line 1256

def visit_while_node(node)
  listeners[:on_while_node_enter]&.each { |listener| listener.on_while_node_enter(node) }
  super
  listeners[:on_while_node_leave]&.each { |listener| listener.on_while_node_leave(node) }
end

#visit_x_string_node(node) ⇒ Object

Dispatch enter and leave events for XStringNode nodes and continue walking the tree.



1264
1265
1266
1267
1268
# File 'lib/prism/dispatcher.rb', line 1264

def visit_x_string_node(node)
  listeners[:on_x_string_node_enter]&.each { |listener| listener.on_x_string_node_enter(node) }
  super
  listeners[:on_x_string_node_leave]&.each { |listener| listener.on_x_string_node_leave(node) }
end

#visit_yield_node(node) ⇒ Object

Dispatch enter and leave events for YieldNode nodes and continue walking the tree.



1272
1273
1274
1275
1276
# File 'lib/prism/dispatcher.rb', line 1272

def visit_yield_node(node)
  listeners[:on_yield_node_enter]&.each { |listener| listener.on_yield_node_enter(node) }
  super
  listeners[:on_yield_node_leave]&.each { |listener| listener.on_yield_node_leave(node) }
end