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.
- checksums.yaml +4 -4
- data/BSDmakefile +58 -0
- data/CHANGELOG.md +269 -1
- data/CONTRIBUTING.md +0 -4
- data/Makefile +25 -18
- data/README.md +57 -6
- data/config.yml +1724 -140
- data/docs/build_system.md +39 -11
- data/docs/configuration.md +4 -0
- data/docs/cruby_compilation.md +1 -1
- data/docs/fuzzing.md +1 -1
- data/docs/parser_translation.md +14 -9
- data/docs/parsing_rules.md +4 -1
- data/docs/releasing.md +8 -10
- data/docs/relocation.md +34 -0
- data/docs/ripper_translation.md +72 -0
- data/docs/ruby_api.md +2 -1
- data/docs/serialization.md +29 -5
- data/ext/prism/api_node.c +3395 -1999
- data/ext/prism/api_pack.c +9 -0
- data/ext/prism/extconf.rb +55 -34
- data/ext/prism/extension.c +597 -346
- data/ext/prism/extension.h +6 -5
- data/include/prism/ast.h +2612 -455
- data/include/prism/defines.h +160 -2
- data/include/prism/diagnostic.h +188 -76
- data/include/prism/encoding.h +22 -4
- data/include/prism/node.h +89 -17
- data/include/prism/options.h +224 -12
- data/include/prism/pack.h +11 -0
- data/include/prism/parser.h +267 -66
- data/include/prism/prettyprint.h +8 -0
- data/include/prism/regexp.h +18 -8
- data/include/prism/static_literals.h +121 -0
- data/include/prism/util/pm_buffer.h +75 -2
- data/include/prism/util/pm_char.h +1 -2
- data/include/prism/util/pm_constant_pool.h +18 -9
- data/include/prism/util/pm_integer.h +126 -0
- data/include/prism/util/pm_list.h +1 -1
- data/include/prism/util/pm_newline_list.h +19 -0
- data/include/prism/util/pm_string.h +48 -8
- data/include/prism/version.h +3 -3
- data/include/prism.h +99 -5
- data/jruby-prism.jar +0 -0
- data/lib/prism/compiler.rb +11 -1
- data/lib/prism/desugar_compiler.rb +113 -74
- data/lib/prism/dispatcher.rb +45 -1
- data/lib/prism/dot_visitor.rb +201 -77
- data/lib/prism/dsl.rb +673 -461
- data/lib/prism/ffi.rb +233 -45
- data/lib/prism/inspect_visitor.rb +2389 -0
- data/lib/prism/lex_compat.rb +35 -16
- data/lib/prism/mutation_compiler.rb +24 -8
- data/lib/prism/node.rb +7731 -8460
- data/lib/prism/node_ext.rb +328 -32
- data/lib/prism/pack.rb +4 -0
- data/lib/prism/parse_result/comments.rb +34 -24
- data/lib/prism/parse_result/errors.rb +65 -0
- data/lib/prism/parse_result/newlines.rb +102 -12
- data/lib/prism/parse_result.rb +448 -44
- data/lib/prism/pattern.rb +28 -10
- data/lib/prism/polyfill/append_as_bytes.rb +15 -0
- data/lib/prism/polyfill/byteindex.rb +13 -0
- data/lib/prism/polyfill/unpack1.rb +14 -0
- data/lib/prism/reflection.rb +413 -0
- data/lib/prism/relocation.rb +504 -0
- data/lib/prism/serialize.rb +1940 -1198
- data/lib/prism/string_query.rb +30 -0
- data/lib/prism/translation/parser/builder.rb +61 -0
- data/lib/prism/translation/parser/compiler.rb +569 -195
- data/lib/prism/translation/parser/lexer.rb +516 -39
- data/lib/prism/translation/parser.rb +177 -12
- data/lib/prism/translation/parser33.rb +1 -1
- data/lib/prism/translation/parser34.rb +1 -1
- data/lib/prism/translation/parser35.rb +12 -0
- data/lib/prism/translation/ripper/sexp.rb +125 -0
- data/lib/prism/translation/ripper/shim.rb +5 -0
- data/lib/prism/translation/ripper.rb +3224 -462
- data/lib/prism/translation/ruby_parser.rb +194 -69
- data/lib/prism/translation.rb +4 -1
- data/lib/prism/version.rb +1 -1
- data/lib/prism/visitor.rb +13 -0
- data/lib/prism.rb +17 -27
- data/prism.gemspec +57 -17
- data/rbi/prism/compiler.rbi +12 -0
- data/rbi/prism/dsl.rbi +524 -0
- data/rbi/prism/inspect_visitor.rbi +12 -0
- data/rbi/prism/node.rbi +8722 -0
- data/rbi/prism/node_ext.rbi +107 -0
- data/rbi/prism/parse_result.rbi +404 -0
- data/rbi/prism/reflection.rbi +58 -0
- data/rbi/prism/string_query.rbi +12 -0
- data/rbi/prism/translation/parser.rbi +11 -0
- data/rbi/prism/translation/parser33.rbi +6 -0
- data/rbi/prism/translation/parser34.rbi +6 -0
- data/rbi/prism/translation/parser35.rbi +6 -0
- data/rbi/prism/translation/ripper.rbi +15 -0
- data/rbi/prism/visitor.rbi +473 -0
- data/rbi/prism.rbi +44 -7745
- data/sig/prism/compiler.rbs +9 -0
- data/sig/prism/dispatcher.rbs +16 -0
- data/sig/prism/dot_visitor.rbs +6 -0
- data/sig/prism/dsl.rbs +351 -0
- data/sig/prism/inspect_visitor.rbs +22 -0
- data/sig/prism/lex_compat.rbs +10 -0
- data/sig/prism/mutation_compiler.rbs +159 -0
- data/sig/prism/node.rbs +3614 -0
- data/sig/prism/node_ext.rbs +82 -0
- data/sig/prism/pack.rbs +43 -0
- data/sig/prism/parse_result.rbs +192 -0
- data/sig/prism/pattern.rbs +13 -0
- data/sig/prism/reflection.rbs +50 -0
- data/sig/prism/relocation.rbs +185 -0
- data/sig/prism/serialize.rbs +8 -0
- data/sig/prism/string_query.rbs +11 -0
- data/sig/prism/visitor.rbs +169 -0
- data/sig/prism.rbs +248 -4767
- data/src/diagnostic.c +672 -230
- data/src/encoding.c +211 -108
- data/src/node.c +7541 -1653
- data/src/options.c +135 -20
- data/src/pack.c +33 -17
- data/src/prettyprint.c +1543 -1485
- data/src/prism.c +7813 -3050
- data/src/regexp.c +225 -73
- data/src/serialize.c +101 -77
- data/src/static_literals.c +617 -0
- data/src/token_type.c +14 -13
- data/src/util/pm_buffer.c +187 -20
- data/src/util/pm_char.c +5 -5
- data/src/util/pm_constant_pool.c +39 -19
- data/src/util/pm_integer.c +670 -0
- data/src/util/pm_list.c +1 -1
- data/src/util/pm_newline_list.c +43 -5
- data/src/util/pm_string.c +213 -33
- data/src/util/pm_strncasecmp.c +13 -1
- data/src/util/pm_strpbrk.c +32 -6
- metadata +55 -19
- data/docs/ripper.md +0 -36
- data/include/prism/util/pm_state_stack.h +0 -42
- data/include/prism/util/pm_string_list.h +0 -44
- data/lib/prism/debug.rb +0 -206
- data/lib/prism/node_inspector.rb +0 -68
- data/lib/prism/translation/parser/rubocop.rb +0 -45
- data/rbi/prism_static.rbi +0 -207
- data/sig/prism_static.rbs +0 -201
- data/src/util/pm_state_stack.c +0 -25
- 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
|
-
|
5
|
+
include DSL
|
6
6
|
|
7
|
-
|
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
|
-
@
|
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
|
-
|
18
|
-
|
19
|
-
read_class
|
20
|
-
|
21
|
-
|
22
|
-
|
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
|
-
|
36
|
+
include DSL
|
37
|
+
|
38
|
+
attr_reader :node, :default_source, :read_class, :write_class, :arguments
|
29
39
|
|
30
|
-
def initialize(node,
|
40
|
+
def initialize(node, default_source, read_class, write_class, **arguments)
|
31
41
|
@node = node
|
32
|
-
@
|
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
|
-
|
41
|
-
|
42
|
-
node.operator_loc,
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
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
|
-
|
87
|
+
include DSL
|
65
88
|
|
66
|
-
|
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
|
-
@
|
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
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
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
|
-
|
94
|
-
|
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
|
-
|
131
|
+
include DSL
|
101
132
|
|
102
|
-
|
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
|
-
@
|
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
|
-
|
113
|
-
|
114
|
-
read_class
|
115
|
-
|
116
|
-
|
117
|
-
|
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,
|
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,
|
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,
|
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,
|
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,
|
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,
|
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,
|
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,
|
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,
|
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,
|
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,
|
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,
|
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,
|
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,
|
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,
|
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
|
|
data/lib/prism/dispatcher.rb
CHANGED
@@ -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
|
-
#
|
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) }
|