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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (148) hide show
  1. checksums.yaml +4 -4
  2. data/BSDmakefile +58 -0
  3. data/CHANGELOG.md +269 -1
  4. data/CONTRIBUTING.md +0 -4
  5. data/Makefile +25 -18
  6. data/README.md +57 -6
  7. data/config.yml +1724 -140
  8. data/docs/build_system.md +39 -11
  9. data/docs/configuration.md +4 -0
  10. data/docs/cruby_compilation.md +1 -1
  11. data/docs/fuzzing.md +1 -1
  12. data/docs/parser_translation.md +14 -9
  13. data/docs/parsing_rules.md +4 -1
  14. data/docs/releasing.md +8 -10
  15. data/docs/relocation.md +34 -0
  16. data/docs/ripper_translation.md +72 -0
  17. data/docs/ruby_api.md +2 -1
  18. data/docs/serialization.md +29 -5
  19. data/ext/prism/api_node.c +3395 -1999
  20. data/ext/prism/api_pack.c +9 -0
  21. data/ext/prism/extconf.rb +55 -34
  22. data/ext/prism/extension.c +597 -346
  23. data/ext/prism/extension.h +6 -5
  24. data/include/prism/ast.h +2612 -455
  25. data/include/prism/defines.h +160 -2
  26. data/include/prism/diagnostic.h +188 -76
  27. data/include/prism/encoding.h +22 -4
  28. data/include/prism/node.h +89 -17
  29. data/include/prism/options.h +224 -12
  30. data/include/prism/pack.h +11 -0
  31. data/include/prism/parser.h +267 -66
  32. data/include/prism/prettyprint.h +8 -0
  33. data/include/prism/regexp.h +18 -8
  34. data/include/prism/static_literals.h +121 -0
  35. data/include/prism/util/pm_buffer.h +75 -2
  36. data/include/prism/util/pm_char.h +1 -2
  37. data/include/prism/util/pm_constant_pool.h +18 -9
  38. data/include/prism/util/pm_integer.h +126 -0
  39. data/include/prism/util/pm_list.h +1 -1
  40. data/include/prism/util/pm_newline_list.h +19 -0
  41. data/include/prism/util/pm_string.h +48 -8
  42. data/include/prism/version.h +3 -3
  43. data/include/prism.h +99 -5
  44. data/jruby-prism.jar +0 -0
  45. data/lib/prism/compiler.rb +11 -1
  46. data/lib/prism/desugar_compiler.rb +113 -74
  47. data/lib/prism/dispatcher.rb +45 -1
  48. data/lib/prism/dot_visitor.rb +201 -77
  49. data/lib/prism/dsl.rb +673 -461
  50. data/lib/prism/ffi.rb +233 -45
  51. data/lib/prism/inspect_visitor.rb +2389 -0
  52. data/lib/prism/lex_compat.rb +35 -16
  53. data/lib/prism/mutation_compiler.rb +24 -8
  54. data/lib/prism/node.rb +7731 -8460
  55. data/lib/prism/node_ext.rb +328 -32
  56. data/lib/prism/pack.rb +4 -0
  57. data/lib/prism/parse_result/comments.rb +34 -24
  58. data/lib/prism/parse_result/errors.rb +65 -0
  59. data/lib/prism/parse_result/newlines.rb +102 -12
  60. data/lib/prism/parse_result.rb +448 -44
  61. data/lib/prism/pattern.rb +28 -10
  62. data/lib/prism/polyfill/append_as_bytes.rb +15 -0
  63. data/lib/prism/polyfill/byteindex.rb +13 -0
  64. data/lib/prism/polyfill/unpack1.rb +14 -0
  65. data/lib/prism/reflection.rb +413 -0
  66. data/lib/prism/relocation.rb +504 -0
  67. data/lib/prism/serialize.rb +1940 -1198
  68. data/lib/prism/string_query.rb +30 -0
  69. data/lib/prism/translation/parser/builder.rb +61 -0
  70. data/lib/prism/translation/parser/compiler.rb +569 -195
  71. data/lib/prism/translation/parser/lexer.rb +516 -39
  72. data/lib/prism/translation/parser.rb +177 -12
  73. data/lib/prism/translation/parser33.rb +1 -1
  74. data/lib/prism/translation/parser34.rb +1 -1
  75. data/lib/prism/translation/parser35.rb +12 -0
  76. data/lib/prism/translation/ripper/sexp.rb +125 -0
  77. data/lib/prism/translation/ripper/shim.rb +5 -0
  78. data/lib/prism/translation/ripper.rb +3224 -462
  79. data/lib/prism/translation/ruby_parser.rb +194 -69
  80. data/lib/prism/translation.rb +4 -1
  81. data/lib/prism/version.rb +1 -1
  82. data/lib/prism/visitor.rb +13 -0
  83. data/lib/prism.rb +17 -27
  84. data/prism.gemspec +57 -17
  85. data/rbi/prism/compiler.rbi +12 -0
  86. data/rbi/prism/dsl.rbi +524 -0
  87. data/rbi/prism/inspect_visitor.rbi +12 -0
  88. data/rbi/prism/node.rbi +8722 -0
  89. data/rbi/prism/node_ext.rbi +107 -0
  90. data/rbi/prism/parse_result.rbi +404 -0
  91. data/rbi/prism/reflection.rbi +58 -0
  92. data/rbi/prism/string_query.rbi +12 -0
  93. data/rbi/prism/translation/parser.rbi +11 -0
  94. data/rbi/prism/translation/parser33.rbi +6 -0
  95. data/rbi/prism/translation/parser34.rbi +6 -0
  96. data/rbi/prism/translation/parser35.rbi +6 -0
  97. data/rbi/prism/translation/ripper.rbi +15 -0
  98. data/rbi/prism/visitor.rbi +473 -0
  99. data/rbi/prism.rbi +44 -7745
  100. data/sig/prism/compiler.rbs +9 -0
  101. data/sig/prism/dispatcher.rbs +16 -0
  102. data/sig/prism/dot_visitor.rbs +6 -0
  103. data/sig/prism/dsl.rbs +351 -0
  104. data/sig/prism/inspect_visitor.rbs +22 -0
  105. data/sig/prism/lex_compat.rbs +10 -0
  106. data/sig/prism/mutation_compiler.rbs +159 -0
  107. data/sig/prism/node.rbs +3614 -0
  108. data/sig/prism/node_ext.rbs +82 -0
  109. data/sig/prism/pack.rbs +43 -0
  110. data/sig/prism/parse_result.rbs +192 -0
  111. data/sig/prism/pattern.rbs +13 -0
  112. data/sig/prism/reflection.rbs +50 -0
  113. data/sig/prism/relocation.rbs +185 -0
  114. data/sig/prism/serialize.rbs +8 -0
  115. data/sig/prism/string_query.rbs +11 -0
  116. data/sig/prism/visitor.rbs +169 -0
  117. data/sig/prism.rbs +248 -4767
  118. data/src/diagnostic.c +672 -230
  119. data/src/encoding.c +211 -108
  120. data/src/node.c +7541 -1653
  121. data/src/options.c +135 -20
  122. data/src/pack.c +33 -17
  123. data/src/prettyprint.c +1543 -1485
  124. data/src/prism.c +7813 -3050
  125. data/src/regexp.c +225 -73
  126. data/src/serialize.c +101 -77
  127. data/src/static_literals.c +617 -0
  128. data/src/token_type.c +14 -13
  129. data/src/util/pm_buffer.c +187 -20
  130. data/src/util/pm_char.c +5 -5
  131. data/src/util/pm_constant_pool.c +39 -19
  132. data/src/util/pm_integer.c +670 -0
  133. data/src/util/pm_list.c +1 -1
  134. data/src/util/pm_newline_list.c +43 -5
  135. data/src/util/pm_string.c +213 -33
  136. data/src/util/pm_strncasecmp.c +13 -1
  137. data/src/util/pm_strpbrk.c +32 -6
  138. metadata +55 -19
  139. data/docs/ripper.md +0 -36
  140. data/include/prism/util/pm_state_stack.h +0 -42
  141. data/include/prism/util/pm_string_list.h +0 -44
  142. data/lib/prism/debug.rb +0 -206
  143. data/lib/prism/node_inspector.rb +0 -68
  144. data/lib/prism/translation/parser/rubocop.rb +0 -45
  145. data/rbi/prism_static.rbi +0 -207
  146. data/sig/prism_static.rbs +0 -201
  147. data/src/util/pm_state_stack.c +0 -25
  148. data/src/util/pm_string_list.c +0 -28
@@ -2,11 +2,13 @@
2
2
 
3
3
  module Prism
4
4
  class DesugarAndWriteNode # :nodoc:
5
- attr_reader :node, :source, :read_class, :write_class, :arguments
5
+ include DSL
6
6
 
7
- def initialize(node, source, read_class, write_class, *arguments)
7
+ attr_reader :node, :default_source, :read_class, :write_class, :arguments
8
+
9
+ def initialize(node, default_source, read_class, write_class, **arguments)
8
10
  @node = node
9
- @source = source
11
+ @default_source = default_source
10
12
  @read_class = read_class
11
13
  @write_class = write_class
12
14
  @arguments = arguments
@@ -14,22 +16,30 @@ module Prism
14
16
 
15
17
  # Desugar `x &&= y` to `x && x = y`
16
18
  def compile
17
- AndNode.new(
18
- source,
19
- read_class.new(source, *arguments, node.name_loc),
20
- write_class.new(source, *arguments, node.name_loc, node.value, node.operator_loc, node.location),
21
- node.operator_loc,
22
- node.location
19
+ and_node(
20
+ location: node.location,
21
+ left: public_send(read_class, location: node.name_loc, **arguments),
22
+ right: public_send(
23
+ write_class,
24
+ location: node.location,
25
+ **arguments,
26
+ name_loc: node.name_loc,
27
+ value: node.value,
28
+ operator_loc: node.operator_loc
29
+ ),
30
+ operator_loc: node.operator_loc
23
31
  )
24
32
  end
25
33
  end
26
34
 
27
35
  class DesugarOrWriteDefinedNode # :nodoc:
28
- attr_reader :node, :source, :read_class, :write_class, :arguments
36
+ include DSL
37
+
38
+ attr_reader :node, :default_source, :read_class, :write_class, :arguments
29
39
 
30
- def initialize(node, source, read_class, write_class, *arguments)
40
+ def initialize(node, default_source, read_class, write_class, **arguments)
31
41
  @node = node
32
- @source = source
42
+ @default_source = default_source
33
43
  @read_class = read_class
34
44
  @write_class = write_class
35
45
  @arguments = arguments
@@ -37,35 +47,50 @@ module Prism
37
47
 
38
48
  # Desugar `x ||= y` to `defined?(x) ? x : x = y`
39
49
  def compile
40
- IfNode.new(
41
- source,
42
- node.operator_loc,
43
- DefinedNode.new(source, nil, read_class.new(source, *arguments, node.name_loc), nil, node.operator_loc, node.name_loc),
44
- node.operator_loc,
45
- StatementsNode.new(source, [read_class.new(source, *arguments, node.name_loc)], node.location),
46
- ElseNode.new(
47
- source,
48
- node.operator_loc,
49
- StatementsNode.new(
50
- source,
51
- [write_class.new(source, *arguments, node.name_loc, node.value, node.operator_loc, node.location)],
52
- node.location
50
+ if_node(
51
+ location: node.location,
52
+ if_keyword_loc: node.operator_loc,
53
+ predicate: defined_node(
54
+ location: node.name_loc,
55
+ value: public_send(read_class, location: node.name_loc, **arguments),
56
+ keyword_loc: node.operator_loc
57
+ ),
58
+ then_keyword_loc: node.operator_loc,
59
+ statements: statements_node(
60
+ location: node.location,
61
+ body: [public_send(read_class, location: node.name_loc, **arguments)]
62
+ ),
63
+ subsequent: else_node(
64
+ location: node.location,
65
+ else_keyword_loc: node.operator_loc,
66
+ statements: statements_node(
67
+ location: node.location,
68
+ body: [
69
+ public_send(
70
+ write_class,
71
+ location: node.location,
72
+ **arguments,
73
+ name_loc: node.name_loc,
74
+ value: node.value,
75
+ operator_loc: node.operator_loc
76
+ )
77
+ ]
53
78
  ),
54
- node.operator_loc,
55
- node.location
79
+ end_keyword_loc: node.operator_loc
56
80
  ),
57
- node.operator_loc,
58
- node.location
81
+ end_keyword_loc: node.operator_loc
59
82
  )
60
83
  end
61
84
  end
62
85
 
63
86
  class DesugarOperatorWriteNode # :nodoc:
64
- attr_reader :node, :source, :read_class, :write_class, :arguments
87
+ include DSL
65
88
 
66
- def initialize(node, source, read_class, write_class, *arguments)
89
+ attr_reader :node, :default_source, :read_class, :write_class, :arguments
90
+
91
+ def initialize(node, default_source, read_class, write_class, **arguments)
67
92
  @node = node
68
- @source = source
93
+ @default_source = default_source
69
94
  @read_class = read_class
70
95
  @write_class = write_class
71
96
  @arguments = arguments
@@ -73,35 +98,43 @@ module Prism
73
98
 
74
99
  # Desugar `x += y` to `x = x + y`
75
100
  def compile
76
- write_class.new(
77
- source,
78
- *arguments,
79
- node.name_loc,
80
- CallNode.new(
81
- source,
82
- 0,
83
- read_class.new(source, *arguments, node.name_loc),
84
- nil,
85
- node.operator_loc.slice.chomp("="),
86
- node.operator_loc.copy(length: node.operator_loc.length - 1),
87
- nil,
88
- ArgumentsNode.new(source, 0, [node.value], node.value.location),
89
- nil,
90
- nil,
91
- node.location
101
+ binary_operator_loc = node.binary_operator_loc.chop
102
+
103
+ public_send(
104
+ write_class,
105
+ location: node.location,
106
+ **arguments,
107
+ name_loc: node.name_loc,
108
+ value: call_node(
109
+ location: node.location,
110
+ receiver: public_send(
111
+ read_class,
112
+ location: node.name_loc,
113
+ **arguments
114
+ ),
115
+ name: binary_operator_loc.slice.to_sym,
116
+ message_loc: binary_operator_loc,
117
+ arguments: arguments_node(
118
+ location: node.value.location,
119
+ arguments: [node.value]
120
+ )
92
121
  ),
93
- node.operator_loc.copy(start_offset: node.operator_loc.end_offset - 1, length: 1),
94
- node.location
122
+ operator_loc: node.binary_operator_loc.copy(
123
+ start_offset: node.binary_operator_loc.end_offset - 1,
124
+ length: 1
125
+ )
95
126
  )
96
127
  end
97
128
  end
98
129
 
99
130
  class DesugarOrWriteNode # :nodoc:
100
- attr_reader :node, :source, :read_class, :write_class, :arguments
131
+ include DSL
101
132
 
102
- def initialize(node, source, read_class, write_class, *arguments)
133
+ attr_reader :node, :default_source, :read_class, :write_class, :arguments
134
+
135
+ def initialize(node, default_source, read_class, write_class, **arguments)
103
136
  @node = node
104
- @source = source
137
+ @default_source = default_source
105
138
  @read_class = read_class
106
139
  @write_class = write_class
107
140
  @arguments = arguments
@@ -109,12 +142,18 @@ module Prism
109
142
 
110
143
  # Desugar `x ||= y` to `x || x = y`
111
144
  def compile
112
- OrNode.new(
113
- source,
114
- read_class.new(source, *arguments, node.name_loc),
115
- write_class.new(source, *arguments, node.name_loc, node.value, node.operator_loc, node.location),
116
- node.operator_loc,
117
- node.location
145
+ or_node(
146
+ location: node.location,
147
+ left: public_send(read_class, location: node.name_loc, **arguments),
148
+ right: public_send(
149
+ write_class,
150
+ location: node.location,
151
+ **arguments,
152
+ name_loc: node.name_loc,
153
+ value: node.value,
154
+ operator_loc: node.operator_loc
155
+ ),
156
+ operator_loc: node.operator_loc
118
157
  )
119
158
  end
120
159
  end
@@ -123,91 +162,91 @@ module Prism
123
162
 
124
163
  class ClassVariableAndWriteNode
125
164
  def desugar # :nodoc:
126
- DesugarAndWriteNode.new(self, source, ClassVariableReadNode, ClassVariableWriteNode, name).compile
165
+ DesugarAndWriteNode.new(self, source, :class_variable_read_node, :class_variable_write_node, name: name).compile
127
166
  end
128
167
  end
129
168
 
130
169
  class ClassVariableOrWriteNode
131
170
  def desugar # :nodoc:
132
- DesugarOrWriteDefinedNode.new(self, source, ClassVariableReadNode, ClassVariableWriteNode, name).compile
171
+ DesugarOrWriteDefinedNode.new(self, source, :class_variable_read_node, :class_variable_write_node, name: name).compile
133
172
  end
134
173
  end
135
174
 
136
175
  class ClassVariableOperatorWriteNode
137
176
  def desugar # :nodoc:
138
- DesugarOperatorWriteNode.new(self, source, ClassVariableReadNode, ClassVariableWriteNode, name).compile
177
+ DesugarOperatorWriteNode.new(self, source, :class_variable_read_node, :class_variable_write_node, name: name).compile
139
178
  end
140
179
  end
141
180
 
142
181
  class ConstantAndWriteNode
143
182
  def desugar # :nodoc:
144
- DesugarAndWriteNode.new(self, source, ConstantReadNode, ConstantWriteNode, name).compile
183
+ DesugarAndWriteNode.new(self, source, :constant_read_node, :constant_write_node, name: name).compile
145
184
  end
146
185
  end
147
186
 
148
187
  class ConstantOrWriteNode
149
188
  def desugar # :nodoc:
150
- DesugarOrWriteDefinedNode.new(self, source, ConstantReadNode, ConstantWriteNode, name).compile
189
+ DesugarOrWriteDefinedNode.new(self, source, :constant_read_node, :constant_write_node, name: name).compile
151
190
  end
152
191
  end
153
192
 
154
193
  class ConstantOperatorWriteNode
155
194
  def desugar # :nodoc:
156
- DesugarOperatorWriteNode.new(self, source, ConstantReadNode, ConstantWriteNode, name).compile
195
+ DesugarOperatorWriteNode.new(self, source, :constant_read_node, :constant_write_node, name: name).compile
157
196
  end
158
197
  end
159
198
 
160
199
  class GlobalVariableAndWriteNode
161
200
  def desugar # :nodoc:
162
- DesugarAndWriteNode.new(self, source, GlobalVariableReadNode, GlobalVariableWriteNode, name).compile
201
+ DesugarAndWriteNode.new(self, source, :global_variable_read_node, :global_variable_write_node, name: name).compile
163
202
  end
164
203
  end
165
204
 
166
205
  class GlobalVariableOrWriteNode
167
206
  def desugar # :nodoc:
168
- DesugarOrWriteDefinedNode.new(self, source, GlobalVariableReadNode, GlobalVariableWriteNode, name).compile
207
+ DesugarOrWriteDefinedNode.new(self, source, :global_variable_read_node, :global_variable_write_node, name: name).compile
169
208
  end
170
209
  end
171
210
 
172
211
  class GlobalVariableOperatorWriteNode
173
212
  def desugar # :nodoc:
174
- DesugarOperatorWriteNode.new(self, source, GlobalVariableReadNode, GlobalVariableWriteNode, name).compile
213
+ DesugarOperatorWriteNode.new(self, source, :global_variable_read_node, :global_variable_write_node, name: name).compile
175
214
  end
176
215
  end
177
216
 
178
217
  class InstanceVariableAndWriteNode
179
218
  def desugar # :nodoc:
180
- DesugarAndWriteNode.new(self, source, InstanceVariableReadNode, InstanceVariableWriteNode, name).compile
219
+ DesugarAndWriteNode.new(self, source, :instance_variable_read_node, :instance_variable_write_node, name: name).compile
181
220
  end
182
221
  end
183
222
 
184
223
  class InstanceVariableOrWriteNode
185
224
  def desugar # :nodoc:
186
- DesugarOrWriteNode.new(self, source, InstanceVariableReadNode, InstanceVariableWriteNode, name).compile
225
+ DesugarOrWriteNode.new(self, source, :instance_variable_read_node, :instance_variable_write_node, name: name).compile
187
226
  end
188
227
  end
189
228
 
190
229
  class InstanceVariableOperatorWriteNode
191
230
  def desugar # :nodoc:
192
- DesugarOperatorWriteNode.new(self, source, InstanceVariableReadNode, InstanceVariableWriteNode, name).compile
231
+ DesugarOperatorWriteNode.new(self, source, :instance_variable_read_node, :instance_variable_write_node, name: name).compile
193
232
  end
194
233
  end
195
234
 
196
235
  class LocalVariableAndWriteNode
197
236
  def desugar # :nodoc:
198
- DesugarAndWriteNode.new(self, source, LocalVariableReadNode, LocalVariableWriteNode, name, depth).compile
237
+ DesugarAndWriteNode.new(self, source, :local_variable_read_node, :local_variable_write_node, name: name, depth: depth).compile
199
238
  end
200
239
  end
201
240
 
202
241
  class LocalVariableOrWriteNode
203
242
  def desugar # :nodoc:
204
- DesugarOrWriteNode.new(self, source, LocalVariableReadNode, LocalVariableWriteNode, name, depth).compile
243
+ DesugarOrWriteNode.new(self, source, :local_variable_read_node, :local_variable_write_node, name: name, depth: depth).compile
205
244
  end
206
245
  end
207
246
 
208
247
  class LocalVariableOperatorWriteNode
209
248
  def desugar # :nodoc:
210
- DesugarOperatorWriteNode.new(self, source, LocalVariableReadNode, LocalVariableWriteNode, name, depth).compile
249
+ DesugarOperatorWriteNode.new(self, source, :local_variable_read_node, :local_variable_write_node, name: name, depth: depth).compile
211
250
  end
212
251
  end
213
252
 
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  =begin
3
4
  This file is generated by the templates/template.rb script and should not be
4
5
  modified manually. See templates/lib/prism/dispatcher.rb.erb
@@ -21,7 +22,8 @@ module Prism
21
22
  # end
22
23
  # end
23
24
  #
24
- # dispatcher = Dispatcher.new
25
+ # listener = OctalListener.new
26
+ # dispatcher = Prism::Dispatcher.new
25
27
  # dispatcher.register(listener, :on_integer_node_enter)
26
28
  #
27
29
  # Then, you can walk any number of trees and dispatch events to the listeners:
@@ -761,6 +763,22 @@ module Prism
761
763
  listeners[:on_interpolated_x_string_node_leave]&.each { |listener| listener.on_interpolated_x_string_node_leave(node) }
762
764
  end
763
765
 
766
+ # Dispatch enter and leave events for ItLocalVariableReadNode nodes and continue
767
+ # walking the tree.
768
+ def visit_it_local_variable_read_node(node)
769
+ listeners[:on_it_local_variable_read_node_enter]&.each { |listener| listener.on_it_local_variable_read_node_enter(node) }
770
+ super
771
+ listeners[:on_it_local_variable_read_node_leave]&.each { |listener| listener.on_it_local_variable_read_node_leave(node) }
772
+ end
773
+
774
+ # Dispatch enter and leave events for ItParametersNode nodes and continue
775
+ # walking the tree.
776
+ def visit_it_parameters_node(node)
777
+ listeners[:on_it_parameters_node_enter]&.each { |listener| listener.on_it_parameters_node_enter(node) }
778
+ super
779
+ listeners[:on_it_parameters_node_leave]&.each { |listener| listener.on_it_parameters_node_leave(node) }
780
+ end
781
+
764
782
  # Dispatch enter and leave events for KeywordHashNode nodes and continue
765
783
  # walking the tree.
766
784
  def visit_keyword_hash_node(node)
@@ -1113,6 +1131,14 @@ module Prism
1113
1131
  listeners[:on_self_node_leave]&.each { |listener| listener.on_self_node_leave(node) }
1114
1132
  end
1115
1133
 
1134
+ # Dispatch enter and leave events for ShareableConstantNode nodes and continue
1135
+ # walking the tree.
1136
+ def visit_shareable_constant_node(node)
1137
+ listeners[:on_shareable_constant_node_enter]&.each { |listener| listener.on_shareable_constant_node_enter(node) }
1138
+ super
1139
+ listeners[:on_shareable_constant_node_leave]&.each { |listener| listener.on_shareable_constant_node_leave(node) }
1140
+ end
1141
+
1116
1142
  # Dispatch enter and leave events for SingletonClassNode nodes and continue
1117
1143
  # walking the tree.
1118
1144
  def visit_singleton_class_node(node)
@@ -1778,6 +1804,18 @@ module Prism
1778
1804
  listeners[:on_interpolated_x_string_node_leave]&.each { |listener| listener.on_interpolated_x_string_node_leave(node) }
1779
1805
  end
1780
1806
 
1807
+ # Dispatch enter and leave events for ItLocalVariableReadNode nodes.
1808
+ def visit_it_local_variable_read_node(node)
1809
+ listeners[:on_it_local_variable_read_node_enter]&.each { |listener| listener.on_it_local_variable_read_node_enter(node) }
1810
+ listeners[:on_it_local_variable_read_node_leave]&.each { |listener| listener.on_it_local_variable_read_node_leave(node) }
1811
+ end
1812
+
1813
+ # Dispatch enter and leave events for ItParametersNode nodes.
1814
+ def visit_it_parameters_node(node)
1815
+ listeners[:on_it_parameters_node_enter]&.each { |listener| listener.on_it_parameters_node_enter(node) }
1816
+ listeners[:on_it_parameters_node_leave]&.each { |listener| listener.on_it_parameters_node_leave(node) }
1817
+ end
1818
+
1781
1819
  # Dispatch enter and leave events for KeywordHashNode nodes.
1782
1820
  def visit_keyword_hash_node(node)
1783
1821
  listeners[:on_keyword_hash_node_enter]&.each { |listener| listener.on_keyword_hash_node_enter(node) }
@@ -2042,6 +2080,12 @@ module Prism
2042
2080
  listeners[:on_self_node_leave]&.each { |listener| listener.on_self_node_leave(node) }
2043
2081
  end
2044
2082
 
2083
+ # Dispatch enter and leave events for ShareableConstantNode nodes.
2084
+ def visit_shareable_constant_node(node)
2085
+ listeners[:on_shareable_constant_node_enter]&.each { |listener| listener.on_shareable_constant_node_enter(node) }
2086
+ listeners[:on_shareable_constant_node_leave]&.each { |listener| listener.on_shareable_constant_node_leave(node) }
2087
+ end
2088
+
2045
2089
  # Dispatch enter and leave events for SingletonClassNode nodes.
2046
2090
  def visit_singleton_class_node(node)
2047
2091
  listeners[:on_singleton_class_node_enter]&.each { |listener| listener.on_singleton_class_node_enter(node) }