jruby-prism-parser 0.23.0.pre.SNAPSHOT-java
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/CHANGELOG.md +401 -0
- data/CODE_OF_CONDUCT.md +76 -0
- data/CONTRIBUTING.md +62 -0
- data/LICENSE.md +7 -0
- data/Makefile +101 -0
- data/README.md +98 -0
- data/config.yml +2902 -0
- data/docs/build_system.md +91 -0
- data/docs/configuration.md +64 -0
- data/docs/cruby_compilation.md +27 -0
- data/docs/design.md +53 -0
- data/docs/encoding.md +121 -0
- data/docs/fuzzing.md +88 -0
- data/docs/heredocs.md +36 -0
- data/docs/javascript.md +118 -0
- data/docs/local_variable_depth.md +229 -0
- data/docs/mapping.md +117 -0
- data/docs/parser_translation.md +34 -0
- data/docs/parsing_rules.md +19 -0
- data/docs/releasing.md +98 -0
- data/docs/ripper.md +36 -0
- data/docs/ruby_api.md +43 -0
- data/docs/ruby_parser_translation.md +19 -0
- data/docs/serialization.md +209 -0
- data/docs/testing.md +55 -0
- data/ext/prism/api_node.c +5098 -0
- data/ext/prism/api_pack.c +267 -0
- data/ext/prism/extconf.rb +110 -0
- data/ext/prism/extension.c +1155 -0
- data/ext/prism/extension.h +18 -0
- data/include/prism/ast.h +5807 -0
- data/include/prism/defines.h +102 -0
- data/include/prism/diagnostic.h +339 -0
- data/include/prism/encoding.h +265 -0
- data/include/prism/node.h +57 -0
- data/include/prism/options.h +230 -0
- data/include/prism/pack.h +152 -0
- data/include/prism/parser.h +732 -0
- data/include/prism/prettyprint.h +26 -0
- data/include/prism/regexp.h +33 -0
- data/include/prism/util/pm_buffer.h +155 -0
- data/include/prism/util/pm_char.h +205 -0
- data/include/prism/util/pm_constant_pool.h +209 -0
- data/include/prism/util/pm_list.h +97 -0
- data/include/prism/util/pm_memchr.h +29 -0
- data/include/prism/util/pm_newline_list.h +93 -0
- data/include/prism/util/pm_state_stack.h +42 -0
- data/include/prism/util/pm_string.h +150 -0
- data/include/prism/util/pm_string_list.h +44 -0
- data/include/prism/util/pm_strncasecmp.h +32 -0
- data/include/prism/util/pm_strpbrk.h +46 -0
- data/include/prism/version.h +29 -0
- data/include/prism.h +289 -0
- data/jruby-prism.jar +0 -0
- data/lib/prism/compiler.rb +486 -0
- data/lib/prism/debug.rb +206 -0
- data/lib/prism/desugar_compiler.rb +207 -0
- data/lib/prism/dispatcher.rb +2150 -0
- data/lib/prism/dot_visitor.rb +4634 -0
- data/lib/prism/dsl.rb +785 -0
- data/lib/prism/ffi.rb +346 -0
- data/lib/prism/lex_compat.rb +908 -0
- data/lib/prism/mutation_compiler.rb +753 -0
- data/lib/prism/node.rb +17864 -0
- data/lib/prism/node_ext.rb +212 -0
- data/lib/prism/node_inspector.rb +68 -0
- data/lib/prism/pack.rb +224 -0
- data/lib/prism/parse_result/comments.rb +177 -0
- data/lib/prism/parse_result/newlines.rb +64 -0
- data/lib/prism/parse_result.rb +498 -0
- data/lib/prism/pattern.rb +250 -0
- data/lib/prism/serialize.rb +1354 -0
- data/lib/prism/translation/parser/compiler.rb +1838 -0
- data/lib/prism/translation/parser/lexer.rb +335 -0
- data/lib/prism/translation/parser/rubocop.rb +37 -0
- data/lib/prism/translation/parser.rb +178 -0
- data/lib/prism/translation/ripper.rb +577 -0
- data/lib/prism/translation/ruby_parser.rb +1521 -0
- data/lib/prism/translation.rb +11 -0
- data/lib/prism/version.rb +3 -0
- data/lib/prism/visitor.rb +495 -0
- data/lib/prism.rb +99 -0
- data/prism.gemspec +135 -0
- data/rbi/prism.rbi +7767 -0
- data/rbi/prism_static.rbi +207 -0
- data/sig/prism.rbs +4773 -0
- data/sig/prism_static.rbs +201 -0
- data/src/diagnostic.c +400 -0
- data/src/encoding.c +5132 -0
- data/src/node.c +2786 -0
- data/src/options.c +213 -0
- data/src/pack.c +493 -0
- data/src/prettyprint.c +8881 -0
- data/src/prism.c +18406 -0
- data/src/regexp.c +638 -0
- data/src/serialize.c +1554 -0
- data/src/token_type.c +700 -0
- data/src/util/pm_buffer.c +190 -0
- data/src/util/pm_char.c +318 -0
- data/src/util/pm_constant_pool.c +322 -0
- data/src/util/pm_list.c +49 -0
- data/src/util/pm_memchr.c +35 -0
- data/src/util/pm_newline_list.c +84 -0
- data/src/util/pm_state_stack.c +25 -0
- data/src/util/pm_string.c +203 -0
- data/src/util/pm_string_list.c +28 -0
- data/src/util/pm_strncasecmp.c +24 -0
- data/src/util/pm_strpbrk.c +180 -0
- metadata +156 -0
@@ -0,0 +1,753 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
=begin
|
3
|
+
This file is generated by the templates/template.rb script and should not be
|
4
|
+
modified manually. See templates/lib/prism/mutation_compiler.rb.erb
|
5
|
+
if you are looking to modify the template
|
6
|
+
=end
|
7
|
+
|
8
|
+
module Prism
|
9
|
+
# This visitor walks through the tree and copies each node as it is being
|
10
|
+
# visited. This is useful for consumers that want to mutate the tree, as you
|
11
|
+
# can change subtrees in place without effecting the rest of the tree.
|
12
|
+
class MutationCompiler < Compiler
|
13
|
+
# Copy a AliasGlobalVariableNode node
|
14
|
+
def visit_alias_global_variable_node(node)
|
15
|
+
node.copy(new_name: visit(node.new_name), old_name: visit(node.old_name))
|
16
|
+
end
|
17
|
+
|
18
|
+
# Copy a AliasMethodNode node
|
19
|
+
def visit_alias_method_node(node)
|
20
|
+
node.copy(new_name: visit(node.new_name), old_name: visit(node.old_name))
|
21
|
+
end
|
22
|
+
|
23
|
+
# Copy a AlternationPatternNode node
|
24
|
+
def visit_alternation_pattern_node(node)
|
25
|
+
node.copy(left: visit(node.left), right: visit(node.right))
|
26
|
+
end
|
27
|
+
|
28
|
+
# Copy a AndNode node
|
29
|
+
def visit_and_node(node)
|
30
|
+
node.copy(left: visit(node.left), right: visit(node.right))
|
31
|
+
end
|
32
|
+
|
33
|
+
# Copy a ArgumentsNode node
|
34
|
+
def visit_arguments_node(node)
|
35
|
+
node.copy(arguments: visit_all(node.arguments))
|
36
|
+
end
|
37
|
+
|
38
|
+
# Copy a ArrayNode node
|
39
|
+
def visit_array_node(node)
|
40
|
+
node.copy(elements: visit_all(node.elements))
|
41
|
+
end
|
42
|
+
|
43
|
+
# Copy a ArrayPatternNode node
|
44
|
+
def visit_array_pattern_node(node)
|
45
|
+
node.copy(constant: visit(node.constant), requireds: visit_all(node.requireds), rest: visit(node.rest), posts: visit_all(node.posts))
|
46
|
+
end
|
47
|
+
|
48
|
+
# Copy a AssocNode node
|
49
|
+
def visit_assoc_node(node)
|
50
|
+
node.copy(key: visit(node.key), value: visit(node.value))
|
51
|
+
end
|
52
|
+
|
53
|
+
# Copy a AssocSplatNode node
|
54
|
+
def visit_assoc_splat_node(node)
|
55
|
+
node.copy(value: visit(node.value))
|
56
|
+
end
|
57
|
+
|
58
|
+
# Copy a BackReferenceReadNode node
|
59
|
+
def visit_back_reference_read_node(node)
|
60
|
+
node.copy
|
61
|
+
end
|
62
|
+
|
63
|
+
# Copy a BeginNode node
|
64
|
+
def visit_begin_node(node)
|
65
|
+
node.copy(statements: visit(node.statements), rescue_clause: visit(node.rescue_clause), else_clause: visit(node.else_clause), ensure_clause: visit(node.ensure_clause))
|
66
|
+
end
|
67
|
+
|
68
|
+
# Copy a BlockArgumentNode node
|
69
|
+
def visit_block_argument_node(node)
|
70
|
+
node.copy(expression: visit(node.expression))
|
71
|
+
end
|
72
|
+
|
73
|
+
# Copy a BlockLocalVariableNode node
|
74
|
+
def visit_block_local_variable_node(node)
|
75
|
+
node.copy
|
76
|
+
end
|
77
|
+
|
78
|
+
# Copy a BlockNode node
|
79
|
+
def visit_block_node(node)
|
80
|
+
node.copy(parameters: visit(node.parameters), body: visit(node.body))
|
81
|
+
end
|
82
|
+
|
83
|
+
# Copy a BlockParameterNode node
|
84
|
+
def visit_block_parameter_node(node)
|
85
|
+
node.copy
|
86
|
+
end
|
87
|
+
|
88
|
+
# Copy a BlockParametersNode node
|
89
|
+
def visit_block_parameters_node(node)
|
90
|
+
node.copy(parameters: visit(node.parameters), locals: visit_all(node.locals))
|
91
|
+
end
|
92
|
+
|
93
|
+
# Copy a BreakNode node
|
94
|
+
def visit_break_node(node)
|
95
|
+
node.copy(arguments: visit(node.arguments))
|
96
|
+
end
|
97
|
+
|
98
|
+
# Copy a CallAndWriteNode node
|
99
|
+
def visit_call_and_write_node(node)
|
100
|
+
node.copy(receiver: visit(node.receiver), value: visit(node.value))
|
101
|
+
end
|
102
|
+
|
103
|
+
# Copy a CallNode node
|
104
|
+
def visit_call_node(node)
|
105
|
+
node.copy(receiver: visit(node.receiver), arguments: visit(node.arguments), block: visit(node.block))
|
106
|
+
end
|
107
|
+
|
108
|
+
# Copy a CallOperatorWriteNode node
|
109
|
+
def visit_call_operator_write_node(node)
|
110
|
+
node.copy(receiver: visit(node.receiver), value: visit(node.value))
|
111
|
+
end
|
112
|
+
|
113
|
+
# Copy a CallOrWriteNode node
|
114
|
+
def visit_call_or_write_node(node)
|
115
|
+
node.copy(receiver: visit(node.receiver), value: visit(node.value))
|
116
|
+
end
|
117
|
+
|
118
|
+
# Copy a CallTargetNode node
|
119
|
+
def visit_call_target_node(node)
|
120
|
+
node.copy(receiver: visit(node.receiver))
|
121
|
+
end
|
122
|
+
|
123
|
+
# Copy a CapturePatternNode node
|
124
|
+
def visit_capture_pattern_node(node)
|
125
|
+
node.copy(value: visit(node.value), target: visit(node.target))
|
126
|
+
end
|
127
|
+
|
128
|
+
# Copy a CaseMatchNode node
|
129
|
+
def visit_case_match_node(node)
|
130
|
+
node.copy(predicate: visit(node.predicate), conditions: visit_all(node.conditions), consequent: visit(node.consequent))
|
131
|
+
end
|
132
|
+
|
133
|
+
# Copy a CaseNode node
|
134
|
+
def visit_case_node(node)
|
135
|
+
node.copy(predicate: visit(node.predicate), conditions: visit_all(node.conditions), consequent: visit(node.consequent))
|
136
|
+
end
|
137
|
+
|
138
|
+
# Copy a ClassNode node
|
139
|
+
def visit_class_node(node)
|
140
|
+
node.copy(constant_path: visit(node.constant_path), superclass: visit(node.superclass), body: visit(node.body))
|
141
|
+
end
|
142
|
+
|
143
|
+
# Copy a ClassVariableAndWriteNode node
|
144
|
+
def visit_class_variable_and_write_node(node)
|
145
|
+
node.copy(value: visit(node.value))
|
146
|
+
end
|
147
|
+
|
148
|
+
# Copy a ClassVariableOperatorWriteNode node
|
149
|
+
def visit_class_variable_operator_write_node(node)
|
150
|
+
node.copy(value: visit(node.value))
|
151
|
+
end
|
152
|
+
|
153
|
+
# Copy a ClassVariableOrWriteNode node
|
154
|
+
def visit_class_variable_or_write_node(node)
|
155
|
+
node.copy(value: visit(node.value))
|
156
|
+
end
|
157
|
+
|
158
|
+
# Copy a ClassVariableReadNode node
|
159
|
+
def visit_class_variable_read_node(node)
|
160
|
+
node.copy
|
161
|
+
end
|
162
|
+
|
163
|
+
# Copy a ClassVariableTargetNode node
|
164
|
+
def visit_class_variable_target_node(node)
|
165
|
+
node.copy
|
166
|
+
end
|
167
|
+
|
168
|
+
# Copy a ClassVariableWriteNode node
|
169
|
+
def visit_class_variable_write_node(node)
|
170
|
+
node.copy(value: visit(node.value))
|
171
|
+
end
|
172
|
+
|
173
|
+
# Copy a ConstantAndWriteNode node
|
174
|
+
def visit_constant_and_write_node(node)
|
175
|
+
node.copy(value: visit(node.value))
|
176
|
+
end
|
177
|
+
|
178
|
+
# Copy a ConstantOperatorWriteNode node
|
179
|
+
def visit_constant_operator_write_node(node)
|
180
|
+
node.copy(value: visit(node.value))
|
181
|
+
end
|
182
|
+
|
183
|
+
# Copy a ConstantOrWriteNode node
|
184
|
+
def visit_constant_or_write_node(node)
|
185
|
+
node.copy(value: visit(node.value))
|
186
|
+
end
|
187
|
+
|
188
|
+
# Copy a ConstantPathAndWriteNode node
|
189
|
+
def visit_constant_path_and_write_node(node)
|
190
|
+
node.copy(target: visit(node.target), value: visit(node.value))
|
191
|
+
end
|
192
|
+
|
193
|
+
# Copy a ConstantPathNode node
|
194
|
+
def visit_constant_path_node(node)
|
195
|
+
node.copy(parent: visit(node.parent), child: visit(node.child))
|
196
|
+
end
|
197
|
+
|
198
|
+
# Copy a ConstantPathOperatorWriteNode node
|
199
|
+
def visit_constant_path_operator_write_node(node)
|
200
|
+
node.copy(target: visit(node.target), value: visit(node.value))
|
201
|
+
end
|
202
|
+
|
203
|
+
# Copy a ConstantPathOrWriteNode node
|
204
|
+
def visit_constant_path_or_write_node(node)
|
205
|
+
node.copy(target: visit(node.target), value: visit(node.value))
|
206
|
+
end
|
207
|
+
|
208
|
+
# Copy a ConstantPathTargetNode node
|
209
|
+
def visit_constant_path_target_node(node)
|
210
|
+
node.copy(parent: visit(node.parent), child: visit(node.child))
|
211
|
+
end
|
212
|
+
|
213
|
+
# Copy a ConstantPathWriteNode node
|
214
|
+
def visit_constant_path_write_node(node)
|
215
|
+
node.copy(target: visit(node.target), value: visit(node.value))
|
216
|
+
end
|
217
|
+
|
218
|
+
# Copy a ConstantReadNode node
|
219
|
+
def visit_constant_read_node(node)
|
220
|
+
node.copy
|
221
|
+
end
|
222
|
+
|
223
|
+
# Copy a ConstantTargetNode node
|
224
|
+
def visit_constant_target_node(node)
|
225
|
+
node.copy
|
226
|
+
end
|
227
|
+
|
228
|
+
# Copy a ConstantWriteNode node
|
229
|
+
def visit_constant_write_node(node)
|
230
|
+
node.copy(value: visit(node.value))
|
231
|
+
end
|
232
|
+
|
233
|
+
# Copy a DefNode node
|
234
|
+
def visit_def_node(node)
|
235
|
+
node.copy(receiver: visit(node.receiver), parameters: visit(node.parameters), body: visit(node.body))
|
236
|
+
end
|
237
|
+
|
238
|
+
# Copy a DefinedNode node
|
239
|
+
def visit_defined_node(node)
|
240
|
+
node.copy(value: visit(node.value))
|
241
|
+
end
|
242
|
+
|
243
|
+
# Copy a ElseNode node
|
244
|
+
def visit_else_node(node)
|
245
|
+
node.copy(statements: visit(node.statements))
|
246
|
+
end
|
247
|
+
|
248
|
+
# Copy a EmbeddedStatementsNode node
|
249
|
+
def visit_embedded_statements_node(node)
|
250
|
+
node.copy(statements: visit(node.statements))
|
251
|
+
end
|
252
|
+
|
253
|
+
# Copy a EmbeddedVariableNode node
|
254
|
+
def visit_embedded_variable_node(node)
|
255
|
+
node.copy(variable: visit(node.variable))
|
256
|
+
end
|
257
|
+
|
258
|
+
# Copy a EnsureNode node
|
259
|
+
def visit_ensure_node(node)
|
260
|
+
node.copy(statements: visit(node.statements))
|
261
|
+
end
|
262
|
+
|
263
|
+
# Copy a FalseNode node
|
264
|
+
def visit_false_node(node)
|
265
|
+
node.copy
|
266
|
+
end
|
267
|
+
|
268
|
+
# Copy a FindPatternNode node
|
269
|
+
def visit_find_pattern_node(node)
|
270
|
+
node.copy(constant: visit(node.constant), left: visit(node.left), requireds: visit_all(node.requireds), right: visit(node.right))
|
271
|
+
end
|
272
|
+
|
273
|
+
# Copy a FlipFlopNode node
|
274
|
+
def visit_flip_flop_node(node)
|
275
|
+
node.copy(left: visit(node.left), right: visit(node.right))
|
276
|
+
end
|
277
|
+
|
278
|
+
# Copy a FloatNode node
|
279
|
+
def visit_float_node(node)
|
280
|
+
node.copy
|
281
|
+
end
|
282
|
+
|
283
|
+
# Copy a ForNode node
|
284
|
+
def visit_for_node(node)
|
285
|
+
node.copy(index: visit(node.index), collection: visit(node.collection), statements: visit(node.statements))
|
286
|
+
end
|
287
|
+
|
288
|
+
# Copy a ForwardingArgumentsNode node
|
289
|
+
def visit_forwarding_arguments_node(node)
|
290
|
+
node.copy
|
291
|
+
end
|
292
|
+
|
293
|
+
# Copy a ForwardingParameterNode node
|
294
|
+
def visit_forwarding_parameter_node(node)
|
295
|
+
node.copy
|
296
|
+
end
|
297
|
+
|
298
|
+
# Copy a ForwardingSuperNode node
|
299
|
+
def visit_forwarding_super_node(node)
|
300
|
+
node.copy(block: visit(node.block))
|
301
|
+
end
|
302
|
+
|
303
|
+
# Copy a GlobalVariableAndWriteNode node
|
304
|
+
def visit_global_variable_and_write_node(node)
|
305
|
+
node.copy(value: visit(node.value))
|
306
|
+
end
|
307
|
+
|
308
|
+
# Copy a GlobalVariableOperatorWriteNode node
|
309
|
+
def visit_global_variable_operator_write_node(node)
|
310
|
+
node.copy(value: visit(node.value))
|
311
|
+
end
|
312
|
+
|
313
|
+
# Copy a GlobalVariableOrWriteNode node
|
314
|
+
def visit_global_variable_or_write_node(node)
|
315
|
+
node.copy(value: visit(node.value))
|
316
|
+
end
|
317
|
+
|
318
|
+
# Copy a GlobalVariableReadNode node
|
319
|
+
def visit_global_variable_read_node(node)
|
320
|
+
node.copy
|
321
|
+
end
|
322
|
+
|
323
|
+
# Copy a GlobalVariableTargetNode node
|
324
|
+
def visit_global_variable_target_node(node)
|
325
|
+
node.copy
|
326
|
+
end
|
327
|
+
|
328
|
+
# Copy a GlobalVariableWriteNode node
|
329
|
+
def visit_global_variable_write_node(node)
|
330
|
+
node.copy(value: visit(node.value))
|
331
|
+
end
|
332
|
+
|
333
|
+
# Copy a HashNode node
|
334
|
+
def visit_hash_node(node)
|
335
|
+
node.copy(elements: visit_all(node.elements))
|
336
|
+
end
|
337
|
+
|
338
|
+
# Copy a HashPatternNode node
|
339
|
+
def visit_hash_pattern_node(node)
|
340
|
+
node.copy(constant: visit(node.constant), elements: visit_all(node.elements), rest: visit(node.rest))
|
341
|
+
end
|
342
|
+
|
343
|
+
# Copy a IfNode node
|
344
|
+
def visit_if_node(node)
|
345
|
+
node.copy(predicate: visit(node.predicate), statements: visit(node.statements), consequent: visit(node.consequent))
|
346
|
+
end
|
347
|
+
|
348
|
+
# Copy a ImaginaryNode node
|
349
|
+
def visit_imaginary_node(node)
|
350
|
+
node.copy(numeric: visit(node.numeric))
|
351
|
+
end
|
352
|
+
|
353
|
+
# Copy a ImplicitNode node
|
354
|
+
def visit_implicit_node(node)
|
355
|
+
node.copy(value: visit(node.value))
|
356
|
+
end
|
357
|
+
|
358
|
+
# Copy a ImplicitRestNode node
|
359
|
+
def visit_implicit_rest_node(node)
|
360
|
+
node.copy
|
361
|
+
end
|
362
|
+
|
363
|
+
# Copy a InNode node
|
364
|
+
def visit_in_node(node)
|
365
|
+
node.copy(pattern: visit(node.pattern), statements: visit(node.statements))
|
366
|
+
end
|
367
|
+
|
368
|
+
# Copy a IndexAndWriteNode node
|
369
|
+
def visit_index_and_write_node(node)
|
370
|
+
node.copy(receiver: visit(node.receiver), arguments: visit(node.arguments), block: visit(node.block), value: visit(node.value))
|
371
|
+
end
|
372
|
+
|
373
|
+
# Copy a IndexOperatorWriteNode node
|
374
|
+
def visit_index_operator_write_node(node)
|
375
|
+
node.copy(receiver: visit(node.receiver), arguments: visit(node.arguments), block: visit(node.block), value: visit(node.value))
|
376
|
+
end
|
377
|
+
|
378
|
+
# Copy a IndexOrWriteNode node
|
379
|
+
def visit_index_or_write_node(node)
|
380
|
+
node.copy(receiver: visit(node.receiver), arguments: visit(node.arguments), block: visit(node.block), value: visit(node.value))
|
381
|
+
end
|
382
|
+
|
383
|
+
# Copy a IndexTargetNode node
|
384
|
+
def visit_index_target_node(node)
|
385
|
+
node.copy(receiver: visit(node.receiver), arguments: visit(node.arguments), block: visit(node.block))
|
386
|
+
end
|
387
|
+
|
388
|
+
# Copy a InstanceVariableAndWriteNode node
|
389
|
+
def visit_instance_variable_and_write_node(node)
|
390
|
+
node.copy(value: visit(node.value))
|
391
|
+
end
|
392
|
+
|
393
|
+
# Copy a InstanceVariableOperatorWriteNode node
|
394
|
+
def visit_instance_variable_operator_write_node(node)
|
395
|
+
node.copy(value: visit(node.value))
|
396
|
+
end
|
397
|
+
|
398
|
+
# Copy a InstanceVariableOrWriteNode node
|
399
|
+
def visit_instance_variable_or_write_node(node)
|
400
|
+
node.copy(value: visit(node.value))
|
401
|
+
end
|
402
|
+
|
403
|
+
# Copy a InstanceVariableReadNode node
|
404
|
+
def visit_instance_variable_read_node(node)
|
405
|
+
node.copy
|
406
|
+
end
|
407
|
+
|
408
|
+
# Copy a InstanceVariableTargetNode node
|
409
|
+
def visit_instance_variable_target_node(node)
|
410
|
+
node.copy
|
411
|
+
end
|
412
|
+
|
413
|
+
# Copy a InstanceVariableWriteNode node
|
414
|
+
def visit_instance_variable_write_node(node)
|
415
|
+
node.copy(value: visit(node.value))
|
416
|
+
end
|
417
|
+
|
418
|
+
# Copy a IntegerNode node
|
419
|
+
def visit_integer_node(node)
|
420
|
+
node.copy
|
421
|
+
end
|
422
|
+
|
423
|
+
# Copy a InterpolatedMatchLastLineNode node
|
424
|
+
def visit_interpolated_match_last_line_node(node)
|
425
|
+
node.copy(parts: visit_all(node.parts))
|
426
|
+
end
|
427
|
+
|
428
|
+
# Copy a InterpolatedRegularExpressionNode node
|
429
|
+
def visit_interpolated_regular_expression_node(node)
|
430
|
+
node.copy(parts: visit_all(node.parts))
|
431
|
+
end
|
432
|
+
|
433
|
+
# Copy a InterpolatedStringNode node
|
434
|
+
def visit_interpolated_string_node(node)
|
435
|
+
node.copy(parts: visit_all(node.parts))
|
436
|
+
end
|
437
|
+
|
438
|
+
# Copy a InterpolatedSymbolNode node
|
439
|
+
def visit_interpolated_symbol_node(node)
|
440
|
+
node.copy(parts: visit_all(node.parts))
|
441
|
+
end
|
442
|
+
|
443
|
+
# Copy a InterpolatedXStringNode node
|
444
|
+
def visit_interpolated_x_string_node(node)
|
445
|
+
node.copy(parts: visit_all(node.parts))
|
446
|
+
end
|
447
|
+
|
448
|
+
# Copy a KeywordHashNode node
|
449
|
+
def visit_keyword_hash_node(node)
|
450
|
+
node.copy(elements: visit_all(node.elements))
|
451
|
+
end
|
452
|
+
|
453
|
+
# Copy a KeywordRestParameterNode node
|
454
|
+
def visit_keyword_rest_parameter_node(node)
|
455
|
+
node.copy
|
456
|
+
end
|
457
|
+
|
458
|
+
# Copy a LambdaNode node
|
459
|
+
def visit_lambda_node(node)
|
460
|
+
node.copy(parameters: visit(node.parameters), body: visit(node.body))
|
461
|
+
end
|
462
|
+
|
463
|
+
# Copy a LocalVariableAndWriteNode node
|
464
|
+
def visit_local_variable_and_write_node(node)
|
465
|
+
node.copy(value: visit(node.value))
|
466
|
+
end
|
467
|
+
|
468
|
+
# Copy a LocalVariableOperatorWriteNode node
|
469
|
+
def visit_local_variable_operator_write_node(node)
|
470
|
+
node.copy(value: visit(node.value))
|
471
|
+
end
|
472
|
+
|
473
|
+
# Copy a LocalVariableOrWriteNode node
|
474
|
+
def visit_local_variable_or_write_node(node)
|
475
|
+
node.copy(value: visit(node.value))
|
476
|
+
end
|
477
|
+
|
478
|
+
# Copy a LocalVariableReadNode node
|
479
|
+
def visit_local_variable_read_node(node)
|
480
|
+
node.copy
|
481
|
+
end
|
482
|
+
|
483
|
+
# Copy a LocalVariableTargetNode node
|
484
|
+
def visit_local_variable_target_node(node)
|
485
|
+
node.copy
|
486
|
+
end
|
487
|
+
|
488
|
+
# Copy a LocalVariableWriteNode node
|
489
|
+
def visit_local_variable_write_node(node)
|
490
|
+
node.copy(value: visit(node.value))
|
491
|
+
end
|
492
|
+
|
493
|
+
# Copy a MatchLastLineNode node
|
494
|
+
def visit_match_last_line_node(node)
|
495
|
+
node.copy
|
496
|
+
end
|
497
|
+
|
498
|
+
# Copy a MatchPredicateNode node
|
499
|
+
def visit_match_predicate_node(node)
|
500
|
+
node.copy(value: visit(node.value), pattern: visit(node.pattern))
|
501
|
+
end
|
502
|
+
|
503
|
+
# Copy a MatchRequiredNode node
|
504
|
+
def visit_match_required_node(node)
|
505
|
+
node.copy(value: visit(node.value), pattern: visit(node.pattern))
|
506
|
+
end
|
507
|
+
|
508
|
+
# Copy a MatchWriteNode node
|
509
|
+
def visit_match_write_node(node)
|
510
|
+
node.copy(call: visit(node.call), targets: visit_all(node.targets))
|
511
|
+
end
|
512
|
+
|
513
|
+
# Copy a MissingNode node
|
514
|
+
def visit_missing_node(node)
|
515
|
+
node.copy
|
516
|
+
end
|
517
|
+
|
518
|
+
# Copy a ModuleNode node
|
519
|
+
def visit_module_node(node)
|
520
|
+
node.copy(constant_path: visit(node.constant_path), body: visit(node.body))
|
521
|
+
end
|
522
|
+
|
523
|
+
# Copy a MultiTargetNode node
|
524
|
+
def visit_multi_target_node(node)
|
525
|
+
node.copy(lefts: visit_all(node.lefts), rest: visit(node.rest), rights: visit_all(node.rights))
|
526
|
+
end
|
527
|
+
|
528
|
+
# Copy a MultiWriteNode node
|
529
|
+
def visit_multi_write_node(node)
|
530
|
+
node.copy(lefts: visit_all(node.lefts), rest: visit(node.rest), rights: visit_all(node.rights), value: visit(node.value))
|
531
|
+
end
|
532
|
+
|
533
|
+
# Copy a NextNode node
|
534
|
+
def visit_next_node(node)
|
535
|
+
node.copy(arguments: visit(node.arguments))
|
536
|
+
end
|
537
|
+
|
538
|
+
# Copy a NilNode node
|
539
|
+
def visit_nil_node(node)
|
540
|
+
node.copy
|
541
|
+
end
|
542
|
+
|
543
|
+
# Copy a NoKeywordsParameterNode node
|
544
|
+
def visit_no_keywords_parameter_node(node)
|
545
|
+
node.copy
|
546
|
+
end
|
547
|
+
|
548
|
+
# Copy a NumberedParametersNode node
|
549
|
+
def visit_numbered_parameters_node(node)
|
550
|
+
node.copy
|
551
|
+
end
|
552
|
+
|
553
|
+
# Copy a NumberedReferenceReadNode node
|
554
|
+
def visit_numbered_reference_read_node(node)
|
555
|
+
node.copy
|
556
|
+
end
|
557
|
+
|
558
|
+
# Copy a OptionalKeywordParameterNode node
|
559
|
+
def visit_optional_keyword_parameter_node(node)
|
560
|
+
node.copy(value: visit(node.value))
|
561
|
+
end
|
562
|
+
|
563
|
+
# Copy a OptionalParameterNode node
|
564
|
+
def visit_optional_parameter_node(node)
|
565
|
+
node.copy(value: visit(node.value))
|
566
|
+
end
|
567
|
+
|
568
|
+
# Copy a OrNode node
|
569
|
+
def visit_or_node(node)
|
570
|
+
node.copy(left: visit(node.left), right: visit(node.right))
|
571
|
+
end
|
572
|
+
|
573
|
+
# Copy a ParametersNode node
|
574
|
+
def visit_parameters_node(node)
|
575
|
+
node.copy(requireds: visit_all(node.requireds), optionals: visit_all(node.optionals), rest: visit(node.rest), posts: visit_all(node.posts), keywords: visit_all(node.keywords), keyword_rest: visit(node.keyword_rest), block: visit(node.block))
|
576
|
+
end
|
577
|
+
|
578
|
+
# Copy a ParenthesesNode node
|
579
|
+
def visit_parentheses_node(node)
|
580
|
+
node.copy(body: visit(node.body))
|
581
|
+
end
|
582
|
+
|
583
|
+
# Copy a PinnedExpressionNode node
|
584
|
+
def visit_pinned_expression_node(node)
|
585
|
+
node.copy(expression: visit(node.expression))
|
586
|
+
end
|
587
|
+
|
588
|
+
# Copy a PinnedVariableNode node
|
589
|
+
def visit_pinned_variable_node(node)
|
590
|
+
node.copy(variable: visit(node.variable))
|
591
|
+
end
|
592
|
+
|
593
|
+
# Copy a PostExecutionNode node
|
594
|
+
def visit_post_execution_node(node)
|
595
|
+
node.copy(statements: visit(node.statements))
|
596
|
+
end
|
597
|
+
|
598
|
+
# Copy a PreExecutionNode node
|
599
|
+
def visit_pre_execution_node(node)
|
600
|
+
node.copy(statements: visit(node.statements))
|
601
|
+
end
|
602
|
+
|
603
|
+
# Copy a ProgramNode node
|
604
|
+
def visit_program_node(node)
|
605
|
+
node.copy(statements: visit(node.statements))
|
606
|
+
end
|
607
|
+
|
608
|
+
# Copy a RangeNode node
|
609
|
+
def visit_range_node(node)
|
610
|
+
node.copy(left: visit(node.left), right: visit(node.right))
|
611
|
+
end
|
612
|
+
|
613
|
+
# Copy a RationalNode node
|
614
|
+
def visit_rational_node(node)
|
615
|
+
node.copy(numeric: visit(node.numeric))
|
616
|
+
end
|
617
|
+
|
618
|
+
# Copy a RedoNode node
|
619
|
+
def visit_redo_node(node)
|
620
|
+
node.copy
|
621
|
+
end
|
622
|
+
|
623
|
+
# Copy a RegularExpressionNode node
|
624
|
+
def visit_regular_expression_node(node)
|
625
|
+
node.copy
|
626
|
+
end
|
627
|
+
|
628
|
+
# Copy a RequiredKeywordParameterNode node
|
629
|
+
def visit_required_keyword_parameter_node(node)
|
630
|
+
node.copy
|
631
|
+
end
|
632
|
+
|
633
|
+
# Copy a RequiredParameterNode node
|
634
|
+
def visit_required_parameter_node(node)
|
635
|
+
node.copy
|
636
|
+
end
|
637
|
+
|
638
|
+
# Copy a RescueModifierNode node
|
639
|
+
def visit_rescue_modifier_node(node)
|
640
|
+
node.copy(expression: visit(node.expression), rescue_expression: visit(node.rescue_expression))
|
641
|
+
end
|
642
|
+
|
643
|
+
# Copy a RescueNode node
|
644
|
+
def visit_rescue_node(node)
|
645
|
+
node.copy(exceptions: visit_all(node.exceptions), reference: visit(node.reference), statements: visit(node.statements), consequent: visit(node.consequent))
|
646
|
+
end
|
647
|
+
|
648
|
+
# Copy a RestParameterNode node
|
649
|
+
def visit_rest_parameter_node(node)
|
650
|
+
node.copy
|
651
|
+
end
|
652
|
+
|
653
|
+
# Copy a RetryNode node
|
654
|
+
def visit_retry_node(node)
|
655
|
+
node.copy
|
656
|
+
end
|
657
|
+
|
658
|
+
# Copy a ReturnNode node
|
659
|
+
def visit_return_node(node)
|
660
|
+
node.copy(arguments: visit(node.arguments))
|
661
|
+
end
|
662
|
+
|
663
|
+
# Copy a SelfNode node
|
664
|
+
def visit_self_node(node)
|
665
|
+
node.copy
|
666
|
+
end
|
667
|
+
|
668
|
+
# Copy a SingletonClassNode node
|
669
|
+
def visit_singleton_class_node(node)
|
670
|
+
node.copy(expression: visit(node.expression), body: visit(node.body))
|
671
|
+
end
|
672
|
+
|
673
|
+
# Copy a SourceEncodingNode node
|
674
|
+
def visit_source_encoding_node(node)
|
675
|
+
node.copy
|
676
|
+
end
|
677
|
+
|
678
|
+
# Copy a SourceFileNode node
|
679
|
+
def visit_source_file_node(node)
|
680
|
+
node.copy
|
681
|
+
end
|
682
|
+
|
683
|
+
# Copy a SourceLineNode node
|
684
|
+
def visit_source_line_node(node)
|
685
|
+
node.copy
|
686
|
+
end
|
687
|
+
|
688
|
+
# Copy a SplatNode node
|
689
|
+
def visit_splat_node(node)
|
690
|
+
node.copy(expression: visit(node.expression))
|
691
|
+
end
|
692
|
+
|
693
|
+
# Copy a StatementsNode node
|
694
|
+
def visit_statements_node(node)
|
695
|
+
node.copy(body: visit_all(node.body))
|
696
|
+
end
|
697
|
+
|
698
|
+
# Copy a StringNode node
|
699
|
+
def visit_string_node(node)
|
700
|
+
node.copy
|
701
|
+
end
|
702
|
+
|
703
|
+
# Copy a SuperNode node
|
704
|
+
def visit_super_node(node)
|
705
|
+
node.copy(arguments: visit(node.arguments), block: visit(node.block))
|
706
|
+
end
|
707
|
+
|
708
|
+
# Copy a SymbolNode node
|
709
|
+
def visit_symbol_node(node)
|
710
|
+
node.copy
|
711
|
+
end
|
712
|
+
|
713
|
+
# Copy a TrueNode node
|
714
|
+
def visit_true_node(node)
|
715
|
+
node.copy
|
716
|
+
end
|
717
|
+
|
718
|
+
# Copy a UndefNode node
|
719
|
+
def visit_undef_node(node)
|
720
|
+
node.copy(names: visit_all(node.names))
|
721
|
+
end
|
722
|
+
|
723
|
+
# Copy a UnlessNode node
|
724
|
+
def visit_unless_node(node)
|
725
|
+
node.copy(predicate: visit(node.predicate), statements: visit(node.statements), consequent: visit(node.consequent))
|
726
|
+
end
|
727
|
+
|
728
|
+
# Copy a UntilNode node
|
729
|
+
def visit_until_node(node)
|
730
|
+
node.copy(predicate: visit(node.predicate), statements: visit(node.statements))
|
731
|
+
end
|
732
|
+
|
733
|
+
# Copy a WhenNode node
|
734
|
+
def visit_when_node(node)
|
735
|
+
node.copy(conditions: visit_all(node.conditions), statements: visit(node.statements))
|
736
|
+
end
|
737
|
+
|
738
|
+
# Copy a WhileNode node
|
739
|
+
def visit_while_node(node)
|
740
|
+
node.copy(predicate: visit(node.predicate), statements: visit(node.statements))
|
741
|
+
end
|
742
|
+
|
743
|
+
# Copy a XStringNode node
|
744
|
+
def visit_x_string_node(node)
|
745
|
+
node.copy
|
746
|
+
end
|
747
|
+
|
748
|
+
# Copy a YieldNode node
|
749
|
+
def visit_yield_node(node)
|
750
|
+
node.copy(arguments: visit(node.arguments))
|
751
|
+
end
|
752
|
+
end
|
753
|
+
end
|