ruby_prism_sys/bindings.rs
1/* Generated by `bundle exec rake cargo:bindings`. Do not edit by hand.
2 * prism 2.1.0, bindgen 0.73.2, layout_tests(false)
3 * so the file stays portable across pointer widths.
4 */
5/* automatically generated by rust-bindgen 0.73.2 */
6
7/** A constant id is a unique identifier for a constant in the constant pool.
8*/
9pub type pm_constant_id_t = u32;
10/** A list of nodes in the source, most often used for lists of children.
11*/
12pub type pm_node_list_t = pm_node_list;
13/** This is the type of node embedded in the node struct. We explicitly control
14 the size of it here to avoid having the variable-width enum.
15*/
16pub type pm_node_type_t = u16;
17/** These are the flags embedded in the node struct. We explicitly control the
18 size of it here to avoid having the variable-width enum.
19*/
20pub type pm_node_flags_t = u16;
21/** This is the base structure that represents a node in the syntax tree. It is
22 embedded into every node type.
23*/
24pub type pm_node_t = pm_node;
25/** AliasGlobalVariableNode
26
27 Represents the use of the `alias` keyword to alias a global variable.
28
29``` ruby
30 alias $foo $bar
31 ^^^^^^^^^^^^^^^
32```
33
34 Type: ::PM_ALIAS_GLOBAL_VARIABLE_NODE
35
36 @extends pm_node_t
37*/
38pub type pm_alias_global_variable_node_t = pm_alias_global_variable_node;
39/** AliasMethodNode
40
41 Represents the use of the `alias` keyword to alias a method.
42
43``` ruby
44 alias foo bar
45 ^^^^^^^^^^^^^
46```
47
48 Type: ::PM_ALIAS_METHOD_NODE
49
50 @extends pm_node_t
51*/
52pub type pm_alias_method_node_t = pm_alias_method_node;
53/** AlternationPatternNode
54
55 Represents an alternation pattern in pattern matching.
56
57``` ruby
58 foo => bar | baz
59 ^^^^^^^^^
60```
61
62 Type: ::PM_ALTERNATION_PATTERN_NODE
63
64 @extends pm_node_t
65*/
66pub type pm_alternation_pattern_node_t = pm_alternation_pattern_node;
67/** AndNode
68
69 Represents the use of the `&&` operator or the `and` keyword.
70
71``` ruby
72 left and right
73 ^^^^^^^^^^^^^^
74```
75
76 Type: ::PM_AND_NODE
77
78 @extends pm_node_t
79*/
80pub type pm_and_node_t = pm_and_node;
81/** ArgumentsNode
82
83 Represents a set of arguments to a method or a keyword.
84
85``` ruby
86 return foo, bar, baz
87 ^^^^^^^^^^^^^
88```
89
90 Type: ::PM_ARGUMENTS_NODE
91
92 Flags (#pm_arguments_node_flags):
93 * ::PM_ARGUMENTS_NODE_FLAGS_CONTAINS_FORWARDING
94 * ::PM_ARGUMENTS_NODE_FLAGS_CONTAINS_KEYWORDS
95 * ::PM_ARGUMENTS_NODE_FLAGS_CONTAINS_KEYWORD_SPLAT
96 * ::PM_ARGUMENTS_NODE_FLAGS_CONTAINS_SPLAT
97 * ::PM_ARGUMENTS_NODE_FLAGS_CONTAINS_MULTIPLE_SPLATS
98
99 @extends pm_node_t
100*/
101pub type pm_arguments_node_t = pm_arguments_node;
102/** ArrayNode
103
104 Represents an array literal. This can be a regular array using brackets or a special array using % like %w or %i.
105
106``` ruby
107 [1, 2, 3]
108 ^^^^^^^^^
109```
110
111 Type: ::PM_ARRAY_NODE
112
113 Flags (#pm_array_node_flags):
114 * ::PM_ARRAY_NODE_FLAGS_CONTAINS_SPLAT
115
116 @extends pm_node_t
117*/
118pub type pm_array_node_t = pm_array_node;
119/** ArrayPatternNode
120
121 Represents an array pattern in pattern matching.
122
123``` ruby
124 foo in 1, 2
125 ^^^^
126```
127
128``` ruby
129 foo in [1, 2]
130 ^^^^^^
131```
132
133``` ruby
134 foo in *bar
135 ^^^^
136```
137
138``` ruby
139 foo in Bar[]
140 ^^^^^
141```
142
143``` ruby
144 foo in Bar[1, 2, 3]
145 ^^^^^^^^^^^^
146```
147
148 Type: ::PM_ARRAY_PATTERN_NODE
149
150 @extends pm_node_t
151*/
152pub type pm_array_pattern_node_t = pm_array_pattern_node;
153/** AssocNode
154
155 Represents a hash key/value pair.
156
157``` ruby
158 { a => b }
159 ^^^^^^
160```
161
162 Type: ::PM_ASSOC_NODE
163
164 @extends pm_node_t
165*/
166pub type pm_assoc_node_t = pm_assoc_node;
167/** AssocSplatNode
168
169 Represents a splat in a hash literal.
170
171``` ruby
172 { **foo }
173 ^^^^^
174```
175
176 Type: ::PM_ASSOC_SPLAT_NODE
177
178 @extends pm_node_t
179*/
180pub type pm_assoc_splat_node_t = pm_assoc_splat_node;
181/** BackReferenceReadNode
182
183 Represents reading a reference to a field in the previous match.
184
185``` ruby
186 $'
187 ^^
188```
189
190 Type: ::PM_BACK_REFERENCE_READ_NODE
191
192 @extends pm_node_t
193*/
194pub type pm_back_reference_read_node_t = pm_back_reference_read_node;
195/** BeginNode
196
197 Represents a begin statement.
198
199``` ruby
200 begin
201 foo
202 end
203 ^^^^^
204```
205
206 Type: ::PM_BEGIN_NODE
207
208 @extends pm_node_t
209*/
210pub type pm_begin_node_t = pm_begin_node;
211/** BlockArgumentNode
212
213 Represents a block argument using `&`.
214
215``` ruby
216 bar(&args)
217 ^^^^^
218```
219
220 Type: ::PM_BLOCK_ARGUMENT_NODE
221
222 @extends pm_node_t
223*/
224pub type pm_block_argument_node_t = pm_block_argument_node;
225/** BlockLocalVariableNode
226
227 Represents a block local variable.
228
229``` ruby
230 a { |; b| }
231 ^
232```
233
234 Type: ::PM_BLOCK_LOCAL_VARIABLE_NODE
235
236 Flags (#pm_parameter_flags):
237 * ::PM_PARAMETER_FLAGS_REPEATED_PARAMETER
238
239 @extends pm_node_t
240*/
241pub type pm_block_local_variable_node_t = pm_block_local_variable_node;
242/** BlockNode
243
244 Represents a block of ruby code.
245
246``` ruby
247 [1, 2, 3].each { |i| puts x }
248 ^^^^^^^^^^^^^^
249```
250
251 Type: ::PM_BLOCK_NODE
252
253 @extends pm_node_t
254*/
255pub type pm_block_node_t = pm_block_node;
256/** BlockParameterNode
257
258 Represents a block parameter of a method, block, or lambda definition.
259
260``` ruby
261 def a(&b)
262 ^^
263 end
264```
265
266 Type: ::PM_BLOCK_PARAMETER_NODE
267
268 Flags (#pm_parameter_flags):
269 * ::PM_PARAMETER_FLAGS_REPEATED_PARAMETER
270
271 @extends pm_node_t
272*/
273pub type pm_block_parameter_node_t = pm_block_parameter_node;
274/** BlockParametersNode
275
276 Represents a block's parameters declaration.
277
278``` ruby
279 -> (a, b = 1; local) { }
280 ^^^^^^^^^^^^^^^^^
281```
282
283``` ruby
284 foo do |a, b = 1; local|
285 ^^^^^^^^^^^^^^^^^
286 end
287```
288
289 Type: ::PM_BLOCK_PARAMETERS_NODE
290
291 @extends pm_node_t
292*/
293pub type pm_block_parameters_node_t = pm_block_parameters_node;
294/** BreakNode
295
296 Represents the use of the `break` keyword.
297
298``` ruby
299 break foo
300 ^^^^^^^^^
301```
302
303 Type: ::PM_BREAK_NODE
304
305 @extends pm_node_t
306*/
307pub type pm_break_node_t = pm_break_node;
308/** CallAndWriteNode
309
310 Represents the use of the `&&=` operator on a call.
311
312``` ruby
313 foo.bar &&= value
314 ^^^^^^^^^^^^^^^^^
315```
316
317 Type: ::PM_CALL_AND_WRITE_NODE
318
319 Flags (#pm_call_node_flags):
320 * ::PM_CALL_NODE_FLAGS_SAFE_NAVIGATION
321 * ::PM_CALL_NODE_FLAGS_VARIABLE_CALL
322 * ::PM_CALL_NODE_FLAGS_ATTRIBUTE_WRITE
323 * ::PM_CALL_NODE_FLAGS_IGNORE_VISIBILITY
324
325 @extends pm_node_t
326*/
327pub type pm_call_and_write_node_t = pm_call_and_write_node;
328/** CallNode
329
330 Represents a method call, in all of the various forms that can take.
331
332``` ruby
333 foo
334 ^^^
335```
336
337``` ruby
338 foo()
339 ^^^^^
340```
341
342``` ruby
343 +foo
344 ^^^^
345```
346
347``` ruby
348 foo + bar
349 ^^^^^^^^^
350```
351
352``` ruby
353 foo.bar
354 ^^^^^^^
355```
356
357``` ruby
358 foo&.bar
359 ^^^^^^^^
360```
361
362 Type: ::PM_CALL_NODE
363
364 Flags (#pm_call_node_flags):
365 * ::PM_CALL_NODE_FLAGS_SAFE_NAVIGATION
366 * ::PM_CALL_NODE_FLAGS_VARIABLE_CALL
367 * ::PM_CALL_NODE_FLAGS_ATTRIBUTE_WRITE
368 * ::PM_CALL_NODE_FLAGS_IGNORE_VISIBILITY
369
370 @extends pm_node_t
371*/
372pub type pm_call_node_t = pm_call_node;
373/** CallOperatorWriteNode
374
375 Represents the use of an assignment operator on a call.
376
377``` ruby
378 foo.bar += baz
379 ^^^^^^^^^^^^^^
380```
381
382 Type: ::PM_CALL_OPERATOR_WRITE_NODE
383
384 Flags (#pm_call_node_flags):
385 * ::PM_CALL_NODE_FLAGS_SAFE_NAVIGATION
386 * ::PM_CALL_NODE_FLAGS_VARIABLE_CALL
387 * ::PM_CALL_NODE_FLAGS_ATTRIBUTE_WRITE
388 * ::PM_CALL_NODE_FLAGS_IGNORE_VISIBILITY
389
390 @extends pm_node_t
391*/
392pub type pm_call_operator_write_node_t = pm_call_operator_write_node;
393/** CallOrWriteNode
394
395 Represents the use of the `||=` operator on a call.
396
397``` ruby
398 foo.bar ||= value
399 ^^^^^^^^^^^^^^^^^
400```
401
402 Type: ::PM_CALL_OR_WRITE_NODE
403
404 Flags (#pm_call_node_flags):
405 * ::PM_CALL_NODE_FLAGS_SAFE_NAVIGATION
406 * ::PM_CALL_NODE_FLAGS_VARIABLE_CALL
407 * ::PM_CALL_NODE_FLAGS_ATTRIBUTE_WRITE
408 * ::PM_CALL_NODE_FLAGS_IGNORE_VISIBILITY
409
410 @extends pm_node_t
411*/
412pub type pm_call_or_write_node_t = pm_call_or_write_node;
413/** CallTargetNode
414
415 Represents assigning to a method call.
416
417``` ruby
418 foo.bar, = 1
419 ^^^^^^^
420```
421
422``` ruby
423 begin
424 rescue => foo.bar
425 ^^^^^^^
426 end
427```
428
429``` ruby
430 for foo.bar in baz do end
431 ^^^^^^^
432```
433
434 Type: ::PM_CALL_TARGET_NODE
435
436 Flags (#pm_call_node_flags):
437 * ::PM_CALL_NODE_FLAGS_SAFE_NAVIGATION
438 * ::PM_CALL_NODE_FLAGS_VARIABLE_CALL
439 * ::PM_CALL_NODE_FLAGS_ATTRIBUTE_WRITE
440 * ::PM_CALL_NODE_FLAGS_IGNORE_VISIBILITY
441
442 @extends pm_node_t
443*/
444pub type pm_call_target_node_t = pm_call_target_node;
445/** CapturePatternNode
446
447 Represents assigning to a local variable in pattern matching.
448
449``` ruby
450 foo => [bar => baz]
451 ^^^^^^^^^^
452```
453
454 Type: ::PM_CAPTURE_PATTERN_NODE
455
456 @extends pm_node_t
457*/
458pub type pm_capture_pattern_node_t = pm_capture_pattern_node;
459/** CaseMatchNode
460
461 Represents the use of a case statement for pattern matching.
462
463``` ruby
464 case true
465 in false
466 end
467 ^^^^^^^^^
468```
469
470 Type: ::PM_CASE_MATCH_NODE
471
472 @extends pm_node_t
473*/
474pub type pm_case_match_node_t = pm_case_match_node;
475/** CaseNode
476
477 Represents the use of a case statement.
478
479``` ruby
480 case true
481 when false
482 end
483 ^^^^^^^^^^
484```
485
486 Type: ::PM_CASE_NODE
487
488 @extends pm_node_t
489*/
490pub type pm_case_node_t = pm_case_node;
491/** ClassNode
492
493 Represents a class declaration involving the `class` keyword.
494
495``` ruby
496 class Foo end
497 ^^^^^^^^^^^^^
498```
499
500 Type: ::PM_CLASS_NODE
501
502 @extends pm_node_t
503*/
504pub type pm_class_node_t = pm_class_node;
505/** ClassVariableAndWriteNode
506
507 Represents the use of the `&&=` operator for assignment to a class variable.
508
509``` ruby
510 @@target &&= value
511 ^^^^^^^^^^^^^^^^^^
512```
513
514 Type: ::PM_CLASS_VARIABLE_AND_WRITE_NODE
515
516 @extends pm_node_t
517*/
518pub type pm_class_variable_and_write_node_t = pm_class_variable_and_write_node;
519/** ClassVariableOperatorWriteNode
520
521 Represents assigning to a class variable using an operator that isn't `=`.
522
523``` ruby
524 @@target += value
525 ^^^^^^^^^^^^^^^^^
526```
527
528 Type: ::PM_CLASS_VARIABLE_OPERATOR_WRITE_NODE
529
530 @extends pm_node_t
531*/
532pub type pm_class_variable_operator_write_node_t = pm_class_variable_operator_write_node;
533/** ClassVariableOrWriteNode
534
535 Represents the use of the `||=` operator for assignment to a class variable.
536
537``` ruby
538 @@target ||= value
539 ^^^^^^^^^^^^^^^^^^
540```
541
542 Type: ::PM_CLASS_VARIABLE_OR_WRITE_NODE
543
544 @extends pm_node_t
545*/
546pub type pm_class_variable_or_write_node_t = pm_class_variable_or_write_node;
547/** ClassVariableReadNode
548
549 Represents referencing a class variable.
550
551``` ruby
552 @@foo
553 ^^^^^
554```
555
556 Type: ::PM_CLASS_VARIABLE_READ_NODE
557
558 @extends pm_node_t
559*/
560pub type pm_class_variable_read_node_t = pm_class_variable_read_node;
561/** ClassVariableTargetNode
562
563 Represents writing to a class variable in a context that doesn't have an explicit value.
564
565``` ruby
566 @@foo, @@bar = baz
567 ^^^^^ ^^^^^
568```
569
570 Type: ::PM_CLASS_VARIABLE_TARGET_NODE
571
572 @extends pm_node_t
573*/
574pub type pm_class_variable_target_node_t = pm_class_variable_target_node;
575/** ClassVariableWriteNode
576
577 Represents writing to a class variable.
578
579``` ruby
580 @@foo = 1
581 ^^^^^^^^^
582```
583
584 Type: ::PM_CLASS_VARIABLE_WRITE_NODE
585
586 @extends pm_node_t
587*/
588pub type pm_class_variable_write_node_t = pm_class_variable_write_node;
589/** ConstantAndWriteNode
590
591 Represents the use of the `&&=` operator for assignment to a constant.
592
593``` ruby
594 Target &&= value
595 ^^^^^^^^^^^^^^^^
596```
597
598 Type: ::PM_CONSTANT_AND_WRITE_NODE
599
600 @extends pm_node_t
601*/
602pub type pm_constant_and_write_node_t = pm_constant_and_write_node;
603/** ConstantOperatorWriteNode
604
605 Represents assigning to a constant using an operator that isn't `=`.
606
607``` ruby
608 Target += value
609 ^^^^^^^^^^^^^^^
610```
611
612 Type: ::PM_CONSTANT_OPERATOR_WRITE_NODE
613
614 @extends pm_node_t
615*/
616pub type pm_constant_operator_write_node_t = pm_constant_operator_write_node;
617/** ConstantOrWriteNode
618
619 Represents the use of the `||=` operator for assignment to a constant.
620
621``` ruby
622 Target ||= value
623 ^^^^^^^^^^^^^^^^
624```
625
626 Type: ::PM_CONSTANT_OR_WRITE_NODE
627
628 @extends pm_node_t
629*/
630pub type pm_constant_or_write_node_t = pm_constant_or_write_node;
631/** ConstantPathAndWriteNode
632
633 Represents the use of the `&&=` operator for assignment to a constant path.
634
635``` ruby
636 Parent::Child &&= value
637 ^^^^^^^^^^^^^^^^^^^^^^^
638```
639
640 Type: ::PM_CONSTANT_PATH_AND_WRITE_NODE
641
642 @extends pm_node_t
643*/
644pub type pm_constant_path_and_write_node_t = pm_constant_path_and_write_node;
645/** ConstantPathNode
646
647 Represents accessing a constant through a path of `::` operators.
648
649``` ruby
650 Foo::Bar
651 ^^^^^^^^
652```
653
654 Type: ::PM_CONSTANT_PATH_NODE
655
656 @extends pm_node_t
657*/
658pub type pm_constant_path_node_t = pm_constant_path_node;
659/** ConstantPathOperatorWriteNode
660
661 Represents assigning to a constant path using an operator that isn't `=`.
662
663``` ruby
664 Parent::Child += value
665 ^^^^^^^^^^^^^^^^^^^^^^
666```
667
668 Type: ::PM_CONSTANT_PATH_OPERATOR_WRITE_NODE
669
670 @extends pm_node_t
671*/
672pub type pm_constant_path_operator_write_node_t = pm_constant_path_operator_write_node;
673/** ConstantPathOrWriteNode
674
675 Represents the use of the `||=` operator for assignment to a constant path.
676
677``` ruby
678 Parent::Child ||= value
679 ^^^^^^^^^^^^^^^^^^^^^^^
680```
681
682 Type: ::PM_CONSTANT_PATH_OR_WRITE_NODE
683
684 @extends pm_node_t
685*/
686pub type pm_constant_path_or_write_node_t = pm_constant_path_or_write_node;
687/** ConstantPathTargetNode
688
689 Represents writing to a constant path in a context that doesn't have an explicit value.
690
691``` ruby
692 Foo::Foo, Bar::Bar = baz
693 ^^^^^^^^ ^^^^^^^^
694```
695
696 Type: ::PM_CONSTANT_PATH_TARGET_NODE
697
698 @extends pm_node_t
699*/
700pub type pm_constant_path_target_node_t = pm_constant_path_target_node;
701/** ConstantPathWriteNode
702
703 Represents writing to a constant path.
704
705``` ruby
706 ::Foo = 1
707 ^^^^^^^^^
708```
709
710``` ruby
711 Foo::Bar = 1
712 ^^^^^^^^^^^^
713```
714
715``` ruby
716 ::Foo::Bar = 1
717 ^^^^^^^^^^^^^^
718```
719
720 Type: ::PM_CONSTANT_PATH_WRITE_NODE
721
722 @extends pm_node_t
723*/
724pub type pm_constant_path_write_node_t = pm_constant_path_write_node;
725/** ConstantReadNode
726
727 Represents referencing a constant.
728
729``` ruby
730 Foo
731 ^^^
732```
733
734 Type: ::PM_CONSTANT_READ_NODE
735
736 @extends pm_node_t
737*/
738pub type pm_constant_read_node_t = pm_constant_read_node;
739/** ConstantTargetNode
740
741 Represents writing to a constant in a context that doesn't have an explicit value.
742
743``` ruby
744 Foo, Bar = baz
745 ^^^ ^^^
746```
747
748 Type: ::PM_CONSTANT_TARGET_NODE
749
750 @extends pm_node_t
751*/
752pub type pm_constant_target_node_t = pm_constant_target_node;
753/** ConstantWriteNode
754
755 Represents writing to a constant.
756
757``` ruby
758 Foo = 1
759 ^^^^^^^
760```
761
762 Type: ::PM_CONSTANT_WRITE_NODE
763
764 @extends pm_node_t
765*/
766pub type pm_constant_write_node_t = pm_constant_write_node;
767/** DefNode
768
769 Represents a method definition.
770
771``` ruby
772 def method
773 end
774 ^^^^^^^^^^
775```
776
777 Type: ::PM_DEF_NODE
778
779 @extends pm_node_t
780*/
781pub type pm_def_node_t = pm_def_node;
782/** DefinedNode
783
784 Represents the use of the `defined?` keyword.
785
786``` ruby
787 defined?(a)
788 ^^^^^^^^^^^
789```
790
791 Type: ::PM_DEFINED_NODE
792
793 @extends pm_node_t
794*/
795pub type pm_defined_node_t = pm_defined_node;
796/** ElseNode
797
798 Represents an `else` clause in a `case`, `if`, or `unless` statement.
799
800``` ruby
801 if a then b else c end
802 ^^^^^^^^^^
803```
804
805 Type: ::PM_ELSE_NODE
806
807 @extends pm_node_t
808*/
809pub type pm_else_node_t = pm_else_node;
810/** EmbeddedStatementsNode
811
812 Represents an interpolated set of statements.
813
814``` ruby
815 "foo #{bar}"
816 ^^^^^^
817```
818
819 Type: ::PM_EMBEDDED_STATEMENTS_NODE
820
821 @extends pm_node_t
822*/
823pub type pm_embedded_statements_node_t = pm_embedded_statements_node;
824/** EmbeddedVariableNode
825
826 Represents an interpolated variable.
827
828``` ruby
829 "foo #@bar"
830 ^^^^^
831```
832
833 Type: ::PM_EMBEDDED_VARIABLE_NODE
834
835 @extends pm_node_t
836*/
837pub type pm_embedded_variable_node_t = pm_embedded_variable_node;
838/** EnsureNode
839
840 Represents an `ensure` clause in a `begin` statement.
841
842``` ruby
843 begin
844 foo
845 ensure
846 ^^^^^^
847 bar
848 end
849```
850
851 Type: ::PM_ENSURE_NODE
852
853 @extends pm_node_t
854*/
855pub type pm_ensure_node_t = pm_ensure_node;
856/** ErrorRecoveryNode
857
858 Represents a node that is either missing or unexpected and results in a syntax error.
859
860 Type: ::PM_ERROR_RECOVERY_NODE
861
862 @extends pm_node_t
863*/
864pub type pm_error_recovery_node_t = pm_error_recovery_node;
865/** FalseNode
866
867 Represents the use of the literal `false` keyword.
868
869``` ruby
870 false
871 ^^^^^
872```
873
874 Type: ::PM_FALSE_NODE
875
876 @extends pm_node_t
877*/
878pub type pm_false_node_t = pm_false_node;
879/** FindPatternNode
880
881 Represents a find pattern in pattern matching.
882
883``` ruby
884 foo in *bar, baz, *qux
885 ^^^^^^^^^^^^^^^
886```
887
888``` ruby
889 foo in [*bar, baz, *qux]
890 ^^^^^^^^^^^^^^^^^
891```
892
893``` ruby
894 foo in Foo(*bar, baz, *qux)
895 ^^^^^^^^^^^^^^^^^^^^
896```
897
898``` ruby
899 foo => *bar, baz, *qux
900 ^^^^^^^^^^^^^^^
901```
902
903 Type: ::PM_FIND_PATTERN_NODE
904
905 @extends pm_node_t
906*/
907pub type pm_find_pattern_node_t = pm_find_pattern_node;
908/** FlipFlopNode
909
910 Represents the use of the `..` or `...` operators to create flip flops.
911
912``` ruby
913 baz if foo .. bar
914 ^^^^^^^^^^
915```
916
917 Type: ::PM_FLIP_FLOP_NODE
918
919 Flags (#pm_range_flags):
920 * ::PM_RANGE_FLAGS_EXCLUDE_END
921
922 @extends pm_node_t
923*/
924pub type pm_flip_flop_node_t = pm_flip_flop_node;
925/** FloatNode
926
927 Represents a floating point number literal.
928
929``` ruby
930 1.0
931 ^^^
932```
933
934 Type: ::PM_FLOAT_NODE
935
936 @extends pm_node_t
937*/
938pub type pm_float_node_t = pm_float_node;
939/** ForNode
940
941 Represents the use of the `for` keyword.
942
943``` ruby
944 for i in a end
945 ^^^^^^^^^^^^^^
946```
947
948 Type: ::PM_FOR_NODE
949
950 @extends pm_node_t
951*/
952pub type pm_for_node_t = pm_for_node;
953/** ForwardingArgumentsNode
954
955 Represents forwarding all arguments to this method to another method.
956
957``` ruby
958 def foo(...)
959 bar(...)
960 ^^^
961 end
962```
963
964 Type: ::PM_FORWARDING_ARGUMENTS_NODE
965
966 @extends pm_node_t
967*/
968pub type pm_forwarding_arguments_node_t = pm_forwarding_arguments_node;
969/** ForwardingParameterNode
970
971 Represents the use of the forwarding parameter in a method, block, or lambda declaration.
972
973``` ruby
974 def foo(...)
975 ^^^
976 end
977```
978
979 Type: ::PM_FORWARDING_PARAMETER_NODE
980
981 @extends pm_node_t
982*/
983pub type pm_forwarding_parameter_node_t = pm_forwarding_parameter_node;
984/** ForwardingSuperNode
985
986 Represents the use of the `super` keyword without parentheses or arguments, but which might have a block.
987
988``` ruby
989 super
990 ^^^^^
991```
992
993``` ruby
994 super { 123 }
995 ^^^^^^^^^^^^^
996```
997
998 If it has any other arguments, it would be a `SuperNode` instead.
999
1000 Type: ::PM_FORWARDING_SUPER_NODE
1001
1002 @extends pm_node_t
1003*/
1004pub type pm_forwarding_super_node_t = pm_forwarding_super_node;
1005/** GlobalVariableAndWriteNode
1006
1007 Represents the use of the `&&=` operator for assignment to a global variable.
1008
1009``` ruby
1010 $target &&= value
1011 ^^^^^^^^^^^^^^^^^
1012```
1013
1014 Type: ::PM_GLOBAL_VARIABLE_AND_WRITE_NODE
1015
1016 @extends pm_node_t
1017*/
1018pub type pm_global_variable_and_write_node_t = pm_global_variable_and_write_node;
1019/** GlobalVariableOperatorWriteNode
1020
1021 Represents assigning to a global variable using an operator that isn't `=`.
1022
1023``` ruby
1024 $target += value
1025 ^^^^^^^^^^^^^^^^
1026```
1027
1028 Type: ::PM_GLOBAL_VARIABLE_OPERATOR_WRITE_NODE
1029
1030 @extends pm_node_t
1031*/
1032pub type pm_global_variable_operator_write_node_t = pm_global_variable_operator_write_node;
1033/** GlobalVariableOrWriteNode
1034
1035 Represents the use of the `||=` operator for assignment to a global variable.
1036
1037``` ruby
1038 $target ||= value
1039 ^^^^^^^^^^^^^^^^^
1040```
1041
1042 Type: ::PM_GLOBAL_VARIABLE_OR_WRITE_NODE
1043
1044 @extends pm_node_t
1045*/
1046pub type pm_global_variable_or_write_node_t = pm_global_variable_or_write_node;
1047/** GlobalVariableReadNode
1048
1049 Represents referencing a global variable.
1050
1051``` ruby
1052 $foo
1053 ^^^^
1054```
1055
1056 Type: ::PM_GLOBAL_VARIABLE_READ_NODE
1057
1058 @extends pm_node_t
1059*/
1060pub type pm_global_variable_read_node_t = pm_global_variable_read_node;
1061/** GlobalVariableTargetNode
1062
1063 Represents writing to a global variable in a context that doesn't have an explicit value.
1064
1065``` ruby
1066 $foo, $bar = baz
1067 ^^^^ ^^^^
1068```
1069
1070 Type: ::PM_GLOBAL_VARIABLE_TARGET_NODE
1071
1072 @extends pm_node_t
1073*/
1074pub type pm_global_variable_target_node_t = pm_global_variable_target_node;
1075/** GlobalVariableWriteNode
1076
1077 Represents writing to a global variable.
1078
1079``` ruby
1080 $foo = 1
1081 ^^^^^^^^
1082```
1083
1084 Type: ::PM_GLOBAL_VARIABLE_WRITE_NODE
1085
1086 @extends pm_node_t
1087*/
1088pub type pm_global_variable_write_node_t = pm_global_variable_write_node;
1089/** HashNode
1090
1091 Represents a hash literal.
1092
1093``` ruby
1094 { a => b }
1095 ^^^^^^^^^^
1096```
1097
1098 Type: ::PM_HASH_NODE
1099
1100 @extends pm_node_t
1101*/
1102pub type pm_hash_node_t = pm_hash_node;
1103/** HashPatternNode
1104
1105 Represents a hash pattern in pattern matching.
1106
1107``` ruby
1108 foo => { a: 1, b: 2 }
1109 ^^^^^^^^^^^^^^
1110```
1111
1112``` ruby
1113 foo => { a: 1, b: 2, **c }
1114 ^^^^^^^^^^^^^^^^^^^
1115```
1116
1117``` ruby
1118 foo => Bar[a: 1, b: 2]
1119 ^^^^^^^^^^^^^^^
1120```
1121
1122``` ruby
1123 foo in { a: 1, b: 2 }
1124 ^^^^^^^^^^^^^^
1125```
1126
1127 Type: ::PM_HASH_PATTERN_NODE
1128
1129 @extends pm_node_t
1130*/
1131pub type pm_hash_pattern_node_t = pm_hash_pattern_node;
1132/** IfNode
1133
1134 Represents the use of the `if` keyword, either in the block form or the modifier form, or a ternary expression.
1135
1136``` ruby
1137 bar if foo
1138 ^^^^^^^^^^
1139```
1140
1141``` ruby
1142 if foo then bar end
1143 ^^^^^^^^^^^^^^^^^^^
1144```
1145
1146``` ruby
1147 foo ? bar : baz
1148 ^^^^^^^^^^^^^^^
1149```
1150
1151 Type: ::PM_IF_NODE
1152
1153 @extends pm_node_t
1154*/
1155pub type pm_if_node_t = pm_if_node;
1156/** ImaginaryNode
1157
1158 Represents an imaginary number literal.
1159
1160``` ruby
1161 1.0i
1162 ^^^^
1163```
1164
1165 Type: ::PM_IMAGINARY_NODE
1166
1167 @extends pm_node_t
1168*/
1169pub type pm_imaginary_node_t = pm_imaginary_node;
1170/** ImplicitNode
1171
1172 Represents a node that is implicitly being added to the tree but doesn't correspond directly to a node in the source.
1173
1174``` ruby
1175 { foo: }
1176 ^^^^
1177```
1178
1179``` ruby
1180 { Foo: }
1181 ^^^^
1182```
1183
1184``` ruby
1185 foo in { bar: }
1186 ^^^^
1187```
1188
1189 Type: ::PM_IMPLICIT_NODE
1190
1191 @extends pm_node_t
1192*/
1193pub type pm_implicit_node_t = pm_implicit_node;
1194/** ImplicitRestNode
1195
1196 Represents using a trailing comma to indicate an implicit rest parameter.
1197
1198``` ruby
1199 foo { |bar,| }
1200 ^
1201```
1202
1203``` ruby
1204 foo in [bar,]
1205 ^
1206```
1207
1208``` ruby
1209 for foo, in bar do end
1210 ^
1211```
1212
1213``` ruby
1214 foo, = bar
1215 ^
1216```
1217
1218 Type: ::PM_IMPLICIT_REST_NODE
1219
1220 @extends pm_node_t
1221*/
1222pub type pm_implicit_rest_node_t = pm_implicit_rest_node;
1223/** InNode
1224
1225 Represents the use of the `in` keyword in a case statement.
1226
1227``` ruby
1228 case a; in b then c end
1229 ^^^^^^^^^^^
1230```
1231
1232 Type: ::PM_IN_NODE
1233
1234 @extends pm_node_t
1235*/
1236pub type pm_in_node_t = pm_in_node;
1237/** IndexAndWriteNode
1238
1239 Represents the use of the `&&=` operator on a call to the `[]` method.
1240
1241``` ruby
1242 foo.bar[baz] &&= value
1243 ^^^^^^^^^^^^^^^^^^^^^^
1244```
1245
1246 Type: ::PM_INDEX_AND_WRITE_NODE
1247
1248 Flags (#pm_call_node_flags):
1249 * ::PM_CALL_NODE_FLAGS_SAFE_NAVIGATION
1250 * ::PM_CALL_NODE_FLAGS_VARIABLE_CALL
1251 * ::PM_CALL_NODE_FLAGS_ATTRIBUTE_WRITE
1252 * ::PM_CALL_NODE_FLAGS_IGNORE_VISIBILITY
1253
1254 @extends pm_node_t
1255*/
1256pub type pm_index_and_write_node_t = pm_index_and_write_node;
1257/** IndexOperatorWriteNode
1258
1259 Represents the use of an assignment operator on a call to `[]`.
1260
1261``` ruby
1262 foo.bar[baz] += value
1263 ^^^^^^^^^^^^^^^^^^^^^
1264```
1265
1266 Type: ::PM_INDEX_OPERATOR_WRITE_NODE
1267
1268 Flags (#pm_call_node_flags):
1269 * ::PM_CALL_NODE_FLAGS_SAFE_NAVIGATION
1270 * ::PM_CALL_NODE_FLAGS_VARIABLE_CALL
1271 * ::PM_CALL_NODE_FLAGS_ATTRIBUTE_WRITE
1272 * ::PM_CALL_NODE_FLAGS_IGNORE_VISIBILITY
1273
1274 @extends pm_node_t
1275*/
1276pub type pm_index_operator_write_node_t = pm_index_operator_write_node;
1277/** IndexOrWriteNode
1278
1279 Represents the use of the `||=` operator on a call to `[]`.
1280
1281``` ruby
1282 foo.bar[baz] ||= value
1283 ^^^^^^^^^^^^^^^^^^^^^^
1284```
1285
1286 Type: ::PM_INDEX_OR_WRITE_NODE
1287
1288 Flags (#pm_call_node_flags):
1289 * ::PM_CALL_NODE_FLAGS_SAFE_NAVIGATION
1290 * ::PM_CALL_NODE_FLAGS_VARIABLE_CALL
1291 * ::PM_CALL_NODE_FLAGS_ATTRIBUTE_WRITE
1292 * ::PM_CALL_NODE_FLAGS_IGNORE_VISIBILITY
1293
1294 @extends pm_node_t
1295*/
1296pub type pm_index_or_write_node_t = pm_index_or_write_node;
1297/** IndexTargetNode
1298
1299 Represents assigning to an index.
1300
1301``` ruby
1302 foo[bar], = 1
1303 ^^^^^^^^
1304```
1305
1306``` ruby
1307 begin
1308 rescue => foo[bar]
1309 ^^^^^^^^
1310 end
1311```
1312
1313``` ruby
1314 for foo[bar] in baz do end
1315 ^^^^^^^^
1316```
1317
1318 Type: ::PM_INDEX_TARGET_NODE
1319
1320 Flags (#pm_call_node_flags):
1321 * ::PM_CALL_NODE_FLAGS_SAFE_NAVIGATION
1322 * ::PM_CALL_NODE_FLAGS_VARIABLE_CALL
1323 * ::PM_CALL_NODE_FLAGS_ATTRIBUTE_WRITE
1324 * ::PM_CALL_NODE_FLAGS_IGNORE_VISIBILITY
1325
1326 @extends pm_node_t
1327*/
1328pub type pm_index_target_node_t = pm_index_target_node;
1329/** InstanceVariableAndWriteNode
1330
1331 Represents the use of the `&&=` operator for assignment to an instance variable.
1332
1333``` ruby
1334 @target &&= value
1335 ^^^^^^^^^^^^^^^^^
1336```
1337
1338 Type: ::PM_INSTANCE_VARIABLE_AND_WRITE_NODE
1339
1340 @extends pm_node_t
1341*/
1342pub type pm_instance_variable_and_write_node_t = pm_instance_variable_and_write_node;
1343/** InstanceVariableOperatorWriteNode
1344
1345 Represents assigning to an instance variable using an operator that isn't `=`.
1346
1347``` ruby
1348 @target += value
1349 ^^^^^^^^^^^^^^^^
1350```
1351
1352 Type: ::PM_INSTANCE_VARIABLE_OPERATOR_WRITE_NODE
1353
1354 @extends pm_node_t
1355*/
1356pub type pm_instance_variable_operator_write_node_t = pm_instance_variable_operator_write_node;
1357/** InstanceVariableOrWriteNode
1358
1359 Represents the use of the `||=` operator for assignment to an instance variable.
1360
1361``` ruby
1362 @target ||= value
1363 ^^^^^^^^^^^^^^^^^
1364```
1365
1366 Type: ::PM_INSTANCE_VARIABLE_OR_WRITE_NODE
1367
1368 @extends pm_node_t
1369*/
1370pub type pm_instance_variable_or_write_node_t = pm_instance_variable_or_write_node;
1371/** InstanceVariableReadNode
1372
1373 Represents referencing an instance variable.
1374
1375``` ruby
1376 @foo
1377 ^^^^
1378```
1379
1380 Type: ::PM_INSTANCE_VARIABLE_READ_NODE
1381
1382 @extends pm_node_t
1383*/
1384pub type pm_instance_variable_read_node_t = pm_instance_variable_read_node;
1385/** InstanceVariableTargetNode
1386
1387 Represents writing to an instance variable in a context that doesn't have an explicit value.
1388
1389``` ruby
1390 @foo, @bar = baz
1391 ^^^^ ^^^^
1392```
1393
1394 Type: ::PM_INSTANCE_VARIABLE_TARGET_NODE
1395
1396 @extends pm_node_t
1397*/
1398pub type pm_instance_variable_target_node_t = pm_instance_variable_target_node;
1399/** InstanceVariableWriteNode
1400
1401 Represents writing to an instance variable.
1402
1403``` ruby
1404 @foo = 1
1405 ^^^^^^^^
1406```
1407
1408 Type: ::PM_INSTANCE_VARIABLE_WRITE_NODE
1409
1410 @extends pm_node_t
1411*/
1412pub type pm_instance_variable_write_node_t = pm_instance_variable_write_node;
1413/** IntegerNode
1414
1415 Represents an integer number literal.
1416
1417``` ruby
1418 1
1419 ^
1420```
1421
1422 Type: ::PM_INTEGER_NODE
1423
1424 Flags (#pm_integer_base_flags):
1425 * ::PM_INTEGER_BASE_FLAGS_BINARY
1426 * ::PM_INTEGER_BASE_FLAGS_DECIMAL
1427 * ::PM_INTEGER_BASE_FLAGS_OCTAL
1428 * ::PM_INTEGER_BASE_FLAGS_HEXADECIMAL
1429
1430 @extends pm_node_t
1431*/
1432pub type pm_integer_node_t = pm_integer_node;
1433/** InterpolatedMatchLastLineNode
1434
1435 Represents a regular expression literal that contains interpolation that is being used in the predicate of a conditional to implicitly match against the last line read by an IO object.
1436
1437``` ruby
1438 if /foo #{bar} baz/ then end
1439 ^^^^^^^^^^^^^^^^
1440```
1441
1442 Type: ::PM_INTERPOLATED_MATCH_LAST_LINE_NODE
1443
1444 Flags (#pm_regular_expression_flags):
1445 * ::PM_REGULAR_EXPRESSION_FLAGS_IGNORE_CASE
1446 * ::PM_REGULAR_EXPRESSION_FLAGS_EXTENDED
1447 * ::PM_REGULAR_EXPRESSION_FLAGS_MULTI_LINE
1448 * ::PM_REGULAR_EXPRESSION_FLAGS_ONCE
1449 * ::PM_REGULAR_EXPRESSION_FLAGS_EUC_JP
1450 * ::PM_REGULAR_EXPRESSION_FLAGS_ASCII_8BIT
1451 * ::PM_REGULAR_EXPRESSION_FLAGS_WINDOWS_31J
1452 * ::PM_REGULAR_EXPRESSION_FLAGS_UTF_8
1453 * ::PM_REGULAR_EXPRESSION_FLAGS_FORCED_UTF8_ENCODING
1454 * ::PM_REGULAR_EXPRESSION_FLAGS_FORCED_BINARY_ENCODING
1455 * ::PM_REGULAR_EXPRESSION_FLAGS_FORCED_US_ASCII_ENCODING
1456
1457 @extends pm_node_t
1458*/
1459pub type pm_interpolated_match_last_line_node_t = pm_interpolated_match_last_line_node;
1460/** InterpolatedRegularExpressionNode
1461
1462 Represents a regular expression literal that contains interpolation.
1463
1464``` ruby
1465 /foo #{bar} baz/
1466 ^^^^^^^^^^^^^^^^
1467```
1468
1469 Type: ::PM_INTERPOLATED_REGULAR_EXPRESSION_NODE
1470
1471 Flags (#pm_regular_expression_flags):
1472 * ::PM_REGULAR_EXPRESSION_FLAGS_IGNORE_CASE
1473 * ::PM_REGULAR_EXPRESSION_FLAGS_EXTENDED
1474 * ::PM_REGULAR_EXPRESSION_FLAGS_MULTI_LINE
1475 * ::PM_REGULAR_EXPRESSION_FLAGS_ONCE
1476 * ::PM_REGULAR_EXPRESSION_FLAGS_EUC_JP
1477 * ::PM_REGULAR_EXPRESSION_FLAGS_ASCII_8BIT
1478 * ::PM_REGULAR_EXPRESSION_FLAGS_WINDOWS_31J
1479 * ::PM_REGULAR_EXPRESSION_FLAGS_UTF_8
1480 * ::PM_REGULAR_EXPRESSION_FLAGS_FORCED_UTF8_ENCODING
1481 * ::PM_REGULAR_EXPRESSION_FLAGS_FORCED_BINARY_ENCODING
1482 * ::PM_REGULAR_EXPRESSION_FLAGS_FORCED_US_ASCII_ENCODING
1483
1484 @extends pm_node_t
1485*/
1486pub type pm_interpolated_regular_expression_node_t = pm_interpolated_regular_expression_node;
1487/** InterpolatedStringNode
1488
1489 Represents a string literal that contains interpolation.
1490
1491``` ruby
1492 "foo #{bar} baz"
1493 ^^^^^^^^^^^^^^^^
1494```
1495
1496 Type: ::PM_INTERPOLATED_STRING_NODE
1497
1498 Flags (#pm_interpolated_string_node_flags):
1499 * ::PM_INTERPOLATED_STRING_NODE_FLAGS_FROZEN
1500 * ::PM_INTERPOLATED_STRING_NODE_FLAGS_MUTABLE
1501
1502 @extends pm_node_t
1503*/
1504pub type pm_interpolated_string_node_t = pm_interpolated_string_node;
1505/** InterpolatedSymbolNode
1506
1507 Represents a symbol literal that contains interpolation.
1508
1509``` ruby
1510 :"foo #{bar} baz"
1511 ^^^^^^^^^^^^^^^^^
1512```
1513
1514 Type: ::PM_INTERPOLATED_SYMBOL_NODE
1515
1516 @extends pm_node_t
1517*/
1518pub type pm_interpolated_symbol_node_t = pm_interpolated_symbol_node;
1519/** InterpolatedXStringNode
1520
1521 Represents an xstring literal that contains interpolation.
1522
1523``` ruby
1524 `foo #{bar} baz`
1525 ^^^^^^^^^^^^^^^^
1526```
1527
1528 Type: ::PM_INTERPOLATED_X_STRING_NODE
1529
1530 @extends pm_node_t
1531*/
1532pub type pm_interpolated_x_string_node_t = pm_interpolated_x_string_node;
1533/** ItLocalVariableReadNode
1534
1535 Represents reading from the implicit `it` local variable.
1536
1537``` ruby
1538 -> { it }
1539 ^^
1540```
1541
1542 Type: ::PM_IT_LOCAL_VARIABLE_READ_NODE
1543
1544 @extends pm_node_t
1545*/
1546pub type pm_it_local_variable_read_node_t = pm_it_local_variable_read_node;
1547/** ItParametersNode
1548
1549 Represents an implicit set of parameters through the use of the `it` keyword within a block or lambda.
1550
1551``` ruby
1552 -> { it + it }
1553 ^^^^^^^^^^^^^^
1554```
1555
1556 Type: ::PM_IT_PARAMETERS_NODE
1557
1558 @extends pm_node_t
1559*/
1560pub type pm_it_parameters_node_t = pm_it_parameters_node;
1561/** KeywordHashNode
1562
1563 Represents a hash literal without opening and closing braces.
1564
1565``` ruby
1566 foo(a: b)
1567 ^^^^
1568```
1569
1570 Type: ::PM_KEYWORD_HASH_NODE
1571
1572 Flags (#pm_keyword_hash_node_flags):
1573 * ::PM_KEYWORD_HASH_NODE_FLAGS_SYMBOL_KEYS
1574
1575 @extends pm_node_t
1576*/
1577pub type pm_keyword_hash_node_t = pm_keyword_hash_node;
1578/** KeywordRestParameterNode
1579
1580 Represents a keyword rest parameter to a method, block, or lambda definition.
1581
1582``` ruby
1583 def a(**b)
1584 ^^^
1585 end
1586```
1587
1588 Type: ::PM_KEYWORD_REST_PARAMETER_NODE
1589
1590 Flags (#pm_parameter_flags):
1591 * ::PM_PARAMETER_FLAGS_REPEATED_PARAMETER
1592
1593 @extends pm_node_t
1594*/
1595pub type pm_keyword_rest_parameter_node_t = pm_keyword_rest_parameter_node;
1596/** LambdaNode
1597
1598 Represents using a lambda literal (not the lambda method call).
1599
1600``` ruby
1601 ->(value) { value * 2 }
1602 ^^^^^^^^^^^^^^^^^^^^^^^
1603```
1604
1605 Type: ::PM_LAMBDA_NODE
1606
1607 @extends pm_node_t
1608*/
1609pub type pm_lambda_node_t = pm_lambda_node;
1610/** LocalVariableAndWriteNode
1611
1612 Represents the use of the `&&=` operator for assignment to a local variable.
1613
1614``` ruby
1615 target &&= value
1616 ^^^^^^^^^^^^^^^^
1617```
1618
1619 Type: ::PM_LOCAL_VARIABLE_AND_WRITE_NODE
1620
1621 @extends pm_node_t
1622*/
1623pub type pm_local_variable_and_write_node_t = pm_local_variable_and_write_node;
1624/** LocalVariableOperatorWriteNode
1625
1626 Represents assigning to a local variable using an operator that isn't `=`.
1627
1628``` ruby
1629 target += value
1630 ^^^^^^^^^^^^^^^
1631```
1632
1633 Type: ::PM_LOCAL_VARIABLE_OPERATOR_WRITE_NODE
1634
1635 @extends pm_node_t
1636*/
1637pub type pm_local_variable_operator_write_node_t = pm_local_variable_operator_write_node;
1638/** LocalVariableOrWriteNode
1639
1640 Represents the use of the `||=` operator for assignment to a local variable.
1641
1642``` ruby
1643 target ||= value
1644 ^^^^^^^^^^^^^^^^
1645```
1646
1647 Type: ::PM_LOCAL_VARIABLE_OR_WRITE_NODE
1648
1649 @extends pm_node_t
1650*/
1651pub type pm_local_variable_or_write_node_t = pm_local_variable_or_write_node;
1652/** LocalVariableReadNode
1653
1654 Represents reading a local variable. Note that this requires that a local variable of the same name has already been written to in the same scope, otherwise it is parsed as a method call.
1655
1656``` ruby
1657 foo
1658 ^^^
1659```
1660
1661 Type: ::PM_LOCAL_VARIABLE_READ_NODE
1662
1663 @extends pm_node_t
1664*/
1665pub type pm_local_variable_read_node_t = pm_local_variable_read_node;
1666/** LocalVariableTargetNode
1667
1668 Represents writing to a local variable in a context that doesn't have an explicit value.
1669
1670``` ruby
1671 foo, bar = baz
1672 ^^^ ^^^
1673```
1674
1675``` ruby
1676 foo => baz
1677 ^^^
1678```
1679
1680 Type: ::PM_LOCAL_VARIABLE_TARGET_NODE
1681
1682 @extends pm_node_t
1683*/
1684pub type pm_local_variable_target_node_t = pm_local_variable_target_node;
1685/** LocalVariableWriteNode
1686
1687 Represents writing to a local variable.
1688
1689``` ruby
1690 foo = 1
1691 ^^^^^^^
1692```
1693
1694 Type: ::PM_LOCAL_VARIABLE_WRITE_NODE
1695
1696 @extends pm_node_t
1697*/
1698pub type pm_local_variable_write_node_t = pm_local_variable_write_node;
1699/** MatchLastLineNode
1700
1701 Represents a regular expression literal used in the predicate of a conditional to implicitly match against the last line read by an IO object.
1702
1703``` ruby
1704 if /foo/i then end
1705 ^^^^^^
1706```
1707
1708 Type: ::PM_MATCH_LAST_LINE_NODE
1709
1710 Flags (#pm_regular_expression_flags):
1711 * ::PM_REGULAR_EXPRESSION_FLAGS_IGNORE_CASE
1712 * ::PM_REGULAR_EXPRESSION_FLAGS_EXTENDED
1713 * ::PM_REGULAR_EXPRESSION_FLAGS_MULTI_LINE
1714 * ::PM_REGULAR_EXPRESSION_FLAGS_ONCE
1715 * ::PM_REGULAR_EXPRESSION_FLAGS_EUC_JP
1716 * ::PM_REGULAR_EXPRESSION_FLAGS_ASCII_8BIT
1717 * ::PM_REGULAR_EXPRESSION_FLAGS_WINDOWS_31J
1718 * ::PM_REGULAR_EXPRESSION_FLAGS_UTF_8
1719 * ::PM_REGULAR_EXPRESSION_FLAGS_FORCED_UTF8_ENCODING
1720 * ::PM_REGULAR_EXPRESSION_FLAGS_FORCED_BINARY_ENCODING
1721 * ::PM_REGULAR_EXPRESSION_FLAGS_FORCED_US_ASCII_ENCODING
1722
1723 @extends pm_node_t
1724*/
1725pub type pm_match_last_line_node_t = pm_match_last_line_node;
1726/** MatchPredicateNode
1727
1728 Represents the use of the modifier `in` operator.
1729
1730``` ruby
1731 foo in bar
1732 ^^^^^^^^^^
1733```
1734
1735 Type: ::PM_MATCH_PREDICATE_NODE
1736
1737 @extends pm_node_t
1738*/
1739pub type pm_match_predicate_node_t = pm_match_predicate_node;
1740/** MatchRequiredNode
1741
1742 Represents the use of the `=>` operator.
1743
1744``` ruby
1745 foo => bar
1746 ^^^^^^^^^^
1747```
1748
1749 Type: ::PM_MATCH_REQUIRED_NODE
1750
1751 @extends pm_node_t
1752*/
1753pub type pm_match_required_node_t = pm_match_required_node;
1754/** MatchWriteNode
1755
1756 Represents writing local variables using a regular expression match with named capture groups.
1757
1758``` ruby
1759 /(?<foo>bar)/ =~ baz
1760 ^^^^^^^^^^^^^^^^^^^^
1761```
1762
1763 Type: ::PM_MATCH_WRITE_NODE
1764
1765 @extends pm_node_t
1766*/
1767pub type pm_match_write_node_t = pm_match_write_node;
1768/** ModuleNode
1769
1770 Represents a module declaration involving the `module` keyword.
1771
1772``` ruby
1773 module Foo end
1774 ^^^^^^^^^^^^^^
1775```
1776
1777 Type: ::PM_MODULE_NODE
1778
1779 @extends pm_node_t
1780*/
1781pub type pm_module_node_t = pm_module_node;
1782/** MultiTargetNode
1783
1784 Represents a multi-target expression.
1785
1786``` ruby
1787 a, (b, c) = 1, 2, 3
1788 ^^^^^^
1789```
1790
1791 This can be a part of `MultiWriteNode` as above, or the target of a `for` loop
1792
1793``` ruby
1794 for a, b in [[1, 2], [3, 4]]
1795 ^^^^
1796```
1797
1798 Type: ::PM_MULTI_TARGET_NODE
1799
1800 @extends pm_node_t
1801*/
1802pub type pm_multi_target_node_t = pm_multi_target_node;
1803/** MultiWriteNode
1804
1805 Represents a write to a multi-target expression.
1806
1807``` ruby
1808 a, b, c = 1, 2, 3
1809 ^^^^^^^^^^^^^^^^^
1810```
1811
1812 Type: ::PM_MULTI_WRITE_NODE
1813
1814 @extends pm_node_t
1815*/
1816pub type pm_multi_write_node_t = pm_multi_write_node;
1817/** NextNode
1818
1819 Represents the use of the `next` keyword.
1820
1821``` ruby
1822 next 1
1823 ^^^^^^
1824```
1825
1826 Type: ::PM_NEXT_NODE
1827
1828 @extends pm_node_t
1829*/
1830pub type pm_next_node_t = pm_next_node;
1831/** NilNode
1832
1833 Represents the use of the `nil` keyword.
1834
1835``` ruby
1836 nil
1837 ^^^
1838```
1839
1840 Type: ::PM_NIL_NODE
1841
1842 @extends pm_node_t
1843*/
1844pub type pm_nil_node_t = pm_nil_node;
1845/** NoBlockParameterNode
1846
1847 Represents the use of `&nil` inside method arguments.
1848
1849``` ruby
1850 def a(&nil)
1851 ^^^^
1852 end
1853```
1854
1855 Type: ::PM_NO_BLOCK_PARAMETER_NODE
1856
1857 @extends pm_node_t
1858*/
1859pub type pm_no_block_parameter_node_t = pm_no_block_parameter_node;
1860/** NoKeywordsParameterNode
1861
1862 Represents the use of `**nil` inside method arguments.
1863
1864``` ruby
1865 def a(**nil)
1866 ^^^^^
1867 end
1868```
1869
1870 Type: ::PM_NO_KEYWORDS_PARAMETER_NODE
1871
1872 @extends pm_node_t
1873*/
1874pub type pm_no_keywords_parameter_node_t = pm_no_keywords_parameter_node;
1875/** NumberedParametersNode
1876
1877 Represents an implicit set of parameters through the use of numbered parameters within a block or lambda.
1878
1879``` ruby
1880 -> { _1 + _2 }
1881 ^^^^^^^^^^^^^^
1882```
1883
1884 Type: ::PM_NUMBERED_PARAMETERS_NODE
1885
1886 @extends pm_node_t
1887*/
1888pub type pm_numbered_parameters_node_t = pm_numbered_parameters_node;
1889/** NumberedReferenceReadNode
1890
1891 Represents reading a numbered reference to a capture in the previous match.
1892
1893``` ruby
1894 $1
1895 ^^
1896```
1897
1898 Type: ::PM_NUMBERED_REFERENCE_READ_NODE
1899
1900 @extends pm_node_t
1901*/
1902pub type pm_numbered_reference_read_node_t = pm_numbered_reference_read_node;
1903/** OptionalKeywordParameterNode
1904
1905 Represents an optional keyword parameter to a method, block, or lambda definition.
1906
1907``` ruby
1908 def a(b: 1)
1909 ^^^^
1910 end
1911```
1912
1913 Type: ::PM_OPTIONAL_KEYWORD_PARAMETER_NODE
1914
1915 Flags (#pm_parameter_flags):
1916 * ::PM_PARAMETER_FLAGS_REPEATED_PARAMETER
1917
1918 @extends pm_node_t
1919*/
1920pub type pm_optional_keyword_parameter_node_t = pm_optional_keyword_parameter_node;
1921/** OptionalParameterNode
1922
1923 Represents an optional parameter to a method, block, or lambda definition.
1924
1925``` ruby
1926 def a(b = 1)
1927 ^^^^^
1928 end
1929```
1930
1931 Type: ::PM_OPTIONAL_PARAMETER_NODE
1932
1933 Flags (#pm_parameter_flags):
1934 * ::PM_PARAMETER_FLAGS_REPEATED_PARAMETER
1935
1936 @extends pm_node_t
1937*/
1938pub type pm_optional_parameter_node_t = pm_optional_parameter_node;
1939/** OrNode
1940
1941 Represents the use of the `||` operator or the `or` keyword.
1942
1943``` ruby
1944 left or right
1945 ^^^^^^^^^^^^^
1946```
1947
1948 Type: ::PM_OR_NODE
1949
1950 @extends pm_node_t
1951*/
1952pub type pm_or_node_t = pm_or_node;
1953/** ParametersNode
1954
1955 Represents the list of parameters on a method, block, or lambda definition.
1956
1957``` ruby
1958 def a(b, c, d)
1959 ^^^^^^^
1960 end
1961```
1962
1963 Type: ::PM_PARAMETERS_NODE
1964
1965 @extends pm_node_t
1966*/
1967pub type pm_parameters_node_t = pm_parameters_node;
1968/** ParenthesesNode
1969
1970 Represents a parenthesized expression
1971
1972``` ruby
1973 (10 + 34)
1974 ^^^^^^^^^
1975```
1976
1977 Type: ::PM_PARENTHESES_NODE
1978
1979 Flags (#pm_parentheses_node_flags):
1980 * ::PM_PARENTHESES_NODE_FLAGS_MULTIPLE_STATEMENTS
1981
1982 @extends pm_node_t
1983*/
1984pub type pm_parentheses_node_t = pm_parentheses_node;
1985/** PinnedExpressionNode
1986
1987 Represents the use of the `^` operator for pinning an expression in a pattern matching expression.
1988
1989``` ruby
1990 foo in ^(bar)
1991 ^^^^^^
1992```
1993
1994 Type: ::PM_PINNED_EXPRESSION_NODE
1995
1996 @extends pm_node_t
1997*/
1998pub type pm_pinned_expression_node_t = pm_pinned_expression_node;
1999/** PinnedVariableNode
2000
2001 Represents the use of the `^` operator for pinning a variable in a pattern matching expression.
2002
2003``` ruby
2004 foo in ^bar
2005 ^^^^
2006```
2007
2008 Type: ::PM_PINNED_VARIABLE_NODE
2009
2010 @extends pm_node_t
2011*/
2012pub type pm_pinned_variable_node_t = pm_pinned_variable_node;
2013/** PostExecutionNode
2014
2015 Represents the use of the `END` keyword.
2016
2017``` ruby
2018 END { foo }
2019 ^^^^^^^^^^^
2020```
2021
2022 Type: ::PM_POST_EXECUTION_NODE
2023
2024 @extends pm_node_t
2025*/
2026pub type pm_post_execution_node_t = pm_post_execution_node;
2027/** PreExecutionNode
2028
2029 Represents the use of the `BEGIN` keyword.
2030
2031``` ruby
2032 BEGIN { foo }
2033 ^^^^^^^^^^^^^
2034```
2035
2036 Type: ::PM_PRE_EXECUTION_NODE
2037
2038 @extends pm_node_t
2039*/
2040pub type pm_pre_execution_node_t = pm_pre_execution_node;
2041/** ProgramNode
2042
2043 The top level node of any parse tree.
2044
2045 Type: ::PM_PROGRAM_NODE
2046
2047 @extends pm_node_t
2048*/
2049pub type pm_program_node_t = pm_program_node;
2050/** RangeNode
2051
2052 Represents the use of the `..` or `...` operators.
2053
2054``` ruby
2055 1..2
2056 ^^^^
2057```
2058
2059``` ruby
2060 c if a =~ /left/ ... b =~ /right/
2061 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2062```
2063
2064 Type: ::PM_RANGE_NODE
2065
2066 Flags (#pm_range_flags):
2067 * ::PM_RANGE_FLAGS_EXCLUDE_END
2068
2069 @extends pm_node_t
2070*/
2071pub type pm_range_node_t = pm_range_node;
2072/** RationalNode
2073
2074 Represents a rational number literal.
2075
2076``` ruby
2077 1.0r
2078 ^^^^
2079```
2080
2081 Type: ::PM_RATIONAL_NODE
2082
2083 Flags (#pm_integer_base_flags):
2084 * ::PM_INTEGER_BASE_FLAGS_BINARY
2085 * ::PM_INTEGER_BASE_FLAGS_DECIMAL
2086 * ::PM_INTEGER_BASE_FLAGS_OCTAL
2087 * ::PM_INTEGER_BASE_FLAGS_HEXADECIMAL
2088
2089 @extends pm_node_t
2090*/
2091pub type pm_rational_node_t = pm_rational_node;
2092/** RedoNode
2093
2094 Represents the use of the `redo` keyword.
2095
2096``` ruby
2097 redo
2098 ^^^^
2099```
2100
2101 Type: ::PM_REDO_NODE
2102
2103 @extends pm_node_t
2104*/
2105pub type pm_redo_node_t = pm_redo_node;
2106/** RegularExpressionNode
2107
2108 Represents a regular expression literal with no interpolation.
2109
2110``` ruby
2111 /foo/i
2112 ^^^^^^
2113```
2114
2115 Type: ::PM_REGULAR_EXPRESSION_NODE
2116
2117 Flags (#pm_regular_expression_flags):
2118 * ::PM_REGULAR_EXPRESSION_FLAGS_IGNORE_CASE
2119 * ::PM_REGULAR_EXPRESSION_FLAGS_EXTENDED
2120 * ::PM_REGULAR_EXPRESSION_FLAGS_MULTI_LINE
2121 * ::PM_REGULAR_EXPRESSION_FLAGS_ONCE
2122 * ::PM_REGULAR_EXPRESSION_FLAGS_EUC_JP
2123 * ::PM_REGULAR_EXPRESSION_FLAGS_ASCII_8BIT
2124 * ::PM_REGULAR_EXPRESSION_FLAGS_WINDOWS_31J
2125 * ::PM_REGULAR_EXPRESSION_FLAGS_UTF_8
2126 * ::PM_REGULAR_EXPRESSION_FLAGS_FORCED_UTF8_ENCODING
2127 * ::PM_REGULAR_EXPRESSION_FLAGS_FORCED_BINARY_ENCODING
2128 * ::PM_REGULAR_EXPRESSION_FLAGS_FORCED_US_ASCII_ENCODING
2129
2130 @extends pm_node_t
2131*/
2132pub type pm_regular_expression_node_t = pm_regular_expression_node;
2133/** RequiredKeywordParameterNode
2134
2135 Represents a required keyword parameter to a method, block, or lambda definition.
2136
2137``` ruby
2138 def a(b: )
2139 ^^
2140 end
2141```
2142
2143 Type: ::PM_REQUIRED_KEYWORD_PARAMETER_NODE
2144
2145 Flags (#pm_parameter_flags):
2146 * ::PM_PARAMETER_FLAGS_REPEATED_PARAMETER
2147
2148 @extends pm_node_t
2149*/
2150pub type pm_required_keyword_parameter_node_t = pm_required_keyword_parameter_node;
2151/** RequiredParameterNode
2152
2153 Represents a required parameter to a method, block, or lambda definition.
2154
2155``` ruby
2156 def a(b)
2157 ^
2158 end
2159```
2160
2161 Type: ::PM_REQUIRED_PARAMETER_NODE
2162
2163 Flags (#pm_parameter_flags):
2164 * ::PM_PARAMETER_FLAGS_REPEATED_PARAMETER
2165
2166 @extends pm_node_t
2167*/
2168pub type pm_required_parameter_node_t = pm_required_parameter_node;
2169/** RescueModifierNode
2170
2171 Represents an expression modified with a rescue.
2172
2173``` ruby
2174 foo rescue nil
2175 ^^^^^^^^^^^^^^
2176```
2177
2178 Type: ::PM_RESCUE_MODIFIER_NODE
2179
2180 @extends pm_node_t
2181*/
2182pub type pm_rescue_modifier_node_t = pm_rescue_modifier_node;
2183/** RescueNode
2184
2185 Represents a rescue statement.
2186
2187``` ruby
2188 begin
2189 rescue Foo, *splat, Bar => ex
2190 foo
2191 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2192 end
2193```
2194
2195 `Foo, *splat, Bar` are in the `exceptions` field. `ex` is in the `reference` field.
2196
2197 Type: ::PM_RESCUE_NODE
2198
2199 @extends pm_node_t
2200*/
2201pub type pm_rescue_node_t = pm_rescue_node;
2202/** RestParameterNode
2203
2204 Represents a rest parameter to a method, block, or lambda definition.
2205
2206``` ruby
2207 def a(*b)
2208 ^^
2209 end
2210```
2211
2212 Type: ::PM_REST_PARAMETER_NODE
2213
2214 Flags (#pm_parameter_flags):
2215 * ::PM_PARAMETER_FLAGS_REPEATED_PARAMETER
2216
2217 @extends pm_node_t
2218*/
2219pub type pm_rest_parameter_node_t = pm_rest_parameter_node;
2220/** RetryNode
2221
2222 Represents the use of the `retry` keyword.
2223
2224``` ruby
2225 retry
2226 ^^^^^
2227```
2228
2229 Type: ::PM_RETRY_NODE
2230
2231 @extends pm_node_t
2232*/
2233pub type pm_retry_node_t = pm_retry_node;
2234/** ReturnNode
2235
2236 Represents the use of the `return` keyword.
2237
2238``` ruby
2239 return 1
2240 ^^^^^^^^
2241```
2242
2243 Type: ::PM_RETURN_NODE
2244
2245 @extends pm_node_t
2246*/
2247pub type pm_return_node_t = pm_return_node;
2248/** SelfNode
2249
2250 Represents the `self` keyword.
2251
2252``` ruby
2253 self
2254 ^^^^
2255```
2256
2257 Type: ::PM_SELF_NODE
2258
2259 @extends pm_node_t
2260*/
2261pub type pm_self_node_t = pm_self_node;
2262/** ShareableConstantNode
2263
2264 This node wraps a constant write to indicate that when the value is written, it should have its shareability state modified.
2265
2266``` ruby
2267 # shareable_constant_value: literal
2268 C = { a: 1 }
2269 ^^^^^^^^^^^^
2270```
2271
2272 Type: ::PM_SHAREABLE_CONSTANT_NODE
2273
2274 Flags (#pm_shareable_constant_node_flags):
2275 * ::PM_SHAREABLE_CONSTANT_NODE_FLAGS_LITERAL
2276 * ::PM_SHAREABLE_CONSTANT_NODE_FLAGS_EXPERIMENTAL_EVERYTHING
2277 * ::PM_SHAREABLE_CONSTANT_NODE_FLAGS_EXPERIMENTAL_COPY
2278
2279 @extends pm_node_t
2280*/
2281pub type pm_shareable_constant_node_t = pm_shareable_constant_node;
2282/** SingletonClassNode
2283
2284 Represents a singleton class declaration involving the `class` keyword.
2285
2286``` ruby
2287 class << self end
2288 ^^^^^^^^^^^^^^^^^
2289```
2290
2291 Type: ::PM_SINGLETON_CLASS_NODE
2292
2293 @extends pm_node_t
2294*/
2295pub type pm_singleton_class_node_t = pm_singleton_class_node;
2296/** SourceEncodingNode
2297
2298 Represents the use of the `__ENCODING__` keyword.
2299
2300``` ruby
2301 __ENCODING__
2302 ^^^^^^^^^^^^
2303```
2304
2305 Type: ::PM_SOURCE_ENCODING_NODE
2306
2307 @extends pm_node_t
2308*/
2309pub type pm_source_encoding_node_t = pm_source_encoding_node;
2310/** SourceFileNode
2311
2312 Represents the use of the `__FILE__` keyword.
2313
2314``` ruby
2315 __FILE__
2316 ^^^^^^^^
2317```
2318
2319 Type: ::PM_SOURCE_FILE_NODE
2320
2321 Flags (#pm_string_flags):
2322 * ::PM_STRING_FLAGS_FORCED_UTF8_ENCODING
2323 * ::PM_STRING_FLAGS_FORCED_BINARY_ENCODING
2324 * ::PM_STRING_FLAGS_FROZEN
2325 * ::PM_STRING_FLAGS_MUTABLE
2326
2327 @extends pm_node_t
2328*/
2329pub type pm_source_file_node_t = pm_source_file_node;
2330/** SourceLineNode
2331
2332 Represents the use of the `__LINE__` keyword.
2333
2334``` ruby
2335 __LINE__
2336 ^^^^^^^^
2337```
2338
2339 Type: ::PM_SOURCE_LINE_NODE
2340
2341 @extends pm_node_t
2342*/
2343pub type pm_source_line_node_t = pm_source_line_node;
2344/** SplatNode
2345
2346 Represents the use of the splat operator.
2347
2348``` ruby
2349 [*a]
2350 ^^
2351```
2352
2353 Type: ::PM_SPLAT_NODE
2354
2355 @extends pm_node_t
2356*/
2357pub type pm_splat_node_t = pm_splat_node;
2358/** StatementsNode
2359
2360 Represents a set of statements contained within some scope.
2361
2362``` ruby
2363 foo; bar; baz
2364 ^^^^^^^^^^^^^
2365```
2366
2367 Type: ::PM_STATEMENTS_NODE
2368
2369 Flags (#pm_statements_flags):
2370 * ::PM_STATEMENTS_FLAGS_CONTAINS_PRE_EXECUTION
2371
2372 @extends pm_node_t
2373*/
2374pub type pm_statements_node_t = pm_statements_node;
2375/** StringNode
2376
2377 Represents a string literal, a string contained within a `%w` list, or plain string content within an interpolated string.
2378
2379``` ruby
2380 "foo"
2381 ^^^^^
2382```
2383
2384``` ruby
2385 %w[foo]
2386 ^^^
2387```
2388
2389``` ruby
2390 "foo #{bar} baz"
2391 ^^^^ ^^^^
2392```
2393
2394 Type: ::PM_STRING_NODE
2395
2396 Flags (#pm_string_flags):
2397 * ::PM_STRING_FLAGS_FORCED_UTF8_ENCODING
2398 * ::PM_STRING_FLAGS_FORCED_BINARY_ENCODING
2399 * ::PM_STRING_FLAGS_FROZEN
2400 * ::PM_STRING_FLAGS_MUTABLE
2401
2402 @extends pm_node_t
2403*/
2404pub type pm_string_node_t = pm_string_node;
2405/** SuperNode
2406
2407 Represents the use of the `super` keyword with parentheses or arguments.
2408
2409``` ruby
2410 super()
2411 ^^^^^^^
2412```
2413
2414``` ruby
2415 super foo, bar
2416 ^^^^^^^^^^^^^^
2417```
2418
2419 If no arguments are provided (except for a block), it would be a `ForwardingSuperNode` instead.
2420
2421 Type: ::PM_SUPER_NODE
2422
2423 @extends pm_node_t
2424*/
2425pub type pm_super_node_t = pm_super_node;
2426/** SymbolNode
2427
2428 Represents a symbol literal or a symbol contained within a `%i` list.
2429
2430``` ruby
2431 :foo
2432 ^^^^
2433```
2434
2435``` ruby
2436 %i[foo]
2437 ^^^
2438```
2439
2440 Type: ::PM_SYMBOL_NODE
2441
2442 Flags (#pm_symbol_flags):
2443 * ::PM_SYMBOL_FLAGS_FORCED_UTF8_ENCODING
2444 * ::PM_SYMBOL_FLAGS_FORCED_BINARY_ENCODING
2445 * ::PM_SYMBOL_FLAGS_FORCED_US_ASCII_ENCODING
2446
2447 @extends pm_node_t
2448*/
2449pub type pm_symbol_node_t = pm_symbol_node;
2450/** TrueNode
2451
2452 Represents the use of the literal `true` keyword.
2453
2454``` ruby
2455 true
2456 ^^^^
2457```
2458
2459 Type: ::PM_TRUE_NODE
2460
2461 @extends pm_node_t
2462*/
2463pub type pm_true_node_t = pm_true_node;
2464/** UndefNode
2465
2466 Represents the use of the `undef` keyword.
2467
2468``` ruby
2469 undef :foo, :bar, :baz
2470 ^^^^^^^^^^^^^^^^^^^^^^
2471```
2472
2473 Type: ::PM_UNDEF_NODE
2474
2475 @extends pm_node_t
2476*/
2477pub type pm_undef_node_t = pm_undef_node;
2478/** UnlessNode
2479
2480 Represents the use of the `unless` keyword, either in the block form or the modifier form.
2481
2482``` ruby
2483 bar unless foo
2484 ^^^^^^^^^^^^^^
2485```
2486
2487``` ruby
2488 unless foo then bar end
2489 ^^^^^^^^^^^^^^^^^^^^^^^
2490```
2491
2492 Type: ::PM_UNLESS_NODE
2493
2494 @extends pm_node_t
2495*/
2496pub type pm_unless_node_t = pm_unless_node;
2497/** UntilNode
2498
2499 Represents the use of the `until` keyword, either in the block form or the modifier form.
2500
2501``` ruby
2502 bar until foo
2503 ^^^^^^^^^^^^^
2504```
2505
2506``` ruby
2507 until foo do bar end
2508 ^^^^^^^^^^^^^^^^^^^^
2509```
2510
2511 Type: ::PM_UNTIL_NODE
2512
2513 Flags (#pm_loop_flags):
2514 * ::PM_LOOP_FLAGS_BEGIN_MODIFIER
2515
2516 @extends pm_node_t
2517*/
2518pub type pm_until_node_t = pm_until_node;
2519/** WhenNode
2520
2521 Represents the use of the `when` keyword within a case statement.
2522
2523``` ruby
2524 case true
2525 when true
2526 ^^^^^^^^^
2527 end
2528```
2529
2530 Type: ::PM_WHEN_NODE
2531
2532 @extends pm_node_t
2533*/
2534pub type pm_when_node_t = pm_when_node;
2535/** WhileNode
2536
2537 Represents the use of the `while` keyword, either in the block form or the modifier form.
2538
2539``` ruby
2540 bar while foo
2541 ^^^^^^^^^^^^^
2542```
2543
2544``` ruby
2545 while foo do bar end
2546 ^^^^^^^^^^^^^^^^^^^^
2547```
2548
2549 Type: ::PM_WHILE_NODE
2550
2551 Flags (#pm_loop_flags):
2552 * ::PM_LOOP_FLAGS_BEGIN_MODIFIER
2553
2554 @extends pm_node_t
2555*/
2556pub type pm_while_node_t = pm_while_node;
2557/** XStringNode
2558
2559 Represents an xstring literal with no interpolation.
2560
2561``` ruby
2562 `foo`
2563 ^^^^^
2564```
2565
2566 Type: ::PM_X_STRING_NODE
2567
2568 Flags (#pm_encoding_flags):
2569 * ::PM_ENCODING_FLAGS_FORCED_UTF8_ENCODING
2570 * ::PM_ENCODING_FLAGS_FORCED_BINARY_ENCODING
2571
2572 @extends pm_node_t
2573*/
2574pub type pm_x_string_node_t = pm_x_string_node;
2575/** YieldNode
2576
2577 Represents the use of the `yield` keyword.
2578
2579``` ruby
2580 yield 1
2581 ^^^^^^^
2582```
2583
2584 Type: ::PM_YIELD_NODE
2585
2586 @extends pm_node_t
2587*/
2588pub type pm_yield_node_t = pm_yield_node;
2589/** Represents the results of a slice query.
2590*/
2591pub type pm_string_query_t = ::std::os::raw::c_int;
2592/** An opaque pointer to an arena that is used for allocations.
2593*/
2594#[repr(C)]
2595#[derive(Debug)]
2596pub struct pm_arena_t {
2597 _unused: [u8; 0],
2598}
2599/** A list of constant IDs. Usually used to represent a set of locals.
2600*/
2601#[repr(C)]
2602#[derive(Debug, Copy, Clone)]
2603pub struct pm_constant_id_list_t {
2604 /** The number of constant ids in the list. Source offsets are 32 bits, so
2605 the source is less than 4 GiB, and a list built from it stays far below
2606 what this can count.
2607*/
2608 pub size: u32,
2609 /** The constant ids in the list.
2610*/
2611 pub ids: *mut pm_constant_id_t,
2612}
2613/** A constant in the pool which effectively stores a string.
2614*/
2615#[repr(C)]
2616#[derive(Debug)]
2617pub struct pm_constant_t {
2618 _unused: [u8; 0],
2619}
2620/** A structure represents an arbitrary-sized integer. The magnitude is stored as
2621 32-bit words, least significant first.
2622*/
2623#[repr(C)]
2624#[derive(Copy, Clone)]
2625pub struct pm_integer_t {
2626 /** The number of words in the magnitude, with no leading zero words. Zero
2627 has no words, so a zeroed pm_integer_t is always positive zero.
2628*/
2629 pub length: u32,
2630 /** Whether or not the integer is negative.
2631*/
2632 pub negative: bool,
2633 pub words: pm_integer_t__bindgen_ty_1,
2634}
2635/** A view of a sequence of bytes. The string does not own the bytes, so they
2636 must remain valid for as long as the string is in use.
2637*/
2638#[repr(C)]
2639#[derive(Debug, Copy, Clone)]
2640pub struct pm_string_t {
2641 /** A pointer to the start of the string.
2642*/
2643 pub source: *const u8,
2644 /** The length of the string in bytes of memory.
2645*/
2646 pub length: usize,
2647}
2648/** This struct represents a slice in the source code, defined by an offset and
2649 a length. Note that we have confirmation that we can represent all locations
2650 within Ruby source files using 32-bit integers per:
2651
2652``` ruby
2653 https://bugs.ruby-lang.org/issues/20488#note-1
2654```
2655*/
2656#[repr(C)]
2657#[derive(Debug, Default, Copy, Clone)]
2658pub struct pm_location_t {
2659 /** The offset of the location from the start of the source.
2660*/
2661 pub start: u32,
2662 /** The length of the location.
2663*/
2664 pub length: u32,
2665}
2666/** A list of nodes in the source, most often used for lists of children.
2667*/
2668#[repr(C)]
2669#[derive(Debug, Copy, Clone)]
2670pub struct pm_node_list {
2671 /** The number of nodes in the list. Source offsets are 32 bits, so the
2672 source is less than 4 GiB, and a list built from it stays far below what
2673 this can count.
2674*/
2675 pub size: u32,
2676 /** The nodes in the list.
2677*/
2678 pub nodes: *mut *mut pm_node,
2679}
2680/** This is the base structure that represents a node in the syntax tree. It is
2681 embedded into every node type.
2682*/
2683#[repr(C)]
2684#[derive(Debug, Default, Copy, Clone)]
2685pub struct pm_node {
2686 /** This represents the type of the node. It somewhat maps to the nodes that
2687 existed in the original grammar and ripper, but it is not a 1:1 mapping.
2688*/
2689 pub type_: pm_node_type_t,
2690 /** This represents any flags on the node. Some are common to all nodes, and
2691 some are specific to the type of node.
2692*/
2693 pub flags: pm_node_flags_t,
2694 /** The unique identifier for this node, which is deterministic based on the
2695 source. It is used to identify unique nodes across parses. Nodes created
2696 outside of parsing have no position in the source and can use 0, which
2697 no parsed node uses.
2698*/
2699 pub node_id: u32,
2700 /** This is the location of the node in the source. It is a range of bytes
2701 containing a start and an end.
2702*/
2703 pub location: pm_location_t,
2704}
2705/** AliasGlobalVariableNode
2706
2707 Represents the use of the `alias` keyword to alias a global variable.
2708
2709``` ruby
2710 alias $foo $bar
2711 ^^^^^^^^^^^^^^^
2712```
2713
2714 Type: ::PM_ALIAS_GLOBAL_VARIABLE_NODE
2715
2716 @extends pm_node_t
2717*/
2718#[repr(C)]
2719#[derive(Debug, Copy, Clone)]
2720pub struct pm_alias_global_variable_node {
2721 /** The embedded base node.
2722*/
2723 pub base: pm_node_t,
2724 /** AliasGlobalVariableNode#new_name
2725
2726 Represents the new name of the global variable that can be used after aliasing.
2727
2728``` ruby
2729 alias $foo $bar
2730 ^^^^
2731```
2732*/
2733 pub new_name: *mut pm_node,
2734 /** AliasGlobalVariableNode#old_name
2735
2736 Represents the old name of the global variable that can be used before aliasing.
2737
2738``` ruby
2739 alias $foo $bar
2740 ^^^^
2741```
2742*/
2743 pub old_name: *mut pm_node,
2744 /** AliasGlobalVariableNode#keyword_loc
2745
2746 The Location of the `alias` keyword.
2747
2748``` ruby
2749 alias $foo $bar
2750 ^^^^^
2751```
2752*/
2753 pub keyword_loc: pm_location_t,
2754}
2755/** AliasMethodNode
2756
2757 Represents the use of the `alias` keyword to alias a method.
2758
2759``` ruby
2760 alias foo bar
2761 ^^^^^^^^^^^^^
2762```
2763
2764 Type: ::PM_ALIAS_METHOD_NODE
2765
2766 @extends pm_node_t
2767*/
2768#[repr(C)]
2769#[derive(Debug, Copy, Clone)]
2770pub struct pm_alias_method_node {
2771 /** The embedded base node.
2772*/
2773 pub base: pm_node_t,
2774 /** AliasMethodNode#new_name
2775
2776 Represents the new name of the method that will be aliased.
2777
2778``` ruby
2779 alias foo bar
2780 ^^^
2781```
2782
2783``` ruby
2784 alias :foo :bar
2785 ^^^^
2786```
2787
2788``` ruby
2789 alias :"#{foo}" :"#{bar}"
2790 ^^^^^^^^^
2791```
2792*/
2793 pub new_name: *mut pm_node,
2794 /** AliasMethodNode#old_name
2795
2796 Represents the old name of the method that will be aliased.
2797
2798``` ruby
2799 alias foo bar
2800 ^^^
2801```
2802
2803``` ruby
2804 alias :foo :bar
2805 ^^^^
2806```
2807
2808``` ruby
2809 alias :"#{foo}" :"#{bar}"
2810 ^^^^^^^^^
2811```
2812*/
2813 pub old_name: *mut pm_node,
2814 /** AliasMethodNode#keyword_loc
2815
2816 Represents the Location of the `alias` keyword.
2817
2818``` ruby
2819 alias foo bar
2820 ^^^^^
2821```
2822*/
2823 pub keyword_loc: pm_location_t,
2824}
2825/** AlternationPatternNode
2826
2827 Represents an alternation pattern in pattern matching.
2828
2829``` ruby
2830 foo => bar | baz
2831 ^^^^^^^^^
2832```
2833
2834 Type: ::PM_ALTERNATION_PATTERN_NODE
2835
2836 @extends pm_node_t
2837*/
2838#[repr(C)]
2839#[derive(Debug, Copy, Clone)]
2840pub struct pm_alternation_pattern_node {
2841 /** The embedded base node.
2842*/
2843 pub base: pm_node_t,
2844 /** AlternationPatternNode#left
2845
2846 Represents the left side of the expression.
2847
2848``` ruby
2849 foo => bar | baz
2850 ^^^
2851```
2852*/
2853 pub left: *mut pm_node,
2854 /** AlternationPatternNode#right
2855
2856 Represents the right side of the expression.
2857
2858``` ruby
2859 foo => bar | baz
2860 ^^^
2861```
2862*/
2863 pub right: *mut pm_node,
2864 /** AlternationPatternNode#operator_loc
2865
2866 Represents the alternation operator Location.
2867
2868``` ruby
2869 foo => bar | baz
2870 ^
2871```
2872*/
2873 pub operator_loc: pm_location_t,
2874}
2875/** AndNode
2876
2877 Represents the use of the `&&` operator or the `and` keyword.
2878
2879``` ruby
2880 left and right
2881 ^^^^^^^^^^^^^^
2882```
2883
2884 Type: ::PM_AND_NODE
2885
2886 @extends pm_node_t
2887*/
2888#[repr(C)]
2889#[derive(Debug, Copy, Clone)]
2890pub struct pm_and_node {
2891 /** The embedded base node.
2892*/
2893 pub base: pm_node_t,
2894 /** AndNode#left
2895
2896 Represents the left side of the expression. It can be any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression).
2897
2898``` ruby
2899 left and right
2900 ^^^^
2901```
2902
2903``` ruby
2904 1 && 2
2905 ^
2906```
2907*/
2908 pub left: *mut pm_node,
2909 /** AndNode#right
2910
2911 Represents the right side of the expression.
2912
2913``` ruby
2914 left && right
2915 ^^^^^
2916```
2917
2918``` ruby
2919 1 and 2
2920 ^
2921```
2922*/
2923 pub right: *mut pm_node,
2924 /** AndNode#operator_loc
2925
2926 The Location of the `and` keyword or the `&&` operator.
2927
2928``` ruby
2929 left and right
2930 ^^^
2931```
2932*/
2933 pub operator_loc: pm_location_t,
2934}
2935/** ArgumentsNode
2936
2937 Represents a set of arguments to a method or a keyword.
2938
2939``` ruby
2940 return foo, bar, baz
2941 ^^^^^^^^^^^^^
2942```
2943
2944 Type: ::PM_ARGUMENTS_NODE
2945
2946 Flags (#pm_arguments_node_flags):
2947 * ::PM_ARGUMENTS_NODE_FLAGS_CONTAINS_FORWARDING
2948 * ::PM_ARGUMENTS_NODE_FLAGS_CONTAINS_KEYWORDS
2949 * ::PM_ARGUMENTS_NODE_FLAGS_CONTAINS_KEYWORD_SPLAT
2950 * ::PM_ARGUMENTS_NODE_FLAGS_CONTAINS_SPLAT
2951 * ::PM_ARGUMENTS_NODE_FLAGS_CONTAINS_MULTIPLE_SPLATS
2952
2953 @extends pm_node_t
2954*/
2955#[repr(C)]
2956#[derive(Debug, Copy, Clone)]
2957pub struct pm_arguments_node {
2958 /** The embedded base node.
2959*/
2960 pub base: pm_node_t,
2961 /** ArgumentsNode#arguments
2962
2963 The list of arguments, if present. These can be any [non-void expressions](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression).
2964
2965``` ruby
2966 foo(bar, baz)
2967 ^^^^^^^^
2968```
2969*/
2970 pub arguments: pm_node_list,
2971}
2972/** ArrayNode
2973
2974 Represents an array literal. This can be a regular array using brackets or a special array using % like %w or %i.
2975
2976``` ruby
2977 [1, 2, 3]
2978 ^^^^^^^^^
2979```
2980
2981 Type: ::PM_ARRAY_NODE
2982
2983 Flags (#pm_array_node_flags):
2984 * ::PM_ARRAY_NODE_FLAGS_CONTAINS_SPLAT
2985
2986 @extends pm_node_t
2987*/
2988#[repr(C)]
2989#[derive(Debug, Copy, Clone)]
2990pub struct pm_array_node {
2991 /** The embedded base node.
2992*/
2993 pub base: pm_node_t,
2994 /** ArrayNode#elements
2995
2996 Represent the list of zero or more [non-void expressions](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression) within the array.
2997*/
2998 pub elements: pm_node_list,
2999 /** ArrayNode#opening_loc
3000
3001 Represents the optional source Location for the opening token.
3002
3003``` ruby
3004 [1,2,3] # "["
3005 %w[foo bar baz] # "%w["
3006 %I(apple orange banana) # "%I("
3007 foo = 1, 2, 3 # nil
3008```
3009*/
3010 pub opening_loc: pm_location_t,
3011 /** ArrayNode#closing_loc
3012
3013 Represents the optional source Location for the closing token.
3014
3015``` ruby
3016 [1,2,3] # "]"
3017 %w[foo bar baz] # "]"
3018 %I(apple orange banana) # ")"
3019 foo = 1, 2, 3 # nil
3020```
3021*/
3022 pub closing_loc: pm_location_t,
3023}
3024/** ArrayPatternNode
3025
3026 Represents an array pattern in pattern matching.
3027
3028``` ruby
3029 foo in 1, 2
3030 ^^^^
3031```
3032
3033``` ruby
3034 foo in [1, 2]
3035 ^^^^^^
3036```
3037
3038``` ruby
3039 foo in *bar
3040 ^^^^
3041```
3042
3043``` ruby
3044 foo in Bar[]
3045 ^^^^^
3046```
3047
3048``` ruby
3049 foo in Bar[1, 2, 3]
3050 ^^^^^^^^^^^^
3051```
3052
3053 Type: ::PM_ARRAY_PATTERN_NODE
3054
3055 @extends pm_node_t
3056*/
3057#[repr(C)]
3058#[derive(Debug, Copy, Clone)]
3059pub struct pm_array_pattern_node {
3060 /** The embedded base node.
3061*/
3062 pub base: pm_node_t,
3063 /** ArrayPatternNode#constant
3064
3065 Represents the optional constant preceding the Array
3066
3067``` ruby
3068 foo in Bar[]
3069 ^^^
3070```
3071
3072``` ruby
3073 foo in Bar[1, 2, 3]
3074 ^^^
3075```
3076
3077``` ruby
3078 foo in Bar::Baz[1, 2, 3]
3079 ^^^^^^^^
3080```
3081*/
3082 pub constant: *mut pm_node,
3083 /** ArrayPatternNode#requireds
3084
3085 Represents the required elements of the array pattern.
3086
3087``` ruby
3088 foo in [1, 2]
3089 ^ ^
3090```
3091*/
3092 pub requireds: pm_node_list,
3093 /** ArrayPatternNode#rest
3094
3095 Represents the rest element of the array pattern.
3096
3097``` ruby
3098 foo in *bar
3099 ^^^^
3100```
3101*/
3102 pub rest: *mut pm_node,
3103 /** ArrayPatternNode#posts
3104
3105 Represents the elements after the rest element of the array pattern.
3106
3107``` ruby
3108 foo in *bar, baz
3109 ^^^
3110```
3111*/
3112 pub posts: pm_node_list,
3113 /** ArrayPatternNode#opening_loc
3114
3115 Represents the opening Location of the array pattern.
3116
3117``` ruby
3118 foo in [1, 2]
3119 ^
3120```
3121*/
3122 pub opening_loc: pm_location_t,
3123 /** ArrayPatternNode#closing_loc
3124
3125 Represents the closing Location of the array pattern.
3126
3127``` ruby
3128 foo in [1, 2]
3129 ^
3130```
3131*/
3132 pub closing_loc: pm_location_t,
3133}
3134/** AssocNode
3135
3136 Represents a hash key/value pair.
3137
3138``` ruby
3139 { a => b }
3140 ^^^^^^
3141```
3142
3143 Type: ::PM_ASSOC_NODE
3144
3145 @extends pm_node_t
3146*/
3147#[repr(C)]
3148#[derive(Debug, Copy, Clone)]
3149pub struct pm_assoc_node {
3150 /** The embedded base node.
3151*/
3152 pub base: pm_node_t,
3153 /** AssocNode#key
3154
3155 The key of the association. This can be any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression).
3156
3157``` ruby
3158 { a: b }
3159 ^
3160```
3161
3162``` ruby
3163 { foo => bar }
3164 ^^^
3165```
3166
3167``` ruby
3168 { def a; end => 1 }
3169 ^^^^^^^^^^
3170```
3171*/
3172 pub key: *mut pm_node,
3173 /** AssocNode#value
3174
3175 The value of the association, if present. This can be any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression).
3176
3177``` ruby
3178 { foo => bar }
3179 ^^^
3180```
3181
3182``` ruby
3183 { x: 1 }
3184 ^
3185```
3186*/
3187 pub value: *mut pm_node,
3188 /** AssocNode#operator_loc
3189
3190 The Location of the `=>` operator, if present.
3191
3192``` ruby
3193 { foo => bar }
3194 ^^
3195```
3196*/
3197 pub operator_loc: pm_location_t,
3198}
3199/** AssocSplatNode
3200
3201 Represents a splat in a hash literal.
3202
3203``` ruby
3204 { **foo }
3205 ^^^^^
3206```
3207
3208 Type: ::PM_ASSOC_SPLAT_NODE
3209
3210 @extends pm_node_t
3211*/
3212#[repr(C)]
3213#[derive(Debug, Copy, Clone)]
3214pub struct pm_assoc_splat_node {
3215 /** The embedded base node.
3216*/
3217 pub base: pm_node_t,
3218 /** AssocSplatNode#value
3219
3220 The value to be splatted, if present. Will be missing when keyword rest argument forwarding is used.
3221
3222``` ruby
3223 { **foo }
3224 ^^^
3225```
3226*/
3227 pub value: *mut pm_node,
3228 /** AssocSplatNode#operator_loc
3229
3230 The Location of the `**` operator.
3231
3232``` ruby
3233 { **x }
3234 ^^
3235```
3236*/
3237 pub operator_loc: pm_location_t,
3238}
3239/** BackReferenceReadNode
3240
3241 Represents reading a reference to a field in the previous match.
3242
3243``` ruby
3244 $'
3245 ^^
3246```
3247
3248 Type: ::PM_BACK_REFERENCE_READ_NODE
3249
3250 @extends pm_node_t
3251*/
3252#[repr(C)]
3253#[derive(Debug, Default, Copy, Clone)]
3254pub struct pm_back_reference_read_node {
3255 /** The embedded base node.
3256*/
3257 pub base: pm_node_t,
3258 /** BackReferenceReadNode#name
3259
3260 The name of the back-reference variable, including the leading `$`.
3261
3262``` ruby
3263 $& # name `:$&`
3264```
3265
3266``` ruby
3267 $+ # name `:$+`
3268```
3269*/
3270 pub name: pm_constant_id_t,
3271}
3272/** BeginNode
3273
3274 Represents a begin statement.
3275
3276``` ruby
3277 begin
3278 foo
3279 end
3280 ^^^^^
3281```
3282
3283 Type: ::PM_BEGIN_NODE
3284
3285 @extends pm_node_t
3286*/
3287#[repr(C)]
3288#[derive(Debug, Copy, Clone)]
3289pub struct pm_begin_node {
3290 /** The embedded base node.
3291*/
3292 pub base: pm_node_t,
3293 /** BeginNode#begin_keyword_loc
3294
3295 Represents the Location of the `begin` keyword.
3296
3297``` ruby
3298 begin x end
3299 ^^^^^
3300```
3301*/
3302 pub begin_keyword_loc: pm_location_t,
3303 /** BeginNode#statements
3304
3305 Represents the statements within the begin block.
3306
3307``` ruby
3308 begin x end
3309 ^
3310```
3311*/
3312 pub statements: *mut pm_statements_node,
3313 /** BeginNode#rescue_clause
3314
3315 Represents the rescue clause within the begin block.
3316
3317``` ruby
3318 begin x; rescue y; end
3319 ^^^^^^^^
3320```
3321*/
3322 pub rescue_clause: *mut pm_rescue_node,
3323 /** BeginNode#else_clause
3324
3325 Represents the else clause within the begin block.
3326
3327``` ruby
3328 begin x; rescue y; else z; end
3329 ^^^^^^^^^^^
3330```
3331*/
3332 pub else_clause: *mut pm_else_node,
3333 /** BeginNode#ensure_clause
3334
3335 Represents the ensure clause within the begin block.
3336
3337``` ruby
3338 begin x; ensure y; end
3339 ^^^^^^^^
3340```
3341*/
3342 pub ensure_clause: *mut pm_ensure_node,
3343 /** BeginNode#end_keyword_loc
3344
3345 Represents the Location of the `end` keyword.
3346
3347``` ruby
3348 begin x end
3349 ^^^
3350```
3351*/
3352 pub end_keyword_loc: pm_location_t,
3353}
3354/** BlockArgumentNode
3355
3356 Represents a block argument using `&`.
3357
3358``` ruby
3359 bar(&args)
3360 ^^^^^
3361```
3362
3363 Type: ::PM_BLOCK_ARGUMENT_NODE
3364
3365 @extends pm_node_t
3366*/
3367#[repr(C)]
3368#[derive(Debug, Copy, Clone)]
3369pub struct pm_block_argument_node {
3370 /** The embedded base node.
3371*/
3372 pub base: pm_node_t,
3373 /** BlockArgumentNode#expression
3374
3375 The expression that is being passed as a block argument. This can be any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression).
3376
3377``` ruby
3378 foo(&args)
3379 ^^^^
3380```
3381*/
3382 pub expression: *mut pm_node,
3383 /** BlockArgumentNode#operator_loc
3384
3385 Represents the Location of the `&` operator.
3386
3387``` ruby
3388 foo(&args)
3389 ^
3390```
3391*/
3392 pub operator_loc: pm_location_t,
3393}
3394/** BlockLocalVariableNode
3395
3396 Represents a block local variable.
3397
3398``` ruby
3399 a { |; b| }
3400 ^
3401```
3402
3403 Type: ::PM_BLOCK_LOCAL_VARIABLE_NODE
3404
3405 Flags (#pm_parameter_flags):
3406 * ::PM_PARAMETER_FLAGS_REPEATED_PARAMETER
3407
3408 @extends pm_node_t
3409*/
3410#[repr(C)]
3411#[derive(Debug, Default, Copy, Clone)]
3412pub struct pm_block_local_variable_node {
3413 /** The embedded base node.
3414*/
3415 pub base: pm_node_t,
3416 /** BlockLocalVariableNode#name
3417
3418 The name of the block local variable.
3419
3420``` ruby
3421 a { |; b| } # name `:b`
3422 ^
3423```
3424*/
3425 pub name: pm_constant_id_t,
3426}
3427/** BlockNode
3428
3429 Represents a block of ruby code.
3430
3431``` ruby
3432 [1, 2, 3].each { |i| puts x }
3433 ^^^^^^^^^^^^^^
3434```
3435
3436 Type: ::PM_BLOCK_NODE
3437
3438 @extends pm_node_t
3439*/
3440#[repr(C)]
3441#[derive(Debug, Copy, Clone)]
3442pub struct pm_block_node {
3443 /** The embedded base node.
3444*/
3445 pub base: pm_node_t,
3446 /** BlockNode#locals
3447
3448 The local variables declared in the block.
3449
3450``` ruby
3451 [1, 2, 3].each { |i| puts x } # locals: [:i]
3452 ^
3453```
3454*/
3455 pub locals: pm_constant_id_list_t,
3456 /** BlockNode#parameters
3457
3458 The parameters of the block.
3459
3460``` ruby
3461 [1, 2, 3].each { |i| puts x }
3462 ^^^
3463 [1, 2, 3].each { puts _1 }
3464 ^^^^^^^^^^^
3465 [1, 2, 3].each { puts it }
3466 ^^^^^^^^^^^
3467```
3468*/
3469 pub parameters: *mut pm_node,
3470 /** BlockNode#body
3471
3472 The body of the block.
3473
3474``` ruby
3475 [1, 2, 3].each { |i| puts x }
3476 ^^^^^^
3477```
3478*/
3479 pub body: *mut pm_node,
3480 /** BlockNode#opening_loc
3481
3482 Represents the Location of the opening `{` or `do`.
3483
3484``` ruby
3485 [1, 2, 3].each { |i| puts x }
3486 ^
3487```
3488*/
3489 pub opening_loc: pm_location_t,
3490 /** BlockNode#closing_loc
3491
3492 Represents the Location of the closing `}` or `end`.
3493
3494``` ruby
3495 [1, 2, 3].each { |i| puts x }
3496 ^
3497```
3498*/
3499 pub closing_loc: pm_location_t,
3500}
3501/** BlockParameterNode
3502
3503 Represents a block parameter of a method, block, or lambda definition.
3504
3505``` ruby
3506 def a(&b)
3507 ^^
3508 end
3509```
3510
3511 Type: ::PM_BLOCK_PARAMETER_NODE
3512
3513 Flags (#pm_parameter_flags):
3514 * ::PM_PARAMETER_FLAGS_REPEATED_PARAMETER
3515
3516 @extends pm_node_t
3517*/
3518#[repr(C)]
3519#[derive(Debug, Default, Copy, Clone)]
3520pub struct pm_block_parameter_node {
3521 /** The embedded base node.
3522*/
3523 pub base: pm_node_t,
3524 /** BlockParameterNode#name
3525
3526 The name of the block parameter.
3527
3528``` ruby
3529 def a(&b) # name `:b`
3530 ^
3531 end
3532```
3533*/
3534 pub name: pm_constant_id_t,
3535 /** BlockParameterNode#name_loc
3536
3537 Represents the Location of the block parameter name.
3538
3539``` ruby
3540 def a(&b)
3541 ^
3542```
3543*/
3544 pub name_loc: pm_location_t,
3545 /** BlockParameterNode#operator_loc
3546
3547 Represents the Location of the `&` operator.
3548
3549``` ruby
3550 def a(&b)
3551 ^
3552 end
3553```
3554*/
3555 pub operator_loc: pm_location_t,
3556}
3557/** BlockParametersNode
3558
3559 Represents a block's parameters declaration.
3560
3561``` ruby
3562 -> (a, b = 1; local) { }
3563 ^^^^^^^^^^^^^^^^^
3564```
3565
3566``` ruby
3567 foo do |a, b = 1; local|
3568 ^^^^^^^^^^^^^^^^^
3569 end
3570```
3571
3572 Type: ::PM_BLOCK_PARAMETERS_NODE
3573
3574 @extends pm_node_t
3575*/
3576#[repr(C)]
3577#[derive(Debug, Copy, Clone)]
3578pub struct pm_block_parameters_node {
3579 /** The embedded base node.
3580*/
3581 pub base: pm_node_t,
3582 /** BlockParametersNode#parameters
3583
3584 Represents the parameters of the block.
3585
3586``` ruby
3587 -> (a, b = 1; local) { }
3588 ^^^^^^^^
3589```
3590
3591``` ruby
3592 foo do |a, b = 1; local|
3593 ^^^^^^^^
3594 end
3595```
3596*/
3597 pub parameters: *mut pm_parameters_node,
3598 /** BlockParametersNode#locals
3599
3600 Represents the local variables of the block.
3601
3602``` ruby
3603 -> (a, b = 1; local) { }
3604 ^^^^^
3605```
3606
3607``` ruby
3608 foo do |a, b = 1; local|
3609 ^^^^^
3610 end
3611```
3612*/
3613 pub locals: pm_node_list,
3614 /** BlockParametersNode#opening_loc
3615
3616 Represents the opening Location of the block parameters.
3617
3618``` ruby
3619 -> (a, b = 1; local) { }
3620 ^
3621```
3622
3623``` ruby
3624 foo do |a, b = 1; local|
3625 ^
3626 end
3627```
3628*/
3629 pub opening_loc: pm_location_t,
3630 /** BlockParametersNode#closing_loc
3631
3632 Represents the closing Location of the block parameters.
3633
3634``` ruby
3635 -> (a, b = 1; local) { }
3636 ^
3637```
3638
3639``` ruby
3640 foo do |a, b = 1; local|
3641 ^
3642 end
3643```
3644*/
3645 pub closing_loc: pm_location_t,
3646}
3647/** BreakNode
3648
3649 Represents the use of the `break` keyword.
3650
3651``` ruby
3652 break foo
3653 ^^^^^^^^^
3654```
3655
3656 Type: ::PM_BREAK_NODE
3657
3658 @extends pm_node_t
3659*/
3660#[repr(C)]
3661#[derive(Debug, Copy, Clone)]
3662pub struct pm_break_node {
3663 /** The embedded base node.
3664*/
3665 pub base: pm_node_t,
3666 /** BreakNode#arguments
3667
3668 The arguments to the break statement, if present. These can be any [non-void expressions](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression).
3669
3670``` ruby
3671 break foo
3672 ^^^
3673```
3674*/
3675 pub arguments: *mut pm_arguments_node,
3676 /** BreakNode#keyword_loc
3677
3678 The Location of the `break` keyword.
3679
3680``` ruby
3681 break foo
3682 ^^^^^
3683```
3684*/
3685 pub keyword_loc: pm_location_t,
3686}
3687/** CallAndWriteNode
3688
3689 Represents the use of the `&&=` operator on a call.
3690
3691``` ruby
3692 foo.bar &&= value
3693 ^^^^^^^^^^^^^^^^^
3694```
3695
3696 Type: ::PM_CALL_AND_WRITE_NODE
3697
3698 Flags (#pm_call_node_flags):
3699 * ::PM_CALL_NODE_FLAGS_SAFE_NAVIGATION
3700 * ::PM_CALL_NODE_FLAGS_VARIABLE_CALL
3701 * ::PM_CALL_NODE_FLAGS_ATTRIBUTE_WRITE
3702 * ::PM_CALL_NODE_FLAGS_IGNORE_VISIBILITY
3703
3704 @extends pm_node_t
3705*/
3706#[repr(C)]
3707#[derive(Debug, Copy, Clone)]
3708pub struct pm_call_and_write_node {
3709 /** The embedded base node.
3710*/
3711 pub base: pm_node_t,
3712 /** CallAndWriteNode#receiver
3713
3714 The object that the method is being called on. This can be either `nil` or any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression).
3715
3716``` ruby
3717 foo.bar &&= value
3718 ^^^
3719```
3720*/
3721 pub receiver: *mut pm_node,
3722 /** CallAndWriteNode#call_operator_loc
3723
3724 Represents the Location of the call operator.
3725
3726``` ruby
3727 foo.bar &&= value
3728 ^
3729```
3730*/
3731 pub call_operator_loc: pm_location_t,
3732 /** CallAndWriteNode#message_loc
3733
3734 Represents the Location of the message.
3735
3736``` ruby
3737 foo.bar &&= value
3738 ^^^
3739```
3740*/
3741 pub message_loc: pm_location_t,
3742 /** CallAndWriteNode#read_name
3743
3744 Represents the name of the method being called.
3745
3746``` ruby
3747 foo.bar &&= value # read_name `:bar`
3748 ^^^
3749```
3750*/
3751 pub read_name: pm_constant_id_t,
3752 /** CallAndWriteNode#write_name
3753
3754 Represents the name of the method being written to.
3755
3756``` ruby
3757 foo.bar &&= value # write_name `:bar=`
3758 ^^^
3759```
3760*/
3761 pub write_name: pm_constant_id_t,
3762 /** CallAndWriteNode#operator_loc
3763
3764 Represents the Location of the operator.
3765
3766``` ruby
3767 foo.bar &&= value
3768 ^^^
3769```
3770*/
3771 pub operator_loc: pm_location_t,
3772 /** CallAndWriteNode#value
3773
3774 Represents the value being assigned.
3775
3776``` ruby
3777 foo.bar &&= value
3778 ^^^^^
3779```
3780*/
3781 pub value: *mut pm_node,
3782}
3783/** CallNode
3784
3785 Represents a method call, in all of the various forms that can take.
3786
3787``` ruby
3788 foo
3789 ^^^
3790```
3791
3792``` ruby
3793 foo()
3794 ^^^^^
3795```
3796
3797``` ruby
3798 +foo
3799 ^^^^
3800```
3801
3802``` ruby
3803 foo + bar
3804 ^^^^^^^^^
3805```
3806
3807``` ruby
3808 foo.bar
3809 ^^^^^^^
3810```
3811
3812``` ruby
3813 foo&.bar
3814 ^^^^^^^^
3815```
3816
3817 Type: ::PM_CALL_NODE
3818
3819 Flags (#pm_call_node_flags):
3820 * ::PM_CALL_NODE_FLAGS_SAFE_NAVIGATION
3821 * ::PM_CALL_NODE_FLAGS_VARIABLE_CALL
3822 * ::PM_CALL_NODE_FLAGS_ATTRIBUTE_WRITE
3823 * ::PM_CALL_NODE_FLAGS_IGNORE_VISIBILITY
3824
3825 @extends pm_node_t
3826*/
3827#[repr(C)]
3828#[derive(Debug, Copy, Clone)]
3829pub struct pm_call_node {
3830 /** The embedded base node.
3831*/
3832 pub base: pm_node_t,
3833 /** CallNode#receiver
3834
3835 The object that the method is being called on. This can be either `nil` or any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression).
3836
3837``` ruby
3838 foo.bar
3839 ^^^
3840```
3841
3842``` ruby
3843 +foo
3844 ^^^
3845```
3846
3847``` ruby
3848 foo + bar
3849 ^^^
3850```
3851*/
3852 pub receiver: *mut pm_node,
3853 /** CallNode#call_operator_loc
3854
3855 Represents the Location of the call operator.
3856
3857``` ruby
3858 foo.bar
3859 ^
3860```
3861
3862``` ruby
3863 foo&.bar
3864 ^^
3865```
3866*/
3867 pub call_operator_loc: pm_location_t,
3868 /** CallNode#name
3869
3870 Represents the name of the method being called.
3871
3872``` ruby
3873 foo.bar # name `:foo`
3874 ^^^
3875```
3876*/
3877 pub name: pm_constant_id_t,
3878 /** CallNode#message_loc
3879
3880 Represents the Location of the message.
3881
3882``` ruby
3883 foo.bar
3884 ^^^
3885```
3886*/
3887 pub message_loc: pm_location_t,
3888 /** CallNode#opening_loc
3889
3890 Represents the Location of the left parenthesis.
3891
3892``` ruby
3893 foo(bar)
3894 ^
3895```
3896*/
3897 pub opening_loc: pm_location_t,
3898 /** CallNode#arguments
3899
3900 Represents the arguments to the method call. These can be any [non-void expressions](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression).
3901
3902``` ruby
3903 foo(bar)
3904 ^^^
3905```
3906*/
3907 pub arguments: *mut pm_arguments_node,
3908 /** CallNode#closing_loc
3909
3910 Represents the Location of the right parenthesis.
3911
3912``` ruby
3913 foo(bar)
3914 ^
3915```
3916*/
3917 pub closing_loc: pm_location_t,
3918 /** CallNode#equal_loc
3919
3920 Represents the Location of the equal sign, in the case that this is an attribute write.
3921
3922``` ruby
3923 foo.bar = value
3924 ^
3925```
3926
3927``` ruby
3928 foo[bar] = value
3929 ^
3930```
3931*/
3932 pub equal_loc: pm_location_t,
3933 /** CallNode#block
3934
3935 Represents the block that is being passed to the method.
3936
3937``` ruby
3938 foo { |a| a }
3939 ^^^^^^^^^
3940```
3941*/
3942 pub block: *mut pm_node,
3943}
3944/** CallOperatorWriteNode
3945
3946 Represents the use of an assignment operator on a call.
3947
3948``` ruby
3949 foo.bar += baz
3950 ^^^^^^^^^^^^^^
3951```
3952
3953 Type: ::PM_CALL_OPERATOR_WRITE_NODE
3954
3955 Flags (#pm_call_node_flags):
3956 * ::PM_CALL_NODE_FLAGS_SAFE_NAVIGATION
3957 * ::PM_CALL_NODE_FLAGS_VARIABLE_CALL
3958 * ::PM_CALL_NODE_FLAGS_ATTRIBUTE_WRITE
3959 * ::PM_CALL_NODE_FLAGS_IGNORE_VISIBILITY
3960
3961 @extends pm_node_t
3962*/
3963#[repr(C)]
3964#[derive(Debug, Copy, Clone)]
3965pub struct pm_call_operator_write_node {
3966 /** The embedded base node.
3967*/
3968 pub base: pm_node_t,
3969 /** CallOperatorWriteNode#receiver
3970
3971 The object that the method is being called on. This can be either `nil` or any [non-void expressions](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression).
3972
3973``` ruby
3974 foo.bar += value
3975 ^^^
3976```
3977*/
3978 pub receiver: *mut pm_node,
3979 /** CallOperatorWriteNode#call_operator_loc
3980
3981 Represents the Location of the call operator.
3982
3983``` ruby
3984 foo.bar += value
3985 ^
3986```
3987*/
3988 pub call_operator_loc: pm_location_t,
3989 /** CallOperatorWriteNode#message_loc
3990
3991 Represents the Location of the message.
3992
3993``` ruby
3994 foo.bar += value
3995 ^^^
3996```
3997*/
3998 pub message_loc: pm_location_t,
3999 /** CallOperatorWriteNode#read_name
4000
4001 Represents the name of the method being called.
4002
4003``` ruby
4004 foo.bar += value # read_name `:bar`
4005 ^^^
4006```
4007*/
4008 pub read_name: pm_constant_id_t,
4009 /** CallOperatorWriteNode#write_name
4010
4011 Represents the name of the method being written to.
4012
4013``` ruby
4014 foo.bar += value # write_name `:bar=`
4015 ^^^
4016```
4017*/
4018 pub write_name: pm_constant_id_t,
4019 /** CallOperatorWriteNode#binary_operator
4020
4021 Represents the binary operator being used.
4022
4023``` ruby
4024 foo.bar += value # binary_operator `:+`
4025 ^
4026```
4027*/
4028 pub binary_operator: pm_constant_id_t,
4029 /** CallOperatorWriteNode#binary_operator_loc
4030
4031 Represents the Location of the binary operator.
4032
4033``` ruby
4034 foo.bar += value
4035 ^^
4036```
4037*/
4038 pub binary_operator_loc: pm_location_t,
4039 /** CallOperatorWriteNode#value
4040
4041 Represents the value being assigned.
4042
4043``` ruby
4044 foo.bar += value
4045 ^^^^^
4046```
4047*/
4048 pub value: *mut pm_node,
4049}
4050/** CallOrWriteNode
4051
4052 Represents the use of the `||=` operator on a call.
4053
4054``` ruby
4055 foo.bar ||= value
4056 ^^^^^^^^^^^^^^^^^
4057```
4058
4059 Type: ::PM_CALL_OR_WRITE_NODE
4060
4061 Flags (#pm_call_node_flags):
4062 * ::PM_CALL_NODE_FLAGS_SAFE_NAVIGATION
4063 * ::PM_CALL_NODE_FLAGS_VARIABLE_CALL
4064 * ::PM_CALL_NODE_FLAGS_ATTRIBUTE_WRITE
4065 * ::PM_CALL_NODE_FLAGS_IGNORE_VISIBILITY
4066
4067 @extends pm_node_t
4068*/
4069#[repr(C)]
4070#[derive(Debug, Copy, Clone)]
4071pub struct pm_call_or_write_node {
4072 /** The embedded base node.
4073*/
4074 pub base: pm_node_t,
4075 /** CallOrWriteNode#receiver
4076
4077 The object that the method is being called on. This can be either `nil` or any [non-void expressions](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression).
4078
4079``` ruby
4080 foo.bar ||= value
4081 ^^^
4082```
4083*/
4084 pub receiver: *mut pm_node,
4085 /** CallOrWriteNode#call_operator_loc
4086
4087 Represents the Location of the call operator.
4088
4089``` ruby
4090 foo.bar ||= value
4091 ^
4092```
4093*/
4094 pub call_operator_loc: pm_location_t,
4095 /** CallOrWriteNode#message_loc
4096
4097 Represents the Location of the message.
4098
4099``` ruby
4100 foo.bar ||= value
4101 ^^^
4102```
4103*/
4104 pub message_loc: pm_location_t,
4105 /** CallOrWriteNode#read_name
4106
4107 Represents the name of the method being called.
4108
4109``` ruby
4110 foo.bar ||= value # read_name `:bar`
4111 ^^^
4112```
4113*/
4114 pub read_name: pm_constant_id_t,
4115 /** CallOrWriteNode#write_name
4116
4117 Represents the name of the method being written to.
4118
4119``` ruby
4120 foo.bar ||= value # write_name `:bar=`
4121 ^^^
4122```
4123*/
4124 pub write_name: pm_constant_id_t,
4125 /** CallOrWriteNode#operator_loc
4126
4127 Represents the Location of the operator.
4128
4129``` ruby
4130 foo.bar ||= value
4131 ^^^
4132```
4133*/
4134 pub operator_loc: pm_location_t,
4135 /** CallOrWriteNode#value
4136
4137 Represents the value being assigned.
4138
4139``` ruby
4140 foo.bar ||= value
4141 ^^^^^
4142```
4143*/
4144 pub value: *mut pm_node,
4145}
4146/** CallTargetNode
4147
4148 Represents assigning to a method call.
4149
4150``` ruby
4151 foo.bar, = 1
4152 ^^^^^^^
4153```
4154
4155``` ruby
4156 begin
4157 rescue => foo.bar
4158 ^^^^^^^
4159 end
4160```
4161
4162``` ruby
4163 for foo.bar in baz do end
4164 ^^^^^^^
4165```
4166
4167 Type: ::PM_CALL_TARGET_NODE
4168
4169 Flags (#pm_call_node_flags):
4170 * ::PM_CALL_NODE_FLAGS_SAFE_NAVIGATION
4171 * ::PM_CALL_NODE_FLAGS_VARIABLE_CALL
4172 * ::PM_CALL_NODE_FLAGS_ATTRIBUTE_WRITE
4173 * ::PM_CALL_NODE_FLAGS_IGNORE_VISIBILITY
4174
4175 @extends pm_node_t
4176*/
4177#[repr(C)]
4178#[derive(Debug, Copy, Clone)]
4179pub struct pm_call_target_node {
4180 /** The embedded base node.
4181*/
4182 pub base: pm_node_t,
4183 /** CallTargetNode#receiver
4184
4185 The object that the method is being called on. This can be any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression).
4186
4187``` ruby
4188 foo.bar = 1
4189 ^^^
4190```
4191*/
4192 pub receiver: *mut pm_node,
4193 /** CallTargetNode#call_operator_loc
4194
4195 Represents the Location of the call operator.
4196
4197``` ruby
4198 foo.bar = 1
4199 ^
4200```
4201*/
4202 pub call_operator_loc: pm_location_t,
4203 /** CallTargetNode#name
4204
4205 Represents the name of the method being called.
4206
4207``` ruby
4208 foo.bar = 1 # name `:foo`
4209 ^^^
4210```
4211*/
4212 pub name: pm_constant_id_t,
4213 /** CallTargetNode#message_loc
4214
4215 Represents the Location of the message.
4216
4217``` ruby
4218 foo.bar = 1
4219 ^^^
4220```
4221*/
4222 pub message_loc: pm_location_t,
4223}
4224/** CapturePatternNode
4225
4226 Represents assigning to a local variable in pattern matching.
4227
4228``` ruby
4229 foo => [bar => baz]
4230 ^^^^^^^^^^
4231```
4232
4233 Type: ::PM_CAPTURE_PATTERN_NODE
4234
4235 @extends pm_node_t
4236*/
4237#[repr(C)]
4238#[derive(Debug, Copy, Clone)]
4239pub struct pm_capture_pattern_node {
4240 /** The embedded base node.
4241*/
4242 pub base: pm_node_t,
4243 /** CapturePatternNode#value
4244
4245 Represents the value to capture.
4246
4247``` ruby
4248 foo => bar
4249 ^^^
4250```
4251*/
4252 pub value: *mut pm_node,
4253 /** CapturePatternNode#target
4254
4255 Represents the target of the capture.
4256
4257``` ruby
4258 foo => bar
4259 ^^^
4260```
4261*/
4262 pub target: *mut pm_local_variable_target_node,
4263 /** CapturePatternNode#operator_loc
4264
4265 Represents the Location of the `=>` operator.
4266
4267``` ruby
4268 foo => bar
4269 ^^
4270```
4271*/
4272 pub operator_loc: pm_location_t,
4273}
4274/** CaseMatchNode
4275
4276 Represents the use of a case statement for pattern matching.
4277
4278``` ruby
4279 case true
4280 in false
4281 end
4282 ^^^^^^^^^
4283```
4284
4285 Type: ::PM_CASE_MATCH_NODE
4286
4287 @extends pm_node_t
4288*/
4289#[repr(C)]
4290#[derive(Debug, Copy, Clone)]
4291pub struct pm_case_match_node {
4292 /** The embedded base node.
4293*/
4294 pub base: pm_node_t,
4295 /** CaseMatchNode#predicate
4296
4297 Represents the predicate of the case match. This can be either `nil` or any [non-void expressions](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression).
4298
4299``` ruby
4300 case true; in false; end
4301 ^^^^
4302```
4303*/
4304 pub predicate: *mut pm_node,
4305 /** CaseMatchNode#conditions
4306
4307 Represents the conditions of the case match.
4308
4309``` ruby
4310 case true; in false; end
4311 ^^^^^^^^
4312```
4313*/
4314 pub conditions: pm_node_list,
4315 /** CaseMatchNode#else_clause
4316
4317 Represents the else clause of the case match.
4318
4319``` ruby
4320 case true; in false; else; end
4321 ^^^^^^^^^
4322```
4323*/
4324 pub else_clause: *mut pm_else_node,
4325 /** CaseMatchNode#case_keyword_loc
4326
4327 Represents the Location of the `case` keyword.
4328
4329``` ruby
4330 case true; in false; end
4331 ^^^^
4332```
4333*/
4334 pub case_keyword_loc: pm_location_t,
4335 /** CaseMatchNode#end_keyword_loc
4336
4337 Represents the Location of the `end` keyword.
4338
4339``` ruby
4340 case true; in false; end
4341 ^^^
4342```
4343*/
4344 pub end_keyword_loc: pm_location_t,
4345}
4346/** CaseNode
4347
4348 Represents the use of a case statement.
4349
4350``` ruby
4351 case true
4352 when false
4353 end
4354 ^^^^^^^^^^
4355```
4356
4357 Type: ::PM_CASE_NODE
4358
4359 @extends pm_node_t
4360*/
4361#[repr(C)]
4362#[derive(Debug, Copy, Clone)]
4363pub struct pm_case_node {
4364 /** The embedded base node.
4365*/
4366 pub base: pm_node_t,
4367 /** CaseNode#predicate
4368
4369 Represents the predicate of the case statement. This can be either `nil` or any [non-void expressions](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression).
4370
4371``` ruby
4372 case true; when false; end
4373 ^^^^
4374```
4375*/
4376 pub predicate: *mut pm_node,
4377 /** CaseNode#conditions
4378
4379 Represents the conditions of the case statement.
4380
4381``` ruby
4382 case true; when false; end
4383 ^^^^^^^^^^
4384```
4385*/
4386 pub conditions: pm_node_list,
4387 /** CaseNode#else_clause
4388
4389 Represents the else clause of the case statement.
4390
4391``` ruby
4392 case true; when false; else; end
4393 ^^^^^^^^^
4394```
4395*/
4396 pub else_clause: *mut pm_else_node,
4397 /** CaseNode#case_keyword_loc
4398
4399 Represents the Location of the `case` keyword.
4400
4401``` ruby
4402 case true; when false; end
4403 ^^^^
4404```
4405*/
4406 pub case_keyword_loc: pm_location_t,
4407 /** CaseNode#end_keyword_loc
4408
4409 Represents the Location of the `end` keyword.
4410
4411``` ruby
4412 case true; when false; end
4413 ^^^
4414```
4415*/
4416 pub end_keyword_loc: pm_location_t,
4417}
4418/** ClassNode
4419
4420 Represents a class declaration involving the `class` keyword.
4421
4422``` ruby
4423 class Foo end
4424 ^^^^^^^^^^^^^
4425```
4426
4427 Type: ::PM_CLASS_NODE
4428
4429 @extends pm_node_t
4430*/
4431#[repr(C)]
4432#[derive(Debug, Copy, Clone)]
4433pub struct pm_class_node {
4434 /** The embedded base node.
4435*/
4436 pub base: pm_node_t,
4437 /** ClassNode#locals
4438*/
4439 pub locals: pm_constant_id_list_t,
4440 /** ClassNode#class_keyword_loc
4441
4442 Represents the Location of the `class` keyword.
4443
4444``` ruby
4445 class Foo end
4446 ^^^^^
4447```
4448*/
4449 pub class_keyword_loc: pm_location_t,
4450 /** ClassNode#constant_path
4451*/
4452 pub constant_path: *mut pm_node,
4453 /** ClassNode#inheritance_operator_loc
4454
4455 Represents the Location of the `<` operator.
4456
4457``` ruby
4458 class Foo < Bar
4459 ^
4460```
4461*/
4462 pub inheritance_operator_loc: pm_location_t,
4463 /** ClassNode#superclass
4464
4465 Represents the superclass of the class.
4466
4467``` ruby
4468 class Foo < Bar
4469 ^^^
4470```
4471*/
4472 pub superclass: *mut pm_node,
4473 /** ClassNode#body
4474
4475 Represents the body of the class.
4476
4477``` ruby
4478 class Foo; bar; end
4479 ^^^
4480```
4481*/
4482 pub body: *mut pm_node,
4483 /** ClassNode#end_keyword_loc
4484
4485 Represents the Location of the `end` keyword.
4486
4487``` ruby
4488 class Foo end
4489 ^^^
4490```
4491*/
4492 pub end_keyword_loc: pm_location_t,
4493 /** ClassNode#name
4494
4495 The name of the class.
4496
4497``` ruby
4498 class Foo end # name `:Foo`
4499```
4500*/
4501 pub name: pm_constant_id_t,
4502}
4503/** ClassVariableAndWriteNode
4504
4505 Represents the use of the `&&=` operator for assignment to a class variable.
4506
4507``` ruby
4508 @@target &&= value
4509 ^^^^^^^^^^^^^^^^^^
4510```
4511
4512 Type: ::PM_CLASS_VARIABLE_AND_WRITE_NODE
4513
4514 @extends pm_node_t
4515*/
4516#[repr(C)]
4517#[derive(Debug, Copy, Clone)]
4518pub struct pm_class_variable_and_write_node {
4519 /** The embedded base node.
4520*/
4521 pub base: pm_node_t,
4522 /** ClassVariableAndWriteNode#name
4523
4524 The name of the class variable, which is a `@@` followed by an [identifier](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#identifiers).
4525
4526``` ruby
4527 @@target &&= value # name `:@@target`
4528 ^^^^^^^^
4529```
4530*/
4531 pub name: pm_constant_id_t,
4532 /** ClassVariableAndWriteNode#name_loc
4533
4534 Represents the Location of the variable name.
4535
4536``` ruby
4537 @@target &&= value
4538 ^^^^^^^^
4539```
4540*/
4541 pub name_loc: pm_location_t,
4542 /** ClassVariableAndWriteNode#operator_loc
4543
4544 Represents the Location of the `&&=` operator.
4545
4546``` ruby
4547 @@target &&= value
4548 ^^^
4549```
4550*/
4551 pub operator_loc: pm_location_t,
4552 /** ClassVariableAndWriteNode#value
4553
4554 Represents the value being assigned. This can be any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression).
4555
4556``` ruby
4557 @@target &&= value
4558 ^^^^^
4559```
4560*/
4561 pub value: *mut pm_node,
4562}
4563/** ClassVariableOperatorWriteNode
4564
4565 Represents assigning to a class variable using an operator that isn't `=`.
4566
4567``` ruby
4568 @@target += value
4569 ^^^^^^^^^^^^^^^^^
4570```
4571
4572 Type: ::PM_CLASS_VARIABLE_OPERATOR_WRITE_NODE
4573
4574 @extends pm_node_t
4575*/
4576#[repr(C)]
4577#[derive(Debug, Copy, Clone)]
4578pub struct pm_class_variable_operator_write_node {
4579 /** The embedded base node.
4580*/
4581 pub base: pm_node_t,
4582 /** ClassVariableOperatorWriteNode#name
4583*/
4584 pub name: pm_constant_id_t,
4585 /** ClassVariableOperatorWriteNode#name_loc
4586*/
4587 pub name_loc: pm_location_t,
4588 /** ClassVariableOperatorWriteNode#binary_operator_loc
4589*/
4590 pub binary_operator_loc: pm_location_t,
4591 /** ClassVariableOperatorWriteNode#value
4592*/
4593 pub value: *mut pm_node,
4594 /** ClassVariableOperatorWriteNode#binary_operator
4595*/
4596 pub binary_operator: pm_constant_id_t,
4597}
4598/** ClassVariableOrWriteNode
4599
4600 Represents the use of the `||=` operator for assignment to a class variable.
4601
4602``` ruby
4603 @@target ||= value
4604 ^^^^^^^^^^^^^^^^^^
4605```
4606
4607 Type: ::PM_CLASS_VARIABLE_OR_WRITE_NODE
4608
4609 @extends pm_node_t
4610*/
4611#[repr(C)]
4612#[derive(Debug, Copy, Clone)]
4613pub struct pm_class_variable_or_write_node {
4614 /** The embedded base node.
4615*/
4616 pub base: pm_node_t,
4617 /** ClassVariableOrWriteNode#name
4618*/
4619 pub name: pm_constant_id_t,
4620 /** ClassVariableOrWriteNode#name_loc
4621*/
4622 pub name_loc: pm_location_t,
4623 /** ClassVariableOrWriteNode#operator_loc
4624*/
4625 pub operator_loc: pm_location_t,
4626 /** ClassVariableOrWriteNode#value
4627*/
4628 pub value: *mut pm_node,
4629}
4630/** ClassVariableReadNode
4631
4632 Represents referencing a class variable.
4633
4634``` ruby
4635 @@foo
4636 ^^^^^
4637```
4638
4639 Type: ::PM_CLASS_VARIABLE_READ_NODE
4640
4641 @extends pm_node_t
4642*/
4643#[repr(C)]
4644#[derive(Debug, Default, Copy, Clone)]
4645pub struct pm_class_variable_read_node {
4646 /** The embedded base node.
4647*/
4648 pub base: pm_node_t,
4649 /** ClassVariableReadNode#name
4650
4651 The name of the class variable, which is a `@@` followed by an [identifier](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#identifiers).
4652
4653``` ruby
4654 @@abc # name `:@@abc`
4655```
4656
4657``` ruby
4658 @@_test # name `:@@_test`
4659```
4660*/
4661 pub name: pm_constant_id_t,
4662}
4663/** ClassVariableTargetNode
4664
4665 Represents writing to a class variable in a context that doesn't have an explicit value.
4666
4667``` ruby
4668 @@foo, @@bar = baz
4669 ^^^^^ ^^^^^
4670```
4671
4672 Type: ::PM_CLASS_VARIABLE_TARGET_NODE
4673
4674 @extends pm_node_t
4675*/
4676#[repr(C)]
4677#[derive(Debug, Default, Copy, Clone)]
4678pub struct pm_class_variable_target_node {
4679 /** The embedded base node.
4680*/
4681 pub base: pm_node_t,
4682 /** ClassVariableTargetNode#name
4683*/
4684 pub name: pm_constant_id_t,
4685}
4686/** ClassVariableWriteNode
4687
4688 Represents writing to a class variable.
4689
4690``` ruby
4691 @@foo = 1
4692 ^^^^^^^^^
4693```
4694
4695 Type: ::PM_CLASS_VARIABLE_WRITE_NODE
4696
4697 @extends pm_node_t
4698*/
4699#[repr(C)]
4700#[derive(Debug, Copy, Clone)]
4701pub struct pm_class_variable_write_node {
4702 /** The embedded base node.
4703*/
4704 pub base: pm_node_t,
4705 /** ClassVariableWriteNode#name
4706
4707 The name of the class variable, which is a `@@` followed by an [identifier](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#identifiers).
4708
4709``` ruby
4710 @@abc = 123 # name `@@abc`
4711```
4712
4713``` ruby
4714 @@_test = :test # name `@@_test`
4715```
4716*/
4717 pub name: pm_constant_id_t,
4718 /** ClassVariableWriteNode#name_loc
4719
4720 The Location of the variable name.
4721
4722``` ruby
4723 @@foo = :bar
4724 ^^^^^
4725```
4726*/
4727 pub name_loc: pm_location_t,
4728 /** ClassVariableWriteNode#value
4729
4730 The value to write to the class variable. This can be any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression).
4731
4732``` ruby
4733 @@foo = :bar
4734 ^^^^
4735```
4736
4737``` ruby
4738 @@_xyz = 123
4739 ^^^
4740```
4741*/
4742 pub value: *mut pm_node,
4743 /** ClassVariableWriteNode#operator_loc
4744
4745 The Location of the `=` operator.
4746
4747``` ruby
4748 @@foo = :bar
4749 ^
4750```
4751*/
4752 pub operator_loc: pm_location_t,
4753}
4754/** ConstantAndWriteNode
4755
4756 Represents the use of the `&&=` operator for assignment to a constant.
4757
4758``` ruby
4759 Target &&= value
4760 ^^^^^^^^^^^^^^^^
4761```
4762
4763 Type: ::PM_CONSTANT_AND_WRITE_NODE
4764
4765 @extends pm_node_t
4766*/
4767#[repr(C)]
4768#[derive(Debug, Copy, Clone)]
4769pub struct pm_constant_and_write_node {
4770 /** The embedded base node.
4771*/
4772 pub base: pm_node_t,
4773 /** ConstantAndWriteNode#name
4774*/
4775 pub name: pm_constant_id_t,
4776 /** ConstantAndWriteNode#name_loc
4777*/
4778 pub name_loc: pm_location_t,
4779 /** ConstantAndWriteNode#operator_loc
4780*/
4781 pub operator_loc: pm_location_t,
4782 /** ConstantAndWriteNode#value
4783*/
4784 pub value: *mut pm_node,
4785}
4786/** ConstantOperatorWriteNode
4787
4788 Represents assigning to a constant using an operator that isn't `=`.
4789
4790``` ruby
4791 Target += value
4792 ^^^^^^^^^^^^^^^
4793```
4794
4795 Type: ::PM_CONSTANT_OPERATOR_WRITE_NODE
4796
4797 @extends pm_node_t
4798*/
4799#[repr(C)]
4800#[derive(Debug, Copy, Clone)]
4801pub struct pm_constant_operator_write_node {
4802 /** The embedded base node.
4803*/
4804 pub base: pm_node_t,
4805 /** ConstantOperatorWriteNode#name
4806*/
4807 pub name: pm_constant_id_t,
4808 /** ConstantOperatorWriteNode#name_loc
4809*/
4810 pub name_loc: pm_location_t,
4811 /** ConstantOperatorWriteNode#binary_operator_loc
4812*/
4813 pub binary_operator_loc: pm_location_t,
4814 /** ConstantOperatorWriteNode#value
4815*/
4816 pub value: *mut pm_node,
4817 /** ConstantOperatorWriteNode#binary_operator
4818*/
4819 pub binary_operator: pm_constant_id_t,
4820}
4821/** ConstantOrWriteNode
4822
4823 Represents the use of the `||=` operator for assignment to a constant.
4824
4825``` ruby
4826 Target ||= value
4827 ^^^^^^^^^^^^^^^^
4828```
4829
4830 Type: ::PM_CONSTANT_OR_WRITE_NODE
4831
4832 @extends pm_node_t
4833*/
4834#[repr(C)]
4835#[derive(Debug, Copy, Clone)]
4836pub struct pm_constant_or_write_node {
4837 /** The embedded base node.
4838*/
4839 pub base: pm_node_t,
4840 /** ConstantOrWriteNode#name
4841*/
4842 pub name: pm_constant_id_t,
4843 /** ConstantOrWriteNode#name_loc
4844*/
4845 pub name_loc: pm_location_t,
4846 /** ConstantOrWriteNode#operator_loc
4847*/
4848 pub operator_loc: pm_location_t,
4849 /** ConstantOrWriteNode#value
4850*/
4851 pub value: *mut pm_node,
4852}
4853/** ConstantPathAndWriteNode
4854
4855 Represents the use of the `&&=` operator for assignment to a constant path.
4856
4857``` ruby
4858 Parent::Child &&= value
4859 ^^^^^^^^^^^^^^^^^^^^^^^
4860```
4861
4862 Type: ::PM_CONSTANT_PATH_AND_WRITE_NODE
4863
4864 @extends pm_node_t
4865*/
4866#[repr(C)]
4867#[derive(Debug, Copy, Clone)]
4868pub struct pm_constant_path_and_write_node {
4869 /** The embedded base node.
4870*/
4871 pub base: pm_node_t,
4872 /** ConstantPathAndWriteNode#target
4873*/
4874 pub target: *mut pm_constant_path_node,
4875 /** ConstantPathAndWriteNode#operator_loc
4876*/
4877 pub operator_loc: pm_location_t,
4878 /** ConstantPathAndWriteNode#value
4879*/
4880 pub value: *mut pm_node,
4881}
4882/** ConstantPathNode
4883
4884 Represents accessing a constant through a path of `::` operators.
4885
4886``` ruby
4887 Foo::Bar
4888 ^^^^^^^^
4889```
4890
4891 Type: ::PM_CONSTANT_PATH_NODE
4892
4893 @extends pm_node_t
4894*/
4895#[repr(C)]
4896#[derive(Debug, Copy, Clone)]
4897pub struct pm_constant_path_node {
4898 /** The embedded base node.
4899*/
4900 pub base: pm_node_t,
4901 /** ConstantPathNode#parent
4902
4903 The left-hand node of the path, if present. It can be `nil` or any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). It will be `nil` when the constant lookup is at the root of the module tree.
4904
4905``` ruby
4906 Foo::Bar
4907 ^^^
4908```
4909
4910``` ruby
4911 self::Test
4912 ^^^^
4913```
4914
4915``` ruby
4916 a.b::C
4917 ^^^
4918```
4919*/
4920 pub parent: *mut pm_node,
4921 /** ConstantPathNode#name
4922
4923 The name of the constant being accessed. This could be `nil` in the event of a syntax error.
4924*/
4925 pub name: pm_constant_id_t,
4926 /** ConstantPathNode#delimiter_loc
4927
4928 The Location of the `::` delimiter.
4929
4930``` ruby
4931 ::Foo
4932 ^^
4933```
4934
4935``` ruby
4936 One::Two
4937 ^^
4938```
4939*/
4940 pub delimiter_loc: pm_location_t,
4941 /** ConstantPathNode#name_loc
4942
4943 The Location of the name of the constant.
4944
4945``` ruby
4946 ::Foo
4947 ^^^
4948```
4949
4950``` ruby
4951 One::Two
4952 ^^^
4953```
4954*/
4955 pub name_loc: pm_location_t,
4956}
4957/** ConstantPathOperatorWriteNode
4958
4959 Represents assigning to a constant path using an operator that isn't `=`.
4960
4961``` ruby
4962 Parent::Child += value
4963 ^^^^^^^^^^^^^^^^^^^^^^
4964```
4965
4966 Type: ::PM_CONSTANT_PATH_OPERATOR_WRITE_NODE
4967
4968 @extends pm_node_t
4969*/
4970#[repr(C)]
4971#[derive(Debug, Copy, Clone)]
4972pub struct pm_constant_path_operator_write_node {
4973 /** The embedded base node.
4974*/
4975 pub base: pm_node_t,
4976 /** ConstantPathOperatorWriteNode#target
4977*/
4978 pub target: *mut pm_constant_path_node,
4979 /** ConstantPathOperatorWriteNode#binary_operator_loc
4980*/
4981 pub binary_operator_loc: pm_location_t,
4982 /** ConstantPathOperatorWriteNode#value
4983*/
4984 pub value: *mut pm_node,
4985 /** ConstantPathOperatorWriteNode#binary_operator
4986*/
4987 pub binary_operator: pm_constant_id_t,
4988}
4989/** ConstantPathOrWriteNode
4990
4991 Represents the use of the `||=` operator for assignment to a constant path.
4992
4993``` ruby
4994 Parent::Child ||= value
4995 ^^^^^^^^^^^^^^^^^^^^^^^
4996```
4997
4998 Type: ::PM_CONSTANT_PATH_OR_WRITE_NODE
4999
5000 @extends pm_node_t
5001*/
5002#[repr(C)]
5003#[derive(Debug, Copy, Clone)]
5004pub struct pm_constant_path_or_write_node {
5005 /** The embedded base node.
5006*/
5007 pub base: pm_node_t,
5008 /** ConstantPathOrWriteNode#target
5009*/
5010 pub target: *mut pm_constant_path_node,
5011 /** ConstantPathOrWriteNode#operator_loc
5012*/
5013 pub operator_loc: pm_location_t,
5014 /** ConstantPathOrWriteNode#value
5015*/
5016 pub value: *mut pm_node,
5017}
5018/** ConstantPathTargetNode
5019
5020 Represents writing to a constant path in a context that doesn't have an explicit value.
5021
5022``` ruby
5023 Foo::Foo, Bar::Bar = baz
5024 ^^^^^^^^ ^^^^^^^^
5025```
5026
5027 Type: ::PM_CONSTANT_PATH_TARGET_NODE
5028
5029 @extends pm_node_t
5030*/
5031#[repr(C)]
5032#[derive(Debug, Copy, Clone)]
5033pub struct pm_constant_path_target_node {
5034 /** The embedded base node.
5035*/
5036 pub base: pm_node_t,
5037 /** ConstantPathTargetNode#parent
5038*/
5039 pub parent: *mut pm_node,
5040 /** ConstantPathTargetNode#name
5041*/
5042 pub name: pm_constant_id_t,
5043 /** ConstantPathTargetNode#delimiter_loc
5044*/
5045 pub delimiter_loc: pm_location_t,
5046 /** ConstantPathTargetNode#name_loc
5047*/
5048 pub name_loc: pm_location_t,
5049}
5050/** ConstantPathWriteNode
5051
5052 Represents writing to a constant path.
5053
5054``` ruby
5055 ::Foo = 1
5056 ^^^^^^^^^
5057```
5058
5059``` ruby
5060 Foo::Bar = 1
5061 ^^^^^^^^^^^^
5062```
5063
5064``` ruby
5065 ::Foo::Bar = 1
5066 ^^^^^^^^^^^^^^
5067```
5068
5069 Type: ::PM_CONSTANT_PATH_WRITE_NODE
5070
5071 @extends pm_node_t
5072*/
5073#[repr(C)]
5074#[derive(Debug, Copy, Clone)]
5075pub struct pm_constant_path_write_node {
5076 /** The embedded base node.
5077*/
5078 pub base: pm_node_t,
5079 /** ConstantPathWriteNode#target
5080
5081 A node representing the constant path being written to.
5082
5083``` ruby
5084 Foo::Bar = 1
5085 ^^^^^^^^
5086```
5087
5088``` ruby
5089 ::Foo = :abc
5090 ^^^^^
5091```
5092*/
5093 pub target: *mut pm_constant_path_node,
5094 /** ConstantPathWriteNode#operator_loc
5095
5096 The Location of the `=` operator.
5097
5098``` ruby
5099 ::ABC = 123
5100 ^
5101```
5102*/
5103 pub operator_loc: pm_location_t,
5104 /** ConstantPathWriteNode#value
5105
5106 The value to write to the constant path. It can be any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression).
5107
5108``` ruby
5109 FOO::BAR = :abc
5110 ^^^^
5111```
5112*/
5113 pub value: *mut pm_node,
5114}
5115/** ConstantReadNode
5116
5117 Represents referencing a constant.
5118
5119``` ruby
5120 Foo
5121 ^^^
5122```
5123
5124 Type: ::PM_CONSTANT_READ_NODE
5125
5126 @extends pm_node_t
5127*/
5128#[repr(C)]
5129#[derive(Debug, Default, Copy, Clone)]
5130pub struct pm_constant_read_node {
5131 /** The embedded base node.
5132*/
5133 pub base: pm_node_t,
5134 /** ConstantReadNode#name
5135
5136 The name of the [constant](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#constants).
5137
5138``` ruby
5139 X # name `:X`
5140```
5141
5142``` ruby
5143 SOME_CONSTANT # name `:SOME_CONSTANT`
5144```
5145*/
5146 pub name: pm_constant_id_t,
5147}
5148/** ConstantTargetNode
5149
5150 Represents writing to a constant in a context that doesn't have an explicit value.
5151
5152``` ruby
5153 Foo, Bar = baz
5154 ^^^ ^^^
5155```
5156
5157 Type: ::PM_CONSTANT_TARGET_NODE
5158
5159 @extends pm_node_t
5160*/
5161#[repr(C)]
5162#[derive(Debug, Default, Copy, Clone)]
5163pub struct pm_constant_target_node {
5164 /** The embedded base node.
5165*/
5166 pub base: pm_node_t,
5167 /** ConstantTargetNode#name
5168*/
5169 pub name: pm_constant_id_t,
5170}
5171/** ConstantWriteNode
5172
5173 Represents writing to a constant.
5174
5175``` ruby
5176 Foo = 1
5177 ^^^^^^^
5178```
5179
5180 Type: ::PM_CONSTANT_WRITE_NODE
5181
5182 @extends pm_node_t
5183*/
5184#[repr(C)]
5185#[derive(Debug, Copy, Clone)]
5186pub struct pm_constant_write_node {
5187 /** The embedded base node.
5188*/
5189 pub base: pm_node_t,
5190 /** ConstantWriteNode#name
5191
5192 The name of the [constant](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#constants).
5193
5194``` ruby
5195 Foo = :bar # name `:Foo`
5196```
5197
5198``` ruby
5199 XYZ = 1 # name `:XYZ`
5200```
5201*/
5202 pub name: pm_constant_id_t,
5203 /** ConstantWriteNode#name_loc
5204
5205 The Location of the constant name.
5206
5207``` ruby
5208 FOO = 1
5209 ^^^
5210```
5211*/
5212 pub name_loc: pm_location_t,
5213 /** ConstantWriteNode#value
5214
5215 The value to write to the constant. It can be any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression).
5216
5217``` ruby
5218 FOO = :bar
5219 ^^^^
5220```
5221
5222``` ruby
5223 MyClass = Class.new
5224 ^^^^^^^^^
5225```
5226*/
5227 pub value: *mut pm_node,
5228 /** ConstantWriteNode#operator_loc
5229
5230 The Location of the `=` operator.
5231
5232``` ruby
5233 FOO = :bar
5234 ^
5235```
5236*/
5237 pub operator_loc: pm_location_t,
5238}
5239/** DefNode
5240
5241 Represents a method definition.
5242
5243``` ruby
5244 def method
5245 end
5246 ^^^^^^^^^^
5247```
5248
5249 Type: ::PM_DEF_NODE
5250
5251 @extends pm_node_t
5252*/
5253#[repr(C)]
5254#[derive(Debug, Copy, Clone)]
5255pub struct pm_def_node {
5256 /** The embedded base node.
5257*/
5258 pub base: pm_node_t,
5259 /** DefNode#name
5260*/
5261 pub name: pm_constant_id_t,
5262 /** DefNode#name_loc
5263*/
5264 pub name_loc: pm_location_t,
5265 /** DefNode#receiver
5266*/
5267 pub receiver: *mut pm_node,
5268 /** DefNode#parameters
5269*/
5270 pub parameters: *mut pm_parameters_node,
5271 /** DefNode#body
5272*/
5273 pub body: *mut pm_node,
5274 /** DefNode#locals
5275*/
5276 pub locals: pm_constant_id_list_t,
5277 /** DefNode#def_keyword_loc
5278*/
5279 pub def_keyword_loc: pm_location_t,
5280 /** DefNode#operator_loc
5281*/
5282 pub operator_loc: pm_location_t,
5283 /** DefNode#lparen_loc
5284*/
5285 pub lparen_loc: pm_location_t,
5286 /** DefNode#rparen_loc
5287*/
5288 pub rparen_loc: pm_location_t,
5289 /** DefNode#equal_loc
5290*/
5291 pub equal_loc: pm_location_t,
5292 /** DefNode#end_keyword_loc
5293*/
5294 pub end_keyword_loc: pm_location_t,
5295}
5296/** DefinedNode
5297
5298 Represents the use of the `defined?` keyword.
5299
5300``` ruby
5301 defined?(a)
5302 ^^^^^^^^^^^
5303```
5304
5305 Type: ::PM_DEFINED_NODE
5306
5307 @extends pm_node_t
5308*/
5309#[repr(C)]
5310#[derive(Debug, Copy, Clone)]
5311pub struct pm_defined_node {
5312 /** The embedded base node.
5313*/
5314 pub base: pm_node_t,
5315 /** DefinedNode#lparen_loc
5316*/
5317 pub lparen_loc: pm_location_t,
5318 /** DefinedNode#value
5319*/
5320 pub value: *mut pm_node,
5321 /** DefinedNode#rparen_loc
5322*/
5323 pub rparen_loc: pm_location_t,
5324 /** DefinedNode#keyword_loc
5325*/
5326 pub keyword_loc: pm_location_t,
5327}
5328/** ElseNode
5329
5330 Represents an `else` clause in a `case`, `if`, or `unless` statement.
5331
5332``` ruby
5333 if a then b else c end
5334 ^^^^^^^^^^
5335```
5336
5337 Type: ::PM_ELSE_NODE
5338
5339 @extends pm_node_t
5340*/
5341#[repr(C)]
5342#[derive(Debug, Copy, Clone)]
5343pub struct pm_else_node {
5344 /** The embedded base node.
5345*/
5346 pub base: pm_node_t,
5347 /** ElseNode#else_keyword_loc
5348*/
5349 pub else_keyword_loc: pm_location_t,
5350 /** ElseNode#statements
5351*/
5352 pub statements: *mut pm_statements_node,
5353 /** ElseNode#end_keyword_loc
5354*/
5355 pub end_keyword_loc: pm_location_t,
5356}
5357/** EmbeddedStatementsNode
5358
5359 Represents an interpolated set of statements.
5360
5361``` ruby
5362 "foo #{bar}"
5363 ^^^^^^
5364```
5365
5366 Type: ::PM_EMBEDDED_STATEMENTS_NODE
5367
5368 @extends pm_node_t
5369*/
5370#[repr(C)]
5371#[derive(Debug, Copy, Clone)]
5372pub struct pm_embedded_statements_node {
5373 /** The embedded base node.
5374*/
5375 pub base: pm_node_t,
5376 /** EmbeddedStatementsNode#opening_loc
5377*/
5378 pub opening_loc: pm_location_t,
5379 /** EmbeddedStatementsNode#statements
5380*/
5381 pub statements: *mut pm_statements_node,
5382 /** EmbeddedStatementsNode#closing_loc
5383*/
5384 pub closing_loc: pm_location_t,
5385}
5386/** EmbeddedVariableNode
5387
5388 Represents an interpolated variable.
5389
5390``` ruby
5391 "foo #@bar"
5392 ^^^^^
5393```
5394
5395 Type: ::PM_EMBEDDED_VARIABLE_NODE
5396
5397 @extends pm_node_t
5398*/
5399#[repr(C)]
5400#[derive(Debug, Copy, Clone)]
5401pub struct pm_embedded_variable_node {
5402 /** The embedded base node.
5403*/
5404 pub base: pm_node_t,
5405 /** EmbeddedVariableNode#operator_loc
5406*/
5407 pub operator_loc: pm_location_t,
5408 /** EmbeddedVariableNode#variable
5409*/
5410 pub variable: *mut pm_node,
5411}
5412/** EnsureNode
5413
5414 Represents an `ensure` clause in a `begin` statement.
5415
5416``` ruby
5417 begin
5418 foo
5419 ensure
5420 ^^^^^^
5421 bar
5422 end
5423```
5424
5425 Type: ::PM_ENSURE_NODE
5426
5427 @extends pm_node_t
5428*/
5429#[repr(C)]
5430#[derive(Debug, Copy, Clone)]
5431pub struct pm_ensure_node {
5432 /** The embedded base node.
5433*/
5434 pub base: pm_node_t,
5435 /** EnsureNode#ensure_keyword_loc
5436*/
5437 pub ensure_keyword_loc: pm_location_t,
5438 /** EnsureNode#statements
5439*/
5440 pub statements: *mut pm_statements_node,
5441 /** EnsureNode#end_keyword_loc
5442*/
5443 pub end_keyword_loc: pm_location_t,
5444}
5445/** ErrorRecoveryNode
5446
5447 Represents a node that is either missing or unexpected and results in a syntax error.
5448
5449 Type: ::PM_ERROR_RECOVERY_NODE
5450
5451 @extends pm_node_t
5452*/
5453#[repr(C)]
5454#[derive(Debug, Copy, Clone)]
5455pub struct pm_error_recovery_node {
5456 /** The embedded base node.
5457*/
5458 pub base: pm_node_t,
5459 /** ErrorRecoveryNode#unexpected
5460
5461 The unexpected node that was found in the tree, if there was one.
5462*/
5463 pub unexpected: *mut pm_node,
5464}
5465/** FalseNode
5466
5467 Represents the use of the literal `false` keyword.
5468
5469``` ruby
5470 false
5471 ^^^^^
5472```
5473
5474 Type: ::PM_FALSE_NODE
5475
5476 @extends pm_node_t
5477*/
5478#[repr(C)]
5479#[derive(Debug, Default, Copy, Clone)]
5480pub struct pm_false_node {
5481 /** The embedded base node.
5482*/
5483 pub base: pm_node_t,
5484}
5485/** FindPatternNode
5486
5487 Represents a find pattern in pattern matching.
5488
5489``` ruby
5490 foo in *bar, baz, *qux
5491 ^^^^^^^^^^^^^^^
5492```
5493
5494``` ruby
5495 foo in [*bar, baz, *qux]
5496 ^^^^^^^^^^^^^^^^^
5497```
5498
5499``` ruby
5500 foo in Foo(*bar, baz, *qux)
5501 ^^^^^^^^^^^^^^^^^^^^
5502```
5503
5504``` ruby
5505 foo => *bar, baz, *qux
5506 ^^^^^^^^^^^^^^^
5507```
5508
5509 Type: ::PM_FIND_PATTERN_NODE
5510
5511 @extends pm_node_t
5512*/
5513#[repr(C)]
5514#[derive(Debug, Copy, Clone)]
5515pub struct pm_find_pattern_node {
5516 /** The embedded base node.
5517*/
5518 pub base: pm_node_t,
5519 /** FindPatternNode#constant
5520
5521 Represents the optional constant preceding the pattern
5522
5523``` ruby
5524 foo in Foo(*bar, baz, *qux)
5525 ^^^
5526```
5527*/
5528 pub constant: *mut pm_node,
5529 /** FindPatternNode#left
5530
5531 Represents the first wildcard node in the pattern.
5532
5533``` ruby
5534 foo in *bar, baz, *qux
5535 ^^^^
5536```
5537
5538``` ruby
5539 foo in Foo(*bar, baz, *qux)
5540 ^^^^
5541```
5542*/
5543 pub left: *mut pm_splat_node,
5544 /** FindPatternNode#requireds
5545
5546 Represents the nodes in between the wildcards.
5547
5548``` ruby
5549 foo in *bar, baz, *qux
5550 ^^^
5551```
5552
5553``` ruby
5554 foo in Foo(*bar, baz, 1, *qux)
5555 ^^^^^^
5556```
5557*/
5558 pub requireds: pm_node_list,
5559 /** FindPatternNode#right
5560
5561 Represents the second wildcard node in the pattern.
5562
5563``` ruby
5564 foo in *bar, baz, *qux
5565 ^^^^
5566```
5567
5568``` ruby
5569 foo in Foo(*bar, baz, *qux)
5570 ^^^^
5571```
5572*/
5573 pub right: *mut pm_splat_node,
5574 /** FindPatternNode#opening_loc
5575
5576 The Location of the opening brace.
5577
5578``` ruby
5579 foo in [*bar, baz, *qux]
5580 ^
5581```
5582
5583``` ruby
5584 foo in Foo(*bar, baz, *qux)
5585 ^
5586```
5587*/
5588 pub opening_loc: pm_location_t,
5589 /** FindPatternNode#closing_loc
5590
5591 The Location of the closing brace.
5592
5593``` ruby
5594 foo in [*bar, baz, *qux]
5595 ^
5596```
5597
5598``` ruby
5599 foo in Foo(*bar, baz, *qux)
5600 ^
5601```
5602*/
5603 pub closing_loc: pm_location_t,
5604}
5605/** FlipFlopNode
5606
5607 Represents the use of the `..` or `...` operators to create flip flops.
5608
5609``` ruby
5610 baz if foo .. bar
5611 ^^^^^^^^^^
5612```
5613
5614 Type: ::PM_FLIP_FLOP_NODE
5615
5616 Flags (#pm_range_flags):
5617 * ::PM_RANGE_FLAGS_EXCLUDE_END
5618
5619 @extends pm_node_t
5620*/
5621#[repr(C)]
5622#[derive(Debug, Copy, Clone)]
5623pub struct pm_flip_flop_node {
5624 /** The embedded base node.
5625*/
5626 pub base: pm_node_t,
5627 /** FlipFlopNode#left
5628*/
5629 pub left: *mut pm_node,
5630 /** FlipFlopNode#right
5631*/
5632 pub right: *mut pm_node,
5633 /** FlipFlopNode#operator_loc
5634*/
5635 pub operator_loc: pm_location_t,
5636}
5637/** FloatNode
5638
5639 Represents a floating point number literal.
5640
5641``` ruby
5642 1.0
5643 ^^^
5644```
5645
5646 Type: ::PM_FLOAT_NODE
5647
5648 @extends pm_node_t
5649*/
5650#[repr(C)]
5651#[derive(Debug, Default, Copy, Clone)]
5652pub struct pm_float_node {
5653 /** The embedded base node.
5654*/
5655 pub base: pm_node_t,
5656 /** FloatNode#value
5657
5658 The value of the floating point number as a Float.
5659*/
5660 pub value: f64,
5661}
5662/** ForNode
5663
5664 Represents the use of the `for` keyword.
5665
5666``` ruby
5667 for i in a end
5668 ^^^^^^^^^^^^^^
5669```
5670
5671 Type: ::PM_FOR_NODE
5672
5673 @extends pm_node_t
5674*/
5675#[repr(C)]
5676#[derive(Debug, Copy, Clone)]
5677pub struct pm_for_node {
5678 /** The embedded base node.
5679*/
5680 pub base: pm_node_t,
5681 /** ForNode#index
5682
5683 The index expression for `for` loops.
5684
5685``` ruby
5686 for i in a end
5687 ^
5688```
5689*/
5690 pub index: *mut pm_node,
5691 /** ForNode#collection
5692
5693 The collection to iterate over.
5694
5695``` ruby
5696 for i in a end
5697 ^
5698```
5699*/
5700 pub collection: *mut pm_node,
5701 /** ForNode#statements
5702
5703 Represents the body of statements to execute for each iteration of the loop.
5704
5705``` ruby
5706 for i in a
5707 foo(i)
5708 ^^^^^^
5709 end
5710```
5711*/
5712 pub statements: *mut pm_statements_node,
5713 /** ForNode#for_keyword_loc
5714
5715 The Location of the `for` keyword.
5716
5717``` ruby
5718 for i in a end
5719 ^^^
5720```
5721*/
5722 pub for_keyword_loc: pm_location_t,
5723 /** ForNode#in_keyword_loc
5724
5725 The Location of the `in` keyword.
5726
5727``` ruby
5728 for i in a end
5729 ^^
5730```
5731*/
5732 pub in_keyword_loc: pm_location_t,
5733 /** ForNode#do_keyword_loc
5734
5735 The Location of the `do` keyword, if present.
5736
5737``` ruby
5738 for i in a do end
5739 ^^
5740```
5741*/
5742 pub do_keyword_loc: pm_location_t,
5743 /** ForNode#end_keyword_loc
5744
5745 The Location of the `end` keyword.
5746
5747``` ruby
5748 for i in a end
5749 ^^^
5750```
5751*/
5752 pub end_keyword_loc: pm_location_t,
5753}
5754/** ForwardingArgumentsNode
5755
5756 Represents forwarding all arguments to this method to another method.
5757
5758``` ruby
5759 def foo(...)
5760 bar(...)
5761 ^^^
5762 end
5763```
5764
5765 Type: ::PM_FORWARDING_ARGUMENTS_NODE
5766
5767 @extends pm_node_t
5768*/
5769#[repr(C)]
5770#[derive(Debug, Default, Copy, Clone)]
5771pub struct pm_forwarding_arguments_node {
5772 /** The embedded base node.
5773*/
5774 pub base: pm_node_t,
5775}
5776/** ForwardingParameterNode
5777
5778 Represents the use of the forwarding parameter in a method, block, or lambda declaration.
5779
5780``` ruby
5781 def foo(...)
5782 ^^^
5783 end
5784```
5785
5786 Type: ::PM_FORWARDING_PARAMETER_NODE
5787
5788 @extends pm_node_t
5789*/
5790#[repr(C)]
5791#[derive(Debug, Default, Copy, Clone)]
5792pub struct pm_forwarding_parameter_node {
5793 /** The embedded base node.
5794*/
5795 pub base: pm_node_t,
5796}
5797/** ForwardingSuperNode
5798
5799 Represents the use of the `super` keyword without parentheses or arguments, but which might have a block.
5800
5801``` ruby
5802 super
5803 ^^^^^
5804```
5805
5806``` ruby
5807 super { 123 }
5808 ^^^^^^^^^^^^^
5809```
5810
5811 If it has any other arguments, it would be a `SuperNode` instead.
5812
5813 Type: ::PM_FORWARDING_SUPER_NODE
5814
5815 @extends pm_node_t
5816*/
5817#[repr(C)]
5818#[derive(Debug, Copy, Clone)]
5819pub struct pm_forwarding_super_node {
5820 /** The embedded base node.
5821*/
5822 pub base: pm_node_t,
5823 /** ForwardingSuperNode#keyword_loc
5824
5825 super
5826 ^^^^^
5827
5828 super { 123 }
5829 ^^^^^
5830*/
5831 pub keyword_loc: pm_location_t,
5832 /** ForwardingSuperNode#block
5833
5834 All other arguments are forwarded as normal, except the original block is replaced with the new block.
5835*/
5836 pub block: *mut pm_block_node,
5837}
5838/** GlobalVariableAndWriteNode
5839
5840 Represents the use of the `&&=` operator for assignment to a global variable.
5841
5842``` ruby
5843 $target &&= value
5844 ^^^^^^^^^^^^^^^^^
5845```
5846
5847 Type: ::PM_GLOBAL_VARIABLE_AND_WRITE_NODE
5848
5849 @extends pm_node_t
5850*/
5851#[repr(C)]
5852#[derive(Debug, Copy, Clone)]
5853pub struct pm_global_variable_and_write_node {
5854 /** The embedded base node.
5855*/
5856 pub base: pm_node_t,
5857 /** GlobalVariableAndWriteNode#name
5858*/
5859 pub name: pm_constant_id_t,
5860 /** GlobalVariableAndWriteNode#name_loc
5861*/
5862 pub name_loc: pm_location_t,
5863 /** GlobalVariableAndWriteNode#operator_loc
5864*/
5865 pub operator_loc: pm_location_t,
5866 /** GlobalVariableAndWriteNode#value
5867*/
5868 pub value: *mut pm_node,
5869}
5870/** GlobalVariableOperatorWriteNode
5871
5872 Represents assigning to a global variable using an operator that isn't `=`.
5873
5874``` ruby
5875 $target += value
5876 ^^^^^^^^^^^^^^^^
5877```
5878
5879 Type: ::PM_GLOBAL_VARIABLE_OPERATOR_WRITE_NODE
5880
5881 @extends pm_node_t
5882*/
5883#[repr(C)]
5884#[derive(Debug, Copy, Clone)]
5885pub struct pm_global_variable_operator_write_node {
5886 /** The embedded base node.
5887*/
5888 pub base: pm_node_t,
5889 /** GlobalVariableOperatorWriteNode#name
5890*/
5891 pub name: pm_constant_id_t,
5892 /** GlobalVariableOperatorWriteNode#name_loc
5893*/
5894 pub name_loc: pm_location_t,
5895 /** GlobalVariableOperatorWriteNode#binary_operator_loc
5896*/
5897 pub binary_operator_loc: pm_location_t,
5898 /** GlobalVariableOperatorWriteNode#value
5899*/
5900 pub value: *mut pm_node,
5901 /** GlobalVariableOperatorWriteNode#binary_operator
5902*/
5903 pub binary_operator: pm_constant_id_t,
5904}
5905/** GlobalVariableOrWriteNode
5906
5907 Represents the use of the `||=` operator for assignment to a global variable.
5908
5909``` ruby
5910 $target ||= value
5911 ^^^^^^^^^^^^^^^^^
5912```
5913
5914 Type: ::PM_GLOBAL_VARIABLE_OR_WRITE_NODE
5915
5916 @extends pm_node_t
5917*/
5918#[repr(C)]
5919#[derive(Debug, Copy, Clone)]
5920pub struct pm_global_variable_or_write_node {
5921 /** The embedded base node.
5922*/
5923 pub base: pm_node_t,
5924 /** GlobalVariableOrWriteNode#name
5925*/
5926 pub name: pm_constant_id_t,
5927 /** GlobalVariableOrWriteNode#name_loc
5928*/
5929 pub name_loc: pm_location_t,
5930 /** GlobalVariableOrWriteNode#operator_loc
5931*/
5932 pub operator_loc: pm_location_t,
5933 /** GlobalVariableOrWriteNode#value
5934*/
5935 pub value: *mut pm_node,
5936}
5937/** GlobalVariableReadNode
5938
5939 Represents referencing a global variable.
5940
5941``` ruby
5942 $foo
5943 ^^^^
5944```
5945
5946 Type: ::PM_GLOBAL_VARIABLE_READ_NODE
5947
5948 @extends pm_node_t
5949*/
5950#[repr(C)]
5951#[derive(Debug, Default, Copy, Clone)]
5952pub struct pm_global_variable_read_node {
5953 /** The embedded base node.
5954*/
5955 pub base: pm_node_t,
5956 /** GlobalVariableReadNode#name
5957
5958 The name of the global variable, which is a `$` followed by an [identifier](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#identifier). Alternatively, it can be one of the special global variables designated by a symbol.
5959
5960``` ruby
5961 $foo # name `:$foo`
5962```
5963
5964``` ruby
5965 $_Test # name `:$_Test`
5966```
5967*/
5968 pub name: pm_constant_id_t,
5969}
5970/** GlobalVariableTargetNode
5971
5972 Represents writing to a global variable in a context that doesn't have an explicit value.
5973
5974``` ruby
5975 $foo, $bar = baz
5976 ^^^^ ^^^^
5977```
5978
5979 Type: ::PM_GLOBAL_VARIABLE_TARGET_NODE
5980
5981 @extends pm_node_t
5982*/
5983#[repr(C)]
5984#[derive(Debug, Default, Copy, Clone)]
5985pub struct pm_global_variable_target_node {
5986 /** The embedded base node.
5987*/
5988 pub base: pm_node_t,
5989 /** GlobalVariableTargetNode#name
5990*/
5991 pub name: pm_constant_id_t,
5992}
5993/** GlobalVariableWriteNode
5994
5995 Represents writing to a global variable.
5996
5997``` ruby
5998 $foo = 1
5999 ^^^^^^^^
6000```
6001
6002 Type: ::PM_GLOBAL_VARIABLE_WRITE_NODE
6003
6004 @extends pm_node_t
6005*/
6006#[repr(C)]
6007#[derive(Debug, Copy, Clone)]
6008pub struct pm_global_variable_write_node {
6009 /** The embedded base node.
6010*/
6011 pub base: pm_node_t,
6012 /** GlobalVariableWriteNode#name
6013
6014 The name of the global variable, which is a `$` followed by an [identifier](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#identifier). Alternatively, it can be one of the special global variables designated by a symbol.
6015
6016``` ruby
6017 $foo = :bar # name `:$foo`
6018```
6019
6020``` ruby
6021 $_Test = 123 # name `:$_Test`
6022```
6023*/
6024 pub name: pm_constant_id_t,
6025 /** GlobalVariableWriteNode#name_loc
6026
6027 The Location of the global variable's name.
6028
6029``` ruby
6030 $foo = :bar
6031 ^^^^
6032```
6033*/
6034 pub name_loc: pm_location_t,
6035 /** GlobalVariableWriteNode#value
6036
6037 The value to write to the global variable. It can be any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression).
6038
6039``` ruby
6040 $foo = :bar
6041 ^^^^
6042```
6043
6044``` ruby
6045 $-xyz = 123
6046 ^^^
6047```
6048*/
6049 pub value: *mut pm_node,
6050 /** GlobalVariableWriteNode#operator_loc
6051
6052 The Location of the `=` operator.
6053
6054``` ruby
6055 $foo = :bar
6056 ^
6057```
6058*/
6059 pub operator_loc: pm_location_t,
6060}
6061/** HashNode
6062
6063 Represents a hash literal.
6064
6065``` ruby
6066 { a => b }
6067 ^^^^^^^^^^
6068```
6069
6070 Type: ::PM_HASH_NODE
6071
6072 @extends pm_node_t
6073*/
6074#[repr(C)]
6075#[derive(Debug, Copy, Clone)]
6076pub struct pm_hash_node {
6077 /** The embedded base node.
6078*/
6079 pub base: pm_node_t,
6080 /** HashNode#opening_loc
6081
6082 The Location of the opening brace.
6083
6084``` ruby
6085 { a => b }
6086 ^
6087```
6088*/
6089 pub opening_loc: pm_location_t,
6090 /** HashNode#elements
6091
6092 The elements of the hash. These can be either `AssocNode`s or `AssocSplatNode`s.
6093
6094``` ruby
6095 { a: b }
6096 ^^^^
6097```
6098
6099``` ruby
6100 { **foo }
6101 ^^^^^
6102```
6103*/
6104 pub elements: pm_node_list,
6105 /** HashNode#closing_loc
6106
6107 The Location of the closing brace.
6108
6109``` ruby
6110 { a => b }
6111 ^
6112```
6113*/
6114 pub closing_loc: pm_location_t,
6115}
6116/** HashPatternNode
6117
6118 Represents a hash pattern in pattern matching.
6119
6120``` ruby
6121 foo => { a: 1, b: 2 }
6122 ^^^^^^^^^^^^^^
6123```
6124
6125``` ruby
6126 foo => { a: 1, b: 2, **c }
6127 ^^^^^^^^^^^^^^^^^^^
6128```
6129
6130``` ruby
6131 foo => Bar[a: 1, b: 2]
6132 ^^^^^^^^^^^^^^^
6133```
6134
6135``` ruby
6136 foo in { a: 1, b: 2 }
6137 ^^^^^^^^^^^^^^
6138```
6139
6140 Type: ::PM_HASH_PATTERN_NODE
6141
6142 @extends pm_node_t
6143*/
6144#[repr(C)]
6145#[derive(Debug, Copy, Clone)]
6146pub struct pm_hash_pattern_node {
6147 /** The embedded base node.
6148*/
6149 pub base: pm_node_t,
6150 /** HashPatternNode#constant
6151
6152 Represents the optional constant preceding the Hash.
6153
6154``` ruby
6155 foo => Bar[a: 1, b: 2]
6156 ^^^
6157```
6158
6159``` ruby
6160 foo => Bar::Baz[a: 1, b: 2]
6161 ^^^^^^^^
6162```
6163*/
6164 pub constant: *mut pm_node,
6165 /** HashPatternNode#elements
6166
6167 Represents the explicit named hash keys and values.
6168
6169``` ruby
6170 foo => { a: 1, b:, ** }
6171 ^^^^^^^^
6172```
6173*/
6174 pub elements: pm_node_list,
6175 /** HashPatternNode#rest
6176
6177 Represents the rest of the Hash keys and values. This can be named, unnamed, or explicitly forbidden via `**nil`, this last one results in a `NoKeywordsParameterNode`.
6178
6179``` ruby
6180 foo => { a: 1, b:, **c }
6181 ^^^
6182```
6183
6184``` ruby
6185 foo => { a: 1, b:, ** }
6186 ^^
6187```
6188
6189``` ruby
6190 foo => { a: 1, b:, **nil }
6191 ^^^^^
6192```
6193*/
6194 pub rest: *mut pm_node,
6195 /** HashPatternNode#opening_loc
6196
6197 The Location of the opening brace.
6198
6199``` ruby
6200 foo => { a: 1 }
6201 ^
6202```
6203
6204``` ruby
6205 foo => Bar[a: 1]
6206 ^
6207```
6208*/
6209 pub opening_loc: pm_location_t,
6210 /** HashPatternNode#closing_loc
6211
6212 The Location of the closing brace.
6213
6214``` ruby
6215 foo => { a: 1 }
6216 ^
6217```
6218
6219``` ruby
6220 foo => Bar[a: 1]
6221 ^
6222```
6223*/
6224 pub closing_loc: pm_location_t,
6225}
6226/** IfNode
6227
6228 Represents the use of the `if` keyword, either in the block form or the modifier form, or a ternary expression.
6229
6230``` ruby
6231 bar if foo
6232 ^^^^^^^^^^
6233```
6234
6235``` ruby
6236 if foo then bar end
6237 ^^^^^^^^^^^^^^^^^^^
6238```
6239
6240``` ruby
6241 foo ? bar : baz
6242 ^^^^^^^^^^^^^^^
6243```
6244
6245 Type: ::PM_IF_NODE
6246
6247 @extends pm_node_t
6248*/
6249#[repr(C)]
6250#[derive(Debug, Copy, Clone)]
6251pub struct pm_if_node {
6252 /** The embedded base node.
6253*/
6254 pub base: pm_node_t,
6255 /** IfNode#if_keyword_loc
6256
6257 The Location of the `if` keyword if present.
6258
6259``` ruby
6260 bar if foo
6261 ^^
6262```
6263
6264 The `if_keyword_loc` field will be `nil` when the `IfNode` represents a ternary expression.
6265*/
6266 pub if_keyword_loc: pm_location_t,
6267 /** IfNode#predicate
6268
6269 The node for the condition the `IfNode` is testing.
6270
6271``` ruby
6272 if foo
6273 ^^^
6274 bar
6275 end
6276```
6277
6278``` ruby
6279 bar if foo
6280 ^^^
6281```
6282
6283``` ruby
6284 foo ? bar : baz
6285 ^^^
6286```
6287*/
6288 pub predicate: *mut pm_node,
6289 /** IfNode#then_keyword_loc
6290
6291 The Location of the `then` keyword (if present) or the `?` in a ternary expression, `nil` otherwise.
6292
6293``` ruby
6294 if foo then bar end
6295 ^^^^
6296```
6297
6298``` ruby
6299 a ? b : c
6300 ^
6301```
6302*/
6303 pub then_keyword_loc: pm_location_t,
6304 /** IfNode#statements
6305
6306 Represents the body of statements that will be executed when the predicate is evaluated as truthy. Will be `nil` when no body is provided.
6307
6308``` ruby
6309 if foo
6310 bar
6311 ^^^
6312 baz
6313 ^^^
6314 end
6315```
6316*/
6317 pub statements: *mut pm_statements_node,
6318 /** IfNode#subsequent
6319
6320 Represents an `ElseNode` or an `IfNode` when there is an `else` or an `elsif` in the `if` statement.
6321
6322``` ruby
6323 if foo
6324 bar
6325 elsif baz
6326 ^^^^^^^^^
6327 qux
6328 ^^^
6329 end
6330 ^^^
6331```
6332
6333``` ruby
6334 if foo then bar else baz end
6335 ^^^^^^^^^^^^
6336```
6337*/
6338 pub subsequent: *mut pm_node,
6339 /** IfNode#end_keyword_loc
6340
6341 The Location of the `end` keyword if present, `nil` otherwise.
6342
6343``` ruby
6344 if foo
6345 bar
6346 end
6347 ^^^
6348```
6349*/
6350 pub end_keyword_loc: pm_location_t,
6351}
6352/** ImaginaryNode
6353
6354 Represents an imaginary number literal.
6355
6356``` ruby
6357 1.0i
6358 ^^^^
6359```
6360
6361 Type: ::PM_IMAGINARY_NODE
6362
6363 @extends pm_node_t
6364*/
6365#[repr(C)]
6366#[derive(Debug, Copy, Clone)]
6367pub struct pm_imaginary_node {
6368 /** The embedded base node.
6369*/
6370 pub base: pm_node_t,
6371 /** ImaginaryNode#numeric
6372*/
6373 pub numeric: *mut pm_node,
6374}
6375/** ImplicitNode
6376
6377 Represents a node that is implicitly being added to the tree but doesn't correspond directly to a node in the source.
6378
6379``` ruby
6380 { foo: }
6381 ^^^^
6382```
6383
6384``` ruby
6385 { Foo: }
6386 ^^^^
6387```
6388
6389``` ruby
6390 foo in { bar: }
6391 ^^^^
6392```
6393
6394 Type: ::PM_IMPLICIT_NODE
6395
6396 @extends pm_node_t
6397*/
6398#[repr(C)]
6399#[derive(Debug, Copy, Clone)]
6400pub struct pm_implicit_node {
6401 /** The embedded base node.
6402*/
6403 pub base: pm_node_t,
6404 /** ImplicitNode#value
6405*/
6406 pub value: *mut pm_node,
6407}
6408/** ImplicitRestNode
6409
6410 Represents using a trailing comma to indicate an implicit rest parameter.
6411
6412``` ruby
6413 foo { |bar,| }
6414 ^
6415```
6416
6417``` ruby
6418 foo in [bar,]
6419 ^
6420```
6421
6422``` ruby
6423 for foo, in bar do end
6424 ^
6425```
6426
6427``` ruby
6428 foo, = bar
6429 ^
6430```
6431
6432 Type: ::PM_IMPLICIT_REST_NODE
6433
6434 @extends pm_node_t
6435*/
6436#[repr(C)]
6437#[derive(Debug, Default, Copy, Clone)]
6438pub struct pm_implicit_rest_node {
6439 /** The embedded base node.
6440*/
6441 pub base: pm_node_t,
6442}
6443/** InNode
6444
6445 Represents the use of the `in` keyword in a case statement.
6446
6447``` ruby
6448 case a; in b then c end
6449 ^^^^^^^^^^^
6450```
6451
6452 Type: ::PM_IN_NODE
6453
6454 @extends pm_node_t
6455*/
6456#[repr(C)]
6457#[derive(Debug, Copy, Clone)]
6458pub struct pm_in_node {
6459 /** The embedded base node.
6460*/
6461 pub base: pm_node_t,
6462 /** InNode#pattern
6463*/
6464 pub pattern: *mut pm_node,
6465 /** InNode#statements
6466*/
6467 pub statements: *mut pm_statements_node,
6468 /** InNode#in_keyword_loc
6469*/
6470 pub in_keyword_loc: pm_location_t,
6471 /** InNode#then_keyword_loc
6472*/
6473 pub then_keyword_loc: pm_location_t,
6474}
6475/** IndexAndWriteNode
6476
6477 Represents the use of the `&&=` operator on a call to the `[]` method.
6478
6479``` ruby
6480 foo.bar[baz] &&= value
6481 ^^^^^^^^^^^^^^^^^^^^^^
6482```
6483
6484 Type: ::PM_INDEX_AND_WRITE_NODE
6485
6486 Flags (#pm_call_node_flags):
6487 * ::PM_CALL_NODE_FLAGS_SAFE_NAVIGATION
6488 * ::PM_CALL_NODE_FLAGS_VARIABLE_CALL
6489 * ::PM_CALL_NODE_FLAGS_ATTRIBUTE_WRITE
6490 * ::PM_CALL_NODE_FLAGS_IGNORE_VISIBILITY
6491
6492 @extends pm_node_t
6493*/
6494#[repr(C)]
6495#[derive(Debug, Copy, Clone)]
6496pub struct pm_index_and_write_node {
6497 /** The embedded base node.
6498*/
6499 pub base: pm_node_t,
6500 /** IndexAndWriteNode#receiver
6501*/
6502 pub receiver: *mut pm_node,
6503 /** IndexAndWriteNode#call_operator_loc
6504*/
6505 pub call_operator_loc: pm_location_t,
6506 /** IndexAndWriteNode#opening_loc
6507*/
6508 pub opening_loc: pm_location_t,
6509 /** IndexAndWriteNode#arguments
6510*/
6511 pub arguments: *mut pm_arguments_node,
6512 /** IndexAndWriteNode#closing_loc
6513*/
6514 pub closing_loc: pm_location_t,
6515 /** IndexAndWriteNode#block
6516*/
6517 pub block: *mut pm_block_argument_node,
6518 /** IndexAndWriteNode#operator_loc
6519*/
6520 pub operator_loc: pm_location_t,
6521 /** IndexAndWriteNode#value
6522*/
6523 pub value: *mut pm_node,
6524}
6525/** IndexOperatorWriteNode
6526
6527 Represents the use of an assignment operator on a call to `[]`.
6528
6529``` ruby
6530 foo.bar[baz] += value
6531 ^^^^^^^^^^^^^^^^^^^^^
6532```
6533
6534 Type: ::PM_INDEX_OPERATOR_WRITE_NODE
6535
6536 Flags (#pm_call_node_flags):
6537 * ::PM_CALL_NODE_FLAGS_SAFE_NAVIGATION
6538 * ::PM_CALL_NODE_FLAGS_VARIABLE_CALL
6539 * ::PM_CALL_NODE_FLAGS_ATTRIBUTE_WRITE
6540 * ::PM_CALL_NODE_FLAGS_IGNORE_VISIBILITY
6541
6542 @extends pm_node_t
6543*/
6544#[repr(C)]
6545#[derive(Debug, Copy, Clone)]
6546pub struct pm_index_operator_write_node {
6547 /** The embedded base node.
6548*/
6549 pub base: pm_node_t,
6550 /** IndexOperatorWriteNode#receiver
6551*/
6552 pub receiver: *mut pm_node,
6553 /** IndexOperatorWriteNode#call_operator_loc
6554*/
6555 pub call_operator_loc: pm_location_t,
6556 /** IndexOperatorWriteNode#opening_loc
6557*/
6558 pub opening_loc: pm_location_t,
6559 /** IndexOperatorWriteNode#arguments
6560*/
6561 pub arguments: *mut pm_arguments_node,
6562 /** IndexOperatorWriteNode#closing_loc
6563*/
6564 pub closing_loc: pm_location_t,
6565 /** IndexOperatorWriteNode#block
6566*/
6567 pub block: *mut pm_block_argument_node,
6568 /** IndexOperatorWriteNode#binary_operator
6569*/
6570 pub binary_operator: pm_constant_id_t,
6571 /** IndexOperatorWriteNode#binary_operator_loc
6572*/
6573 pub binary_operator_loc: pm_location_t,
6574 /** IndexOperatorWriteNode#value
6575*/
6576 pub value: *mut pm_node,
6577}
6578/** IndexOrWriteNode
6579
6580 Represents the use of the `||=` operator on a call to `[]`.
6581
6582``` ruby
6583 foo.bar[baz] ||= value
6584 ^^^^^^^^^^^^^^^^^^^^^^
6585```
6586
6587 Type: ::PM_INDEX_OR_WRITE_NODE
6588
6589 Flags (#pm_call_node_flags):
6590 * ::PM_CALL_NODE_FLAGS_SAFE_NAVIGATION
6591 * ::PM_CALL_NODE_FLAGS_VARIABLE_CALL
6592 * ::PM_CALL_NODE_FLAGS_ATTRIBUTE_WRITE
6593 * ::PM_CALL_NODE_FLAGS_IGNORE_VISIBILITY
6594
6595 @extends pm_node_t
6596*/
6597#[repr(C)]
6598#[derive(Debug, Copy, Clone)]
6599pub struct pm_index_or_write_node {
6600 /** The embedded base node.
6601*/
6602 pub base: pm_node_t,
6603 /** IndexOrWriteNode#receiver
6604*/
6605 pub receiver: *mut pm_node,
6606 /** IndexOrWriteNode#call_operator_loc
6607*/
6608 pub call_operator_loc: pm_location_t,
6609 /** IndexOrWriteNode#opening_loc
6610*/
6611 pub opening_loc: pm_location_t,
6612 /** IndexOrWriteNode#arguments
6613*/
6614 pub arguments: *mut pm_arguments_node,
6615 /** IndexOrWriteNode#closing_loc
6616*/
6617 pub closing_loc: pm_location_t,
6618 /** IndexOrWriteNode#block
6619*/
6620 pub block: *mut pm_block_argument_node,
6621 /** IndexOrWriteNode#operator_loc
6622*/
6623 pub operator_loc: pm_location_t,
6624 /** IndexOrWriteNode#value
6625*/
6626 pub value: *mut pm_node,
6627}
6628/** IndexTargetNode
6629
6630 Represents assigning to an index.
6631
6632``` ruby
6633 foo[bar], = 1
6634 ^^^^^^^^
6635```
6636
6637``` ruby
6638 begin
6639 rescue => foo[bar]
6640 ^^^^^^^^
6641 end
6642```
6643
6644``` ruby
6645 for foo[bar] in baz do end
6646 ^^^^^^^^
6647```
6648
6649 Type: ::PM_INDEX_TARGET_NODE
6650
6651 Flags (#pm_call_node_flags):
6652 * ::PM_CALL_NODE_FLAGS_SAFE_NAVIGATION
6653 * ::PM_CALL_NODE_FLAGS_VARIABLE_CALL
6654 * ::PM_CALL_NODE_FLAGS_ATTRIBUTE_WRITE
6655 * ::PM_CALL_NODE_FLAGS_IGNORE_VISIBILITY
6656
6657 @extends pm_node_t
6658*/
6659#[repr(C)]
6660#[derive(Debug, Copy, Clone)]
6661pub struct pm_index_target_node {
6662 /** The embedded base node.
6663*/
6664 pub base: pm_node_t,
6665 /** IndexTargetNode#receiver
6666*/
6667 pub receiver: *mut pm_node,
6668 /** IndexTargetNode#opening_loc
6669*/
6670 pub opening_loc: pm_location_t,
6671 /** IndexTargetNode#arguments
6672*/
6673 pub arguments: *mut pm_arguments_node,
6674 /** IndexTargetNode#closing_loc
6675*/
6676 pub closing_loc: pm_location_t,
6677 /** IndexTargetNode#block
6678*/
6679 pub block: *mut pm_block_argument_node,
6680}
6681/** InstanceVariableAndWriteNode
6682
6683 Represents the use of the `&&=` operator for assignment to an instance variable.
6684
6685``` ruby
6686 @target &&= value
6687 ^^^^^^^^^^^^^^^^^
6688```
6689
6690 Type: ::PM_INSTANCE_VARIABLE_AND_WRITE_NODE
6691
6692 @extends pm_node_t
6693*/
6694#[repr(C)]
6695#[derive(Debug, Copy, Clone)]
6696pub struct pm_instance_variable_and_write_node {
6697 /** The embedded base node.
6698*/
6699 pub base: pm_node_t,
6700 /** InstanceVariableAndWriteNode#name
6701*/
6702 pub name: pm_constant_id_t,
6703 /** InstanceVariableAndWriteNode#name_loc
6704*/
6705 pub name_loc: pm_location_t,
6706 /** InstanceVariableAndWriteNode#operator_loc
6707*/
6708 pub operator_loc: pm_location_t,
6709 /** InstanceVariableAndWriteNode#value
6710*/
6711 pub value: *mut pm_node,
6712}
6713/** InstanceVariableOperatorWriteNode
6714
6715 Represents assigning to an instance variable using an operator that isn't `=`.
6716
6717``` ruby
6718 @target += value
6719 ^^^^^^^^^^^^^^^^
6720```
6721
6722 Type: ::PM_INSTANCE_VARIABLE_OPERATOR_WRITE_NODE
6723
6724 @extends pm_node_t
6725*/
6726#[repr(C)]
6727#[derive(Debug, Copy, Clone)]
6728pub struct pm_instance_variable_operator_write_node {
6729 /** The embedded base node.
6730*/
6731 pub base: pm_node_t,
6732 /** InstanceVariableOperatorWriteNode#name
6733*/
6734 pub name: pm_constant_id_t,
6735 /** InstanceVariableOperatorWriteNode#name_loc
6736*/
6737 pub name_loc: pm_location_t,
6738 /** InstanceVariableOperatorWriteNode#binary_operator_loc
6739*/
6740 pub binary_operator_loc: pm_location_t,
6741 /** InstanceVariableOperatorWriteNode#value
6742*/
6743 pub value: *mut pm_node,
6744 /** InstanceVariableOperatorWriteNode#binary_operator
6745*/
6746 pub binary_operator: pm_constant_id_t,
6747}
6748/** InstanceVariableOrWriteNode
6749
6750 Represents the use of the `||=` operator for assignment to an instance variable.
6751
6752``` ruby
6753 @target ||= value
6754 ^^^^^^^^^^^^^^^^^
6755```
6756
6757 Type: ::PM_INSTANCE_VARIABLE_OR_WRITE_NODE
6758
6759 @extends pm_node_t
6760*/
6761#[repr(C)]
6762#[derive(Debug, Copy, Clone)]
6763pub struct pm_instance_variable_or_write_node {
6764 /** The embedded base node.
6765*/
6766 pub base: pm_node_t,
6767 /** InstanceVariableOrWriteNode#name
6768*/
6769 pub name: pm_constant_id_t,
6770 /** InstanceVariableOrWriteNode#name_loc
6771*/
6772 pub name_loc: pm_location_t,
6773 /** InstanceVariableOrWriteNode#operator_loc
6774*/
6775 pub operator_loc: pm_location_t,
6776 /** InstanceVariableOrWriteNode#value
6777*/
6778 pub value: *mut pm_node,
6779}
6780/** InstanceVariableReadNode
6781
6782 Represents referencing an instance variable.
6783
6784``` ruby
6785 @foo
6786 ^^^^
6787```
6788
6789 Type: ::PM_INSTANCE_VARIABLE_READ_NODE
6790
6791 @extends pm_node_t
6792*/
6793#[repr(C)]
6794#[derive(Debug, Default, Copy, Clone)]
6795pub struct pm_instance_variable_read_node {
6796 /** The embedded base node.
6797*/
6798 pub base: pm_node_t,
6799 /** InstanceVariableReadNode#name
6800
6801 The name of the instance variable, which is a `@` followed by an [identifier](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#identifiers).
6802
6803``` ruby
6804 @x # name `:@x`
6805```
6806
6807``` ruby
6808 @_test # name `:@_test`
6809```
6810*/
6811 pub name: pm_constant_id_t,
6812}
6813/** InstanceVariableTargetNode
6814
6815 Represents writing to an instance variable in a context that doesn't have an explicit value.
6816
6817``` ruby
6818 @foo, @bar = baz
6819 ^^^^ ^^^^
6820```
6821
6822 Type: ::PM_INSTANCE_VARIABLE_TARGET_NODE
6823
6824 @extends pm_node_t
6825*/
6826#[repr(C)]
6827#[derive(Debug, Default, Copy, Clone)]
6828pub struct pm_instance_variable_target_node {
6829 /** The embedded base node.
6830*/
6831 pub base: pm_node_t,
6832 /** InstanceVariableTargetNode#name
6833*/
6834 pub name: pm_constant_id_t,
6835}
6836/** InstanceVariableWriteNode
6837
6838 Represents writing to an instance variable.
6839
6840``` ruby
6841 @foo = 1
6842 ^^^^^^^^
6843```
6844
6845 Type: ::PM_INSTANCE_VARIABLE_WRITE_NODE
6846
6847 @extends pm_node_t
6848*/
6849#[repr(C)]
6850#[derive(Debug, Copy, Clone)]
6851pub struct pm_instance_variable_write_node {
6852 /** The embedded base node.
6853*/
6854 pub base: pm_node_t,
6855 /** InstanceVariableWriteNode#name
6856
6857 The name of the instance variable, which is a `@` followed by an [identifier](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#identifiers).
6858
6859``` ruby
6860 @x = :y # name `:@x`
6861```
6862
6863``` ruby
6864 @_foo = "bar" # name `@_foo`
6865```
6866*/
6867 pub name: pm_constant_id_t,
6868 /** InstanceVariableWriteNode#name_loc
6869
6870 The Location of the variable name.
6871
6872``` ruby
6873 @_x = 1
6874 ^^^
6875```
6876*/
6877 pub name_loc: pm_location_t,
6878 /** InstanceVariableWriteNode#value
6879
6880 The value to write to the instance variable. It can be any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression).
6881
6882``` ruby
6883 @foo = :bar
6884 ^^^^
6885```
6886
6887``` ruby
6888 @_x = 1234
6889 ^^^^
6890```
6891*/
6892 pub value: *mut pm_node,
6893 /** InstanceVariableWriteNode#operator_loc
6894
6895 The Location of the `=` operator.
6896
6897``` ruby
6898 @x = y
6899 ^
6900```
6901*/
6902 pub operator_loc: pm_location_t,
6903}
6904/** IntegerNode
6905
6906 Represents an integer number literal.
6907
6908``` ruby
6909 1
6910 ^
6911```
6912
6913 Type: ::PM_INTEGER_NODE
6914
6915 Flags (#pm_integer_base_flags):
6916 * ::PM_INTEGER_BASE_FLAGS_BINARY
6917 * ::PM_INTEGER_BASE_FLAGS_DECIMAL
6918 * ::PM_INTEGER_BASE_FLAGS_OCTAL
6919 * ::PM_INTEGER_BASE_FLAGS_HEXADECIMAL
6920
6921 @extends pm_node_t
6922*/
6923#[repr(C)]
6924#[derive(Copy, Clone)]
6925pub struct pm_integer_node {
6926 /** The embedded base node.
6927*/
6928 pub base: pm_node_t,
6929 /** IntegerNode#value
6930
6931 The value of the integer literal as a number.
6932*/
6933 pub value: pm_integer_t,
6934}
6935/** InterpolatedMatchLastLineNode
6936
6937 Represents a regular expression literal that contains interpolation that is being used in the predicate of a conditional to implicitly match against the last line read by an IO object.
6938
6939``` ruby
6940 if /foo #{bar} baz/ then end
6941 ^^^^^^^^^^^^^^^^
6942```
6943
6944 Type: ::PM_INTERPOLATED_MATCH_LAST_LINE_NODE
6945
6946 Flags (#pm_regular_expression_flags):
6947 * ::PM_REGULAR_EXPRESSION_FLAGS_IGNORE_CASE
6948 * ::PM_REGULAR_EXPRESSION_FLAGS_EXTENDED
6949 * ::PM_REGULAR_EXPRESSION_FLAGS_MULTI_LINE
6950 * ::PM_REGULAR_EXPRESSION_FLAGS_ONCE
6951 * ::PM_REGULAR_EXPRESSION_FLAGS_EUC_JP
6952 * ::PM_REGULAR_EXPRESSION_FLAGS_ASCII_8BIT
6953 * ::PM_REGULAR_EXPRESSION_FLAGS_WINDOWS_31J
6954 * ::PM_REGULAR_EXPRESSION_FLAGS_UTF_8
6955 * ::PM_REGULAR_EXPRESSION_FLAGS_FORCED_UTF8_ENCODING
6956 * ::PM_REGULAR_EXPRESSION_FLAGS_FORCED_BINARY_ENCODING
6957 * ::PM_REGULAR_EXPRESSION_FLAGS_FORCED_US_ASCII_ENCODING
6958
6959 @extends pm_node_t
6960*/
6961#[repr(C)]
6962#[derive(Debug, Copy, Clone)]
6963pub struct pm_interpolated_match_last_line_node {
6964 /** The embedded base node.
6965*/
6966 pub base: pm_node_t,
6967 /** InterpolatedMatchLastLineNode#opening_loc
6968*/
6969 pub opening_loc: pm_location_t,
6970 /** InterpolatedMatchLastLineNode#parts
6971*/
6972 pub parts: pm_node_list,
6973 /** InterpolatedMatchLastLineNode#closing_loc
6974*/
6975 pub closing_loc: pm_location_t,
6976}
6977/** InterpolatedRegularExpressionNode
6978
6979 Represents a regular expression literal that contains interpolation.
6980
6981``` ruby
6982 /foo #{bar} baz/
6983 ^^^^^^^^^^^^^^^^
6984```
6985
6986 Type: ::PM_INTERPOLATED_REGULAR_EXPRESSION_NODE
6987
6988 Flags (#pm_regular_expression_flags):
6989 * ::PM_REGULAR_EXPRESSION_FLAGS_IGNORE_CASE
6990 * ::PM_REGULAR_EXPRESSION_FLAGS_EXTENDED
6991 * ::PM_REGULAR_EXPRESSION_FLAGS_MULTI_LINE
6992 * ::PM_REGULAR_EXPRESSION_FLAGS_ONCE
6993 * ::PM_REGULAR_EXPRESSION_FLAGS_EUC_JP
6994 * ::PM_REGULAR_EXPRESSION_FLAGS_ASCII_8BIT
6995 * ::PM_REGULAR_EXPRESSION_FLAGS_WINDOWS_31J
6996 * ::PM_REGULAR_EXPRESSION_FLAGS_UTF_8
6997 * ::PM_REGULAR_EXPRESSION_FLAGS_FORCED_UTF8_ENCODING
6998 * ::PM_REGULAR_EXPRESSION_FLAGS_FORCED_BINARY_ENCODING
6999 * ::PM_REGULAR_EXPRESSION_FLAGS_FORCED_US_ASCII_ENCODING
7000
7001 @extends pm_node_t
7002*/
7003#[repr(C)]
7004#[derive(Debug, Copy, Clone)]
7005pub struct pm_interpolated_regular_expression_node {
7006 /** The embedded base node.
7007*/
7008 pub base: pm_node_t,
7009 /** InterpolatedRegularExpressionNode#opening_loc
7010*/
7011 pub opening_loc: pm_location_t,
7012 /** InterpolatedRegularExpressionNode#parts
7013*/
7014 pub parts: pm_node_list,
7015 /** InterpolatedRegularExpressionNode#closing_loc
7016*/
7017 pub closing_loc: pm_location_t,
7018}
7019/** InterpolatedStringNode
7020
7021 Represents a string literal that contains interpolation.
7022
7023``` ruby
7024 "foo #{bar} baz"
7025 ^^^^^^^^^^^^^^^^
7026```
7027
7028 Type: ::PM_INTERPOLATED_STRING_NODE
7029
7030 Flags (#pm_interpolated_string_node_flags):
7031 * ::PM_INTERPOLATED_STRING_NODE_FLAGS_FROZEN
7032 * ::PM_INTERPOLATED_STRING_NODE_FLAGS_MUTABLE
7033
7034 @extends pm_node_t
7035*/
7036#[repr(C)]
7037#[derive(Debug, Copy, Clone)]
7038pub struct pm_interpolated_string_node {
7039 /** The embedded base node.
7040*/
7041 pub base: pm_node_t,
7042 /** InterpolatedStringNode#opening_loc
7043*/
7044 pub opening_loc: pm_location_t,
7045 /** InterpolatedStringNode#parts
7046*/
7047 pub parts: pm_node_list,
7048 /** InterpolatedStringNode#closing_loc
7049*/
7050 pub closing_loc: pm_location_t,
7051}
7052/** InterpolatedSymbolNode
7053
7054 Represents a symbol literal that contains interpolation.
7055
7056``` ruby
7057 :"foo #{bar} baz"
7058 ^^^^^^^^^^^^^^^^^
7059```
7060
7061 Type: ::PM_INTERPOLATED_SYMBOL_NODE
7062
7063 @extends pm_node_t
7064*/
7065#[repr(C)]
7066#[derive(Debug, Copy, Clone)]
7067pub struct pm_interpolated_symbol_node {
7068 /** The embedded base node.
7069*/
7070 pub base: pm_node_t,
7071 /** InterpolatedSymbolNode#opening_loc
7072*/
7073 pub opening_loc: pm_location_t,
7074 /** InterpolatedSymbolNode#parts
7075*/
7076 pub parts: pm_node_list,
7077 /** InterpolatedSymbolNode#closing_loc
7078*/
7079 pub closing_loc: pm_location_t,
7080}
7081/** InterpolatedXStringNode
7082
7083 Represents an xstring literal that contains interpolation.
7084
7085``` ruby
7086 `foo #{bar} baz`
7087 ^^^^^^^^^^^^^^^^
7088```
7089
7090 Type: ::PM_INTERPOLATED_X_STRING_NODE
7091
7092 @extends pm_node_t
7093*/
7094#[repr(C)]
7095#[derive(Debug, Copy, Clone)]
7096pub struct pm_interpolated_x_string_node {
7097 /** The embedded base node.
7098*/
7099 pub base: pm_node_t,
7100 /** InterpolatedXStringNode#opening_loc
7101*/
7102 pub opening_loc: pm_location_t,
7103 /** InterpolatedXStringNode#parts
7104*/
7105 pub parts: pm_node_list,
7106 /** InterpolatedXStringNode#closing_loc
7107*/
7108 pub closing_loc: pm_location_t,
7109}
7110/** ItLocalVariableReadNode
7111
7112 Represents reading from the implicit `it` local variable.
7113
7114``` ruby
7115 -> { it }
7116 ^^
7117```
7118
7119 Type: ::PM_IT_LOCAL_VARIABLE_READ_NODE
7120
7121 @extends pm_node_t
7122*/
7123#[repr(C)]
7124#[derive(Debug, Default, Copy, Clone)]
7125pub struct pm_it_local_variable_read_node {
7126 /** The embedded base node.
7127*/
7128 pub base: pm_node_t,
7129}
7130/** ItParametersNode
7131
7132 Represents an implicit set of parameters through the use of the `it` keyword within a block or lambda.
7133
7134``` ruby
7135 -> { it + it }
7136 ^^^^^^^^^^^^^^
7137```
7138
7139 Type: ::PM_IT_PARAMETERS_NODE
7140
7141 @extends pm_node_t
7142*/
7143#[repr(C)]
7144#[derive(Debug, Default, Copy, Clone)]
7145pub struct pm_it_parameters_node {
7146 /** The embedded base node.
7147*/
7148 pub base: pm_node_t,
7149}
7150/** KeywordHashNode
7151
7152 Represents a hash literal without opening and closing braces.
7153
7154``` ruby
7155 foo(a: b)
7156 ^^^^
7157```
7158
7159 Type: ::PM_KEYWORD_HASH_NODE
7160
7161 Flags (#pm_keyword_hash_node_flags):
7162 * ::PM_KEYWORD_HASH_NODE_FLAGS_SYMBOL_KEYS
7163
7164 @extends pm_node_t
7165*/
7166#[repr(C)]
7167#[derive(Debug, Copy, Clone)]
7168pub struct pm_keyword_hash_node {
7169 /** The embedded base node.
7170*/
7171 pub base: pm_node_t,
7172 /** KeywordHashNode#elements
7173*/
7174 pub elements: pm_node_list,
7175}
7176/** KeywordRestParameterNode
7177
7178 Represents a keyword rest parameter to a method, block, or lambda definition.
7179
7180``` ruby
7181 def a(**b)
7182 ^^^
7183 end
7184```
7185
7186 Type: ::PM_KEYWORD_REST_PARAMETER_NODE
7187
7188 Flags (#pm_parameter_flags):
7189 * ::PM_PARAMETER_FLAGS_REPEATED_PARAMETER
7190
7191 @extends pm_node_t
7192*/
7193#[repr(C)]
7194#[derive(Debug, Default, Copy, Clone)]
7195pub struct pm_keyword_rest_parameter_node {
7196 /** The embedded base node.
7197*/
7198 pub base: pm_node_t,
7199 /** KeywordRestParameterNode#name
7200*/
7201 pub name: pm_constant_id_t,
7202 /** KeywordRestParameterNode#name_loc
7203*/
7204 pub name_loc: pm_location_t,
7205 /** KeywordRestParameterNode#operator_loc
7206*/
7207 pub operator_loc: pm_location_t,
7208}
7209/** LambdaNode
7210
7211 Represents using a lambda literal (not the lambda method call).
7212
7213``` ruby
7214 ->(value) { value * 2 }
7215 ^^^^^^^^^^^^^^^^^^^^^^^
7216```
7217
7218 Type: ::PM_LAMBDA_NODE
7219
7220 @extends pm_node_t
7221*/
7222#[repr(C)]
7223#[derive(Debug, Copy, Clone)]
7224pub struct pm_lambda_node {
7225 /** The embedded base node.
7226*/
7227 pub base: pm_node_t,
7228 /** LambdaNode#locals
7229*/
7230 pub locals: pm_constant_id_list_t,
7231 /** LambdaNode#operator_loc
7232*/
7233 pub operator_loc: pm_location_t,
7234 /** LambdaNode#opening_loc
7235*/
7236 pub opening_loc: pm_location_t,
7237 /** LambdaNode#closing_loc
7238*/
7239 pub closing_loc: pm_location_t,
7240 /** LambdaNode#parameters
7241*/
7242 pub parameters: *mut pm_node,
7243 /** LambdaNode#body
7244*/
7245 pub body: *mut pm_node,
7246}
7247/** LocalVariableAndWriteNode
7248
7249 Represents the use of the `&&=` operator for assignment to a local variable.
7250
7251``` ruby
7252 target &&= value
7253 ^^^^^^^^^^^^^^^^
7254```
7255
7256 Type: ::PM_LOCAL_VARIABLE_AND_WRITE_NODE
7257
7258 @extends pm_node_t
7259*/
7260#[repr(C)]
7261#[derive(Debug, Copy, Clone)]
7262pub struct pm_local_variable_and_write_node {
7263 /** The embedded base node.
7264*/
7265 pub base: pm_node_t,
7266 /** LocalVariableAndWriteNode#name_loc
7267*/
7268 pub name_loc: pm_location_t,
7269 /** LocalVariableAndWriteNode#operator_loc
7270*/
7271 pub operator_loc: pm_location_t,
7272 /** LocalVariableAndWriteNode#value
7273*/
7274 pub value: *mut pm_node,
7275 /** LocalVariableAndWriteNode#name
7276*/
7277 pub name: pm_constant_id_t,
7278 /** LocalVariableAndWriteNode#depth
7279*/
7280 pub depth: u32,
7281}
7282/** LocalVariableOperatorWriteNode
7283
7284 Represents assigning to a local variable using an operator that isn't `=`.
7285
7286``` ruby
7287 target += value
7288 ^^^^^^^^^^^^^^^
7289```
7290
7291 Type: ::PM_LOCAL_VARIABLE_OPERATOR_WRITE_NODE
7292
7293 @extends pm_node_t
7294*/
7295#[repr(C)]
7296#[derive(Debug, Copy, Clone)]
7297pub struct pm_local_variable_operator_write_node {
7298 /** The embedded base node.
7299*/
7300 pub base: pm_node_t,
7301 /** LocalVariableOperatorWriteNode#name_loc
7302*/
7303 pub name_loc: pm_location_t,
7304 /** LocalVariableOperatorWriteNode#binary_operator_loc
7305*/
7306 pub binary_operator_loc: pm_location_t,
7307 /** LocalVariableOperatorWriteNode#value
7308*/
7309 pub value: *mut pm_node,
7310 /** LocalVariableOperatorWriteNode#name
7311*/
7312 pub name: pm_constant_id_t,
7313 /** LocalVariableOperatorWriteNode#binary_operator
7314*/
7315 pub binary_operator: pm_constant_id_t,
7316 /** LocalVariableOperatorWriteNode#depth
7317*/
7318 pub depth: u32,
7319}
7320/** LocalVariableOrWriteNode
7321
7322 Represents the use of the `||=` operator for assignment to a local variable.
7323
7324``` ruby
7325 target ||= value
7326 ^^^^^^^^^^^^^^^^
7327```
7328
7329 Type: ::PM_LOCAL_VARIABLE_OR_WRITE_NODE
7330
7331 @extends pm_node_t
7332*/
7333#[repr(C)]
7334#[derive(Debug, Copy, Clone)]
7335pub struct pm_local_variable_or_write_node {
7336 /** The embedded base node.
7337*/
7338 pub base: pm_node_t,
7339 /** LocalVariableOrWriteNode#name_loc
7340*/
7341 pub name_loc: pm_location_t,
7342 /** LocalVariableOrWriteNode#operator_loc
7343*/
7344 pub operator_loc: pm_location_t,
7345 /** LocalVariableOrWriteNode#value
7346*/
7347 pub value: *mut pm_node,
7348 /** LocalVariableOrWriteNode#name
7349*/
7350 pub name: pm_constant_id_t,
7351 /** LocalVariableOrWriteNode#depth
7352*/
7353 pub depth: u32,
7354}
7355/** LocalVariableReadNode
7356
7357 Represents reading a local variable. Note that this requires that a local variable of the same name has already been written to in the same scope, otherwise it is parsed as a method call.
7358
7359``` ruby
7360 foo
7361 ^^^
7362```
7363
7364 Type: ::PM_LOCAL_VARIABLE_READ_NODE
7365
7366 @extends pm_node_t
7367*/
7368#[repr(C)]
7369#[derive(Debug, Default, Copy, Clone)]
7370pub struct pm_local_variable_read_node {
7371 /** The embedded base node.
7372*/
7373 pub base: pm_node_t,
7374 /** LocalVariableReadNode#name
7375
7376 The name of the local variable, which is an [identifier](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#identifiers).
7377
7378``` ruby
7379 x # name `:x`
7380```
7381
7382``` ruby
7383 _Test # name `:_Test`
7384```
7385
7386 Note that this can also be an underscore followed by a number for the default block parameters.
7387
7388``` ruby
7389 _1 # name `:_1`
7390```
7391*/
7392 pub name: pm_constant_id_t,
7393 /** LocalVariableReadNode#depth
7394
7395 The number of visible scopes that should be searched to find the origin of this local variable.
7396
7397``` ruby
7398 foo = 1; foo # depth 0
7399```
7400
7401``` ruby
7402 bar = 2; tap { bar } # depth 1
7403```
7404
7405 The specific rules for calculating the depth may differ from individual Ruby implementations, as they are not specified by the language. For more information, see [the Prism documentation](https://github.com/ruby/prism/blob/main/docs/local_variable_depth.md).
7406*/
7407 pub depth: u32,
7408}
7409/** LocalVariableTargetNode
7410
7411 Represents writing to a local variable in a context that doesn't have an explicit value.
7412
7413``` ruby
7414 foo, bar = baz
7415 ^^^ ^^^
7416```
7417
7418``` ruby
7419 foo => baz
7420 ^^^
7421```
7422
7423 Type: ::PM_LOCAL_VARIABLE_TARGET_NODE
7424
7425 @extends pm_node_t
7426*/
7427#[repr(C)]
7428#[derive(Debug, Default, Copy, Clone)]
7429pub struct pm_local_variable_target_node {
7430 /** The embedded base node.
7431*/
7432 pub base: pm_node_t,
7433 /** LocalVariableTargetNode#name
7434*/
7435 pub name: pm_constant_id_t,
7436 /** LocalVariableTargetNode#depth
7437*/
7438 pub depth: u32,
7439}
7440/** LocalVariableWriteNode
7441
7442 Represents writing to a local variable.
7443
7444``` ruby
7445 foo = 1
7446 ^^^^^^^
7447```
7448
7449 Type: ::PM_LOCAL_VARIABLE_WRITE_NODE
7450
7451 @extends pm_node_t
7452*/
7453#[repr(C)]
7454#[derive(Debug, Copy, Clone)]
7455pub struct pm_local_variable_write_node {
7456 /** The embedded base node.
7457*/
7458 pub base: pm_node_t,
7459 /** LocalVariableWriteNode#name
7460
7461 The name of the local variable, which is an [identifier](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#identifiers).
7462
7463``` ruby
7464 foo = :bar # name `:foo`
7465```
7466
7467``` ruby
7468 abc = 123 # name `:abc`
7469```
7470*/
7471 pub name: pm_constant_id_t,
7472 /** LocalVariableWriteNode#depth
7473
7474 The number of semantic scopes we have to traverse to find the declaration of this variable.
7475
7476``` ruby
7477 foo = 1 # depth 0
7478```
7479
7480``` ruby
7481 tap { foo = 1 } # depth 1
7482```
7483
7484 The specific rules for calculating the depth may differ from individual Ruby implementations, as they are not specified by the language. For more information, see [the Prism documentation](https://github.com/ruby/prism/blob/main/docs/local_variable_depth.md).
7485*/
7486 pub depth: u32,
7487 /** LocalVariableWriteNode#name_loc
7488
7489 The Location of the variable name.
7490
7491``` ruby
7492 foo = :bar
7493 ^^^
7494```
7495*/
7496 pub name_loc: pm_location_t,
7497 /** LocalVariableWriteNode#value
7498
7499 The value to write to the local variable. It can be any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression).
7500
7501``` ruby
7502 foo = :bar
7503 ^^^^
7504```
7505
7506``` ruby
7507 abc = 1234
7508 ^^^^
7509```
7510
7511 Note that since the name of a local variable is known before the value is parsed, it is valid for a local variable to appear within the value of its own write.
7512
7513``` ruby
7514 foo = foo
7515```
7516*/
7517 pub value: *mut pm_node,
7518 /** LocalVariableWriteNode#operator_loc
7519
7520 The Location of the `=` operator.
7521
7522``` ruby
7523 x = :y
7524 ^
7525```
7526*/
7527 pub operator_loc: pm_location_t,
7528}
7529/** MatchLastLineNode
7530
7531 Represents a regular expression literal used in the predicate of a conditional to implicitly match against the last line read by an IO object.
7532
7533``` ruby
7534 if /foo/i then end
7535 ^^^^^^
7536```
7537
7538 Type: ::PM_MATCH_LAST_LINE_NODE
7539
7540 Flags (#pm_regular_expression_flags):
7541 * ::PM_REGULAR_EXPRESSION_FLAGS_IGNORE_CASE
7542 * ::PM_REGULAR_EXPRESSION_FLAGS_EXTENDED
7543 * ::PM_REGULAR_EXPRESSION_FLAGS_MULTI_LINE
7544 * ::PM_REGULAR_EXPRESSION_FLAGS_ONCE
7545 * ::PM_REGULAR_EXPRESSION_FLAGS_EUC_JP
7546 * ::PM_REGULAR_EXPRESSION_FLAGS_ASCII_8BIT
7547 * ::PM_REGULAR_EXPRESSION_FLAGS_WINDOWS_31J
7548 * ::PM_REGULAR_EXPRESSION_FLAGS_UTF_8
7549 * ::PM_REGULAR_EXPRESSION_FLAGS_FORCED_UTF8_ENCODING
7550 * ::PM_REGULAR_EXPRESSION_FLAGS_FORCED_BINARY_ENCODING
7551 * ::PM_REGULAR_EXPRESSION_FLAGS_FORCED_US_ASCII_ENCODING
7552
7553 @extends pm_node_t
7554*/
7555#[repr(C)]
7556#[derive(Debug, Copy, Clone)]
7557pub struct pm_match_last_line_node {
7558 /** The embedded base node.
7559*/
7560 pub base: pm_node_t,
7561 /** MatchLastLineNode#opening_loc
7562*/
7563 pub opening_loc: pm_location_t,
7564 /** MatchLastLineNode#content_loc
7565*/
7566 pub content_loc: pm_location_t,
7567 /** MatchLastLineNode#closing_loc
7568*/
7569 pub closing_loc: pm_location_t,
7570 /** MatchLastLineNode#unescaped
7571*/
7572 pub unescaped: pm_string_t,
7573}
7574/** MatchPredicateNode
7575
7576 Represents the use of the modifier `in` operator.
7577
7578``` ruby
7579 foo in bar
7580 ^^^^^^^^^^
7581```
7582
7583 Type: ::PM_MATCH_PREDICATE_NODE
7584
7585 @extends pm_node_t
7586*/
7587#[repr(C)]
7588#[derive(Debug, Copy, Clone)]
7589pub struct pm_match_predicate_node {
7590 /** The embedded base node.
7591*/
7592 pub base: pm_node_t,
7593 /** MatchPredicateNode#value
7594*/
7595 pub value: *mut pm_node,
7596 /** MatchPredicateNode#pattern
7597*/
7598 pub pattern: *mut pm_node,
7599 /** MatchPredicateNode#keyword_loc
7600*/
7601 pub keyword_loc: pm_location_t,
7602}
7603/** MatchRequiredNode
7604
7605 Represents the use of the `=>` operator.
7606
7607``` ruby
7608 foo => bar
7609 ^^^^^^^^^^
7610```
7611
7612 Type: ::PM_MATCH_REQUIRED_NODE
7613
7614 @extends pm_node_t
7615*/
7616#[repr(C)]
7617#[derive(Debug, Copy, Clone)]
7618pub struct pm_match_required_node {
7619 /** The embedded base node.
7620*/
7621 pub base: pm_node_t,
7622 /** MatchRequiredNode#value
7623
7624 Represents the left-hand side of the operator.
7625
7626``` ruby
7627 foo => bar
7628 ^^^
7629```
7630*/
7631 pub value: *mut pm_node,
7632 /** MatchRequiredNode#pattern
7633
7634 Represents the right-hand side of the operator. The type of the node depends on the expression.
7635
7636 Anything that looks like a local variable name (including `_`) will result in a `LocalVariableTargetNode`.
7637
7638``` ruby
7639 foo => a # This is equivalent to writing `a = foo`
7640 ^
7641```
7642
7643 Using an explicit `Array` or combining expressions with `,` will result in a `ArrayPatternNode`. This can be preceded by a constant.
7644
7645``` ruby
7646 foo => [a]
7647 ^^^
7648```
7649
7650``` ruby
7651 foo => a, b
7652 ^^^^
7653```
7654
7655``` ruby
7656 foo => Bar[a, b]
7657 ^^^^^^^^^
7658```
7659
7660 If the array pattern contains at least two wildcard matches, a `FindPatternNode` is created instead.
7661
7662``` ruby
7663 foo => *, 1, *a
7664 ^^^^^
7665```
7666
7667 Using an explicit `Hash` or a constant with square brackets and hash keys in the square brackets will result in a `HashPatternNode`.
7668
7669``` ruby
7670 foo => { a: 1, b: }
7671```
7672
7673``` ruby
7674 foo => Bar[a: 1, b:]
7675```
7676
7677``` ruby
7678 foo => Bar[**]
7679```
7680
7681 To use any variable that needs run time evaluation, pinning is required. This results in a `PinnedVariableNode`
7682
7683``` ruby
7684 foo => ^a
7685 ^^
7686```
7687
7688 Similar, any expression can be used with pinning. This results in a `PinnedExpressionNode`.
7689
7690``` ruby
7691 foo => ^(a + 1)
7692```
7693
7694 Anything else will result in the regular node for that expression, for example a `ConstantReadNode`.
7695
7696``` ruby
7697 foo => CONST
7698```
7699*/
7700 pub pattern: *mut pm_node,
7701 /** MatchRequiredNode#operator_loc
7702
7703 The Location of the operator.
7704
7705``` ruby
7706 foo => bar
7707 ^^
7708```
7709*/
7710 pub operator_loc: pm_location_t,
7711}
7712/** MatchWriteNode
7713
7714 Represents writing local variables using a regular expression match with named capture groups.
7715
7716``` ruby
7717 /(?<foo>bar)/ =~ baz
7718 ^^^^^^^^^^^^^^^^^^^^
7719```
7720
7721 Type: ::PM_MATCH_WRITE_NODE
7722
7723 @extends pm_node_t
7724*/
7725#[repr(C)]
7726#[derive(Debug, Copy, Clone)]
7727pub struct pm_match_write_node {
7728 /** The embedded base node.
7729*/
7730 pub base: pm_node_t,
7731 /** MatchWriteNode#call
7732*/
7733 pub call: *mut pm_call_node,
7734 /** MatchWriteNode#targets
7735*/
7736 pub targets: pm_node_list,
7737}
7738/** ModuleNode
7739
7740 Represents a module declaration involving the `module` keyword.
7741
7742``` ruby
7743 module Foo end
7744 ^^^^^^^^^^^^^^
7745```
7746
7747 Type: ::PM_MODULE_NODE
7748
7749 @extends pm_node_t
7750*/
7751#[repr(C)]
7752#[derive(Debug, Copy, Clone)]
7753pub struct pm_module_node {
7754 /** The embedded base node.
7755*/
7756 pub base: pm_node_t,
7757 /** ModuleNode#locals
7758*/
7759 pub locals: pm_constant_id_list_t,
7760 /** ModuleNode#module_keyword_loc
7761*/
7762 pub module_keyword_loc: pm_location_t,
7763 /** ModuleNode#constant_path
7764*/
7765 pub constant_path: *mut pm_node,
7766 /** ModuleNode#body
7767*/
7768 pub body: *mut pm_node,
7769 /** ModuleNode#end_keyword_loc
7770*/
7771 pub end_keyword_loc: pm_location_t,
7772 /** ModuleNode#name
7773*/
7774 pub name: pm_constant_id_t,
7775}
7776/** MultiTargetNode
7777
7778 Represents a multi-target expression.
7779
7780``` ruby
7781 a, (b, c) = 1, 2, 3
7782 ^^^^^^
7783```
7784
7785 This can be a part of `MultiWriteNode` as above, or the target of a `for` loop
7786
7787``` ruby
7788 for a, b in [[1, 2], [3, 4]]
7789 ^^^^
7790```
7791
7792 Type: ::PM_MULTI_TARGET_NODE
7793
7794 @extends pm_node_t
7795*/
7796#[repr(C)]
7797#[derive(Debug, Copy, Clone)]
7798pub struct pm_multi_target_node {
7799 /** The embedded base node.
7800*/
7801 pub base: pm_node_t,
7802 /** MultiTargetNode#lefts
7803
7804 Represents the targets expressions before a splat node.
7805
7806``` ruby
7807 a, (b, c, *) = 1, 2, 3, 4, 5
7808 ^^^^
7809```
7810
7811 The splat node can be absent, in that case all target expressions are in the left field.
7812
7813``` ruby
7814 a, (b, c) = 1, 2, 3, 4, 5
7815 ^^^^
7816```
7817*/
7818 pub lefts: pm_node_list,
7819 /** MultiTargetNode#rest
7820
7821 Represents a splat node in the target expression.
7822
7823``` ruby
7824 a, (b, *c) = 1, 2, 3, 4
7825 ^^
7826```
7827
7828 The variable can be empty, this results in a `SplatNode` with a `nil` expression field.
7829
7830``` ruby
7831 a, (b, *) = 1, 2, 3, 4
7832 ^
7833```
7834
7835 If the `*` is omitted, this field will contain an `ImplicitRestNode`
7836
7837``` ruby
7838 a, (b,) = 1, 2, 3, 4
7839 ^
7840```
7841*/
7842 pub rest: *mut pm_node,
7843 /** MultiTargetNode#rights
7844
7845 Represents the targets expressions after a splat node.
7846
7847``` ruby
7848 a, (*, b, c) = 1, 2, 3, 4, 5
7849 ^^^^
7850```
7851*/
7852 pub rights: pm_node_list,
7853 /** MultiTargetNode#lparen_loc
7854
7855 The Location of the opening parenthesis.
7856
7857``` ruby
7858 a, (b, c) = 1, 2, 3
7859 ^
7860```
7861*/
7862 pub lparen_loc: pm_location_t,
7863 /** MultiTargetNode#rparen_loc
7864
7865 The Location of the closing parenthesis.
7866
7867``` ruby
7868 a, (b, c) = 1, 2, 3
7869 ^
7870```
7871*/
7872 pub rparen_loc: pm_location_t,
7873}
7874/** MultiWriteNode
7875
7876 Represents a write to a multi-target expression.
7877
7878``` ruby
7879 a, b, c = 1, 2, 3
7880 ^^^^^^^^^^^^^^^^^
7881```
7882
7883 Type: ::PM_MULTI_WRITE_NODE
7884
7885 @extends pm_node_t
7886*/
7887#[repr(C)]
7888#[derive(Debug, Copy, Clone)]
7889pub struct pm_multi_write_node {
7890 /** The embedded base node.
7891*/
7892 pub base: pm_node_t,
7893 /** MultiWriteNode#lefts
7894
7895 Represents the targets expressions before a splat node.
7896
7897``` ruby
7898 a, b, * = 1, 2, 3, 4, 5
7899 ^^^^
7900```
7901
7902 The splat node can be absent, in that case all target expressions are in the left field.
7903
7904``` ruby
7905 a, b, c = 1, 2, 3, 4, 5
7906 ^^^^^^^
7907```
7908*/
7909 pub lefts: pm_node_list,
7910 /** MultiWriteNode#rest
7911
7912 Represents a splat node in the target expression.
7913
7914``` ruby
7915 a, b, *c = 1, 2, 3, 4
7916 ^^
7917```
7918
7919 The variable can be empty, this results in a `SplatNode` with a `nil` expression field.
7920
7921``` ruby
7922 a, b, * = 1, 2, 3, 4
7923 ^
7924```
7925
7926 If the `*` is omitted, this field will contain an `ImplicitRestNode`
7927
7928``` ruby
7929 a, b, = 1, 2, 3, 4
7930 ^
7931```
7932*/
7933 pub rest: *mut pm_node,
7934 /** MultiWriteNode#rights
7935
7936 Represents the targets expressions after a splat node.
7937
7938``` ruby
7939 a, *, b, c = 1, 2, 3, 4, 5
7940 ^^^^
7941```
7942*/
7943 pub rights: pm_node_list,
7944 /** MultiWriteNode#lparen_loc
7945
7946 The Location of the opening parenthesis.
7947
7948``` ruby
7949 (a, b, c) = 1, 2, 3
7950 ^
7951```
7952*/
7953 pub lparen_loc: pm_location_t,
7954 /** MultiWriteNode#rparen_loc
7955
7956 The Location of the closing parenthesis.
7957
7958``` ruby
7959 (a, b, c) = 1, 2, 3
7960 ^
7961```
7962*/
7963 pub rparen_loc: pm_location_t,
7964 /** MultiWriteNode#operator_loc
7965
7966 The Location of the operator.
7967
7968``` ruby
7969 a, b, c = 1, 2, 3
7970 ^
7971```
7972*/
7973 pub operator_loc: pm_location_t,
7974 /** MultiWriteNode#value
7975
7976 The value to write to the targets. It can be any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression).
7977
7978``` ruby
7979 a, b, c = 1, 2, 3
7980 ^^^^^^^
7981```
7982*/
7983 pub value: *mut pm_node,
7984}
7985/** NextNode
7986
7987 Represents the use of the `next` keyword.
7988
7989``` ruby
7990 next 1
7991 ^^^^^^
7992```
7993
7994 Type: ::PM_NEXT_NODE
7995
7996 @extends pm_node_t
7997*/
7998#[repr(C)]
7999#[derive(Debug, Copy, Clone)]
8000pub struct pm_next_node {
8001 /** The embedded base node.
8002*/
8003 pub base: pm_node_t,
8004 /** NextNode#arguments
8005*/
8006 pub arguments: *mut pm_arguments_node,
8007 /** NextNode#keyword_loc
8008*/
8009 pub keyword_loc: pm_location_t,
8010}
8011/** NilNode
8012
8013 Represents the use of the `nil` keyword.
8014
8015``` ruby
8016 nil
8017 ^^^
8018```
8019
8020 Type: ::PM_NIL_NODE
8021
8022 @extends pm_node_t
8023*/
8024#[repr(C)]
8025#[derive(Debug, Default, Copy, Clone)]
8026pub struct pm_nil_node {
8027 /** The embedded base node.
8028*/
8029 pub base: pm_node_t,
8030}
8031/** NoBlockParameterNode
8032
8033 Represents the use of `&nil` inside method arguments.
8034
8035``` ruby
8036 def a(&nil)
8037 ^^^^
8038 end
8039```
8040
8041 Type: ::PM_NO_BLOCK_PARAMETER_NODE
8042
8043 @extends pm_node_t
8044*/
8045#[repr(C)]
8046#[derive(Debug, Default, Copy, Clone)]
8047pub struct pm_no_block_parameter_node {
8048 /** The embedded base node.
8049*/
8050 pub base: pm_node_t,
8051 /** NoBlockParameterNode#operator_loc
8052*/
8053 pub operator_loc: pm_location_t,
8054 /** NoBlockParameterNode#keyword_loc
8055*/
8056 pub keyword_loc: pm_location_t,
8057}
8058/** NoKeywordsParameterNode
8059
8060 Represents the use of `**nil` inside method arguments.
8061
8062``` ruby
8063 def a(**nil)
8064 ^^^^^
8065 end
8066```
8067
8068 Type: ::PM_NO_KEYWORDS_PARAMETER_NODE
8069
8070 @extends pm_node_t
8071*/
8072#[repr(C)]
8073#[derive(Debug, Default, Copy, Clone)]
8074pub struct pm_no_keywords_parameter_node {
8075 /** The embedded base node.
8076*/
8077 pub base: pm_node_t,
8078 /** NoKeywordsParameterNode#operator_loc
8079*/
8080 pub operator_loc: pm_location_t,
8081 /** NoKeywordsParameterNode#keyword_loc
8082*/
8083 pub keyword_loc: pm_location_t,
8084}
8085/** NumberedParametersNode
8086
8087 Represents an implicit set of parameters through the use of numbered parameters within a block or lambda.
8088
8089``` ruby
8090 -> { _1 + _2 }
8091 ^^^^^^^^^^^^^^
8092```
8093
8094 Type: ::PM_NUMBERED_PARAMETERS_NODE
8095
8096 @extends pm_node_t
8097*/
8098#[repr(C)]
8099#[derive(Debug, Default, Copy, Clone)]
8100pub struct pm_numbered_parameters_node {
8101 /** The embedded base node.
8102*/
8103 pub base: pm_node_t,
8104 /** NumberedParametersNode#maximum
8105*/
8106 pub maximum: u8,
8107}
8108/** NumberedReferenceReadNode
8109
8110 Represents reading a numbered reference to a capture in the previous match.
8111
8112``` ruby
8113 $1
8114 ^^
8115```
8116
8117 Type: ::PM_NUMBERED_REFERENCE_READ_NODE
8118
8119 @extends pm_node_t
8120*/
8121#[repr(C)]
8122#[derive(Debug, Default, Copy, Clone)]
8123pub struct pm_numbered_reference_read_node {
8124 /** The embedded base node.
8125*/
8126 pub base: pm_node_t,
8127 /** NumberedReferenceReadNode#number
8128
8129 The (1-indexed, from the left) number of the capture group. Numbered references that are too large result in this value being `0`.
8130
8131``` ruby
8132 $1 # number `1`
8133```
8134
8135``` ruby
8136 $5432 # number `5432`
8137```
8138
8139``` ruby
8140 $4294967296 # number `0`
8141```
8142*/
8143 pub number: u32,
8144}
8145/** OptionalKeywordParameterNode
8146
8147 Represents an optional keyword parameter to a method, block, or lambda definition.
8148
8149``` ruby
8150 def a(b: 1)
8151 ^^^^
8152 end
8153```
8154
8155 Type: ::PM_OPTIONAL_KEYWORD_PARAMETER_NODE
8156
8157 Flags (#pm_parameter_flags):
8158 * ::PM_PARAMETER_FLAGS_REPEATED_PARAMETER
8159
8160 @extends pm_node_t
8161*/
8162#[repr(C)]
8163#[derive(Debug, Copy, Clone)]
8164pub struct pm_optional_keyword_parameter_node {
8165 /** The embedded base node.
8166*/
8167 pub base: pm_node_t,
8168 /** OptionalKeywordParameterNode#name
8169*/
8170 pub name: pm_constant_id_t,
8171 /** OptionalKeywordParameterNode#name_loc
8172*/
8173 pub name_loc: pm_location_t,
8174 /** OptionalKeywordParameterNode#value
8175*/
8176 pub value: *mut pm_node,
8177}
8178/** OptionalParameterNode
8179
8180 Represents an optional parameter to a method, block, or lambda definition.
8181
8182``` ruby
8183 def a(b = 1)
8184 ^^^^^
8185 end
8186```
8187
8188 Type: ::PM_OPTIONAL_PARAMETER_NODE
8189
8190 Flags (#pm_parameter_flags):
8191 * ::PM_PARAMETER_FLAGS_REPEATED_PARAMETER
8192
8193 @extends pm_node_t
8194*/
8195#[repr(C)]
8196#[derive(Debug, Copy, Clone)]
8197pub struct pm_optional_parameter_node {
8198 /** The embedded base node.
8199*/
8200 pub base: pm_node_t,
8201 /** OptionalParameterNode#name
8202*/
8203 pub name: pm_constant_id_t,
8204 /** OptionalParameterNode#name_loc
8205*/
8206 pub name_loc: pm_location_t,
8207 /** OptionalParameterNode#operator_loc
8208*/
8209 pub operator_loc: pm_location_t,
8210 /** OptionalParameterNode#value
8211*/
8212 pub value: *mut pm_node,
8213}
8214/** OrNode
8215
8216 Represents the use of the `||` operator or the `or` keyword.
8217
8218``` ruby
8219 left or right
8220 ^^^^^^^^^^^^^
8221```
8222
8223 Type: ::PM_OR_NODE
8224
8225 @extends pm_node_t
8226*/
8227#[repr(C)]
8228#[derive(Debug, Copy, Clone)]
8229pub struct pm_or_node {
8230 /** The embedded base node.
8231*/
8232 pub base: pm_node_t,
8233 /** OrNode#left
8234
8235 Represents the left side of the expression. It can be any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression).
8236
8237``` ruby
8238 left or right
8239 ^^^^
8240```
8241
8242``` ruby
8243 1 || 2
8244 ^
8245```
8246*/
8247 pub left: *mut pm_node,
8248 /** OrNode#right
8249
8250 Represents the right side of the expression.
8251
8252``` ruby
8253 left || right
8254 ^^^^^
8255```
8256
8257``` ruby
8258 1 or 2
8259 ^
8260```
8261*/
8262 pub right: *mut pm_node,
8263 /** OrNode#operator_loc
8264
8265 The Location of the `or` keyword or the `||` operator.
8266
8267``` ruby
8268 left or right
8269 ^^
8270```
8271*/
8272 pub operator_loc: pm_location_t,
8273}
8274/** ParametersNode
8275
8276 Represents the list of parameters on a method, block, or lambda definition.
8277
8278``` ruby
8279 def a(b, c, d)
8280 ^^^^^^^
8281 end
8282```
8283
8284 Type: ::PM_PARAMETERS_NODE
8285
8286 @extends pm_node_t
8287*/
8288#[repr(C)]
8289#[derive(Debug, Copy, Clone)]
8290pub struct pm_parameters_node {
8291 /** The embedded base node.
8292*/
8293 pub base: pm_node_t,
8294 /** ParametersNode#requireds
8295*/
8296 pub requireds: pm_node_list,
8297 /** ParametersNode#optionals
8298*/
8299 pub optionals: pm_node_list,
8300 /** ParametersNode#rest
8301*/
8302 pub rest: *mut pm_node,
8303 /** ParametersNode#posts
8304*/
8305 pub posts: pm_node_list,
8306 /** ParametersNode#keywords
8307*/
8308 pub keywords: pm_node_list,
8309 /** ParametersNode#keyword_rest
8310*/
8311 pub keyword_rest: *mut pm_node,
8312 /** ParametersNode#block
8313*/
8314 pub block: *mut pm_node,
8315}
8316/** ParenthesesNode
8317
8318 Represents a parenthesized expression
8319
8320``` ruby
8321 (10 + 34)
8322 ^^^^^^^^^
8323```
8324
8325 Type: ::PM_PARENTHESES_NODE
8326
8327 Flags (#pm_parentheses_node_flags):
8328 * ::PM_PARENTHESES_NODE_FLAGS_MULTIPLE_STATEMENTS
8329
8330 @extends pm_node_t
8331*/
8332#[repr(C)]
8333#[derive(Debug, Copy, Clone)]
8334pub struct pm_parentheses_node {
8335 /** The embedded base node.
8336*/
8337 pub base: pm_node_t,
8338 /** ParenthesesNode#body
8339*/
8340 pub body: *mut pm_node,
8341 /** ParenthesesNode#opening_loc
8342*/
8343 pub opening_loc: pm_location_t,
8344 /** ParenthesesNode#closing_loc
8345*/
8346 pub closing_loc: pm_location_t,
8347}
8348/** PinnedExpressionNode
8349
8350 Represents the use of the `^` operator for pinning an expression in a pattern matching expression.
8351
8352``` ruby
8353 foo in ^(bar)
8354 ^^^^^^
8355```
8356
8357 Type: ::PM_PINNED_EXPRESSION_NODE
8358
8359 @extends pm_node_t
8360*/
8361#[repr(C)]
8362#[derive(Debug, Copy, Clone)]
8363pub struct pm_pinned_expression_node {
8364 /** The embedded base node.
8365*/
8366 pub base: pm_node_t,
8367 /** PinnedExpressionNode#expression
8368
8369 The expression used in the pinned expression
8370
8371``` ruby
8372 foo in ^(bar)
8373 ^^^
8374```
8375*/
8376 pub expression: *mut pm_node,
8377 /** PinnedExpressionNode#operator_loc
8378
8379 The Location of the `^` operator
8380
8381``` ruby
8382 foo in ^(bar)
8383 ^
8384```
8385*/
8386 pub operator_loc: pm_location_t,
8387 /** PinnedExpressionNode#lparen_loc
8388
8389 The Location of the opening parenthesis.
8390
8391``` ruby
8392 foo in ^(bar)
8393 ^
8394```
8395*/
8396 pub lparen_loc: pm_location_t,
8397 /** PinnedExpressionNode#rparen_loc
8398
8399 The Location of the closing parenthesis.
8400
8401``` ruby
8402 foo in ^(bar)
8403 ^
8404```
8405*/
8406 pub rparen_loc: pm_location_t,
8407}
8408/** PinnedVariableNode
8409
8410 Represents the use of the `^` operator for pinning a variable in a pattern matching expression.
8411
8412``` ruby
8413 foo in ^bar
8414 ^^^^
8415```
8416
8417 Type: ::PM_PINNED_VARIABLE_NODE
8418
8419 @extends pm_node_t
8420*/
8421#[repr(C)]
8422#[derive(Debug, Copy, Clone)]
8423pub struct pm_pinned_variable_node {
8424 /** The embedded base node.
8425*/
8426 pub base: pm_node_t,
8427 /** PinnedVariableNode#variable
8428
8429 The variable used in the pinned expression
8430
8431``` ruby
8432 foo in ^bar
8433 ^^^
8434```
8435*/
8436 pub variable: *mut pm_node,
8437 /** PinnedVariableNode#operator_loc
8438
8439 The Location of the `^` operator
8440
8441``` ruby
8442 foo in ^bar
8443 ^
8444```
8445*/
8446 pub operator_loc: pm_location_t,
8447}
8448/** PostExecutionNode
8449
8450 Represents the use of the `END` keyword.
8451
8452``` ruby
8453 END { foo }
8454 ^^^^^^^^^^^
8455```
8456
8457 Type: ::PM_POST_EXECUTION_NODE
8458
8459 @extends pm_node_t
8460*/
8461#[repr(C)]
8462#[derive(Debug, Copy, Clone)]
8463pub struct pm_post_execution_node {
8464 /** The embedded base node.
8465*/
8466 pub base: pm_node_t,
8467 /** PostExecutionNode#statements
8468*/
8469 pub statements: *mut pm_statements_node,
8470 /** PostExecutionNode#keyword_loc
8471*/
8472 pub keyword_loc: pm_location_t,
8473 /** PostExecutionNode#opening_loc
8474*/
8475 pub opening_loc: pm_location_t,
8476 /** PostExecutionNode#closing_loc
8477*/
8478 pub closing_loc: pm_location_t,
8479}
8480/** PreExecutionNode
8481
8482 Represents the use of the `BEGIN` keyword.
8483
8484``` ruby
8485 BEGIN { foo }
8486 ^^^^^^^^^^^^^
8487```
8488
8489 Type: ::PM_PRE_EXECUTION_NODE
8490
8491 @extends pm_node_t
8492*/
8493#[repr(C)]
8494#[derive(Debug, Copy, Clone)]
8495pub struct pm_pre_execution_node {
8496 /** The embedded base node.
8497*/
8498 pub base: pm_node_t,
8499 /** PreExecutionNode#statements
8500*/
8501 pub statements: *mut pm_statements_node,
8502 /** PreExecutionNode#keyword_loc
8503*/
8504 pub keyword_loc: pm_location_t,
8505 /** PreExecutionNode#opening_loc
8506*/
8507 pub opening_loc: pm_location_t,
8508 /** PreExecutionNode#closing_loc
8509*/
8510 pub closing_loc: pm_location_t,
8511}
8512/** ProgramNode
8513
8514 The top level node of any parse tree.
8515
8516 Type: ::PM_PROGRAM_NODE
8517
8518 @extends pm_node_t
8519*/
8520#[repr(C)]
8521#[derive(Debug, Copy, Clone)]
8522pub struct pm_program_node {
8523 /** The embedded base node.
8524*/
8525 pub base: pm_node_t,
8526 /** ProgramNode#locals
8527*/
8528 pub locals: pm_constant_id_list_t,
8529 /** ProgramNode#statements
8530*/
8531 pub statements: *mut pm_statements_node,
8532}
8533/** RangeNode
8534
8535 Represents the use of the `..` or `...` operators.
8536
8537``` ruby
8538 1..2
8539 ^^^^
8540```
8541
8542``` ruby
8543 c if a =~ /left/ ... b =~ /right/
8544 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
8545```
8546
8547 Type: ::PM_RANGE_NODE
8548
8549 Flags (#pm_range_flags):
8550 * ::PM_RANGE_FLAGS_EXCLUDE_END
8551
8552 @extends pm_node_t
8553*/
8554#[repr(C)]
8555#[derive(Debug, Copy, Clone)]
8556pub struct pm_range_node {
8557 /** The embedded base node.
8558*/
8559 pub base: pm_node_t,
8560 /** RangeNode#left
8561
8562 The left-hand side of the range, if present. It can be either `nil` or any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression).
8563
8564``` ruby
8565 1...
8566 ^
8567```
8568
8569``` ruby
8570 hello...goodbye
8571 ^^^^^
8572```
8573*/
8574 pub left: *mut pm_node,
8575 /** RangeNode#right
8576
8577 The right-hand side of the range, if present. It can be either `nil` or any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression).
8578
8579``` ruby
8580 ..5
8581 ^
8582```
8583
8584``` ruby
8585 1...foo
8586 ^^^
8587```
8588 If neither right-hand or left-hand side was included, this will be an ErrorRecoveryNode.
8589*/
8590 pub right: *mut pm_node,
8591 /** RangeNode#operator_loc
8592
8593 The Location of the `..` or `...` operator.
8594*/
8595 pub operator_loc: pm_location_t,
8596}
8597/** RationalNode
8598
8599 Represents a rational number literal.
8600
8601``` ruby
8602 1.0r
8603 ^^^^
8604```
8605
8606 Type: ::PM_RATIONAL_NODE
8607
8608 Flags (#pm_integer_base_flags):
8609 * ::PM_INTEGER_BASE_FLAGS_BINARY
8610 * ::PM_INTEGER_BASE_FLAGS_DECIMAL
8611 * ::PM_INTEGER_BASE_FLAGS_OCTAL
8612 * ::PM_INTEGER_BASE_FLAGS_HEXADECIMAL
8613
8614 @extends pm_node_t
8615*/
8616#[repr(C)]
8617#[derive(Copy, Clone)]
8618pub struct pm_rational_node {
8619 /** The embedded base node.
8620*/
8621 pub base: pm_node_t,
8622 /** RationalNode#numerator
8623
8624 The numerator of the rational number.
8625
8626``` ruby
8627 1.5r # numerator 3
8628```
8629*/
8630 pub numerator: pm_integer_t,
8631 /** RationalNode#denominator
8632
8633 The denominator of the rational number.
8634
8635``` ruby
8636 1.5r # denominator 2
8637```
8638*/
8639 pub denominator: pm_integer_t,
8640}
8641/** RedoNode
8642
8643 Represents the use of the `redo` keyword.
8644
8645``` ruby
8646 redo
8647 ^^^^
8648```
8649
8650 Type: ::PM_REDO_NODE
8651
8652 @extends pm_node_t
8653*/
8654#[repr(C)]
8655#[derive(Debug, Default, Copy, Clone)]
8656pub struct pm_redo_node {
8657 /** The embedded base node.
8658*/
8659 pub base: pm_node_t,
8660}
8661/** RegularExpressionNode
8662
8663 Represents a regular expression literal with no interpolation.
8664
8665``` ruby
8666 /foo/i
8667 ^^^^^^
8668```
8669
8670 Type: ::PM_REGULAR_EXPRESSION_NODE
8671
8672 Flags (#pm_regular_expression_flags):
8673 * ::PM_REGULAR_EXPRESSION_FLAGS_IGNORE_CASE
8674 * ::PM_REGULAR_EXPRESSION_FLAGS_EXTENDED
8675 * ::PM_REGULAR_EXPRESSION_FLAGS_MULTI_LINE
8676 * ::PM_REGULAR_EXPRESSION_FLAGS_ONCE
8677 * ::PM_REGULAR_EXPRESSION_FLAGS_EUC_JP
8678 * ::PM_REGULAR_EXPRESSION_FLAGS_ASCII_8BIT
8679 * ::PM_REGULAR_EXPRESSION_FLAGS_WINDOWS_31J
8680 * ::PM_REGULAR_EXPRESSION_FLAGS_UTF_8
8681 * ::PM_REGULAR_EXPRESSION_FLAGS_FORCED_UTF8_ENCODING
8682 * ::PM_REGULAR_EXPRESSION_FLAGS_FORCED_BINARY_ENCODING
8683 * ::PM_REGULAR_EXPRESSION_FLAGS_FORCED_US_ASCII_ENCODING
8684
8685 @extends pm_node_t
8686*/
8687#[repr(C)]
8688#[derive(Debug, Copy, Clone)]
8689pub struct pm_regular_expression_node {
8690 /** The embedded base node.
8691*/
8692 pub base: pm_node_t,
8693 /** RegularExpressionNode#opening_loc
8694*/
8695 pub opening_loc: pm_location_t,
8696 /** RegularExpressionNode#content_loc
8697*/
8698 pub content_loc: pm_location_t,
8699 /** RegularExpressionNode#closing_loc
8700*/
8701 pub closing_loc: pm_location_t,
8702 /** RegularExpressionNode#unescaped
8703*/
8704 pub unescaped: pm_string_t,
8705}
8706/** RequiredKeywordParameterNode
8707
8708 Represents a required keyword parameter to a method, block, or lambda definition.
8709
8710``` ruby
8711 def a(b: )
8712 ^^
8713 end
8714```
8715
8716 Type: ::PM_REQUIRED_KEYWORD_PARAMETER_NODE
8717
8718 Flags (#pm_parameter_flags):
8719 * ::PM_PARAMETER_FLAGS_REPEATED_PARAMETER
8720
8721 @extends pm_node_t
8722*/
8723#[repr(C)]
8724#[derive(Debug, Default, Copy, Clone)]
8725pub struct pm_required_keyword_parameter_node {
8726 /** The embedded base node.
8727*/
8728 pub base: pm_node_t,
8729 /** RequiredKeywordParameterNode#name
8730*/
8731 pub name: pm_constant_id_t,
8732 /** RequiredKeywordParameterNode#name_loc
8733*/
8734 pub name_loc: pm_location_t,
8735}
8736/** RequiredParameterNode
8737
8738 Represents a required parameter to a method, block, or lambda definition.
8739
8740``` ruby
8741 def a(b)
8742 ^
8743 end
8744```
8745
8746 Type: ::PM_REQUIRED_PARAMETER_NODE
8747
8748 Flags (#pm_parameter_flags):
8749 * ::PM_PARAMETER_FLAGS_REPEATED_PARAMETER
8750
8751 @extends pm_node_t
8752*/
8753#[repr(C)]
8754#[derive(Debug, Default, Copy, Clone)]
8755pub struct pm_required_parameter_node {
8756 /** The embedded base node.
8757*/
8758 pub base: pm_node_t,
8759 /** RequiredParameterNode#name
8760*/
8761 pub name: pm_constant_id_t,
8762}
8763/** RescueModifierNode
8764
8765 Represents an expression modified with a rescue.
8766
8767``` ruby
8768 foo rescue nil
8769 ^^^^^^^^^^^^^^
8770```
8771
8772 Type: ::PM_RESCUE_MODIFIER_NODE
8773
8774 @extends pm_node_t
8775*/
8776#[repr(C)]
8777#[derive(Debug, Copy, Clone)]
8778pub struct pm_rescue_modifier_node {
8779 /** The embedded base node.
8780*/
8781 pub base: pm_node_t,
8782 /** RescueModifierNode#expression
8783*/
8784 pub expression: *mut pm_node,
8785 /** RescueModifierNode#keyword_loc
8786*/
8787 pub keyword_loc: pm_location_t,
8788 /** RescueModifierNode#rescue_expression
8789*/
8790 pub rescue_expression: *mut pm_node,
8791}
8792/** RescueNode
8793
8794 Represents a rescue statement.
8795
8796``` ruby
8797 begin
8798 rescue Foo, *splat, Bar => ex
8799 foo
8800 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
8801 end
8802```
8803
8804 `Foo, *splat, Bar` are in the `exceptions` field. `ex` is in the `reference` field.
8805
8806 Type: ::PM_RESCUE_NODE
8807
8808 @extends pm_node_t
8809*/
8810#[repr(C)]
8811#[derive(Debug, Copy, Clone)]
8812pub struct pm_rescue_node {
8813 /** The embedded base node.
8814*/
8815 pub base: pm_node_t,
8816 /** RescueNode#keyword_loc
8817*/
8818 pub keyword_loc: pm_location_t,
8819 /** RescueNode#exceptions
8820*/
8821 pub exceptions: pm_node_list,
8822 /** RescueNode#operator_loc
8823*/
8824 pub operator_loc: pm_location_t,
8825 /** RescueNode#reference
8826*/
8827 pub reference: *mut pm_node,
8828 /** RescueNode#then_keyword_loc
8829*/
8830 pub then_keyword_loc: pm_location_t,
8831 /** RescueNode#statements
8832*/
8833 pub statements: *mut pm_statements_node,
8834 /** RescueNode#subsequent
8835*/
8836 pub subsequent: *mut pm_rescue_node,
8837}
8838/** RestParameterNode
8839
8840 Represents a rest parameter to a method, block, or lambda definition.
8841
8842``` ruby
8843 def a(*b)
8844 ^^
8845 end
8846```
8847
8848 Type: ::PM_REST_PARAMETER_NODE
8849
8850 Flags (#pm_parameter_flags):
8851 * ::PM_PARAMETER_FLAGS_REPEATED_PARAMETER
8852
8853 @extends pm_node_t
8854*/
8855#[repr(C)]
8856#[derive(Debug, Default, Copy, Clone)]
8857pub struct pm_rest_parameter_node {
8858 /** The embedded base node.
8859*/
8860 pub base: pm_node_t,
8861 /** RestParameterNode#name
8862*/
8863 pub name: pm_constant_id_t,
8864 /** RestParameterNode#name_loc
8865*/
8866 pub name_loc: pm_location_t,
8867 /** RestParameterNode#operator_loc
8868*/
8869 pub operator_loc: pm_location_t,
8870}
8871/** RetryNode
8872
8873 Represents the use of the `retry` keyword.
8874
8875``` ruby
8876 retry
8877 ^^^^^
8878```
8879
8880 Type: ::PM_RETRY_NODE
8881
8882 @extends pm_node_t
8883*/
8884#[repr(C)]
8885#[derive(Debug, Default, Copy, Clone)]
8886pub struct pm_retry_node {
8887 /** The embedded base node.
8888*/
8889 pub base: pm_node_t,
8890}
8891/** ReturnNode
8892
8893 Represents the use of the `return` keyword.
8894
8895``` ruby
8896 return 1
8897 ^^^^^^^^
8898```
8899
8900 Type: ::PM_RETURN_NODE
8901
8902 @extends pm_node_t
8903*/
8904#[repr(C)]
8905#[derive(Debug, Copy, Clone)]
8906pub struct pm_return_node {
8907 /** The embedded base node.
8908*/
8909 pub base: pm_node_t,
8910 /** ReturnNode#keyword_loc
8911*/
8912 pub keyword_loc: pm_location_t,
8913 /** ReturnNode#arguments
8914*/
8915 pub arguments: *mut pm_arguments_node,
8916}
8917/** SelfNode
8918
8919 Represents the `self` keyword.
8920
8921``` ruby
8922 self
8923 ^^^^
8924```
8925
8926 Type: ::PM_SELF_NODE
8927
8928 @extends pm_node_t
8929*/
8930#[repr(C)]
8931#[derive(Debug, Default, Copy, Clone)]
8932pub struct pm_self_node {
8933 /** The embedded base node.
8934*/
8935 pub base: pm_node_t,
8936}
8937/** ShareableConstantNode
8938
8939 This node wraps a constant write to indicate that when the value is written, it should have its shareability state modified.
8940
8941``` ruby
8942 # shareable_constant_value: literal
8943 C = { a: 1 }
8944 ^^^^^^^^^^^^
8945```
8946
8947 Type: ::PM_SHAREABLE_CONSTANT_NODE
8948
8949 Flags (#pm_shareable_constant_node_flags):
8950 * ::PM_SHAREABLE_CONSTANT_NODE_FLAGS_LITERAL
8951 * ::PM_SHAREABLE_CONSTANT_NODE_FLAGS_EXPERIMENTAL_EVERYTHING
8952 * ::PM_SHAREABLE_CONSTANT_NODE_FLAGS_EXPERIMENTAL_COPY
8953
8954 @extends pm_node_t
8955*/
8956#[repr(C)]
8957#[derive(Debug, Copy, Clone)]
8958pub struct pm_shareable_constant_node {
8959 /** The embedded base node.
8960*/
8961 pub base: pm_node_t,
8962 /** ShareableConstantNode#write
8963
8964 The constant write that should be modified with the shareability state.
8965*/
8966 pub write: *mut pm_node,
8967}
8968/** SingletonClassNode
8969
8970 Represents a singleton class declaration involving the `class` keyword.
8971
8972``` ruby
8973 class << self end
8974 ^^^^^^^^^^^^^^^^^
8975```
8976
8977 Type: ::PM_SINGLETON_CLASS_NODE
8978
8979 @extends pm_node_t
8980*/
8981#[repr(C)]
8982#[derive(Debug, Copy, Clone)]
8983pub struct pm_singleton_class_node {
8984 /** The embedded base node.
8985*/
8986 pub base: pm_node_t,
8987 /** SingletonClassNode#locals
8988*/
8989 pub locals: pm_constant_id_list_t,
8990 /** SingletonClassNode#class_keyword_loc
8991*/
8992 pub class_keyword_loc: pm_location_t,
8993 /** SingletonClassNode#operator_loc
8994*/
8995 pub operator_loc: pm_location_t,
8996 /** SingletonClassNode#expression
8997*/
8998 pub expression: *mut pm_node,
8999 /** SingletonClassNode#body
9000*/
9001 pub body: *mut pm_node,
9002 /** SingletonClassNode#end_keyword_loc
9003*/
9004 pub end_keyword_loc: pm_location_t,
9005}
9006/** SourceEncodingNode
9007
9008 Represents the use of the `__ENCODING__` keyword.
9009
9010``` ruby
9011 __ENCODING__
9012 ^^^^^^^^^^^^
9013```
9014
9015 Type: ::PM_SOURCE_ENCODING_NODE
9016
9017 @extends pm_node_t
9018*/
9019#[repr(C)]
9020#[derive(Debug, Default, Copy, Clone)]
9021pub struct pm_source_encoding_node {
9022 /** The embedded base node.
9023*/
9024 pub base: pm_node_t,
9025}
9026/** SourceFileNode
9027
9028 Represents the use of the `__FILE__` keyword.
9029
9030``` ruby
9031 __FILE__
9032 ^^^^^^^^
9033```
9034
9035 Type: ::PM_SOURCE_FILE_NODE
9036
9037 Flags (#pm_string_flags):
9038 * ::PM_STRING_FLAGS_FORCED_UTF8_ENCODING
9039 * ::PM_STRING_FLAGS_FORCED_BINARY_ENCODING
9040 * ::PM_STRING_FLAGS_FROZEN
9041 * ::PM_STRING_FLAGS_MUTABLE
9042
9043 @extends pm_node_t
9044*/
9045#[repr(C)]
9046#[derive(Debug, Copy, Clone)]
9047pub struct pm_source_file_node {
9048 /** The embedded base node.
9049*/
9050 pub base: pm_node_t,
9051 /** SourceFileNode#filepath
9052
9053 Represents the file path being parsed. This corresponds directly to the `filepath` option given to the various `Prism.parse*` APIs.
9054*/
9055 pub filepath: pm_string_t,
9056}
9057/** SourceLineNode
9058
9059 Represents the use of the `__LINE__` keyword.
9060
9061``` ruby
9062 __LINE__
9063 ^^^^^^^^
9064```
9065
9066 Type: ::PM_SOURCE_LINE_NODE
9067
9068 @extends pm_node_t
9069*/
9070#[repr(C)]
9071#[derive(Debug, Default, Copy, Clone)]
9072pub struct pm_source_line_node {
9073 /** The embedded base node.
9074*/
9075 pub base: pm_node_t,
9076}
9077/** SplatNode
9078
9079 Represents the use of the splat operator.
9080
9081``` ruby
9082 [*a]
9083 ^^
9084```
9085
9086 Type: ::PM_SPLAT_NODE
9087
9088 @extends pm_node_t
9089*/
9090#[repr(C)]
9091#[derive(Debug, Copy, Clone)]
9092pub struct pm_splat_node {
9093 /** The embedded base node.
9094*/
9095 pub base: pm_node_t,
9096 /** SplatNode#operator_loc
9097*/
9098 pub operator_loc: pm_location_t,
9099 /** SplatNode#expression
9100*/
9101 pub expression: *mut pm_node,
9102}
9103/** StatementsNode
9104
9105 Represents a set of statements contained within some scope.
9106
9107``` ruby
9108 foo; bar; baz
9109 ^^^^^^^^^^^^^
9110```
9111
9112 Type: ::PM_STATEMENTS_NODE
9113
9114 Flags (#pm_statements_flags):
9115 * ::PM_STATEMENTS_FLAGS_CONTAINS_PRE_EXECUTION
9116
9117 @extends pm_node_t
9118*/
9119#[repr(C)]
9120#[derive(Debug, Copy, Clone)]
9121pub struct pm_statements_node {
9122 /** The embedded base node.
9123*/
9124 pub base: pm_node_t,
9125 /** StatementsNode#body
9126*/
9127 pub body: pm_node_list,
9128}
9129/** StringNode
9130
9131 Represents a string literal, a string contained within a `%w` list, or plain string content within an interpolated string.
9132
9133``` ruby
9134 "foo"
9135 ^^^^^
9136```
9137
9138``` ruby
9139 %w[foo]
9140 ^^^
9141```
9142
9143``` ruby
9144 "foo #{bar} baz"
9145 ^^^^ ^^^^
9146```
9147
9148 Type: ::PM_STRING_NODE
9149
9150 Flags (#pm_string_flags):
9151 * ::PM_STRING_FLAGS_FORCED_UTF8_ENCODING
9152 * ::PM_STRING_FLAGS_FORCED_BINARY_ENCODING
9153 * ::PM_STRING_FLAGS_FROZEN
9154 * ::PM_STRING_FLAGS_MUTABLE
9155
9156 @extends pm_node_t
9157*/
9158#[repr(C)]
9159#[derive(Debug, Copy, Clone)]
9160pub struct pm_string_node {
9161 /** The embedded base node.
9162*/
9163 pub base: pm_node_t,
9164 /** StringNode#opening_loc
9165*/
9166 pub opening_loc: pm_location_t,
9167 /** StringNode#content_loc
9168*/
9169 pub content_loc: pm_location_t,
9170 /** StringNode#closing_loc
9171*/
9172 pub closing_loc: pm_location_t,
9173 /** StringNode#unescaped
9174*/
9175 pub unescaped: pm_string_t,
9176}
9177/** SuperNode
9178
9179 Represents the use of the `super` keyword with parentheses or arguments.
9180
9181``` ruby
9182 super()
9183 ^^^^^^^
9184```
9185
9186``` ruby
9187 super foo, bar
9188 ^^^^^^^^^^^^^^
9189```
9190
9191 If no arguments are provided (except for a block), it would be a `ForwardingSuperNode` instead.
9192
9193 Type: ::PM_SUPER_NODE
9194
9195 @extends pm_node_t
9196*/
9197#[repr(C)]
9198#[derive(Debug, Copy, Clone)]
9199pub struct pm_super_node {
9200 /** The embedded base node.
9201*/
9202 pub base: pm_node_t,
9203 /** SuperNode#keyword_loc
9204*/
9205 pub keyword_loc: pm_location_t,
9206 /** SuperNode#lparen_loc
9207*/
9208 pub lparen_loc: pm_location_t,
9209 /** SuperNode#arguments
9210
9211 Can be only `nil` when there are empty parentheses, like `super()`.
9212*/
9213 pub arguments: *mut pm_arguments_node,
9214 /** SuperNode#rparen_loc
9215*/
9216 pub rparen_loc: pm_location_t,
9217 /** SuperNode#block
9218*/
9219 pub block: *mut pm_node,
9220}
9221/** SymbolNode
9222
9223 Represents a symbol literal or a symbol contained within a `%i` list.
9224
9225``` ruby
9226 :foo
9227 ^^^^
9228```
9229
9230``` ruby
9231 %i[foo]
9232 ^^^
9233```
9234
9235 Type: ::PM_SYMBOL_NODE
9236
9237 Flags (#pm_symbol_flags):
9238 * ::PM_SYMBOL_FLAGS_FORCED_UTF8_ENCODING
9239 * ::PM_SYMBOL_FLAGS_FORCED_BINARY_ENCODING
9240 * ::PM_SYMBOL_FLAGS_FORCED_US_ASCII_ENCODING
9241
9242 @extends pm_node_t
9243*/
9244#[repr(C)]
9245#[derive(Debug, Copy, Clone)]
9246pub struct pm_symbol_node {
9247 /** The embedded base node.
9248*/
9249 pub base: pm_node_t,
9250 /** SymbolNode#opening_loc
9251*/
9252 pub opening_loc: pm_location_t,
9253 /** SymbolNode#content_loc
9254*/
9255 pub content_loc: pm_location_t,
9256 /** SymbolNode#closing_loc
9257*/
9258 pub closing_loc: pm_location_t,
9259 /** SymbolNode#unescaped
9260*/
9261 pub unescaped: pm_string_t,
9262}
9263/** TrueNode
9264
9265 Represents the use of the literal `true` keyword.
9266
9267``` ruby
9268 true
9269 ^^^^
9270```
9271
9272 Type: ::PM_TRUE_NODE
9273
9274 @extends pm_node_t
9275*/
9276#[repr(C)]
9277#[derive(Debug, Default, Copy, Clone)]
9278pub struct pm_true_node {
9279 /** The embedded base node.
9280*/
9281 pub base: pm_node_t,
9282}
9283/** UndefNode
9284
9285 Represents the use of the `undef` keyword.
9286
9287``` ruby
9288 undef :foo, :bar, :baz
9289 ^^^^^^^^^^^^^^^^^^^^^^
9290```
9291
9292 Type: ::PM_UNDEF_NODE
9293
9294 @extends pm_node_t
9295*/
9296#[repr(C)]
9297#[derive(Debug, Copy, Clone)]
9298pub struct pm_undef_node {
9299 /** The embedded base node.
9300*/
9301 pub base: pm_node_t,
9302 /** UndefNode#names
9303*/
9304 pub names: pm_node_list,
9305 /** UndefNode#keyword_loc
9306*/
9307 pub keyword_loc: pm_location_t,
9308}
9309/** UnlessNode
9310
9311 Represents the use of the `unless` keyword, either in the block form or the modifier form.
9312
9313``` ruby
9314 bar unless foo
9315 ^^^^^^^^^^^^^^
9316```
9317
9318``` ruby
9319 unless foo then bar end
9320 ^^^^^^^^^^^^^^^^^^^^^^^
9321```
9322
9323 Type: ::PM_UNLESS_NODE
9324
9325 @extends pm_node_t
9326*/
9327#[repr(C)]
9328#[derive(Debug, Copy, Clone)]
9329pub struct pm_unless_node {
9330 /** The embedded base node.
9331*/
9332 pub base: pm_node_t,
9333 /** UnlessNode#unless_keyword_loc
9334
9335 The Location of the `unless` keyword.
9336
9337``` ruby
9338 unless cond then bar end
9339 ^^^^^^
9340```
9341
9342``` ruby
9343 bar unless cond
9344 ^^^^^^
9345```
9346*/
9347 pub unless_keyword_loc: pm_location_t,
9348 /** UnlessNode#predicate
9349
9350 The condition to be evaluated for the unless expression. It can be any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression).
9351
9352``` ruby
9353 unless cond then bar end
9354 ^^^^
9355```
9356
9357``` ruby
9358 bar unless cond
9359 ^^^^
9360```
9361*/
9362 pub predicate: *mut pm_node,
9363 /** UnlessNode#then_keyword_loc
9364
9365 The Location of the `then` keyword, if present.
9366
9367``` ruby
9368 unless cond then bar end
9369 ^^^^
9370```
9371*/
9372 pub then_keyword_loc: pm_location_t,
9373 /** UnlessNode#statements
9374
9375 The body of statements that will executed if the unless condition is
9376 falsey. Will be `nil` if no body is provided.
9377
9378``` ruby
9379 unless cond then bar end
9380 ^^^
9381```
9382*/
9383 pub statements: *mut pm_statements_node,
9384 /** UnlessNode#else_clause
9385
9386 The else clause of the unless expression, if present.
9387
9388``` ruby
9389 unless cond then bar else baz end
9390 ^^^^^^^^^^^^
9391```
9392*/
9393 pub else_clause: *mut pm_else_node,
9394 /** UnlessNode#end_keyword_loc
9395
9396 The Location of the `end` keyword, if present.
9397
9398``` ruby
9399 unless cond then bar end
9400 ^^^
9401```
9402*/
9403 pub end_keyword_loc: pm_location_t,
9404}
9405/** UntilNode
9406
9407 Represents the use of the `until` keyword, either in the block form or the modifier form.
9408
9409``` ruby
9410 bar until foo
9411 ^^^^^^^^^^^^^
9412```
9413
9414``` ruby
9415 until foo do bar end
9416 ^^^^^^^^^^^^^^^^^^^^
9417```
9418
9419 Type: ::PM_UNTIL_NODE
9420
9421 Flags (#pm_loop_flags):
9422 * ::PM_LOOP_FLAGS_BEGIN_MODIFIER
9423
9424 @extends pm_node_t
9425*/
9426#[repr(C)]
9427#[derive(Debug, Copy, Clone)]
9428pub struct pm_until_node {
9429 /** The embedded base node.
9430*/
9431 pub base: pm_node_t,
9432 /** UntilNode#until_keyword_loc
9433*/
9434 pub until_keyword_loc: pm_location_t,
9435 /** UntilNode#do_keyword_loc
9436*/
9437 pub do_keyword_loc: pm_location_t,
9438 /** UntilNode#end_keyword_loc
9439*/
9440 pub end_keyword_loc: pm_location_t,
9441 /** UntilNode#predicate
9442*/
9443 pub predicate: *mut pm_node,
9444 /** UntilNode#statements
9445*/
9446 pub statements: *mut pm_statements_node,
9447}
9448/** WhenNode
9449
9450 Represents the use of the `when` keyword within a case statement.
9451
9452``` ruby
9453 case true
9454 when true
9455 ^^^^^^^^^
9456 end
9457```
9458
9459 Type: ::PM_WHEN_NODE
9460
9461 @extends pm_node_t
9462*/
9463#[repr(C)]
9464#[derive(Debug, Copy, Clone)]
9465pub struct pm_when_node {
9466 /** The embedded base node.
9467*/
9468 pub base: pm_node_t,
9469 /** WhenNode#when_keyword_loc
9470*/
9471 pub when_keyword_loc: pm_location_t,
9472 /** WhenNode#conditions
9473*/
9474 pub conditions: pm_node_list,
9475 /** WhenNode#then_keyword_loc
9476*/
9477 pub then_keyword_loc: pm_location_t,
9478 /** WhenNode#statements
9479*/
9480 pub statements: *mut pm_statements_node,
9481}
9482/** WhileNode
9483
9484 Represents the use of the `while` keyword, either in the block form or the modifier form.
9485
9486``` ruby
9487 bar while foo
9488 ^^^^^^^^^^^^^
9489```
9490
9491``` ruby
9492 while foo do bar end
9493 ^^^^^^^^^^^^^^^^^^^^
9494```
9495
9496 Type: ::PM_WHILE_NODE
9497
9498 Flags (#pm_loop_flags):
9499 * ::PM_LOOP_FLAGS_BEGIN_MODIFIER
9500
9501 @extends pm_node_t
9502*/
9503#[repr(C)]
9504#[derive(Debug, Copy, Clone)]
9505pub struct pm_while_node {
9506 /** The embedded base node.
9507*/
9508 pub base: pm_node_t,
9509 /** WhileNode#while_keyword_loc
9510*/
9511 pub while_keyword_loc: pm_location_t,
9512 /** WhileNode#do_keyword_loc
9513*/
9514 pub do_keyword_loc: pm_location_t,
9515 /** WhileNode#end_keyword_loc
9516*/
9517 pub end_keyword_loc: pm_location_t,
9518 /** WhileNode#predicate
9519*/
9520 pub predicate: *mut pm_node,
9521 /** WhileNode#statements
9522*/
9523 pub statements: *mut pm_statements_node,
9524}
9525/** XStringNode
9526
9527 Represents an xstring literal with no interpolation.
9528
9529``` ruby
9530 `foo`
9531 ^^^^^
9532```
9533
9534 Type: ::PM_X_STRING_NODE
9535
9536 Flags (#pm_encoding_flags):
9537 * ::PM_ENCODING_FLAGS_FORCED_UTF8_ENCODING
9538 * ::PM_ENCODING_FLAGS_FORCED_BINARY_ENCODING
9539
9540 @extends pm_node_t
9541*/
9542#[repr(C)]
9543#[derive(Debug, Copy, Clone)]
9544pub struct pm_x_string_node {
9545 /** The embedded base node.
9546*/
9547 pub base: pm_node_t,
9548 /** XStringNode#opening_loc
9549*/
9550 pub opening_loc: pm_location_t,
9551 /** XStringNode#content_loc
9552*/
9553 pub content_loc: pm_location_t,
9554 /** XStringNode#closing_loc
9555*/
9556 pub closing_loc: pm_location_t,
9557 /** XStringNode#unescaped
9558*/
9559 pub unescaped: pm_string_t,
9560}
9561/** YieldNode
9562
9563 Represents the use of the `yield` keyword.
9564
9565``` ruby
9566 yield 1
9567 ^^^^^^^
9568```
9569
9570 Type: ::PM_YIELD_NODE
9571
9572 @extends pm_node_t
9573*/
9574#[repr(C)]
9575#[derive(Debug, Copy, Clone)]
9576pub struct pm_yield_node {
9577 /** The embedded base node.
9578*/
9579 pub base: pm_node_t,
9580 /** YieldNode#keyword_loc
9581*/
9582 pub keyword_loc: pm_location_t,
9583 /** YieldNode#lparen_loc
9584*/
9585 pub lparen_loc: pm_location_t,
9586 /** YieldNode#arguments
9587*/
9588 pub arguments: *mut pm_arguments_node,
9589 /** YieldNode#rparen_loc
9590*/
9591 pub rparen_loc: pm_location_t,
9592}
9593/** An opaque pointer to a diagnostic generated during parsing.
9594*/
9595#[repr(C)]
9596#[derive(Debug)]
9597pub struct pm_diagnostic_t {
9598 _unused: [u8; 0],
9599}
9600/** An opaque pointer to a comment found while parsing.
9601*/
9602#[repr(C)]
9603#[derive(Debug)]
9604pub struct pm_comment_t {
9605 _unused: [u8; 0],
9606}
9607/** A list of offsets of the start of lines in a string. The offsets are assumed
9608 to be sorted/inserted in ascending order.
9609*/
9610#[repr(C)]
9611#[derive(Debug, Copy, Clone)]
9612pub struct pm_line_offset_list_t {
9613 /** The number of offsets in the list.
9614*/
9615 pub size: usize,
9616 /** The capacity of the list that has been allocated.
9617*/
9618 pub capacity: usize,
9619 /** The list of offsets.
9620*/
9621 pub offsets: *mut u32,
9622}
9623/** A line and column in a string.
9624*/
9625#[repr(C)]
9626#[derive(Debug, Default, Copy, Clone)]
9627pub struct pm_line_column_t {
9628 /** The line number.
9629*/
9630 pub line: i32,
9631 /** The column in bytes.
9632*/
9633 pub column: u32,
9634}
9635/** An opaque pointer to a magic comment found while parsing.
9636*/
9637#[repr(C)]
9638#[derive(Debug)]
9639pub struct pm_magic_comment_t {
9640 _unused: [u8; 0],
9641}
9642/** A scope of locals surrounding the code that is being parsed.
9643*/
9644#[repr(C)]
9645#[derive(Debug)]
9646pub struct pm_options_scope_t {
9647 _unused: [u8; 0],
9648}
9649/** The options that can be passed to the parser.
9650*/
9651#[repr(C)]
9652#[derive(Debug)]
9653pub struct pm_options_t {
9654 _unused: [u8; 0],
9655}
9656/** The parser used to parse Ruby source.
9657*/
9658#[repr(C)]
9659#[derive(Debug)]
9660pub struct pm_parser_t {
9661 _unused: [u8; 0],
9662}
9663/** The default value for parameters.
9664*/
9665pub const PM_OPTIONS_SCOPE_FORWARDING_NONE: u8 = 0;
9666/** When the scope is forwarding with the * parameter.
9667*/
9668pub const PM_OPTIONS_SCOPE_FORWARDING_POSITIONALS: u8 = 1;
9669/** When the scope is forwarding with the ** parameter.
9670*/
9671pub const PM_OPTIONS_SCOPE_FORWARDING_KEYWORDS: u8 = 2;
9672/** When the scope is forwarding with the & parameter.
9673*/
9674pub const PM_OPTIONS_SCOPE_FORWARDING_BLOCK: u8 = 4;
9675/** When the scope is forwarding with the ... parameter.
9676*/
9677pub const PM_OPTIONS_SCOPE_FORWARDING_ALL: u8 = 8;
9678/** A bit representing whether or not the command line -a option was set. -a
9679 splits the input line $_ into $F.
9680*/
9681pub const PM_OPTIONS_COMMAND_LINE_A: u8 = 1;
9682/** A bit representing whether or not the command line -e option was set. -e
9683 allow the user to specify a script to be executed. This is necessary for
9684 prism to know because certain warnings are not generated when -e is used.
9685*/
9686pub const PM_OPTIONS_COMMAND_LINE_E: u8 = 2;
9687/** A bit representing whether or not the command line -l option was set. -l
9688 chomps the input line by default.
9689*/
9690pub const PM_OPTIONS_COMMAND_LINE_L: u8 = 4;
9691/** A bit representing whether or not the command line -n option was set. -n
9692 wraps the script in a while gets loop.
9693*/
9694pub const PM_OPTIONS_COMMAND_LINE_N: u8 = 8;
9695/** A bit representing whether or not the command line -p option was set. -p
9696 prints the value of $_ at the end of each loop.
9697*/
9698pub const PM_OPTIONS_COMMAND_LINE_P: u8 = 16;
9699/** A bit representing whether or not the command line -x option was set. -x
9700 searches the input file for a shebang that includes "ruby".
9701*/
9702pub const PM_OPTIONS_COMMAND_LINE_X: u8 = 32;
9703/** Returned if the version given to a slice query was invalid.
9704*/
9705pub const PM_STRING_QUERY_ERROR_VERSION: pm_string_query_t = -2;
9706/** Returned if the encoding given to a slice query was invalid.
9707*/
9708pub const PM_STRING_QUERY_ERROR: pm_string_query_t = -1;
9709/** Returned if the result of the slice query is false.
9710*/
9711pub const PM_STRING_QUERY_FALSE: pm_string_query_t = 0;
9712/** Returned if the result of the slice query is true.
9713*/
9714pub const PM_STRING_QUERY_TRUE: pm_string_query_t = 1;
9715#[repr(u32)]
9716#[non_exhaustive]
9717/** This enum represents every type of node in the Ruby syntax tree.
9718*/
9719#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
9720pub enum pm_node_type {
9721 /** AliasGlobalVariableNode
9722*/
9723 PM_ALIAS_GLOBAL_VARIABLE_NODE = 1,
9724 /** AliasMethodNode
9725*/
9726 PM_ALIAS_METHOD_NODE = 2,
9727 /** AlternationPatternNode
9728*/
9729 PM_ALTERNATION_PATTERN_NODE = 3,
9730 /** AndNode
9731*/
9732 PM_AND_NODE = 4,
9733 /** ArgumentsNode
9734*/
9735 PM_ARGUMENTS_NODE = 5,
9736 /** ArrayNode
9737*/
9738 PM_ARRAY_NODE = 6,
9739 /** ArrayPatternNode
9740*/
9741 PM_ARRAY_PATTERN_NODE = 7,
9742 /** AssocNode
9743*/
9744 PM_ASSOC_NODE = 8,
9745 /** AssocSplatNode
9746*/
9747 PM_ASSOC_SPLAT_NODE = 9,
9748 /** BackReferenceReadNode
9749*/
9750 PM_BACK_REFERENCE_READ_NODE = 10,
9751 /** BeginNode
9752*/
9753 PM_BEGIN_NODE = 11,
9754 /** BlockArgumentNode
9755*/
9756 PM_BLOCK_ARGUMENT_NODE = 12,
9757 /** BlockLocalVariableNode
9758*/
9759 PM_BLOCK_LOCAL_VARIABLE_NODE = 13,
9760 /** BlockNode
9761*/
9762 PM_BLOCK_NODE = 14,
9763 /** BlockParameterNode
9764*/
9765 PM_BLOCK_PARAMETER_NODE = 15,
9766 /** BlockParametersNode
9767*/
9768 PM_BLOCK_PARAMETERS_NODE = 16,
9769 /** BreakNode
9770*/
9771 PM_BREAK_NODE = 17,
9772 /** CallAndWriteNode
9773*/
9774 PM_CALL_AND_WRITE_NODE = 18,
9775 /** CallNode
9776*/
9777 PM_CALL_NODE = 19,
9778 /** CallOperatorWriteNode
9779*/
9780 PM_CALL_OPERATOR_WRITE_NODE = 20,
9781 /** CallOrWriteNode
9782*/
9783 PM_CALL_OR_WRITE_NODE = 21,
9784 /** CallTargetNode
9785*/
9786 PM_CALL_TARGET_NODE = 22,
9787 /** CapturePatternNode
9788*/
9789 PM_CAPTURE_PATTERN_NODE = 23,
9790 /** CaseMatchNode
9791*/
9792 PM_CASE_MATCH_NODE = 24,
9793 /** CaseNode
9794*/
9795 PM_CASE_NODE = 25,
9796 /** ClassNode
9797*/
9798 PM_CLASS_NODE = 26,
9799 /** ClassVariableAndWriteNode
9800*/
9801 PM_CLASS_VARIABLE_AND_WRITE_NODE = 27,
9802 /** ClassVariableOperatorWriteNode
9803*/
9804 PM_CLASS_VARIABLE_OPERATOR_WRITE_NODE = 28,
9805 /** ClassVariableOrWriteNode
9806*/
9807 PM_CLASS_VARIABLE_OR_WRITE_NODE = 29,
9808 /** ClassVariableReadNode
9809*/
9810 PM_CLASS_VARIABLE_READ_NODE = 30,
9811 /** ClassVariableTargetNode
9812*/
9813 PM_CLASS_VARIABLE_TARGET_NODE = 31,
9814 /** ClassVariableWriteNode
9815*/
9816 PM_CLASS_VARIABLE_WRITE_NODE = 32,
9817 /** ConstantAndWriteNode
9818*/
9819 PM_CONSTANT_AND_WRITE_NODE = 33,
9820 /** ConstantOperatorWriteNode
9821*/
9822 PM_CONSTANT_OPERATOR_WRITE_NODE = 34,
9823 /** ConstantOrWriteNode
9824*/
9825 PM_CONSTANT_OR_WRITE_NODE = 35,
9826 /** ConstantPathAndWriteNode
9827*/
9828 PM_CONSTANT_PATH_AND_WRITE_NODE = 36,
9829 /** ConstantPathNode
9830*/
9831 PM_CONSTANT_PATH_NODE = 37,
9832 /** ConstantPathOperatorWriteNode
9833*/
9834 PM_CONSTANT_PATH_OPERATOR_WRITE_NODE = 38,
9835 /** ConstantPathOrWriteNode
9836*/
9837 PM_CONSTANT_PATH_OR_WRITE_NODE = 39,
9838 /** ConstantPathTargetNode
9839*/
9840 PM_CONSTANT_PATH_TARGET_NODE = 40,
9841 /** ConstantPathWriteNode
9842*/
9843 PM_CONSTANT_PATH_WRITE_NODE = 41,
9844 /** ConstantReadNode
9845*/
9846 PM_CONSTANT_READ_NODE = 42,
9847 /** ConstantTargetNode
9848*/
9849 PM_CONSTANT_TARGET_NODE = 43,
9850 /** ConstantWriteNode
9851*/
9852 PM_CONSTANT_WRITE_NODE = 44,
9853 /** DefNode
9854*/
9855 PM_DEF_NODE = 45,
9856 /** DefinedNode
9857*/
9858 PM_DEFINED_NODE = 46,
9859 /** ElseNode
9860*/
9861 PM_ELSE_NODE = 47,
9862 /** EmbeddedStatementsNode
9863*/
9864 PM_EMBEDDED_STATEMENTS_NODE = 48,
9865 /** EmbeddedVariableNode
9866*/
9867 PM_EMBEDDED_VARIABLE_NODE = 49,
9868 /** EnsureNode
9869*/
9870 PM_ENSURE_NODE = 50,
9871 /** ErrorRecoveryNode
9872*/
9873 PM_ERROR_RECOVERY_NODE = 51,
9874 /** FalseNode
9875*/
9876 PM_FALSE_NODE = 52,
9877 /** FindPatternNode
9878*/
9879 PM_FIND_PATTERN_NODE = 53,
9880 /** FlipFlopNode
9881*/
9882 PM_FLIP_FLOP_NODE = 54,
9883 /** FloatNode
9884*/
9885 PM_FLOAT_NODE = 55,
9886 /** ForNode
9887*/
9888 PM_FOR_NODE = 56,
9889 /** ForwardingArgumentsNode
9890*/
9891 PM_FORWARDING_ARGUMENTS_NODE = 57,
9892 /** ForwardingParameterNode
9893*/
9894 PM_FORWARDING_PARAMETER_NODE = 58,
9895 /** ForwardingSuperNode
9896*/
9897 PM_FORWARDING_SUPER_NODE = 59,
9898 /** GlobalVariableAndWriteNode
9899*/
9900 PM_GLOBAL_VARIABLE_AND_WRITE_NODE = 60,
9901 /** GlobalVariableOperatorWriteNode
9902*/
9903 PM_GLOBAL_VARIABLE_OPERATOR_WRITE_NODE = 61,
9904 /** GlobalVariableOrWriteNode
9905*/
9906 PM_GLOBAL_VARIABLE_OR_WRITE_NODE = 62,
9907 /** GlobalVariableReadNode
9908*/
9909 PM_GLOBAL_VARIABLE_READ_NODE = 63,
9910 /** GlobalVariableTargetNode
9911*/
9912 PM_GLOBAL_VARIABLE_TARGET_NODE = 64,
9913 /** GlobalVariableWriteNode
9914*/
9915 PM_GLOBAL_VARIABLE_WRITE_NODE = 65,
9916 /** HashNode
9917*/
9918 PM_HASH_NODE = 66,
9919 /** HashPatternNode
9920*/
9921 PM_HASH_PATTERN_NODE = 67,
9922 /** IfNode
9923*/
9924 PM_IF_NODE = 68,
9925 /** ImaginaryNode
9926*/
9927 PM_IMAGINARY_NODE = 69,
9928 /** ImplicitNode
9929*/
9930 PM_IMPLICIT_NODE = 70,
9931 /** ImplicitRestNode
9932*/
9933 PM_IMPLICIT_REST_NODE = 71,
9934 /** InNode
9935*/
9936 PM_IN_NODE = 72,
9937 /** IndexAndWriteNode
9938*/
9939 PM_INDEX_AND_WRITE_NODE = 73,
9940 /** IndexOperatorWriteNode
9941*/
9942 PM_INDEX_OPERATOR_WRITE_NODE = 74,
9943 /** IndexOrWriteNode
9944*/
9945 PM_INDEX_OR_WRITE_NODE = 75,
9946 /** IndexTargetNode
9947*/
9948 PM_INDEX_TARGET_NODE = 76,
9949 /** InstanceVariableAndWriteNode
9950*/
9951 PM_INSTANCE_VARIABLE_AND_WRITE_NODE = 77,
9952 /** InstanceVariableOperatorWriteNode
9953*/
9954 PM_INSTANCE_VARIABLE_OPERATOR_WRITE_NODE = 78,
9955 /** InstanceVariableOrWriteNode
9956*/
9957 PM_INSTANCE_VARIABLE_OR_WRITE_NODE = 79,
9958 /** InstanceVariableReadNode
9959*/
9960 PM_INSTANCE_VARIABLE_READ_NODE = 80,
9961 /** InstanceVariableTargetNode
9962*/
9963 PM_INSTANCE_VARIABLE_TARGET_NODE = 81,
9964 /** InstanceVariableWriteNode
9965*/
9966 PM_INSTANCE_VARIABLE_WRITE_NODE = 82,
9967 /** IntegerNode
9968*/
9969 PM_INTEGER_NODE = 83,
9970 /** InterpolatedMatchLastLineNode
9971*/
9972 PM_INTERPOLATED_MATCH_LAST_LINE_NODE = 84,
9973 /** InterpolatedRegularExpressionNode
9974*/
9975 PM_INTERPOLATED_REGULAR_EXPRESSION_NODE = 85,
9976 /** InterpolatedStringNode
9977*/
9978 PM_INTERPOLATED_STRING_NODE = 86,
9979 /** InterpolatedSymbolNode
9980*/
9981 PM_INTERPOLATED_SYMBOL_NODE = 87,
9982 /** InterpolatedXStringNode
9983*/
9984 PM_INTERPOLATED_X_STRING_NODE = 88,
9985 /** ItLocalVariableReadNode
9986*/
9987 PM_IT_LOCAL_VARIABLE_READ_NODE = 89,
9988 /** ItParametersNode
9989*/
9990 PM_IT_PARAMETERS_NODE = 90,
9991 /** KeywordHashNode
9992*/
9993 PM_KEYWORD_HASH_NODE = 91,
9994 /** KeywordRestParameterNode
9995*/
9996 PM_KEYWORD_REST_PARAMETER_NODE = 92,
9997 /** LambdaNode
9998*/
9999 PM_LAMBDA_NODE = 93,
10000 /** LocalVariableAndWriteNode
10001*/
10002 PM_LOCAL_VARIABLE_AND_WRITE_NODE = 94,
10003 /** LocalVariableOperatorWriteNode
10004*/
10005 PM_LOCAL_VARIABLE_OPERATOR_WRITE_NODE = 95,
10006 /** LocalVariableOrWriteNode
10007*/
10008 PM_LOCAL_VARIABLE_OR_WRITE_NODE = 96,
10009 /** LocalVariableReadNode
10010*/
10011 PM_LOCAL_VARIABLE_READ_NODE = 97,
10012 /** LocalVariableTargetNode
10013*/
10014 PM_LOCAL_VARIABLE_TARGET_NODE = 98,
10015 /** LocalVariableWriteNode
10016*/
10017 PM_LOCAL_VARIABLE_WRITE_NODE = 99,
10018 /** MatchLastLineNode
10019*/
10020 PM_MATCH_LAST_LINE_NODE = 100,
10021 /** MatchPredicateNode
10022*/
10023 PM_MATCH_PREDICATE_NODE = 101,
10024 /** MatchRequiredNode
10025*/
10026 PM_MATCH_REQUIRED_NODE = 102,
10027 /** MatchWriteNode
10028*/
10029 PM_MATCH_WRITE_NODE = 103,
10030 /** ModuleNode
10031*/
10032 PM_MODULE_NODE = 104,
10033 /** MultiTargetNode
10034*/
10035 PM_MULTI_TARGET_NODE = 105,
10036 /** MultiWriteNode
10037*/
10038 PM_MULTI_WRITE_NODE = 106,
10039 /** NextNode
10040*/
10041 PM_NEXT_NODE = 107,
10042 /** NilNode
10043*/
10044 PM_NIL_NODE = 108,
10045 /** NoBlockParameterNode
10046*/
10047 PM_NO_BLOCK_PARAMETER_NODE = 109,
10048 /** NoKeywordsParameterNode
10049*/
10050 PM_NO_KEYWORDS_PARAMETER_NODE = 110,
10051 /** NumberedParametersNode
10052*/
10053 PM_NUMBERED_PARAMETERS_NODE = 111,
10054 /** NumberedReferenceReadNode
10055*/
10056 PM_NUMBERED_REFERENCE_READ_NODE = 112,
10057 /** OptionalKeywordParameterNode
10058*/
10059 PM_OPTIONAL_KEYWORD_PARAMETER_NODE = 113,
10060 /** OptionalParameterNode
10061*/
10062 PM_OPTIONAL_PARAMETER_NODE = 114,
10063 /** OrNode
10064*/
10065 PM_OR_NODE = 115,
10066 /** ParametersNode
10067*/
10068 PM_PARAMETERS_NODE = 116,
10069 /** ParenthesesNode
10070*/
10071 PM_PARENTHESES_NODE = 117,
10072 /** PinnedExpressionNode
10073*/
10074 PM_PINNED_EXPRESSION_NODE = 118,
10075 /** PinnedVariableNode
10076*/
10077 PM_PINNED_VARIABLE_NODE = 119,
10078 /** PostExecutionNode
10079*/
10080 PM_POST_EXECUTION_NODE = 120,
10081 /** PreExecutionNode
10082*/
10083 PM_PRE_EXECUTION_NODE = 121,
10084 /** ProgramNode
10085*/
10086 PM_PROGRAM_NODE = 122,
10087 /** RangeNode
10088*/
10089 PM_RANGE_NODE = 123,
10090 /** RationalNode
10091*/
10092 PM_RATIONAL_NODE = 124,
10093 /** RedoNode
10094*/
10095 PM_REDO_NODE = 125,
10096 /** RegularExpressionNode
10097*/
10098 PM_REGULAR_EXPRESSION_NODE = 126,
10099 /** RequiredKeywordParameterNode
10100*/
10101 PM_REQUIRED_KEYWORD_PARAMETER_NODE = 127,
10102 /** RequiredParameterNode
10103*/
10104 PM_REQUIRED_PARAMETER_NODE = 128,
10105 /** RescueModifierNode
10106*/
10107 PM_RESCUE_MODIFIER_NODE = 129,
10108 /** RescueNode
10109*/
10110 PM_RESCUE_NODE = 130,
10111 /** RestParameterNode
10112*/
10113 PM_REST_PARAMETER_NODE = 131,
10114 /** RetryNode
10115*/
10116 PM_RETRY_NODE = 132,
10117 /** ReturnNode
10118*/
10119 PM_RETURN_NODE = 133,
10120 /** SelfNode
10121*/
10122 PM_SELF_NODE = 134,
10123 /** ShareableConstantNode
10124*/
10125 PM_SHAREABLE_CONSTANT_NODE = 135,
10126 /** SingletonClassNode
10127*/
10128 PM_SINGLETON_CLASS_NODE = 136,
10129 /** SourceEncodingNode
10130*/
10131 PM_SOURCE_ENCODING_NODE = 137,
10132 /** SourceFileNode
10133*/
10134 PM_SOURCE_FILE_NODE = 138,
10135 /** SourceLineNode
10136*/
10137 PM_SOURCE_LINE_NODE = 139,
10138 /** SplatNode
10139*/
10140 PM_SPLAT_NODE = 140,
10141 /** StatementsNode
10142*/
10143 PM_STATEMENTS_NODE = 141,
10144 /** StringNode
10145*/
10146 PM_STRING_NODE = 142,
10147 /** SuperNode
10148*/
10149 PM_SUPER_NODE = 143,
10150 /** SymbolNode
10151*/
10152 PM_SYMBOL_NODE = 144,
10153 /** TrueNode
10154*/
10155 PM_TRUE_NODE = 145,
10156 /** UndefNode
10157*/
10158 PM_UNDEF_NODE = 146,
10159 /** UnlessNode
10160*/
10161 PM_UNLESS_NODE = 147,
10162 /** UntilNode
10163*/
10164 PM_UNTIL_NODE = 148,
10165 /** WhenNode
10166*/
10167 PM_WHEN_NODE = 149,
10168 /** WhileNode
10169*/
10170 PM_WHILE_NODE = 150,
10171 /** XStringNode
10172*/
10173 PM_X_STRING_NODE = 151,
10174 /** YieldNode
10175*/
10176 PM_YIELD_NODE = 152,
10177 /** A special kind of node used for compilation.
10178*/
10179 PM_SCOPE_NODE = 153,
10180}
10181#[repr(u32)]
10182#[non_exhaustive]
10183/** Flags for arguments nodes.
10184*/
10185#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
10186pub enum pm_arguments_node_flags {
10187 /** if the arguments contain forwarding
10188*/
10189 PM_ARGUMENTS_NODE_FLAGS_CONTAINS_FORWARDING = 4,
10190 /** if the arguments contain keywords
10191*/
10192 PM_ARGUMENTS_NODE_FLAGS_CONTAINS_KEYWORDS = 8,
10193 /** if the arguments contain a keyword splat
10194*/
10195 PM_ARGUMENTS_NODE_FLAGS_CONTAINS_KEYWORD_SPLAT = 16,
10196 /** if the arguments contain a splat
10197*/
10198 PM_ARGUMENTS_NODE_FLAGS_CONTAINS_SPLAT = 32,
10199 /** if the arguments contain multiple splats
10200*/
10201 PM_ARGUMENTS_NODE_FLAGS_CONTAINS_MULTIPLE_SPLATS = 64,
10202 /** if the arguments contain multiple splats
10203*/
10204 PM_ARGUMENTS_NODE_FLAGS_LAST = 65,
10205}
10206#[repr(u32)]
10207#[non_exhaustive]
10208/** Flags for array nodes.
10209*/
10210#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
10211pub enum pm_array_node_flags {
10212 /** if array contains splat nodes
10213*/
10214 PM_ARRAY_NODE_FLAGS_CONTAINS_SPLAT = 4,
10215 /** if array contains splat nodes
10216*/
10217 PM_ARRAY_NODE_FLAGS_LAST = 5,
10218}
10219#[repr(u32)]
10220#[non_exhaustive]
10221/** Flags for call nodes.
10222*/
10223#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
10224pub enum pm_call_node_flags {
10225 /** &. operator
10226*/
10227 PM_CALL_NODE_FLAGS_SAFE_NAVIGATION = 4,
10228 /** a call that could have been a local variable
10229*/
10230 PM_CALL_NODE_FLAGS_VARIABLE_CALL = 8,
10231 /** a call that is an attribute write, so the value being written should be returned
10232*/
10233 PM_CALL_NODE_FLAGS_ATTRIBUTE_WRITE = 16,
10234 /** a call that ignores method visibility
10235*/
10236 PM_CALL_NODE_FLAGS_IGNORE_VISIBILITY = 32,
10237 /** a call that ignores method visibility
10238*/
10239 PM_CALL_NODE_FLAGS_LAST = 33,
10240}
10241#[repr(u32)]
10242#[non_exhaustive]
10243/** Flags for nodes that have unescaped content.
10244*/
10245#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
10246pub enum pm_encoding_flags {
10247 /** internal bytes forced the encoding to UTF-8
10248*/
10249 PM_ENCODING_FLAGS_FORCED_UTF8_ENCODING = 4,
10250 /** internal bytes forced the encoding to binary
10251*/
10252 PM_ENCODING_FLAGS_FORCED_BINARY_ENCODING = 8,
10253 /** internal bytes forced the encoding to binary
10254*/
10255 PM_ENCODING_FLAGS_LAST = 9,
10256}
10257#[repr(u32)]
10258#[non_exhaustive]
10259/** Flags for integer nodes that correspond to the base of the integer.
10260*/
10261#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
10262pub enum pm_integer_base_flags {
10263 /** 0b prefix
10264*/
10265 PM_INTEGER_BASE_FLAGS_BINARY = 4,
10266 /** 0d or no prefix
10267*/
10268 PM_INTEGER_BASE_FLAGS_DECIMAL = 8,
10269 /** 0o or 0 prefix
10270*/
10271 PM_INTEGER_BASE_FLAGS_OCTAL = 16,
10272 /** 0x prefix
10273*/
10274 PM_INTEGER_BASE_FLAGS_HEXADECIMAL = 32,
10275 /** 0x prefix
10276*/
10277 PM_INTEGER_BASE_FLAGS_LAST = 33,
10278}
10279#[repr(u32)]
10280#[non_exhaustive]
10281/** Flags for interpolated string nodes that indicated mutability if they are also marked as literals.
10282*/
10283#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
10284pub enum pm_interpolated_string_node_flags {
10285 /** frozen by virtue of a `frozen_string_literal: true` comment or `--enable-frozen-string-literal`; only for adjacent string literals like `'a' 'b'`
10286*/
10287 PM_INTERPOLATED_STRING_NODE_FLAGS_FROZEN = 4,
10288 /** mutable by virtue of a `frozen_string_literal: false` comment or `--disable-frozen-string-literal`; only for adjacent string literals like `'a' 'b'`
10289*/
10290 PM_INTERPOLATED_STRING_NODE_FLAGS_MUTABLE = 8,
10291 /** mutable by virtue of a `frozen_string_literal: false` comment or `--disable-frozen-string-literal`; only for adjacent string literals like `'a' 'b'`
10292*/
10293 PM_INTERPOLATED_STRING_NODE_FLAGS_LAST = 9,
10294}
10295#[repr(u32)]
10296#[non_exhaustive]
10297/** Flags for keyword hash nodes.
10298*/
10299#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
10300pub enum pm_keyword_hash_node_flags {
10301 /** a keyword hash which only has `AssocNode` elements all with symbol keys, which means the elements can be treated as keyword arguments
10302*/
10303 PM_KEYWORD_HASH_NODE_FLAGS_SYMBOL_KEYS = 4,
10304 /** a keyword hash which only has `AssocNode` elements all with symbol keys, which means the elements can be treated as keyword arguments
10305*/
10306 PM_KEYWORD_HASH_NODE_FLAGS_LAST = 5,
10307}
10308#[repr(u32)]
10309#[non_exhaustive]
10310/** Flags for while and until loop nodes.
10311*/
10312#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
10313pub enum pm_loop_flags {
10314 /** a loop after a begin statement, so the body is executed first before the condition
10315*/
10316 PM_LOOP_FLAGS_BEGIN_MODIFIER = 4,
10317 /** a loop after a begin statement, so the body is executed first before the condition
10318*/
10319 PM_LOOP_FLAGS_LAST = 5,
10320}
10321#[repr(u32)]
10322#[non_exhaustive]
10323/** Flags for parameter nodes.
10324*/
10325#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
10326pub enum pm_parameter_flags {
10327 /** a parameter name that has been repeated in the method signature
10328*/
10329 PM_PARAMETER_FLAGS_REPEATED_PARAMETER = 4,
10330 /** a parameter name that has been repeated in the method signature
10331*/
10332 PM_PARAMETER_FLAGS_LAST = 5,
10333}
10334#[repr(u32)]
10335#[non_exhaustive]
10336/** Flags for parentheses nodes.
10337*/
10338#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
10339pub enum pm_parentheses_node_flags {
10340 /** parentheses that contain multiple potentially void statements
10341*/
10342 PM_PARENTHESES_NODE_FLAGS_MULTIPLE_STATEMENTS = 4,
10343 /** parentheses that contain multiple potentially void statements
10344*/
10345 PM_PARENTHESES_NODE_FLAGS_LAST = 5,
10346}
10347#[repr(u32)]
10348#[non_exhaustive]
10349/** Flags for range and flip-flop nodes.
10350*/
10351#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
10352pub enum pm_range_flags {
10353 /** ... operator
10354*/
10355 PM_RANGE_FLAGS_EXCLUDE_END = 4,
10356 /** ... operator
10357*/
10358 PM_RANGE_FLAGS_LAST = 5,
10359}
10360#[repr(u32)]
10361#[non_exhaustive]
10362/** Flags for regular expression and match last line nodes.
10363*/
10364#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
10365pub enum pm_regular_expression_flags {
10366 /** i - ignores the case of characters when matching
10367*/
10368 PM_REGULAR_EXPRESSION_FLAGS_IGNORE_CASE = 4,
10369 /** x - ignores whitespace and allows comments in regular expressions
10370*/
10371 PM_REGULAR_EXPRESSION_FLAGS_EXTENDED = 8,
10372 /** m - allows $ to match the end of lines within strings
10373*/
10374 PM_REGULAR_EXPRESSION_FLAGS_MULTI_LINE = 16,
10375 /** o - only interpolates values into the regular expression once
10376*/
10377 PM_REGULAR_EXPRESSION_FLAGS_ONCE = 32,
10378 /** e - forces the EUC-JP encoding
10379*/
10380 PM_REGULAR_EXPRESSION_FLAGS_EUC_JP = 64,
10381 /** n - forces the ASCII-8BIT encoding
10382*/
10383 PM_REGULAR_EXPRESSION_FLAGS_ASCII_8BIT = 128,
10384 /** s - forces the Windows-31J encoding
10385*/
10386 PM_REGULAR_EXPRESSION_FLAGS_WINDOWS_31J = 256,
10387 /** u - forces the UTF-8 encoding
10388*/
10389 PM_REGULAR_EXPRESSION_FLAGS_UTF_8 = 512,
10390 /** internal bytes forced the encoding to UTF-8
10391*/
10392 PM_REGULAR_EXPRESSION_FLAGS_FORCED_UTF8_ENCODING = 1024,
10393 /** internal bytes forced the encoding to binary
10394*/
10395 PM_REGULAR_EXPRESSION_FLAGS_FORCED_BINARY_ENCODING = 2048,
10396 /** internal bytes forced the encoding to US-ASCII
10397*/
10398 PM_REGULAR_EXPRESSION_FLAGS_FORCED_US_ASCII_ENCODING = 4096,
10399 /** internal bytes forced the encoding to US-ASCII
10400*/
10401 PM_REGULAR_EXPRESSION_FLAGS_LAST = 4097,
10402}
10403#[repr(u32)]
10404#[non_exhaustive]
10405/** Flags for shareable constant nodes.
10406*/
10407#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
10408pub enum pm_shareable_constant_node_flags {
10409 /** constant writes that should be modified with shareable constant value literal
10410*/
10411 PM_SHAREABLE_CONSTANT_NODE_FLAGS_LITERAL = 4,
10412 /** constant writes that should be modified with shareable constant value experimental everything
10413*/
10414 PM_SHAREABLE_CONSTANT_NODE_FLAGS_EXPERIMENTAL_EVERYTHING = 8,
10415 /** constant writes that should be modified with shareable constant value experimental copy
10416*/
10417 PM_SHAREABLE_CONSTANT_NODE_FLAGS_EXPERIMENTAL_COPY = 16,
10418 /** constant writes that should be modified with shareable constant value experimental copy
10419*/
10420 PM_SHAREABLE_CONSTANT_NODE_FLAGS_LAST = 17,
10421}
10422#[repr(u32)]
10423#[non_exhaustive]
10424/** Flags for statement lists.
10425*/
10426#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
10427pub enum pm_statements_flags {
10428 /** the statement list directly contains a `BEGIN` block
10429*/
10430 PM_STATEMENTS_FLAGS_CONTAINS_PRE_EXECUTION = 4,
10431 /** the statement list directly contains a `BEGIN` block
10432*/
10433 PM_STATEMENTS_FLAGS_LAST = 5,
10434}
10435#[repr(u32)]
10436#[non_exhaustive]
10437/** Flags for string nodes.
10438*/
10439#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
10440pub enum pm_string_flags {
10441 /** internal bytes forced the encoding to UTF-8
10442*/
10443 PM_STRING_FLAGS_FORCED_UTF8_ENCODING = 4,
10444 /** internal bytes forced the encoding to binary
10445*/
10446 PM_STRING_FLAGS_FORCED_BINARY_ENCODING = 8,
10447 /** frozen by virtue of a `frozen_string_literal: true` comment or `--enable-frozen-string-literal`
10448*/
10449 PM_STRING_FLAGS_FROZEN = 16,
10450 /** mutable by virtue of a `frozen_string_literal: false` comment or `--disable-frozen-string-literal`
10451*/
10452 PM_STRING_FLAGS_MUTABLE = 32,
10453 /** mutable by virtue of a `frozen_string_literal: false` comment or `--disable-frozen-string-literal`
10454*/
10455 PM_STRING_FLAGS_LAST = 33,
10456}
10457#[repr(u32)]
10458#[non_exhaustive]
10459/** Flags for symbol nodes.
10460*/
10461#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
10462pub enum pm_symbol_flags {
10463 /** internal bytes forced the encoding to UTF-8
10464*/
10465 PM_SYMBOL_FLAGS_FORCED_UTF8_ENCODING = 4,
10466 /** internal bytes forced the encoding to binary
10467*/
10468 PM_SYMBOL_FLAGS_FORCED_BINARY_ENCODING = 8,
10469 /** internal bytes forced the encoding to US-ASCII
10470*/
10471 PM_SYMBOL_FLAGS_FORCED_US_ASCII_ENCODING = 16,
10472 /** internal bytes forced the encoding to US-ASCII
10473*/
10474 PM_SYMBOL_FLAGS_LAST = 17,
10475}
10476#[repr(u32)]
10477#[non_exhaustive]
10478/** The levels of errors generated during parsing.
10479*/
10480#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
10481pub enum pm_error_level_t {
10482 /** For errors that should raise a syntax error.
10483*/
10484 PM_ERROR_LEVEL_SYNTAX = 0,
10485 /** For errors that should raise an argument error.
10486*/
10487 PM_ERROR_LEVEL_ARGUMENT = 1,
10488 /** For errors that should raise a load error.
10489*/
10490 PM_ERROR_LEVEL_LOAD = 2,
10491 /** For errors that should raise a system stack error. These mean that the
10492 parser ran out of the stack it was given, not that the source is
10493 invalid, so the same source may parse with more stack.
10494*/
10495 PM_ERROR_LEVEL_STACK = 3,
10496 /** For errors that should raise an encoding compatibility error.
10497*/
10498 PM_ERROR_LEVEL_ENCODING_COMPATIBILITY = 4,
10499}
10500#[repr(u32)]
10501#[non_exhaustive]
10502/** The levels of warnings generated during parsing.
10503*/
10504#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
10505pub enum pm_warning_level_t {
10506 /** For warnings which should be emitted if $VERBOSE != nil.
10507*/
10508 PM_WARNING_LEVEL_DEFAULT = 0,
10509 /** For warnings which should be emitted if $VERBOSE == true.
10510*/
10511 PM_WARNING_LEVEL_VERBOSE = 1,
10512}
10513#[repr(u32)]
10514#[non_exhaustive]
10515/** This is the type of a comment that we've found while parsing.
10516*/
10517#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
10518pub enum pm_comment_type_t {
10519 PM_COMMENT_INLINE = 0,
10520 PM_COMMENT_EMBDOC = 1,
10521}
10522/** The words of the magnitude. Read them through pm_integer_words or
10523 pm_integer_uint64_value rather than directly.
10524*/
10525#[repr(C)]
10526#[derive(Copy, Clone)]
10527pub union pm_integer_t__bindgen_ty_1 {
10528 /** The words of an integer whose length is at most 2. Words past the
10529 length are zero.
10530*/
10531 pub value: [u32; 2usize],
10532 /** The words of an integer whose length is greater than 2.
10533*/
10534 pub values: *mut u32,
10535}
10536impl Default for pm_constant_id_list_t {
10537 fn default() -> Self {
10538 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
10539 unsafe {
10540 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
10541 s.assume_init()
10542 }
10543 }
10544}
10545impl Default for pm_integer_t__bindgen_ty_1 {
10546 fn default() -> Self {
10547 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
10548 unsafe {
10549 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
10550 s.assume_init()
10551 }
10552 }
10553}
10554impl ::std::fmt::Debug for pm_integer_t__bindgen_ty_1 {
10555 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
10556 write!(f, "pm_integer_t__bindgen_ty_1 {{ union }}")
10557 }
10558}
10559impl Default for pm_integer_t {
10560 fn default() -> Self {
10561 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
10562 unsafe {
10563 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
10564 s.assume_init()
10565 }
10566 }
10567}
10568impl ::std::fmt::Debug for pm_integer_t {
10569 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
10570 write!(
10571 f,
10572 "pm_integer_t {{ negative: {:?}, words: {:?} }}",
10573 self.negative,
10574 self.words,
10575 )
10576 }
10577}
10578impl Default for pm_string_t {
10579 fn default() -> Self {
10580 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
10581 unsafe {
10582 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
10583 s.assume_init()
10584 }
10585 }
10586}
10587impl Default for pm_node_list {
10588 fn default() -> Self {
10589 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
10590 unsafe {
10591 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
10592 s.assume_init()
10593 }
10594 }
10595}
10596impl Default for pm_alias_global_variable_node {
10597 fn default() -> Self {
10598 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
10599 unsafe {
10600 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
10601 s.assume_init()
10602 }
10603 }
10604}
10605impl Default for pm_alias_method_node {
10606 fn default() -> Self {
10607 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
10608 unsafe {
10609 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
10610 s.assume_init()
10611 }
10612 }
10613}
10614impl Default for pm_alternation_pattern_node {
10615 fn default() -> Self {
10616 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
10617 unsafe {
10618 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
10619 s.assume_init()
10620 }
10621 }
10622}
10623impl Default for pm_and_node {
10624 fn default() -> Self {
10625 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
10626 unsafe {
10627 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
10628 s.assume_init()
10629 }
10630 }
10631}
10632impl Default for pm_arguments_node {
10633 fn default() -> Self {
10634 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
10635 unsafe {
10636 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
10637 s.assume_init()
10638 }
10639 }
10640}
10641impl Default for pm_array_node {
10642 fn default() -> Self {
10643 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
10644 unsafe {
10645 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
10646 s.assume_init()
10647 }
10648 }
10649}
10650impl Default for pm_array_pattern_node {
10651 fn default() -> Self {
10652 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
10653 unsafe {
10654 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
10655 s.assume_init()
10656 }
10657 }
10658}
10659impl Default for pm_assoc_node {
10660 fn default() -> Self {
10661 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
10662 unsafe {
10663 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
10664 s.assume_init()
10665 }
10666 }
10667}
10668impl Default for pm_assoc_splat_node {
10669 fn default() -> Self {
10670 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
10671 unsafe {
10672 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
10673 s.assume_init()
10674 }
10675 }
10676}
10677impl Default for pm_begin_node {
10678 fn default() -> Self {
10679 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
10680 unsafe {
10681 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
10682 s.assume_init()
10683 }
10684 }
10685}
10686impl Default for pm_block_argument_node {
10687 fn default() -> Self {
10688 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
10689 unsafe {
10690 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
10691 s.assume_init()
10692 }
10693 }
10694}
10695impl Default for pm_block_node {
10696 fn default() -> Self {
10697 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
10698 unsafe {
10699 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
10700 s.assume_init()
10701 }
10702 }
10703}
10704impl Default for pm_block_parameters_node {
10705 fn default() -> Self {
10706 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
10707 unsafe {
10708 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
10709 s.assume_init()
10710 }
10711 }
10712}
10713impl Default for pm_break_node {
10714 fn default() -> Self {
10715 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
10716 unsafe {
10717 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
10718 s.assume_init()
10719 }
10720 }
10721}
10722impl Default for pm_call_and_write_node {
10723 fn default() -> Self {
10724 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
10725 unsafe {
10726 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
10727 s.assume_init()
10728 }
10729 }
10730}
10731impl Default for pm_call_node {
10732 fn default() -> Self {
10733 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
10734 unsafe {
10735 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
10736 s.assume_init()
10737 }
10738 }
10739}
10740impl Default for pm_call_operator_write_node {
10741 fn default() -> Self {
10742 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
10743 unsafe {
10744 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
10745 s.assume_init()
10746 }
10747 }
10748}
10749impl Default for pm_call_or_write_node {
10750 fn default() -> Self {
10751 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
10752 unsafe {
10753 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
10754 s.assume_init()
10755 }
10756 }
10757}
10758impl Default for pm_call_target_node {
10759 fn default() -> Self {
10760 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
10761 unsafe {
10762 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
10763 s.assume_init()
10764 }
10765 }
10766}
10767impl Default for pm_capture_pattern_node {
10768 fn default() -> Self {
10769 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
10770 unsafe {
10771 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
10772 s.assume_init()
10773 }
10774 }
10775}
10776impl Default for pm_case_match_node {
10777 fn default() -> Self {
10778 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
10779 unsafe {
10780 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
10781 s.assume_init()
10782 }
10783 }
10784}
10785impl Default for pm_case_node {
10786 fn default() -> Self {
10787 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
10788 unsafe {
10789 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
10790 s.assume_init()
10791 }
10792 }
10793}
10794impl Default for pm_class_node {
10795 fn default() -> Self {
10796 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
10797 unsafe {
10798 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
10799 s.assume_init()
10800 }
10801 }
10802}
10803impl Default for pm_class_variable_and_write_node {
10804 fn default() -> Self {
10805 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
10806 unsafe {
10807 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
10808 s.assume_init()
10809 }
10810 }
10811}
10812impl Default for pm_class_variable_operator_write_node {
10813 fn default() -> Self {
10814 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
10815 unsafe {
10816 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
10817 s.assume_init()
10818 }
10819 }
10820}
10821impl Default for pm_class_variable_or_write_node {
10822 fn default() -> Self {
10823 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
10824 unsafe {
10825 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
10826 s.assume_init()
10827 }
10828 }
10829}
10830impl Default for pm_class_variable_write_node {
10831 fn default() -> Self {
10832 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
10833 unsafe {
10834 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
10835 s.assume_init()
10836 }
10837 }
10838}
10839impl Default for pm_constant_and_write_node {
10840 fn default() -> Self {
10841 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
10842 unsafe {
10843 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
10844 s.assume_init()
10845 }
10846 }
10847}
10848impl Default for pm_constant_operator_write_node {
10849 fn default() -> Self {
10850 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
10851 unsafe {
10852 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
10853 s.assume_init()
10854 }
10855 }
10856}
10857impl Default for pm_constant_or_write_node {
10858 fn default() -> Self {
10859 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
10860 unsafe {
10861 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
10862 s.assume_init()
10863 }
10864 }
10865}
10866impl Default for pm_constant_path_and_write_node {
10867 fn default() -> Self {
10868 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
10869 unsafe {
10870 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
10871 s.assume_init()
10872 }
10873 }
10874}
10875impl Default for pm_constant_path_node {
10876 fn default() -> Self {
10877 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
10878 unsafe {
10879 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
10880 s.assume_init()
10881 }
10882 }
10883}
10884impl Default for pm_constant_path_operator_write_node {
10885 fn default() -> Self {
10886 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
10887 unsafe {
10888 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
10889 s.assume_init()
10890 }
10891 }
10892}
10893impl Default for pm_constant_path_or_write_node {
10894 fn default() -> Self {
10895 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
10896 unsafe {
10897 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
10898 s.assume_init()
10899 }
10900 }
10901}
10902impl Default for pm_constant_path_target_node {
10903 fn default() -> Self {
10904 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
10905 unsafe {
10906 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
10907 s.assume_init()
10908 }
10909 }
10910}
10911impl Default for pm_constant_path_write_node {
10912 fn default() -> Self {
10913 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
10914 unsafe {
10915 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
10916 s.assume_init()
10917 }
10918 }
10919}
10920impl Default for pm_constant_write_node {
10921 fn default() -> Self {
10922 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
10923 unsafe {
10924 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
10925 s.assume_init()
10926 }
10927 }
10928}
10929impl Default for pm_def_node {
10930 fn default() -> Self {
10931 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
10932 unsafe {
10933 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
10934 s.assume_init()
10935 }
10936 }
10937}
10938impl Default for pm_defined_node {
10939 fn default() -> Self {
10940 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
10941 unsafe {
10942 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
10943 s.assume_init()
10944 }
10945 }
10946}
10947impl Default for pm_else_node {
10948 fn default() -> Self {
10949 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
10950 unsafe {
10951 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
10952 s.assume_init()
10953 }
10954 }
10955}
10956impl Default for pm_embedded_statements_node {
10957 fn default() -> Self {
10958 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
10959 unsafe {
10960 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
10961 s.assume_init()
10962 }
10963 }
10964}
10965impl Default for pm_embedded_variable_node {
10966 fn default() -> Self {
10967 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
10968 unsafe {
10969 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
10970 s.assume_init()
10971 }
10972 }
10973}
10974impl Default for pm_ensure_node {
10975 fn default() -> Self {
10976 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
10977 unsafe {
10978 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
10979 s.assume_init()
10980 }
10981 }
10982}
10983impl Default for pm_error_recovery_node {
10984 fn default() -> Self {
10985 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
10986 unsafe {
10987 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
10988 s.assume_init()
10989 }
10990 }
10991}
10992impl Default for pm_find_pattern_node {
10993 fn default() -> Self {
10994 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
10995 unsafe {
10996 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
10997 s.assume_init()
10998 }
10999 }
11000}
11001impl Default for pm_flip_flop_node {
11002 fn default() -> Self {
11003 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
11004 unsafe {
11005 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
11006 s.assume_init()
11007 }
11008 }
11009}
11010impl Default for pm_for_node {
11011 fn default() -> Self {
11012 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
11013 unsafe {
11014 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
11015 s.assume_init()
11016 }
11017 }
11018}
11019impl Default for pm_forwarding_super_node {
11020 fn default() -> Self {
11021 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
11022 unsafe {
11023 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
11024 s.assume_init()
11025 }
11026 }
11027}
11028impl Default for pm_global_variable_and_write_node {
11029 fn default() -> Self {
11030 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
11031 unsafe {
11032 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
11033 s.assume_init()
11034 }
11035 }
11036}
11037impl Default for pm_global_variable_operator_write_node {
11038 fn default() -> Self {
11039 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
11040 unsafe {
11041 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
11042 s.assume_init()
11043 }
11044 }
11045}
11046impl Default for pm_global_variable_or_write_node {
11047 fn default() -> Self {
11048 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
11049 unsafe {
11050 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
11051 s.assume_init()
11052 }
11053 }
11054}
11055impl Default for pm_global_variable_write_node {
11056 fn default() -> Self {
11057 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
11058 unsafe {
11059 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
11060 s.assume_init()
11061 }
11062 }
11063}
11064impl Default for pm_hash_node {
11065 fn default() -> Self {
11066 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
11067 unsafe {
11068 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
11069 s.assume_init()
11070 }
11071 }
11072}
11073impl Default for pm_hash_pattern_node {
11074 fn default() -> Self {
11075 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
11076 unsafe {
11077 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
11078 s.assume_init()
11079 }
11080 }
11081}
11082impl Default for pm_if_node {
11083 fn default() -> Self {
11084 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
11085 unsafe {
11086 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
11087 s.assume_init()
11088 }
11089 }
11090}
11091impl Default for pm_imaginary_node {
11092 fn default() -> Self {
11093 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
11094 unsafe {
11095 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
11096 s.assume_init()
11097 }
11098 }
11099}
11100impl Default for pm_implicit_node {
11101 fn default() -> Self {
11102 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
11103 unsafe {
11104 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
11105 s.assume_init()
11106 }
11107 }
11108}
11109impl Default for pm_in_node {
11110 fn default() -> Self {
11111 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
11112 unsafe {
11113 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
11114 s.assume_init()
11115 }
11116 }
11117}
11118impl Default for pm_index_and_write_node {
11119 fn default() -> Self {
11120 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
11121 unsafe {
11122 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
11123 s.assume_init()
11124 }
11125 }
11126}
11127impl Default for pm_index_operator_write_node {
11128 fn default() -> Self {
11129 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
11130 unsafe {
11131 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
11132 s.assume_init()
11133 }
11134 }
11135}
11136impl Default for pm_index_or_write_node {
11137 fn default() -> Self {
11138 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
11139 unsafe {
11140 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
11141 s.assume_init()
11142 }
11143 }
11144}
11145impl Default for pm_index_target_node {
11146 fn default() -> Self {
11147 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
11148 unsafe {
11149 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
11150 s.assume_init()
11151 }
11152 }
11153}
11154impl Default for pm_instance_variable_and_write_node {
11155 fn default() -> Self {
11156 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
11157 unsafe {
11158 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
11159 s.assume_init()
11160 }
11161 }
11162}
11163impl Default for pm_instance_variable_operator_write_node {
11164 fn default() -> Self {
11165 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
11166 unsafe {
11167 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
11168 s.assume_init()
11169 }
11170 }
11171}
11172impl Default for pm_instance_variable_or_write_node {
11173 fn default() -> Self {
11174 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
11175 unsafe {
11176 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
11177 s.assume_init()
11178 }
11179 }
11180}
11181impl Default for pm_instance_variable_write_node {
11182 fn default() -> Self {
11183 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
11184 unsafe {
11185 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
11186 s.assume_init()
11187 }
11188 }
11189}
11190impl Default for pm_integer_node {
11191 fn default() -> Self {
11192 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
11193 unsafe {
11194 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
11195 s.assume_init()
11196 }
11197 }
11198}
11199impl ::std::fmt::Debug for pm_integer_node {
11200 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
11201 write!(f, "pm_integer_node {{ base: {:?}, value: {:?} }}", self.base, self.value)
11202 }
11203}
11204impl Default for pm_interpolated_match_last_line_node {
11205 fn default() -> Self {
11206 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
11207 unsafe {
11208 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
11209 s.assume_init()
11210 }
11211 }
11212}
11213impl Default for pm_interpolated_regular_expression_node {
11214 fn default() -> Self {
11215 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
11216 unsafe {
11217 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
11218 s.assume_init()
11219 }
11220 }
11221}
11222impl Default for pm_interpolated_string_node {
11223 fn default() -> Self {
11224 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
11225 unsafe {
11226 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
11227 s.assume_init()
11228 }
11229 }
11230}
11231impl Default for pm_interpolated_symbol_node {
11232 fn default() -> Self {
11233 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
11234 unsafe {
11235 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
11236 s.assume_init()
11237 }
11238 }
11239}
11240impl Default for pm_interpolated_x_string_node {
11241 fn default() -> Self {
11242 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
11243 unsafe {
11244 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
11245 s.assume_init()
11246 }
11247 }
11248}
11249impl Default for pm_keyword_hash_node {
11250 fn default() -> Self {
11251 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
11252 unsafe {
11253 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
11254 s.assume_init()
11255 }
11256 }
11257}
11258impl Default for pm_lambda_node {
11259 fn default() -> Self {
11260 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
11261 unsafe {
11262 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
11263 s.assume_init()
11264 }
11265 }
11266}
11267impl Default for pm_local_variable_and_write_node {
11268 fn default() -> Self {
11269 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
11270 unsafe {
11271 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
11272 s.assume_init()
11273 }
11274 }
11275}
11276impl Default for pm_local_variable_operator_write_node {
11277 fn default() -> Self {
11278 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
11279 unsafe {
11280 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
11281 s.assume_init()
11282 }
11283 }
11284}
11285impl Default for pm_local_variable_or_write_node {
11286 fn default() -> Self {
11287 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
11288 unsafe {
11289 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
11290 s.assume_init()
11291 }
11292 }
11293}
11294impl Default for pm_local_variable_write_node {
11295 fn default() -> Self {
11296 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
11297 unsafe {
11298 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
11299 s.assume_init()
11300 }
11301 }
11302}
11303impl Default for pm_match_last_line_node {
11304 fn default() -> Self {
11305 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
11306 unsafe {
11307 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
11308 s.assume_init()
11309 }
11310 }
11311}
11312impl Default for pm_match_predicate_node {
11313 fn default() -> Self {
11314 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
11315 unsafe {
11316 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
11317 s.assume_init()
11318 }
11319 }
11320}
11321impl Default for pm_match_required_node {
11322 fn default() -> Self {
11323 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
11324 unsafe {
11325 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
11326 s.assume_init()
11327 }
11328 }
11329}
11330impl Default for pm_match_write_node {
11331 fn default() -> Self {
11332 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
11333 unsafe {
11334 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
11335 s.assume_init()
11336 }
11337 }
11338}
11339impl Default for pm_module_node {
11340 fn default() -> Self {
11341 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
11342 unsafe {
11343 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
11344 s.assume_init()
11345 }
11346 }
11347}
11348impl Default for pm_multi_target_node {
11349 fn default() -> Self {
11350 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
11351 unsafe {
11352 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
11353 s.assume_init()
11354 }
11355 }
11356}
11357impl Default for pm_multi_write_node {
11358 fn default() -> Self {
11359 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
11360 unsafe {
11361 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
11362 s.assume_init()
11363 }
11364 }
11365}
11366impl Default for pm_next_node {
11367 fn default() -> Self {
11368 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
11369 unsafe {
11370 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
11371 s.assume_init()
11372 }
11373 }
11374}
11375impl Default for pm_optional_keyword_parameter_node {
11376 fn default() -> Self {
11377 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
11378 unsafe {
11379 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
11380 s.assume_init()
11381 }
11382 }
11383}
11384impl Default for pm_optional_parameter_node {
11385 fn default() -> Self {
11386 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
11387 unsafe {
11388 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
11389 s.assume_init()
11390 }
11391 }
11392}
11393impl Default for pm_or_node {
11394 fn default() -> Self {
11395 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
11396 unsafe {
11397 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
11398 s.assume_init()
11399 }
11400 }
11401}
11402impl Default for pm_parameters_node {
11403 fn default() -> Self {
11404 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
11405 unsafe {
11406 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
11407 s.assume_init()
11408 }
11409 }
11410}
11411impl Default for pm_parentheses_node {
11412 fn default() -> Self {
11413 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
11414 unsafe {
11415 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
11416 s.assume_init()
11417 }
11418 }
11419}
11420impl Default for pm_pinned_expression_node {
11421 fn default() -> Self {
11422 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
11423 unsafe {
11424 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
11425 s.assume_init()
11426 }
11427 }
11428}
11429impl Default for pm_pinned_variable_node {
11430 fn default() -> Self {
11431 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
11432 unsafe {
11433 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
11434 s.assume_init()
11435 }
11436 }
11437}
11438impl Default for pm_post_execution_node {
11439 fn default() -> Self {
11440 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
11441 unsafe {
11442 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
11443 s.assume_init()
11444 }
11445 }
11446}
11447impl Default for pm_pre_execution_node {
11448 fn default() -> Self {
11449 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
11450 unsafe {
11451 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
11452 s.assume_init()
11453 }
11454 }
11455}
11456impl Default for pm_program_node {
11457 fn default() -> Self {
11458 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
11459 unsafe {
11460 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
11461 s.assume_init()
11462 }
11463 }
11464}
11465impl Default for pm_range_node {
11466 fn default() -> Self {
11467 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
11468 unsafe {
11469 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
11470 s.assume_init()
11471 }
11472 }
11473}
11474impl Default for pm_rational_node {
11475 fn default() -> Self {
11476 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
11477 unsafe {
11478 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
11479 s.assume_init()
11480 }
11481 }
11482}
11483impl ::std::fmt::Debug for pm_rational_node {
11484 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
11485 write!(
11486 f,
11487 "pm_rational_node {{ base: {:?}, numerator: {:?}, denominator: {:?} }}",
11488 self.base,
11489 self.numerator,
11490 self.denominator,
11491 )
11492 }
11493}
11494impl Default for pm_regular_expression_node {
11495 fn default() -> Self {
11496 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
11497 unsafe {
11498 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
11499 s.assume_init()
11500 }
11501 }
11502}
11503impl Default for pm_rescue_modifier_node {
11504 fn default() -> Self {
11505 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
11506 unsafe {
11507 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
11508 s.assume_init()
11509 }
11510 }
11511}
11512impl Default for pm_rescue_node {
11513 fn default() -> Self {
11514 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
11515 unsafe {
11516 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
11517 s.assume_init()
11518 }
11519 }
11520}
11521impl Default for pm_return_node {
11522 fn default() -> Self {
11523 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
11524 unsafe {
11525 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
11526 s.assume_init()
11527 }
11528 }
11529}
11530impl Default for pm_shareable_constant_node {
11531 fn default() -> Self {
11532 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
11533 unsafe {
11534 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
11535 s.assume_init()
11536 }
11537 }
11538}
11539impl Default for pm_singleton_class_node {
11540 fn default() -> Self {
11541 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
11542 unsafe {
11543 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
11544 s.assume_init()
11545 }
11546 }
11547}
11548impl Default for pm_source_file_node {
11549 fn default() -> Self {
11550 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
11551 unsafe {
11552 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
11553 s.assume_init()
11554 }
11555 }
11556}
11557impl Default for pm_splat_node {
11558 fn default() -> Self {
11559 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
11560 unsafe {
11561 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
11562 s.assume_init()
11563 }
11564 }
11565}
11566impl Default for pm_statements_node {
11567 fn default() -> Self {
11568 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
11569 unsafe {
11570 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
11571 s.assume_init()
11572 }
11573 }
11574}
11575impl Default for pm_string_node {
11576 fn default() -> Self {
11577 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
11578 unsafe {
11579 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
11580 s.assume_init()
11581 }
11582 }
11583}
11584impl Default for pm_super_node {
11585 fn default() -> Self {
11586 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
11587 unsafe {
11588 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
11589 s.assume_init()
11590 }
11591 }
11592}
11593impl Default for pm_symbol_node {
11594 fn default() -> Self {
11595 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
11596 unsafe {
11597 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
11598 s.assume_init()
11599 }
11600 }
11601}
11602impl Default for pm_undef_node {
11603 fn default() -> Self {
11604 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
11605 unsafe {
11606 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
11607 s.assume_init()
11608 }
11609 }
11610}
11611impl Default for pm_unless_node {
11612 fn default() -> Self {
11613 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
11614 unsafe {
11615 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
11616 s.assume_init()
11617 }
11618 }
11619}
11620impl Default for pm_until_node {
11621 fn default() -> Self {
11622 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
11623 unsafe {
11624 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
11625 s.assume_init()
11626 }
11627 }
11628}
11629impl Default for pm_when_node {
11630 fn default() -> Self {
11631 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
11632 unsafe {
11633 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
11634 s.assume_init()
11635 }
11636 }
11637}
11638impl Default for pm_while_node {
11639 fn default() -> Self {
11640 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
11641 unsafe {
11642 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
11643 s.assume_init()
11644 }
11645 }
11646}
11647impl Default for pm_x_string_node {
11648 fn default() -> Self {
11649 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
11650 unsafe {
11651 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
11652 s.assume_init()
11653 }
11654 }
11655}
11656impl Default for pm_yield_node {
11657 fn default() -> Self {
11658 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
11659 unsafe {
11660 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
11661 s.assume_init()
11662 }
11663 }
11664}
11665impl Default for pm_line_offset_list_t {
11666 fn default() -> Self {
11667 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
11668 unsafe {
11669 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
11670 s.assume_init()
11671 }
11672 }
11673}
11674unsafe extern "C" {
11675 /** Returns a newly allocated and initialized arena. If the arena cannot be
11676 allocated, this function aborts the process.
11677
11678 @returns A pointer to the newly allocated arena. It is the responsibility of
11679 the caller to free the arena using pm_arena_free when it is no longer
11680 needed.
11681*/
11682 pub fn pm_arena_new() -> *mut pm_arena_t;
11683 /** Frees both the held memory and the arena itself.
11684
11685 @param arena The arena to free.
11686*/
11687 pub fn pm_arena_free(arena: *mut pm_arena_t);
11688 /** Return a raw pointer to the start of a constant.
11689
11690 @param constant The constant to get the start of.
11691 @returns A raw pointer to the start of the constant.
11692*/
11693 pub fn pm_constant_start(constant: *const pm_constant_t) -> *const u8;
11694 /** Return the length of a constant.
11695
11696 @param constant The constant to get the length of.
11697 @returns The length of the constant.
11698*/
11699 pub fn pm_constant_length(constant: *const pm_constant_t) -> usize;
11700 /** Initialize a string that views the given bytes. The bytes are not copied, so
11701 they must remain valid for as long as the string is in use.
11702
11703 @param string The string to initialize.
11704 @param source The start of the bytes.
11705 @param length The number of bytes.
11706*/
11707 pub fn pm_string_init(string: *mut pm_string_t, source: *const u8, length: usize);
11708 /** Returns the length associated with the string.
11709
11710 @param string The string to get the length of.
11711 @returns The length of the string.
11712*/
11713 pub fn pm_string_length(string: *const pm_string_t) -> usize;
11714 /** Returns the start pointer associated with the string.
11715
11716 @param string The string to get the start pointer of.
11717 @returns The start pointer of the string.
11718*/
11719 pub fn pm_string_source(string: *const pm_string_t) -> *const u8;
11720 /** Get the type of the given diagnostic.
11721
11722 @param diagnostic The diagnostic to get the type of.
11723 @returns The type of the given diagnostic. Note that this is a string
11724 representation of an internal ID, and is not meant to be relied upon as a
11725 stable identifier for the diagnostic. We do not guarantee that these will
11726 not change in the future. This is meant to be used for debugging and
11727 error reporting purposes, and not for programmatic checks.
11728*/
11729 pub fn pm_diagnostic_type(
11730 diagnostic: *const pm_diagnostic_t,
11731 ) -> *const ::std::os::raw::c_char;
11732 /** Get the location of the given diagnostic.
11733
11734 @param diagnostic The diagnostic to get the location of.
11735 @returns The location of the given diagnostic.
11736*/
11737 pub fn pm_diagnostic_location(diagnostic: *const pm_diagnostic_t) -> pm_location_t;
11738 /** Get the message of the given diagnostic.
11739
11740 @param diagnostic The diagnostic to get the message of.
11741 @returns The message of the given diagnostic.
11742*/
11743 pub fn pm_diagnostic_message(
11744 diagnostic: *const pm_diagnostic_t,
11745 ) -> *const ::std::os::raw::c_char;
11746 /** Get the error level associated with the given diagnostic.
11747
11748 @param diagnostic The diagnostic to get the error level of.
11749 @returns The error level of the given diagnostic. If the diagnostic was a
11750 warning, or is in any way not an error, then the return value is
11751 undefined and should not be relied upon.
11752*/
11753 pub fn pm_diagnostic_error_level(
11754 diagnostic: *const pm_diagnostic_t,
11755 ) -> pm_error_level_t;
11756 /** Get the warning level associated with the given diagnostic.
11757
11758 @param diagnostic The diagnostic to get the warning level of.
11759 @returns The warning level of the given diagnostic. If the diagnostic was an
11760 error, or is in any way not a warning, then the return value is
11761 undefined and should not be relied upon.
11762*/
11763 pub fn pm_diagnostic_warning_level(
11764 diagnostic: *const pm_diagnostic_t,
11765 ) -> pm_warning_level_t;
11766 /** Get the diagnostic that follows the given diagnostic among the errors or the
11767 warnings of the parser that produced it.
11768
11769 @param diagnostic The diagnostic to get the successor of.
11770 @returns The next diagnostic of the same kind, or NULL if the given
11771 diagnostic is the last one.
11772*/
11773 pub fn pm_diagnostic_next(
11774 diagnostic: *const pm_diagnostic_t,
11775 ) -> *const pm_diagnostic_t;
11776 /** Returns the location associated with the given comment.
11777
11778 @param comment the comment whose location we want to get
11779 @returns the location associated with the given comment
11780*/
11781 pub fn pm_comment_location(comment: *const pm_comment_t) -> pm_location_t;
11782 /** Returns the type associated with the given comment.
11783
11784 @param comment the comment whose type we want to get
11785 @returns the type associated with the given comment. This can either be
11786 PM_COMMENT_INLINE or PM_COMMENT_EMBDOC.
11787*/
11788 pub fn pm_comment_type(comment: *const pm_comment_t) -> pm_comment_type_t;
11789 /** Returns the comment that follows the given comment among the comments
11790 associated with the parser that found it.
11791
11792 @param comment the comment whose successor we want to get
11793 @returns the next comment, or NULL if the given comment is the last one
11794*/
11795 pub fn pm_comment_next(comment: *const pm_comment_t) -> *const pm_comment_t;
11796 /** Returns the line and column of the given offset. If the offset is not in the
11797 list, the line and column of the closest offset less than the given offset
11798 are returned.
11799
11800 @param list The list to search.
11801 @param cursor The offset to search for.
11802 @param start_line The line to start counting from.
11803 @returns The line and column of the given offset.
11804*/
11805 pub fn pm_line_offset_list_line_column(
11806 list: *const pm_line_offset_list_t,
11807 cursor: u32,
11808 start_line: i32,
11809 ) -> pm_line_column_t;
11810 /** Returns the location of the key associated with the given magic comment.
11811
11812 @param magic_comment the magic comment whose key location we want to get
11813 @returns the location of the key associated with the given magic comment
11814*/
11815 pub fn pm_magic_comment_key(
11816 magic_comment: *const pm_magic_comment_t,
11817 ) -> pm_location_t;
11818 /** Returns the location of the value associated with the given magic comment.
11819
11820 @param magic_comment the magic comment whose value location we want to get
11821 @returns the location of the value associated with the given magic comment
11822*/
11823 pub fn pm_magic_comment_value(
11824 magic_comment: *const pm_magic_comment_t,
11825 ) -> pm_location_t;
11826 /** Returns the magic comment that follows the given magic comment among the
11827 magic comments associated with the parser that found it.
11828
11829 @param magic_comment the magic comment whose successor we want to get
11830 @returns the next magic comment, or NULL if the given magic comment is the
11831 last one
11832*/
11833 pub fn pm_magic_comment_next(
11834 magic_comment: *const pm_magic_comment_t,
11835 ) -> *const pm_magic_comment_t;
11836 /** Allocate a new options struct. If the options struct cannot be allocated,
11837 this function aborts the process.
11838
11839 @returns A new options struct with default values. It is the responsibility
11840 of the caller to free this struct using pm_options_free().
11841*/
11842 pub fn pm_options_new() -> *mut pm_options_t;
11843 /** Free both the held memory of the given options struct and the struct itself.
11844
11845 @param options The options struct to free.
11846*/
11847 pub fn pm_options_free(options: *mut pm_options_t);
11848 /** Set the filepath option on the given options struct.
11849
11850 @param options The options struct to set the filepath on.
11851 @param filepath The filepath to set.
11852*/
11853 pub fn pm_options_filepath_set(
11854 options: *mut pm_options_t,
11855 filepath: *const ::std::os::raw::c_char,
11856 );
11857 /** Set the line option on the given options struct.
11858
11859 @param options The options struct to set the line on.
11860 @param line The line to set.
11861*/
11862 pub fn pm_options_line_set(options: *mut pm_options_t, line: i32);
11863 /** Set the encoding option on the given options struct.
11864
11865 @param options The options struct to set the encoding on.
11866 @param encoding The encoding to set.
11867*/
11868 pub fn pm_options_encoding_set(
11869 options: *mut pm_options_t,
11870 encoding: *const ::std::os::raw::c_char,
11871 );
11872 /** Set the encoding_locked option on the given options struct.
11873
11874 @param options The options struct to set the encoding_locked value on.
11875 @param encoding_locked The encoding_locked value to set.
11876*/
11877 pub fn pm_options_encoding_locked_set(
11878 options: *mut pm_options_t,
11879 encoding_locked: bool,
11880 );
11881 /** Set the frozen string literal option on the given options struct.
11882
11883 @param options The options struct to set the frozen string literal value on.
11884 @param frozen_string_literal The frozen string literal value to set.
11885*/
11886 pub fn pm_options_frozen_string_literal_set(
11887 options: *mut pm_options_t,
11888 frozen_string_literal: bool,
11889 );
11890 /** Sets the command line option on the given options struct.
11891
11892 @param options The options struct to set the command line option on.
11893 @param command_line The command_line value to set.
11894*/
11895 pub fn pm_options_command_line_set(options: *mut pm_options_t, command_line: u8);
11896 /** Set the version option on the given options struct by parsing the given
11897 string. If the string contains an invalid option, this returns false.
11898 Otherwise, it returns true.
11899
11900 @param options The options struct to set the version on.
11901 @param version The version to set.
11902 @param length The length of the version string.
11903 @returns Whether or not the version was parsed successfully.
11904*/
11905 pub fn pm_options_version_set(
11906 options: *mut pm_options_t,
11907 version: *const ::std::os::raw::c_char,
11908 length: usize,
11909 ) -> bool;
11910 /** Set the main script option on the given options struct.
11911
11912 @param options The options struct to set the main script value on.
11913 @param main_script The main script value to set.
11914*/
11915 pub fn pm_options_main_script_set(options: *mut pm_options_t, main_script: bool);
11916 /** Set the partial script option on the given options struct.
11917
11918 @param options The options struct to set the partial script value on.
11919 @param partial_script The partial script value to set.
11920*/
11921 pub fn pm_options_partial_script_set(
11922 options: *mut pm_options_t,
11923 partial_script: bool,
11924 );
11925 /** Set the attach_comments option on the given options struct. When this is
11926 set, the parser's comment list is sorted by start offset after parsing and
11927 every comment is assigned an owning node. Without it, comments are left in
11928 the order they were lexed and no nodes own any comments.
11929
11930 @param options The options struct to set the attach_comments value on.
11931 @param attach_comments The attach_comments value to set.
11932*/
11933 pub fn pm_options_attach_comments_set(
11934 options: *mut pm_options_t,
11935 attach_comments: bool,
11936 );
11937 /** Allocate and zero out the scopes array on the given options struct.
11938
11939 @param options The options struct to initialize the scopes array on.
11940 @param scopes_count The number of scopes to allocate.
11941 @returns Whether or not the scopes array was initialized successfully.
11942*/
11943 pub fn pm_options_scopes_init(
11944 options: *mut pm_options_t,
11945 scopes_count: usize,
11946 ) -> bool;
11947 /** Return a mutable pointer to the scope at the given index within the given
11948 options.
11949
11950 @param options The options struct to get the scope from.
11951 @param index The index of the scope to get.
11952 @returns A mutable pointer to the scope at the given index.
11953*/
11954 pub fn pm_options_scope_mut(
11955 options: *mut pm_options_t,
11956 index: usize,
11957 ) -> *mut pm_options_scope_t;
11958 /** Create a new options scope struct. This will hold a set of locals that are in
11959 scope surrounding the code that is being parsed. If the scope was unable to
11960 allocate its locals, this function will abort the process.
11961
11962 @param scope The scope struct to initialize.
11963 @param locals_count The number of locals to allocate.
11964*/
11965 pub fn pm_options_scope_init(scope: *mut pm_options_scope_t, locals_count: usize);
11966 /** Return a mutable pointer to the local at the given index within the given
11967 scope, for setting the local's name with pm_string_init. The parser copies
11968 the name when it is created, so its bytes must remain valid until then.
11969
11970 @param scope The scope struct to get the local from.
11971 @param index The index of the local to get.
11972 @returns A mutable pointer to the local at the given index.
11973*/
11974 pub fn pm_options_scope_local_mut(
11975 scope: *mut pm_options_scope_t,
11976 index: usize,
11977 ) -> *mut pm_string_t;
11978 /** Set the forwarding option on the given scope struct.
11979
11980 @param scope The scope struct to set the forwarding on.
11981 @param forwarding The forwarding value to set.
11982*/
11983 pub fn pm_options_scope_forwarding_set(
11984 scope: *mut pm_options_scope_t,
11985 forwarding: u8,
11986 );
11987 /** Allocate and initialize a parser with the given start and end pointers.
11988
11989 @param arena The arena to use for all AST-lifetime allocations. It is caller-
11990 owned and must outlive the parser.
11991 @param source The source to parse.
11992 @param size The size of the source.
11993 @param options The optional options to use when parsing. These options must
11994 live for the whole lifetime of this parser.
11995 @returns The initialized parser. It is the responsibility of the caller to
11996 free the parser with `pm_parser_free()`.
11997*/
11998 pub fn pm_parser_new(
11999 arena: *mut pm_arena_t,
12000 source: *const u8,
12001 size: usize,
12002 options: *const pm_options_t,
12003 ) -> *mut pm_parser_t;
12004 /** Free both the memory held by the given parser and the parser itself.
12005
12006 @param parser The parser to free.
12007*/
12008 pub fn pm_parser_free(parser: *mut pm_parser_t);
12009 /** Returns the raw pointer to the start of the source that is being parsed.
12010
12011 @param parser the parser whose start pointer we want to get
12012 @returns the raw pointer to the start of the source that is being parsed
12013*/
12014 pub fn pm_parser_start(parser: *const pm_parser_t) -> *const u8;
12015 /** Returns the line that the parser was considered to have started on.
12016
12017 @param parser the parser whose start line we want to get
12018 @returns the line that the parser was considered to have started on
12019*/
12020 pub fn pm_parser_start_line(parser: *const pm_parser_t) -> i32;
12021 /** Add a constant to the parser's constant pool, for naming a node that was not
12022 parsed from the source. If the constant is already in the pool, its existing
12023 id is returned. Otherwise the parser copies the bytes, so they only need to
12024 remain valid for the duration of the call.
12025
12026 Adding a constant makes the pool larger, so a cache with one entry per
12027 constant built beforehand from pm_parser_constants_size and
12028 pm_parser_constant_at does not cover it. Build such caches after adding any
12029 constants.
12030
12031 @param parser the parser whose constant pool we want to add to
12032 @param start a pointer to the start of the string to add
12033 @param length the length of the string to add
12034 @returns the id of the constant
12035*/
12036 pub fn pm_parser_constant_insert(
12037 parser: *mut pm_parser_t,
12038 start: *const u8,
12039 length: usize,
12040 ) -> pm_constant_id_t;
12041 /** Returns the frozen string literal value of the parser, as determined by the
12042 frozen_string_literal magic comment or the option set on the parser.
12043
12044 @param parser the parser whose frozen string literal value we want to get
12045 @returns -1 if disabled, 0 if unset, 1 if enabled
12046*/
12047 pub fn pm_parser_frozen_string_literal(parser: *const pm_parser_t) -> i8;
12048 /** Returns the line offsets that are associated with the given parser.
12049
12050 @param parser the parser whose line offsets we want to get
12051 @returns the line offsets that are associated with the given parser
12052*/
12053 pub fn pm_parser_line_offsets(
12054 parser: *const pm_parser_t,
12055 ) -> *const pm_line_offset_list_t;
12056 /** Returns the location of the __DATA__ section that is associated with the
12057 given parser.
12058
12059 @param parser the parser whose data location we want to get
12060 @returns the location of the __DATA__ section that is associated with the
12061 given parser. If it is unset, then the length will be set to 0.
12062*/
12063 pub fn pm_parser_data_loc(parser: *const pm_parser_t) -> *const pm_location_t;
12064 /** Returns the number of comments associated with the given parser.
12065
12066 @param parser the parser whose comments we want to get the size of
12067 @returns the number of comments associated with the given parser
12068*/
12069 pub fn pm_parser_comments_size(parser: *const pm_parser_t) -> usize;
12070 /** Returns the first comment associated with the given parser. Iterate over the
12071 rest with pm_comment_next, as in:
12072
12073 ```c
12074 for (const pm_comment_t *comment = pm_parser_comments_first(parser); comment != NULL; comment = pm_comment_next(comment)) {
12075 pm_location_t location = pm_comment_location(comment);
12076 }
12077 ```
12078
12079 @param parser the parser whose comments we want to iterate over
12080 @returns the first comment, or NULL if there are no comments
12081*/
12082 pub fn pm_parser_comments_first(parser: *const pm_parser_t) -> *const pm_comment_t;
12083 /** Returns the number of comments owned by the given node. This is 0 if the
12084 node owns no comments or if the attach_comments option was not set.
12085
12086 @param parser the parser that produced the node
12087 @param node the node whose comments we want to count
12088 @returns the number of comments owned by the given node
12089*/
12090 pub fn pm_node_comments_size(
12091 parser: *const pm_parser_t,
12092 node: *const pm_node_t,
12093 ) -> u32;
12094 /** Returns the comment at the given index among the comments owned by the given
12095 node, which are ordered by start offset.
12096
12097 @param parser the parser that produced the node
12098 @param node the node whose comment we want to get
12099 @param index the index of the comment among those owned by the node
12100 @returns the comment at the given index, or NULL if the index is out of range
12101*/
12102 pub fn pm_node_comment(
12103 parser: *const pm_parser_t,
12104 node: *const pm_node_t,
12105 index: u32,
12106 ) -> *const pm_comment_t;
12107 /** Returns the number of magic comments associated with the given parser.
12108
12109 @param parser the parser whose magic comments we want to get the size of
12110 @returns the number of magic comments associated with the given parser
12111*/
12112 pub fn pm_parser_magic_comments_size(parser: *const pm_parser_t) -> usize;
12113 /** Returns the first magic comment associated with the given parser. Iterate
12114 over the rest with pm_magic_comment_next.
12115
12116 @param parser the parser whose magic comments we want to iterate over
12117 @returns the first magic comment, or NULL if there are no magic comments
12118*/
12119 pub fn pm_parser_magic_comments_first(
12120 parser: *const pm_parser_t,
12121 ) -> *const pm_magic_comment_t;
12122 /** Returns the number of errors associated with the given parser.
12123
12124 @param parser the parser whose errors we want to get the size of
12125 @returns the number of errors associated with the given parser
12126*/
12127 pub fn pm_parser_errors_size(parser: *const pm_parser_t) -> usize;
12128 /** Returns the number of warnings associated with the given parser.
12129
12130 @param parser the parser whose warnings we want to get the size of
12131 @returns the number of warnings associated with the given parser
12132*/
12133 pub fn pm_parser_warnings_size(parser: *const pm_parser_t) -> usize;
12134 /** Returns the first error associated with the given parser. Iterate over the
12135 rest with pm_diagnostic_next.
12136
12137 @param parser the parser whose errors we want to iterate over
12138 @returns the first error, or NULL if there are no errors
12139*/
12140 pub fn pm_parser_errors_first(parser: *const pm_parser_t) -> *const pm_diagnostic_t;
12141 /** Returns the first warning associated with the given parser. Iterate over the
12142 rest with pm_diagnostic_next.
12143
12144 @param parser the parser whose warnings we want to iterate over
12145 @returns the first warning, or NULL if there are no warnings
12146*/
12147 pub fn pm_parser_warnings_first(
12148 parser: *const pm_parser_t,
12149 ) -> *const pm_diagnostic_t;
12150 /** Returns the number of constants in the constant pool associated with the
12151 given parser.
12152
12153 @param parser the parser whose constant pool constants we want to get the
12154 size of
12155 @returns the number of constants in the constant pool associated with the
12156 given parser
12157*/
12158 pub fn pm_parser_constants_size(parser: *const pm_parser_t) -> usize;
12159 /** Returns the constant at the given index in the constant pool associated with
12160 the given parser. Together with pm_constant_id_index, this lets a caller
12161 build a cache with one entry per constant and then find the entry for any
12162 constant id, as in:
12163
12164 ```c
12165 size_t size = pm_parser_constants_size(parser);
12166 for (size_t index = 0; index < size; index++) {
12167 cache[index] = convert(pm_parser_constant_at(parser, index));
12168 }
12169
12170 value = cache[pm_constant_id_index(constant_id)];
12171 ```
12172
12173 For any constant id, pm_parser_constant_at(parser,
12174 pm_constant_id_index(constant_id)) is pm_parser_constant(parser,
12175 constant_id).
12176
12177 @param parser the parser whose constant pool we want to look up from
12178 @param index the index of the constant, which must be less than
12179 pm_parser_constants_size(parser)
12180 @returns a pointer to the constant at the given index
12181*/
12182 pub fn pm_parser_constant_at(
12183 parser: *const pm_parser_t,
12184 index: usize,
12185 ) -> *const pm_constant_t;
12186 /** Returns a pointer to the constant at the given id in the constant pool
12187 associated with the given parser.
12188
12189 @param parser the parser whose constant pool we want to look up from
12190 @param constant_id the id of the constant to look up. Optional constant
12191 fields on nodes hold 0 when they are absent, which is not a valid id.
12192 @returns a pointer to the constant at the given id
12193*/
12194 pub fn pm_parser_constant(
12195 parser: *const pm_parser_t,
12196 constant_id: pm_constant_id_t,
12197 ) -> *const pm_constant_t;
12198 /** Initiate the parser with the given parser.
12199
12200 @param parser The parser to use.
12201 @returns The AST representing the source.
12202*/
12203 pub fn pm_parse(parser: *mut pm_parser_t) -> *mut pm_node_t;
12204 /** Append a node to the end of a node list. A node list's storage is always
12205 exactly its size, so it is regrown to exactly one more node by allocating from
12206 the given arena, which must live as long as the list does. For a list in a
12207 parsed tree, that is the arena that was passed to pm_parser_new.
12208
12209 @param arena The arena to allocate the list's storage from.
12210 @param list The list to append to.
12211 @param node The node to append.
12212*/
12213 pub fn pm_node_list_append(
12214 arena: *mut pm_arena_t,
12215 list: *mut pm_node_list_t,
12216 node: *mut pm_node_t,
12217 );
12218 /** Check that the slice is a valid local variable name.
12219
12220 @param source The source to check.
12221 @param length The length of the source.
12222 @param encoding_name The name of the encoding of the source.
12223 @param version The version of Ruby to answer for, as pm_options_version_set
12224 reads it, such as "3.4" or "latest". NULL is the latest version.
12225 @returns PM_STRING_QUERY_TRUE if the query is true, PM_STRING_QUERY_FALSE if
12226 the query is false, PM_STRING_QUERY_ERROR if the encoding was invalid, and
12227 PM_STRING_QUERY_ERROR_VERSION if the version was invalid.
12228*/
12229 pub fn pm_string_query_local(
12230 source: *const u8,
12231 length: usize,
12232 encoding_name: *const ::std::os::raw::c_char,
12233 version: *const ::std::os::raw::c_char,
12234 ) -> pm_string_query_t;
12235 /** Check that the slice is a valid constant name.
12236
12237 @param source The source to check.
12238 @param length The length of the source.
12239 @param encoding_name The name of the encoding of the source.
12240 @param version The version of Ruby to answer for, as pm_options_version_set
12241 reads it, such as "3.4" or "latest". NULL is the latest version.
12242 @returns PM_STRING_QUERY_TRUE if the query is true, PM_STRING_QUERY_FALSE if
12243 the query is false, PM_STRING_QUERY_ERROR if the encoding was invalid, and
12244 PM_STRING_QUERY_ERROR_VERSION if the version was invalid.
12245*/
12246 pub fn pm_string_query_constant(
12247 source: *const u8,
12248 length: usize,
12249 encoding_name: *const ::std::os::raw::c_char,
12250 version: *const ::std::os::raw::c_char,
12251 ) -> pm_string_query_t;
12252 /** Check that the slice is a valid method name.
12253
12254 @param source The source to check.
12255 @param length The length of the source.
12256 @param encoding_name The name of the encoding of the source.
12257 @param version The version of Ruby to answer for, as pm_options_version_set
12258 reads it, such as "3.4" or "latest". NULL is the latest version.
12259 @returns PM_STRING_QUERY_TRUE if the query is true, PM_STRING_QUERY_FALSE if
12260 the query is false, PM_STRING_QUERY_ERROR if the encoding was invalid, and
12261 PM_STRING_QUERY_ERROR_VERSION if the version was invalid.
12262*/
12263 pub fn pm_string_query_method_name(
12264 source: *const u8,
12265 length: usize,
12266 encoding_name: *const ::std::os::raw::c_char,
12267 version: *const ::std::os::raw::c_char,
12268 ) -> pm_string_query_t;
12269 /** Check that the slice is a keyword.
12270
12271 @param source The source to check.
12272 @param length The length of the source.
12273 @param encoding_name The name of the encoding of the source.
12274 @param version The version of Ruby to answer for, as pm_options_version_set
12275 reads it, such as "3.4" or "latest". NULL is the latest version.
12276 @returns PM_STRING_QUERY_TRUE if the query is true, PM_STRING_QUERY_FALSE if
12277 the query is false, PM_STRING_QUERY_ERROR if the encoding was invalid, and
12278 PM_STRING_QUERY_ERROR_VERSION if the version was invalid.
12279*/
12280 pub fn pm_string_query_keyword(
12281 source: *const u8,
12282 length: usize,
12283 encoding_name: *const ::std::os::raw::c_char,
12284 version: *const ::std::os::raw::c_char,
12285 ) -> pm_string_query_t;
12286 /** The prism version and the serialization format.
12287
12288 @returns The prism version as a constant string.
12289*/
12290 pub fn pm_version() -> *const ::std::os::raw::c_char;
12291}