prism 0.13.0

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