prism 2.0.0.rc1-x86_64-linux-gnu

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (216) hide show
  1. checksums.yaml +7 -0
  2. data/BSDmakefile +58 -0
  3. data/CHANGELOG.md +870 -0
  4. data/CODE_OF_CONDUCT.md +76 -0
  5. data/CONTRIBUTING.md +58 -0
  6. data/LICENSE.md +7 -0
  7. data/Makefile +145 -0
  8. data/README.md +81 -0
  9. data/config.yml +4752 -0
  10. data/docs/build_system.md +119 -0
  11. data/docs/configuration.md +69 -0
  12. data/docs/cruby_compilation.md +27 -0
  13. data/docs/design.md +53 -0
  14. data/docs/encoding.md +121 -0
  15. data/docs/fuzzing.md +81 -0
  16. data/docs/heredocs.md +36 -0
  17. data/docs/javascript.md +133 -0
  18. data/docs/local_variable_depth.md +229 -0
  19. data/docs/mapping.md +117 -0
  20. data/docs/parser_translation.md +24 -0
  21. data/docs/parsing_rules.md +22 -0
  22. data/docs/releasing.md +147 -0
  23. data/docs/relocation.md +32 -0
  24. data/docs/ripper_translation.md +63 -0
  25. data/docs/ruby_api.md +45 -0
  26. data/docs/ruby_parser_translation.md +19 -0
  27. data/docs/serialization.md +230 -0
  28. data/docs/testing.md +72 -0
  29. data/ext/prism/api_node.c +7005 -0
  30. data/ext/prism/extconf.rb +126 -0
  31. data/ext/prism/extension.c +1783 -0
  32. data/ext/prism/extension.h +19 -0
  33. data/include/prism/arena.h +37 -0
  34. data/include/prism/ast.h +10371 -0
  35. data/include/prism/buffer.h +52 -0
  36. data/include/prism/comments.h +55 -0
  37. data/include/prism/compiler/accel.h +24 -0
  38. data/include/prism/compiler/align.h +36 -0
  39. data/include/prism/compiler/assume.h +25 -0
  40. data/include/prism/compiler/exported.h +24 -0
  41. data/include/prism/compiler/fallthrough.h +22 -0
  42. data/include/prism/compiler/filesystem.h +32 -0
  43. data/include/prism/compiler/flex_array.h +19 -0
  44. data/include/prism/compiler/force_inline.h +21 -0
  45. data/include/prism/compiler/format.h +25 -0
  46. data/include/prism/compiler/inline.h +17 -0
  47. data/include/prism/compiler/nodiscard.h +22 -0
  48. data/include/prism/compiler/nonnull.h +18 -0
  49. data/include/prism/compiler/unused.h +18 -0
  50. data/include/prism/constant_pool.h +81 -0
  51. data/include/prism/diagnostic.h +93 -0
  52. data/include/prism/errors_format.h +53 -0
  53. data/include/prism/excludes.h +29 -0
  54. data/include/prism/integer.h +41 -0
  55. data/include/prism/internal/allocator.h +68 -0
  56. data/include/prism/internal/allocator_debug.h +88 -0
  57. data/include/prism/internal/arena.h +108 -0
  58. data/include/prism/internal/bit.h +42 -0
  59. data/include/prism/internal/buffer.h +91 -0
  60. data/include/prism/internal/char.h +145 -0
  61. data/include/prism/internal/comments.h +53 -0
  62. data/include/prism/internal/constant_pool.h +152 -0
  63. data/include/prism/internal/diagnostic.h +389 -0
  64. data/include/prism/internal/encoding.h +242 -0
  65. data/include/prism/internal/integer.h +68 -0
  66. data/include/prism/internal/isinf.h +16 -0
  67. data/include/prism/internal/line_offset_list.h +34 -0
  68. data/include/prism/internal/list.h +62 -0
  69. data/include/prism/internal/magic_comments.h +23 -0
  70. data/include/prism/internal/memchr.h +15 -0
  71. data/include/prism/internal/node.h +38 -0
  72. data/include/prism/internal/options.h +232 -0
  73. data/include/prism/internal/parser.h +984 -0
  74. data/include/prism/internal/regexp.h +26 -0
  75. data/include/prism/internal/serialize.h +39 -0
  76. data/include/prism/internal/source.h +72 -0
  77. data/include/prism/internal/static_literals.h +100 -0
  78. data/include/prism/internal/stringy.h +35 -0
  79. data/include/prism/internal/strncasecmp.h +18 -0
  80. data/include/prism/internal/strpbrk.h +33 -0
  81. data/include/prism/internal/tokens.h +11 -0
  82. data/include/prism/json.h +32 -0
  83. data/include/prism/line_offset_list.h +61 -0
  84. data/include/prism/magic_comments.h +35 -0
  85. data/include/prism/node.h +94 -0
  86. data/include/prism/options.h +354 -0
  87. data/include/prism/parser.h +404 -0
  88. data/include/prism/prettyprint.h +31 -0
  89. data/include/prism/serialize.h +115 -0
  90. data/include/prism/source.h +155 -0
  91. data/include/prism/stream.h +28 -0
  92. data/include/prism/string_query.h +63 -0
  93. data/include/prism/stringy.h +72 -0
  94. data/include/prism/version.h +38 -0
  95. data/include/prism.h +131 -0
  96. data/lib/prism/3.3/prism.so +0 -0
  97. data/lib/prism/3.4/prism.so +0 -0
  98. data/lib/prism/4.0/prism.so +0 -0
  99. data/lib/prism/compiler.rb +815 -0
  100. data/lib/prism/desugar_compiler.rb +463 -0
  101. data/lib/prism/dispatcher.rb +2383 -0
  102. data/lib/prism/dot_visitor.rb +4848 -0
  103. data/lib/prism/dsl.rb +1369 -0
  104. data/lib/prism/ffi.rb +740 -0
  105. data/lib/prism/inspect_visitor.rb +2425 -0
  106. data/lib/prism/lex_compat.rb +953 -0
  107. data/lib/prism/mutation_compiler.rb +780 -0
  108. data/lib/prism/node.rb +33204 -0
  109. data/lib/prism/node_ext.rb +504 -0
  110. data/lib/prism/node_find.rb +215 -0
  111. data/lib/prism/parse_result/errors.rb +72 -0
  112. data/lib/prism/parse_result/newlines.rb +423 -0
  113. data/lib/prism/parse_result.rb +1221 -0
  114. data/lib/prism/pattern.rb +314 -0
  115. data/lib/prism/polyfill/append_as_bytes.rb +15 -0
  116. data/lib/prism/polyfill/byteindex.rb +13 -0
  117. data/lib/prism/polyfill/scan_byte.rb +14 -0
  118. data/lib/prism/polyfill/unpack1.rb +14 -0
  119. data/lib/prism/polyfill/warn.rb +36 -0
  120. data/lib/prism/reflection.rb +427 -0
  121. data/lib/prism/relocation.rb +567 -0
  122. data/lib/prism/serialize.rb +5308 -0
  123. data/lib/prism/string_query.rb +46 -0
  124. data/lib/prism/translation/parser/builder.rb +70 -0
  125. data/lib/prism/translation/parser/compiler.rb +2226 -0
  126. data/lib/prism/translation/parser/lexer.rb +769 -0
  127. data/lib/prism/translation/parser.rb +376 -0
  128. data/lib/prism/translation/parser_current.rb +26 -0
  129. data/lib/prism/translation/parser_versions.rb +36 -0
  130. data/lib/prism/translation/ripper/filter.rb +53 -0
  131. data/lib/prism/translation/ripper/lexer.rb +133 -0
  132. data/lib/prism/translation/ripper/sexp.rb +118 -0
  133. data/lib/prism/translation/ripper/shim.rb +7 -0
  134. data/lib/prism/translation/ripper.rb +4278 -0
  135. data/lib/prism/translation/ruby_parser.rb +1721 -0
  136. data/lib/prism/translation.rb +20 -0
  137. data/lib/prism/visitor.rb +1440 -0
  138. data/lib/prism.rb +168 -0
  139. data/prism.gemspec +234 -0
  140. data/rbi/generated/prism/compiler.rbi +489 -0
  141. data/rbi/generated/prism/desugar_compiler.rbi +306 -0
  142. data/rbi/generated/prism/dispatcher.rbi +1138 -0
  143. data/rbi/generated/prism/dot_visitor.rbi +618 -0
  144. data/rbi/generated/prism/dsl.rbi +751 -0
  145. data/rbi/generated/prism/inspect_visitor.rbi +503 -0
  146. data/rbi/generated/prism/lex_compat.rbi +162 -0
  147. data/rbi/generated/prism/mutation_compiler.rbi +464 -0
  148. data/rbi/generated/prism/node.rbi +13681 -0
  149. data/rbi/generated/prism/node_ext.rbi +259 -0
  150. data/rbi/generated/prism/node_find.rbi +79 -0
  151. data/rbi/generated/prism/parse_result/errors.rbi +21 -0
  152. data/rbi/generated/prism/parse_result/newlines.rbi +208 -0
  153. data/rbi/generated/prism/parse_result.rbi +764 -0
  154. data/rbi/generated/prism/pattern.rbi +134 -0
  155. data/rbi/generated/prism/reflection.rbi +89 -0
  156. data/rbi/generated/prism/relocation.rbi +329 -0
  157. data/rbi/generated/prism/serialize.rbi +181 -0
  158. data/rbi/generated/prism/string_query.rbi +36 -0
  159. data/rbi/generated/prism/translation.rbi +7 -0
  160. data/rbi/generated/prism/visitor.rbi +650 -0
  161. data/rbi/generated/prism.rbi +86 -0
  162. data/rbi/prism/translation/parser.rbi +11 -0
  163. data/rbi/prism/translation/parser_versions.rbi +28 -0
  164. data/rbi/prism/translation/ripper.rbi +15 -0
  165. data/rbi/rubyvm/node_find.rbi +14 -0
  166. data/sig/generated/prism/compiler.rbs +492 -0
  167. data/sig/generated/prism/desugar_compiler.rbs +305 -0
  168. data/sig/generated/prism/dispatcher.rbs +1292 -0
  169. data/sig/generated/prism/dot_visitor.rbs +635 -0
  170. data/sig/generated/prism/dsl.rbs +928 -0
  171. data/sig/generated/prism/inspect_visitor.rbs +509 -0
  172. data/sig/generated/prism/lex_compat.rbs +166 -0
  173. data/sig/generated/prism/mutation_compiler.rbs +464 -0
  174. data/sig/generated/prism/node.rbs +20160 -0
  175. data/sig/generated/prism/node_ext.rbs +290 -0
  176. data/sig/generated/prism/node_find.rbs +90 -0
  177. data/sig/generated/prism/parse_result/errors.rbs +22 -0
  178. data/sig/generated/prism/parse_result/newlines.rbs +223 -0
  179. data/sig/generated/prism/parse_result.rbs +859 -0
  180. data/sig/generated/prism/pattern.rbs +156 -0
  181. data/sig/generated/prism/reflection.rbs +101 -0
  182. data/sig/generated/prism/relocation.rbs +428 -0
  183. data/sig/generated/prism/serialize.rbs +195 -0
  184. data/sig/generated/prism/string_query.rbs +36 -0
  185. data/sig/generated/prism/translation.rbs +8 -0
  186. data/sig/generated/prism/visitor.rbs +1111 -0
  187. data/sig/generated/prism.rbs +84 -0
  188. data/sig/manifest.yaml +2 -0
  189. data/src/arena.c +117 -0
  190. data/src/buffer.c +380 -0
  191. data/src/char.c +289 -0
  192. data/src/comments.c +454 -0
  193. data/src/constant_pool.c +406 -0
  194. data/src/diagnostic.c +886 -0
  195. data/src/encoding.c +5345 -0
  196. data/src/errors_format.c +519 -0
  197. data/src/integer.c +681 -0
  198. data/src/json.c +5733 -0
  199. data/src/line_offset_list.c +100 -0
  200. data/src/list.c +24 -0
  201. data/src/memchr.c +37 -0
  202. data/src/node.c +4515 -0
  203. data/src/options.c +451 -0
  204. data/src/parser.c +349 -0
  205. data/src/prettyprint.c +9024 -0
  206. data/src/prism.c +23739 -0
  207. data/src/regexp.c +1706 -0
  208. data/src/serialize.c +2309 -0
  209. data/src/source.c +518 -0
  210. data/src/static_literals.c +685 -0
  211. data/src/string_query.c +166 -0
  212. data/src/stringy.c +91 -0
  213. data/src/strncasecmp.c +37 -0
  214. data/src/strpbrk.c +447 -0
  215. data/src/tokens.c +724 -0
  216. metadata +259 -0
data/lib/prism/dsl.rb ADDED
@@ -0,0 +1,1369 @@
1
+ # frozen_string_literal: true
2
+ # :markup: markdown
3
+
4
+ =begin
5
+ --
6
+ This file is generated by the templates/template.rb script and should not be
7
+ modified manually. See templates/lib/prism/dsl.rb.erb
8
+ if you are looking to modify the template
9
+ ++
10
+ =end
11
+
12
+ #--
13
+ # rbs_inline: enabled
14
+
15
+ module Prism
16
+ # The DSL module provides a set of methods that can be used to create prism
17
+ # nodes in a more concise manner. For example, instead of writing:
18
+ #
19
+ # source = Prism::Source.for("[1]", 1, [0])
20
+ #
21
+ # Prism::ArrayNode.new(
22
+ # source,
23
+ # 0,
24
+ # Prism::Location.new(source, 0, 3),
25
+ # 0,
26
+ # [
27
+ # Prism::IntegerNode.new(
28
+ # source,
29
+ # 0,
30
+ # Prism::Location.new(source, 1, 1),
31
+ # Prism::IntegerBaseFlags::DECIMAL,
32
+ # 1
33
+ # )
34
+ # ],
35
+ # Prism::Location.new(source, 0, 1),
36
+ # Prism::Location.new(source, 2, 1)
37
+ # )
38
+ #
39
+ # you could instead write:
40
+ #
41
+ # class Builder
42
+ # include Prism::DSL
43
+ #
44
+ # attr_reader :default_source
45
+ #
46
+ # def initialize
47
+ # @default_source = source("[1]")
48
+ # end
49
+ #
50
+ # def build
51
+ # array_node(
52
+ # location: location(start_offset: 0, length: 3),
53
+ # elements: [
54
+ # integer_node(
55
+ # location: location(start_offset: 1, length: 1),
56
+ # flags: integer_base_flag(:decimal),
57
+ # value: 1
58
+ # )
59
+ # ],
60
+ # opening_loc: location(start_offset: 0, length: 1),
61
+ # closing_loc: location(start_offset: 2, length: 1)
62
+ # )
63
+ # end
64
+ # end
65
+ #
66
+ # This is mostly helpful in the context of generating trees programmatically.
67
+ module DSL
68
+ # Provide all of these methods as module methods as well, to allow for
69
+ # building nodes like Prism::DSL.nil_node.
70
+ extend self
71
+
72
+ # Create a new Source object.
73
+ #
74
+ #: (String string) -> Source
75
+ def source(string)
76
+ Source.for(string, 1, build_offsets(string))
77
+ end
78
+
79
+ # Create a new Location object.
80
+ #
81
+ #: (?source: Source, ?start_offset: Integer, ?length: Integer) -> Location
82
+ def location(source: default_source, start_offset: 0, length: 0)
83
+ Location.new(source, start_offset, length)
84
+ end
85
+
86
+ # Create a new AliasGlobalVariableNode node.
87
+ #
88
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?new_name: (GlobalVariableReadNode | BackReferenceReadNode | NumberedReferenceReadNode), ?old_name: (GlobalVariableReadNode | BackReferenceReadNode | NumberedReferenceReadNode), ?keyword_loc: Location) -> AliasGlobalVariableNode
89
+ def alias_global_variable_node(source: default_source, node_id: 0, location: default_location, flags: 0, new_name: global_variable_read_node(source: source), old_name: global_variable_read_node(source: source), keyword_loc: location)
90
+ AliasGlobalVariableNode.new(source, node_id, location, flags, new_name, old_name, keyword_loc)
91
+ end
92
+
93
+ # Create a new AliasMethodNode node.
94
+ #
95
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?new_name: (SymbolNode | InterpolatedSymbolNode), ?old_name: (SymbolNode | InterpolatedSymbolNode), ?keyword_loc: Location) -> AliasMethodNode
96
+ def alias_method_node(source: default_source, node_id: 0, location: default_location, flags: 0, new_name: symbol_node(source: source), old_name: symbol_node(source: source), keyword_loc: location)
97
+ AliasMethodNode.new(source, node_id, location, flags, new_name, old_name, keyword_loc)
98
+ end
99
+
100
+ # Create a new AlternationPatternNode node.
101
+ #
102
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?left: Prism::node, ?right: Prism::node, ?operator_loc: Location) -> AlternationPatternNode
103
+ def alternation_pattern_node(source: default_source, node_id: 0, location: default_location, flags: 0, left: default_node(source, location), right: default_node(source, location), operator_loc: location)
104
+ AlternationPatternNode.new(source, node_id, location, flags, left, right, operator_loc)
105
+ end
106
+
107
+ # Create a new AndNode node.
108
+ #
109
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?left: Prism::node, ?right: Prism::node, ?operator_loc: Location) -> AndNode
110
+ def and_node(source: default_source, node_id: 0, location: default_location, flags: 0, left: default_node(source, location), right: default_node(source, location), operator_loc: location)
111
+ AndNode.new(source, node_id, location, flags, left, right, operator_loc)
112
+ end
113
+
114
+ # Create a new ArgumentsNode node.
115
+ #
116
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?arguments: Array[Prism::node]) -> ArgumentsNode
117
+ def arguments_node(source: default_source, node_id: 0, location: default_location, flags: 0, arguments: [])
118
+ ArgumentsNode.new(source, node_id, location, flags, arguments)
119
+ end
120
+
121
+ # Create a new ArrayNode node.
122
+ #
123
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?elements: Array[Prism::node], ?opening_loc: Location?, ?closing_loc: Location?) -> ArrayNode
124
+ def array_node(source: default_source, node_id: 0, location: default_location, flags: 0, elements: [], opening_loc: nil, closing_loc: nil)
125
+ ArrayNode.new(source, node_id, location, flags, elements, opening_loc, closing_loc)
126
+ end
127
+
128
+ # Create a new ArrayPatternNode node.
129
+ #
130
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?constant: (ConstantPathNode | ConstantReadNode)?, ?requireds: Array[Prism::node], ?rest: (ImplicitRestNode | SplatNode)?, ?posts: Array[Prism::node], ?opening_loc: Location?, ?closing_loc: Location?) -> ArrayPatternNode
131
+ def array_pattern_node(source: default_source, node_id: 0, location: default_location, flags: 0, constant: nil, requireds: [], rest: nil, posts: [], opening_loc: nil, closing_loc: nil)
132
+ ArrayPatternNode.new(source, node_id, location, flags, constant, requireds, rest, posts, opening_loc, closing_loc)
133
+ end
134
+
135
+ # Create a new AssocNode node.
136
+ #
137
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?key: Prism::node, ?value: Prism::node, ?operator_loc: Location?) -> AssocNode
138
+ def assoc_node(source: default_source, node_id: 0, location: default_location, flags: 0, key: default_node(source, location), value: default_node(source, location), operator_loc: nil)
139
+ AssocNode.new(source, node_id, location, flags, key, value, operator_loc)
140
+ end
141
+
142
+ # Create a new AssocSplatNode node.
143
+ #
144
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?value: Prism::node?, ?operator_loc: Location) -> AssocSplatNode
145
+ def assoc_splat_node(source: default_source, node_id: 0, location: default_location, flags: 0, value: nil, operator_loc: location)
146
+ AssocSplatNode.new(source, node_id, location, flags, value, operator_loc)
147
+ end
148
+
149
+ # Create a new BackReferenceReadNode node.
150
+ #
151
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol) -> BackReferenceReadNode
152
+ def back_reference_read_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :"")
153
+ BackReferenceReadNode.new(source, node_id, location, flags, name)
154
+ end
155
+
156
+ # Create a new BeginNode node.
157
+ #
158
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?begin_keyword_loc: Location?, ?statements: StatementsNode?, ?rescue_clause: RescueNode?, ?else_clause: ElseNode?, ?ensure_clause: EnsureNode?, ?end_keyword_loc: Location?) -> BeginNode
159
+ def begin_node(source: default_source, node_id: 0, location: default_location, flags: 0, begin_keyword_loc: nil, statements: nil, rescue_clause: nil, else_clause: nil, ensure_clause: nil, end_keyword_loc: nil)
160
+ BeginNode.new(source, node_id, location, flags, begin_keyword_loc, statements, rescue_clause, else_clause, ensure_clause, end_keyword_loc)
161
+ end
162
+
163
+ # Create a new BlockArgumentNode node.
164
+ #
165
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?expression: Prism::node?, ?operator_loc: Location) -> BlockArgumentNode
166
+ def block_argument_node(source: default_source, node_id: 0, location: default_location, flags: 0, expression: nil, operator_loc: location)
167
+ BlockArgumentNode.new(source, node_id, location, flags, expression, operator_loc)
168
+ end
169
+
170
+ # Create a new BlockLocalVariableNode node.
171
+ #
172
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol) -> BlockLocalVariableNode
173
+ def block_local_variable_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :"")
174
+ BlockLocalVariableNode.new(source, node_id, location, flags, name)
175
+ end
176
+
177
+ # Create a new BlockNode node.
178
+ #
179
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?locals: Array[Symbol], ?parameters: (BlockParametersNode | NumberedParametersNode | ItParametersNode)?, ?body: (StatementsNode | BeginNode)?, ?opening_loc: Location, ?closing_loc: Location) -> BlockNode
180
+ def block_node(source: default_source, node_id: 0, location: default_location, flags: 0, locals: [], parameters: nil, body: nil, opening_loc: location, closing_loc: location)
181
+ BlockNode.new(source, node_id, location, flags, locals, parameters, body, opening_loc, closing_loc)
182
+ end
183
+
184
+ # Create a new BlockParameterNode node.
185
+ #
186
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol?, ?name_loc: Location?, ?operator_loc: Location) -> BlockParameterNode
187
+ def block_parameter_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: nil, name_loc: nil, operator_loc: location)
188
+ BlockParameterNode.new(source, node_id, location, flags, name, name_loc, operator_loc)
189
+ end
190
+
191
+ # Create a new BlockParametersNode node.
192
+ #
193
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?parameters: ParametersNode?, ?locals: Array[BlockLocalVariableNode], ?opening_loc: Location?, ?closing_loc: Location?) -> BlockParametersNode
194
+ def block_parameters_node(source: default_source, node_id: 0, location: default_location, flags: 0, parameters: nil, locals: [], opening_loc: nil, closing_loc: nil)
195
+ BlockParametersNode.new(source, node_id, location, flags, parameters, locals, opening_loc, closing_loc)
196
+ end
197
+
198
+ # Create a new BreakNode node.
199
+ #
200
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?arguments: ArgumentsNode?, ?keyword_loc: Location) -> BreakNode
201
+ def break_node(source: default_source, node_id: 0, location: default_location, flags: 0, arguments: nil, keyword_loc: location)
202
+ BreakNode.new(source, node_id, location, flags, arguments, keyword_loc)
203
+ end
204
+
205
+ # Create a new CallAndWriteNode node.
206
+ #
207
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?receiver: Prism::node?, ?call_operator_loc: Location?, ?message_loc: Location?, ?read_name: Symbol, ?write_name: Symbol, ?operator_loc: Location, ?value: Prism::node) -> CallAndWriteNode
208
+ def call_and_write_node(source: default_source, node_id: 0, location: default_location, flags: 0, receiver: nil, call_operator_loc: nil, message_loc: nil, read_name: :"", write_name: :"", operator_loc: location, value: default_node(source, location))
209
+ CallAndWriteNode.new(source, node_id, location, flags, receiver, call_operator_loc, message_loc, read_name, write_name, operator_loc, value)
210
+ end
211
+
212
+ # Create a new CallNode node.
213
+ #
214
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?receiver: Prism::node?, ?call_operator_loc: Location?, ?name: Symbol, ?message_loc: Location?, ?opening_loc: Location?, ?arguments: ArgumentsNode?, ?closing_loc: Location?, ?equal_loc: Location?, ?block: (BlockNode | BlockArgumentNode)?) -> CallNode
215
+ def call_node(source: default_source, node_id: 0, location: default_location, flags: 0, receiver: nil, call_operator_loc: nil, name: :"", message_loc: nil, opening_loc: nil, arguments: nil, closing_loc: nil, equal_loc: nil, block: nil)
216
+ CallNode.new(source, node_id, location, flags, receiver, call_operator_loc, name, message_loc, opening_loc, arguments, closing_loc, equal_loc, block)
217
+ end
218
+
219
+ # Create a new CallOperatorWriteNode node.
220
+ #
221
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?receiver: Prism::node?, ?call_operator_loc: Location?, ?message_loc: Location?, ?read_name: Symbol, ?write_name: Symbol, ?binary_operator: Symbol, ?binary_operator_loc: Location, ?value: Prism::node) -> CallOperatorWriteNode
222
+ def call_operator_write_node(source: default_source, node_id: 0, location: default_location, flags: 0, receiver: nil, call_operator_loc: nil, message_loc: nil, read_name: :"", write_name: :"", binary_operator: :"", binary_operator_loc: location, value: default_node(source, location))
223
+ CallOperatorWriteNode.new(source, node_id, location, flags, receiver, call_operator_loc, message_loc, read_name, write_name, binary_operator, binary_operator_loc, value)
224
+ end
225
+
226
+ # Create a new CallOrWriteNode node.
227
+ #
228
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?receiver: Prism::node?, ?call_operator_loc: Location?, ?message_loc: Location?, ?read_name: Symbol, ?write_name: Symbol, ?operator_loc: Location, ?value: Prism::node) -> CallOrWriteNode
229
+ def call_or_write_node(source: default_source, node_id: 0, location: default_location, flags: 0, receiver: nil, call_operator_loc: nil, message_loc: nil, read_name: :"", write_name: :"", operator_loc: location, value: default_node(source, location))
230
+ CallOrWriteNode.new(source, node_id, location, flags, receiver, call_operator_loc, message_loc, read_name, write_name, operator_loc, value)
231
+ end
232
+
233
+ # Create a new CallTargetNode node.
234
+ #
235
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?receiver: Prism::node, ?call_operator_loc: Location, ?name: Symbol, ?message_loc: Location) -> CallTargetNode
236
+ def call_target_node(source: default_source, node_id: 0, location: default_location, flags: 0, receiver: default_node(source, location), call_operator_loc: location, name: :"", message_loc: location)
237
+ CallTargetNode.new(source, node_id, location, flags, receiver, call_operator_loc, name, message_loc)
238
+ end
239
+
240
+ # Create a new CapturePatternNode node.
241
+ #
242
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?value: Prism::node, ?target: LocalVariableTargetNode, ?operator_loc: Location) -> CapturePatternNode
243
+ def capture_pattern_node(source: default_source, node_id: 0, location: default_location, flags: 0, value: default_node(source, location), target: local_variable_target_node(source: source), operator_loc: location)
244
+ CapturePatternNode.new(source, node_id, location, flags, value, target, operator_loc)
245
+ end
246
+
247
+ # Create a new CaseMatchNode node.
248
+ #
249
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?predicate: Prism::node?, ?conditions: Array[InNode], ?else_clause: ElseNode?, ?case_keyword_loc: Location, ?end_keyword_loc: Location) -> CaseMatchNode
250
+ def case_match_node(source: default_source, node_id: 0, location: default_location, flags: 0, predicate: nil, conditions: [], else_clause: nil, case_keyword_loc: location, end_keyword_loc: location)
251
+ CaseMatchNode.new(source, node_id, location, flags, predicate, conditions, else_clause, case_keyword_loc, end_keyword_loc)
252
+ end
253
+
254
+ # Create a new CaseNode node.
255
+ #
256
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?predicate: Prism::node?, ?conditions: Array[WhenNode], ?else_clause: ElseNode?, ?case_keyword_loc: Location, ?end_keyword_loc: Location) -> CaseNode
257
+ def case_node(source: default_source, node_id: 0, location: default_location, flags: 0, predicate: nil, conditions: [], else_clause: nil, case_keyword_loc: location, end_keyword_loc: location)
258
+ CaseNode.new(source, node_id, location, flags, predicate, conditions, else_clause, case_keyword_loc, end_keyword_loc)
259
+ end
260
+
261
+ # Create a new ClassNode node.
262
+ #
263
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?locals: Array[Symbol], ?class_keyword_loc: Location, ?constant_path: (ConstantReadNode | ConstantPathNode), ?inheritance_operator_loc: Location?, ?superclass: Prism::node?, ?body: (StatementsNode | BeginNode)?, ?end_keyword_loc: Location, ?name: Symbol) -> ClassNode
264
+ def class_node(source: default_source, node_id: 0, location: default_location, flags: 0, locals: [], class_keyword_loc: location, constant_path: constant_read_node(source: source), inheritance_operator_loc: nil, superclass: nil, body: nil, end_keyword_loc: location, name: :"")
265
+ ClassNode.new(source, node_id, location, flags, locals, class_keyword_loc, constant_path, inheritance_operator_loc, superclass, body, end_keyword_loc, name)
266
+ end
267
+
268
+ # Create a new ClassVariableAndWriteNode node.
269
+ #
270
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node) -> ClassVariableAndWriteNode
271
+ def class_variable_and_write_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :"", name_loc: location, operator_loc: location, value: default_node(source, location))
272
+ ClassVariableAndWriteNode.new(source, node_id, location, flags, name, name_loc, operator_loc, value)
273
+ end
274
+
275
+ # Create a new ClassVariableOperatorWriteNode node.
276
+ #
277
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?binary_operator_loc: Location, ?value: Prism::node, ?binary_operator: Symbol) -> ClassVariableOperatorWriteNode
278
+ def class_variable_operator_write_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :"", name_loc: location, binary_operator_loc: location, value: default_node(source, location), binary_operator: :"")
279
+ ClassVariableOperatorWriteNode.new(source, node_id, location, flags, name, name_loc, binary_operator_loc, value, binary_operator)
280
+ end
281
+
282
+ # Create a new ClassVariableOrWriteNode node.
283
+ #
284
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node) -> ClassVariableOrWriteNode
285
+ def class_variable_or_write_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :"", name_loc: location, operator_loc: location, value: default_node(source, location))
286
+ ClassVariableOrWriteNode.new(source, node_id, location, flags, name, name_loc, operator_loc, value)
287
+ end
288
+
289
+ # Create a new ClassVariableReadNode node.
290
+ #
291
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol) -> ClassVariableReadNode
292
+ def class_variable_read_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :"")
293
+ ClassVariableReadNode.new(source, node_id, location, flags, name)
294
+ end
295
+
296
+ # Create a new ClassVariableTargetNode node.
297
+ #
298
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol) -> ClassVariableTargetNode
299
+ def class_variable_target_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :"")
300
+ ClassVariableTargetNode.new(source, node_id, location, flags, name)
301
+ end
302
+
303
+ # Create a new ClassVariableWriteNode node.
304
+ #
305
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?value: Prism::node, ?operator_loc: Location) -> ClassVariableWriteNode
306
+ def class_variable_write_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :"", name_loc: location, value: default_node(source, location), operator_loc: location)
307
+ ClassVariableWriteNode.new(source, node_id, location, flags, name, name_loc, value, operator_loc)
308
+ end
309
+
310
+ # Create a new ConstantAndWriteNode node.
311
+ #
312
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node) -> ConstantAndWriteNode
313
+ def constant_and_write_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :"", name_loc: location, operator_loc: location, value: default_node(source, location))
314
+ ConstantAndWriteNode.new(source, node_id, location, flags, name, name_loc, operator_loc, value)
315
+ end
316
+
317
+ # Create a new ConstantOperatorWriteNode node.
318
+ #
319
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?binary_operator_loc: Location, ?value: Prism::node, ?binary_operator: Symbol) -> ConstantOperatorWriteNode
320
+ def constant_operator_write_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :"", name_loc: location, binary_operator_loc: location, value: default_node(source, location), binary_operator: :"")
321
+ ConstantOperatorWriteNode.new(source, node_id, location, flags, name, name_loc, binary_operator_loc, value, binary_operator)
322
+ end
323
+
324
+ # Create a new ConstantOrWriteNode node.
325
+ #
326
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node) -> ConstantOrWriteNode
327
+ def constant_or_write_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :"", name_loc: location, operator_loc: location, value: default_node(source, location))
328
+ ConstantOrWriteNode.new(source, node_id, location, flags, name, name_loc, operator_loc, value)
329
+ end
330
+
331
+ # Create a new ConstantPathAndWriteNode node.
332
+ #
333
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?target: ConstantPathNode, ?operator_loc: Location, ?value: Prism::node) -> ConstantPathAndWriteNode
334
+ def constant_path_and_write_node(source: default_source, node_id: 0, location: default_location, flags: 0, target: constant_path_node(source: source), operator_loc: location, value: default_node(source, location))
335
+ ConstantPathAndWriteNode.new(source, node_id, location, flags, target, operator_loc, value)
336
+ end
337
+
338
+ # Create a new ConstantPathNode node.
339
+ #
340
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?parent: Prism::node?, ?name: Symbol?, ?delimiter_loc: Location, ?name_loc: Location) -> ConstantPathNode
341
+ def constant_path_node(source: default_source, node_id: 0, location: default_location, flags: 0, parent: nil, name: nil, delimiter_loc: location, name_loc: location)
342
+ ConstantPathNode.new(source, node_id, location, flags, parent, name, delimiter_loc, name_loc)
343
+ end
344
+
345
+ # Create a new ConstantPathOperatorWriteNode node.
346
+ #
347
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?target: ConstantPathNode, ?binary_operator_loc: Location, ?value: Prism::node, ?binary_operator: Symbol) -> ConstantPathOperatorWriteNode
348
+ def constant_path_operator_write_node(source: default_source, node_id: 0, location: default_location, flags: 0, target: constant_path_node(source: source), binary_operator_loc: location, value: default_node(source, location), binary_operator: :"")
349
+ ConstantPathOperatorWriteNode.new(source, node_id, location, flags, target, binary_operator_loc, value, binary_operator)
350
+ end
351
+
352
+ # Create a new ConstantPathOrWriteNode node.
353
+ #
354
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?target: ConstantPathNode, ?operator_loc: Location, ?value: Prism::node) -> ConstantPathOrWriteNode
355
+ def constant_path_or_write_node(source: default_source, node_id: 0, location: default_location, flags: 0, target: constant_path_node(source: source), operator_loc: location, value: default_node(source, location))
356
+ ConstantPathOrWriteNode.new(source, node_id, location, flags, target, operator_loc, value)
357
+ end
358
+
359
+ # Create a new ConstantPathTargetNode node.
360
+ #
361
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?parent: Prism::node?, ?name: Symbol?, ?delimiter_loc: Location, ?name_loc: Location) -> ConstantPathTargetNode
362
+ def constant_path_target_node(source: default_source, node_id: 0, location: default_location, flags: 0, parent: nil, name: nil, delimiter_loc: location, name_loc: location)
363
+ ConstantPathTargetNode.new(source, node_id, location, flags, parent, name, delimiter_loc, name_loc)
364
+ end
365
+
366
+ # Create a new ConstantPathWriteNode node.
367
+ #
368
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?target: ConstantPathNode, ?operator_loc: Location, ?value: Prism::node) -> ConstantPathWriteNode
369
+ def constant_path_write_node(source: default_source, node_id: 0, location: default_location, flags: 0, target: constant_path_node(source: source), operator_loc: location, value: default_node(source, location))
370
+ ConstantPathWriteNode.new(source, node_id, location, flags, target, operator_loc, value)
371
+ end
372
+
373
+ # Create a new ConstantReadNode node.
374
+ #
375
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol) -> ConstantReadNode
376
+ def constant_read_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :"")
377
+ ConstantReadNode.new(source, node_id, location, flags, name)
378
+ end
379
+
380
+ # Create a new ConstantTargetNode node.
381
+ #
382
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol) -> ConstantTargetNode
383
+ def constant_target_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :"")
384
+ ConstantTargetNode.new(source, node_id, location, flags, name)
385
+ end
386
+
387
+ # Create a new ConstantWriteNode node.
388
+ #
389
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?value: Prism::node, ?operator_loc: Location) -> ConstantWriteNode
390
+ def constant_write_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :"", name_loc: location, value: default_node(source, location), operator_loc: location)
391
+ ConstantWriteNode.new(source, node_id, location, flags, name, name_loc, value, operator_loc)
392
+ end
393
+
394
+ # Create a new DefNode node.
395
+ #
396
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?receiver: Prism::node?, ?parameters: ParametersNode?, ?body: (StatementsNode | BeginNode)?, ?locals: Array[Symbol], ?def_keyword_loc: Location, ?operator_loc: Location?, ?lparen_loc: Location?, ?rparen_loc: Location?, ?equal_loc: Location?, ?end_keyword_loc: Location?) -> DefNode
397
+ def def_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :"", name_loc: location, receiver: nil, parameters: nil, body: nil, locals: [], def_keyword_loc: location, operator_loc: nil, lparen_loc: nil, rparen_loc: nil, equal_loc: nil, end_keyword_loc: nil)
398
+ DefNode.new(source, node_id, location, flags, name, name_loc, receiver, parameters, body, locals, def_keyword_loc, operator_loc, lparen_loc, rparen_loc, equal_loc, end_keyword_loc)
399
+ end
400
+
401
+ # Create a new DefinedNode node.
402
+ #
403
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?lparen_loc: Location?, ?value: Prism::node, ?rparen_loc: Location?, ?keyword_loc: Location) -> DefinedNode
404
+ def defined_node(source: default_source, node_id: 0, location: default_location, flags: 0, lparen_loc: nil, value: default_node(source, location), rparen_loc: nil, keyword_loc: location)
405
+ DefinedNode.new(source, node_id, location, flags, lparen_loc, value, rparen_loc, keyword_loc)
406
+ end
407
+
408
+ # Create a new ElseNode node.
409
+ #
410
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?else_keyword_loc: Location, ?statements: StatementsNode?, ?end_keyword_loc: Location?) -> ElseNode
411
+ def else_node(source: default_source, node_id: 0, location: default_location, flags: 0, else_keyword_loc: location, statements: nil, end_keyword_loc: nil)
412
+ ElseNode.new(source, node_id, location, flags, else_keyword_loc, statements, end_keyword_loc)
413
+ end
414
+
415
+ # Create a new EmbeddedStatementsNode node.
416
+ #
417
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?opening_loc: Location, ?statements: StatementsNode?, ?closing_loc: Location) -> EmbeddedStatementsNode
418
+ def embedded_statements_node(source: default_source, node_id: 0, location: default_location, flags: 0, opening_loc: location, statements: nil, closing_loc: location)
419
+ EmbeddedStatementsNode.new(source, node_id, location, flags, opening_loc, statements, closing_loc)
420
+ end
421
+
422
+ # Create a new EmbeddedVariableNode node.
423
+ #
424
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?operator_loc: Location, ?variable: (InstanceVariableReadNode | ClassVariableReadNode | GlobalVariableReadNode | BackReferenceReadNode | NumberedReferenceReadNode)) -> EmbeddedVariableNode
425
+ def embedded_variable_node(source: default_source, node_id: 0, location: default_location, flags: 0, operator_loc: location, variable: instance_variable_read_node(source: source))
426
+ EmbeddedVariableNode.new(source, node_id, location, flags, operator_loc, variable)
427
+ end
428
+
429
+ # Create a new EnsureNode node.
430
+ #
431
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?ensure_keyword_loc: Location, ?statements: StatementsNode?, ?end_keyword_loc: Location) -> EnsureNode
432
+ def ensure_node(source: default_source, node_id: 0, location: default_location, flags: 0, ensure_keyword_loc: location, statements: nil, end_keyword_loc: location)
433
+ EnsureNode.new(source, node_id, location, flags, ensure_keyword_loc, statements, end_keyword_loc)
434
+ end
435
+
436
+ # Create a new ErrorRecoveryNode node.
437
+ #
438
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?unexpected: Prism::node?) -> ErrorRecoveryNode
439
+ def error_recovery_node(source: default_source, node_id: 0, location: default_location, flags: 0, unexpected: nil)
440
+ ErrorRecoveryNode.new(source, node_id, location, flags, unexpected)
441
+ end
442
+
443
+ # Create a new FalseNode node.
444
+ #
445
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer) -> FalseNode
446
+ def false_node(source: default_source, node_id: 0, location: default_location, flags: 0)
447
+ FalseNode.new(source, node_id, location, flags)
448
+ end
449
+
450
+ # Create a new FindPatternNode node.
451
+ #
452
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?constant: (ConstantPathNode | ConstantReadNode)?, ?left: SplatNode, ?requireds: Array[Prism::node], ?right: SplatNode, ?opening_loc: Location?, ?closing_loc: Location?) -> FindPatternNode
453
+ def find_pattern_node(source: default_source, node_id: 0, location: default_location, flags: 0, constant: nil, left: splat_node(source: source), requireds: [], right: splat_node(source: source), opening_loc: nil, closing_loc: nil)
454
+ FindPatternNode.new(source, node_id, location, flags, constant, left, requireds, right, opening_loc, closing_loc)
455
+ end
456
+
457
+ # Create a new FlipFlopNode node.
458
+ #
459
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?left: Prism::node?, ?right: Prism::node?, ?operator_loc: Location) -> FlipFlopNode
460
+ def flip_flop_node(source: default_source, node_id: 0, location: default_location, flags: 0, left: nil, right: nil, operator_loc: location)
461
+ FlipFlopNode.new(source, node_id, location, flags, left, right, operator_loc)
462
+ end
463
+
464
+ # Create a new FloatNode node.
465
+ #
466
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?value: Float) -> FloatNode
467
+ def float_node(source: default_source, node_id: 0, location: default_location, flags: 0, value: 0.0)
468
+ FloatNode.new(source, node_id, location, flags, value)
469
+ end
470
+
471
+ # Create a new ForNode node.
472
+ #
473
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?index: (LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode), ?collection: Prism::node, ?statements: StatementsNode?, ?for_keyword_loc: Location, ?in_keyword_loc: Location, ?do_keyword_loc: Location?, ?end_keyword_loc: Location) -> ForNode
474
+ def for_node(source: default_source, node_id: 0, location: default_location, flags: 0, index: local_variable_target_node(source: source), collection: default_node(source, location), statements: nil, for_keyword_loc: location, in_keyword_loc: location, do_keyword_loc: nil, end_keyword_loc: location)
475
+ ForNode.new(source, node_id, location, flags, index, collection, statements, for_keyword_loc, in_keyword_loc, do_keyword_loc, end_keyword_loc)
476
+ end
477
+
478
+ # Create a new ForwardingArgumentsNode node.
479
+ #
480
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer) -> ForwardingArgumentsNode
481
+ def forwarding_arguments_node(source: default_source, node_id: 0, location: default_location, flags: 0)
482
+ ForwardingArgumentsNode.new(source, node_id, location, flags)
483
+ end
484
+
485
+ # Create a new ForwardingParameterNode node.
486
+ #
487
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer) -> ForwardingParameterNode
488
+ def forwarding_parameter_node(source: default_source, node_id: 0, location: default_location, flags: 0)
489
+ ForwardingParameterNode.new(source, node_id, location, flags)
490
+ end
491
+
492
+ # Create a new ForwardingSuperNode node.
493
+ #
494
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?keyword_loc: Location, ?block: BlockNode?) -> ForwardingSuperNode
495
+ def forwarding_super_node(source: default_source, node_id: 0, location: default_location, flags: 0, keyword_loc: location, block: nil)
496
+ ForwardingSuperNode.new(source, node_id, location, flags, keyword_loc, block)
497
+ end
498
+
499
+ # Create a new GlobalVariableAndWriteNode node.
500
+ #
501
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node) -> GlobalVariableAndWriteNode
502
+ def global_variable_and_write_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :"", name_loc: location, operator_loc: location, value: default_node(source, location))
503
+ GlobalVariableAndWriteNode.new(source, node_id, location, flags, name, name_loc, operator_loc, value)
504
+ end
505
+
506
+ # Create a new GlobalVariableOperatorWriteNode node.
507
+ #
508
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?binary_operator_loc: Location, ?value: Prism::node, ?binary_operator: Symbol) -> GlobalVariableOperatorWriteNode
509
+ def global_variable_operator_write_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :"", name_loc: location, binary_operator_loc: location, value: default_node(source, location), binary_operator: :"")
510
+ GlobalVariableOperatorWriteNode.new(source, node_id, location, flags, name, name_loc, binary_operator_loc, value, binary_operator)
511
+ end
512
+
513
+ # Create a new GlobalVariableOrWriteNode node.
514
+ #
515
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node) -> GlobalVariableOrWriteNode
516
+ def global_variable_or_write_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :"", name_loc: location, operator_loc: location, value: default_node(source, location))
517
+ GlobalVariableOrWriteNode.new(source, node_id, location, flags, name, name_loc, operator_loc, value)
518
+ end
519
+
520
+ # Create a new GlobalVariableReadNode node.
521
+ #
522
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol) -> GlobalVariableReadNode
523
+ def global_variable_read_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :"")
524
+ GlobalVariableReadNode.new(source, node_id, location, flags, name)
525
+ end
526
+
527
+ # Create a new GlobalVariableTargetNode node.
528
+ #
529
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol) -> GlobalVariableTargetNode
530
+ def global_variable_target_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :"")
531
+ GlobalVariableTargetNode.new(source, node_id, location, flags, name)
532
+ end
533
+
534
+ # Create a new GlobalVariableWriteNode node.
535
+ #
536
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?value: Prism::node, ?operator_loc: Location) -> GlobalVariableWriteNode
537
+ def global_variable_write_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :"", name_loc: location, value: default_node(source, location), operator_loc: location)
538
+ GlobalVariableWriteNode.new(source, node_id, location, flags, name, name_loc, value, operator_loc)
539
+ end
540
+
541
+ # Create a new HashNode node.
542
+ #
543
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?opening_loc: Location, ?elements: Array[AssocNode | AssocSplatNode], ?closing_loc: Location) -> HashNode
544
+ def hash_node(source: default_source, node_id: 0, location: default_location, flags: 0, opening_loc: location, elements: [], closing_loc: location)
545
+ HashNode.new(source, node_id, location, flags, opening_loc, elements, closing_loc)
546
+ end
547
+
548
+ # Create a new HashPatternNode node.
549
+ #
550
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?constant: (ConstantPathNode | ConstantReadNode)?, ?elements: Array[AssocNode], ?rest: (AssocSplatNode | NoKeywordsParameterNode)?, ?opening_loc: Location?, ?closing_loc: Location?) -> HashPatternNode
551
+ def hash_pattern_node(source: default_source, node_id: 0, location: default_location, flags: 0, constant: nil, elements: [], rest: nil, opening_loc: nil, closing_loc: nil)
552
+ HashPatternNode.new(source, node_id, location, flags, constant, elements, rest, opening_loc, closing_loc)
553
+ end
554
+
555
+ # Create a new IfNode node.
556
+ #
557
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?if_keyword_loc: Location?, ?predicate: Prism::node, ?then_keyword_loc: Location?, ?statements: StatementsNode?, ?subsequent: (ElseNode | IfNode)?, ?end_keyword_loc: Location?) -> IfNode
558
+ def if_node(source: default_source, node_id: 0, location: default_location, flags: 0, if_keyword_loc: nil, predicate: default_node(source, location), then_keyword_loc: nil, statements: nil, subsequent: nil, end_keyword_loc: nil)
559
+ IfNode.new(source, node_id, location, flags, if_keyword_loc, predicate, then_keyword_loc, statements, subsequent, end_keyword_loc)
560
+ end
561
+
562
+ # Create a new ImaginaryNode node.
563
+ #
564
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?numeric: (FloatNode | IntegerNode | RationalNode)) -> ImaginaryNode
565
+ def imaginary_node(source: default_source, node_id: 0, location: default_location, flags: 0, numeric: float_node(source: source))
566
+ ImaginaryNode.new(source, node_id, location, flags, numeric)
567
+ end
568
+
569
+ # Create a new ImplicitNode node.
570
+ #
571
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?value: (LocalVariableReadNode | CallNode | ConstantReadNode | LocalVariableTargetNode)) -> ImplicitNode
572
+ def implicit_node(source: default_source, node_id: 0, location: default_location, flags: 0, value: local_variable_read_node(source: source))
573
+ ImplicitNode.new(source, node_id, location, flags, value)
574
+ end
575
+
576
+ # Create a new ImplicitRestNode node.
577
+ #
578
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer) -> ImplicitRestNode
579
+ def implicit_rest_node(source: default_source, node_id: 0, location: default_location, flags: 0)
580
+ ImplicitRestNode.new(source, node_id, location, flags)
581
+ end
582
+
583
+ # Create a new InNode node.
584
+ #
585
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?pattern: Prism::node, ?statements: StatementsNode?, ?in_keyword_loc: Location, ?then_keyword_loc: Location?) -> InNode
586
+ def in_node(source: default_source, node_id: 0, location: default_location, flags: 0, pattern: default_node(source, location), statements: nil, in_keyword_loc: location, then_keyword_loc: nil)
587
+ InNode.new(source, node_id, location, flags, pattern, statements, in_keyword_loc, then_keyword_loc)
588
+ end
589
+
590
+ # Create a new IndexAndWriteNode node.
591
+ #
592
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?receiver: Prism::node?, ?call_operator_loc: Location?, ?opening_loc: Location, ?arguments: ArgumentsNode?, ?closing_loc: Location, ?block: BlockArgumentNode?, ?operator_loc: Location, ?value: Prism::node) -> IndexAndWriteNode
593
+ def index_and_write_node(source: default_source, node_id: 0, location: default_location, flags: 0, receiver: nil, call_operator_loc: nil, opening_loc: location, arguments: nil, closing_loc: location, block: nil, operator_loc: location, value: default_node(source, location))
594
+ IndexAndWriteNode.new(source, node_id, location, flags, receiver, call_operator_loc, opening_loc, arguments, closing_loc, block, operator_loc, value)
595
+ end
596
+
597
+ # Create a new IndexOperatorWriteNode node.
598
+ #
599
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?receiver: Prism::node?, ?call_operator_loc: Location?, ?opening_loc: Location, ?arguments: ArgumentsNode?, ?closing_loc: Location, ?block: BlockArgumentNode?, ?binary_operator: Symbol, ?binary_operator_loc: Location, ?value: Prism::node) -> IndexOperatorWriteNode
600
+ def index_operator_write_node(source: default_source, node_id: 0, location: default_location, flags: 0, receiver: nil, call_operator_loc: nil, opening_loc: location, arguments: nil, closing_loc: location, block: nil, binary_operator: :"", binary_operator_loc: location, value: default_node(source, location))
601
+ IndexOperatorWriteNode.new(source, node_id, location, flags, receiver, call_operator_loc, opening_loc, arguments, closing_loc, block, binary_operator, binary_operator_loc, value)
602
+ end
603
+
604
+ # Create a new IndexOrWriteNode node.
605
+ #
606
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?receiver: Prism::node?, ?call_operator_loc: Location?, ?opening_loc: Location, ?arguments: ArgumentsNode?, ?closing_loc: Location, ?block: BlockArgumentNode?, ?operator_loc: Location, ?value: Prism::node) -> IndexOrWriteNode
607
+ def index_or_write_node(source: default_source, node_id: 0, location: default_location, flags: 0, receiver: nil, call_operator_loc: nil, opening_loc: location, arguments: nil, closing_loc: location, block: nil, operator_loc: location, value: default_node(source, location))
608
+ IndexOrWriteNode.new(source, node_id, location, flags, receiver, call_operator_loc, opening_loc, arguments, closing_loc, block, operator_loc, value)
609
+ end
610
+
611
+ # Create a new IndexTargetNode node.
612
+ #
613
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?receiver: Prism::node, ?opening_loc: Location, ?arguments: ArgumentsNode?, ?closing_loc: Location, ?block: BlockArgumentNode?) -> IndexTargetNode
614
+ def index_target_node(source: default_source, node_id: 0, location: default_location, flags: 0, receiver: default_node(source, location), opening_loc: location, arguments: nil, closing_loc: location, block: nil)
615
+ IndexTargetNode.new(source, node_id, location, flags, receiver, opening_loc, arguments, closing_loc, block)
616
+ end
617
+
618
+ # Create a new InstanceVariableAndWriteNode node.
619
+ #
620
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node) -> InstanceVariableAndWriteNode
621
+ def instance_variable_and_write_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :"", name_loc: location, operator_loc: location, value: default_node(source, location))
622
+ InstanceVariableAndWriteNode.new(source, node_id, location, flags, name, name_loc, operator_loc, value)
623
+ end
624
+
625
+ # Create a new InstanceVariableOperatorWriteNode node.
626
+ #
627
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?binary_operator_loc: Location, ?value: Prism::node, ?binary_operator: Symbol) -> InstanceVariableOperatorWriteNode
628
+ def instance_variable_operator_write_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :"", name_loc: location, binary_operator_loc: location, value: default_node(source, location), binary_operator: :"")
629
+ InstanceVariableOperatorWriteNode.new(source, node_id, location, flags, name, name_loc, binary_operator_loc, value, binary_operator)
630
+ end
631
+
632
+ # Create a new InstanceVariableOrWriteNode node.
633
+ #
634
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node) -> InstanceVariableOrWriteNode
635
+ def instance_variable_or_write_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :"", name_loc: location, operator_loc: location, value: default_node(source, location))
636
+ InstanceVariableOrWriteNode.new(source, node_id, location, flags, name, name_loc, operator_loc, value)
637
+ end
638
+
639
+ # Create a new InstanceVariableReadNode node.
640
+ #
641
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol) -> InstanceVariableReadNode
642
+ def instance_variable_read_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :"")
643
+ InstanceVariableReadNode.new(source, node_id, location, flags, name)
644
+ end
645
+
646
+ # Create a new InstanceVariableTargetNode node.
647
+ #
648
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol) -> InstanceVariableTargetNode
649
+ def instance_variable_target_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :"")
650
+ InstanceVariableTargetNode.new(source, node_id, location, flags, name)
651
+ end
652
+
653
+ # Create a new InstanceVariableWriteNode node.
654
+ #
655
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?value: Prism::node, ?operator_loc: Location) -> InstanceVariableWriteNode
656
+ def instance_variable_write_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :"", name_loc: location, value: default_node(source, location), operator_loc: location)
657
+ InstanceVariableWriteNode.new(source, node_id, location, flags, name, name_loc, value, operator_loc)
658
+ end
659
+
660
+ # Create a new IntegerNode node.
661
+ #
662
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?value: Integer) -> IntegerNode
663
+ def integer_node(source: default_source, node_id: 0, location: default_location, flags: 0, value: 0)
664
+ IntegerNode.new(source, node_id, location, flags, value)
665
+ end
666
+
667
+ # Create a new InterpolatedMatchLastLineNode node.
668
+ #
669
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?opening_loc: Location, ?parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode], ?closing_loc: Location) -> InterpolatedMatchLastLineNode
670
+ def interpolated_match_last_line_node(source: default_source, node_id: 0, location: default_location, flags: 0, opening_loc: location, parts: [], closing_loc: location)
671
+ InterpolatedMatchLastLineNode.new(source, node_id, location, flags, opening_loc, parts, closing_loc)
672
+ end
673
+
674
+ # Create a new InterpolatedRegularExpressionNode node.
675
+ #
676
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?opening_loc: Location, ?parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode], ?closing_loc: Location) -> InterpolatedRegularExpressionNode
677
+ def interpolated_regular_expression_node(source: default_source, node_id: 0, location: default_location, flags: 0, opening_loc: location, parts: [], closing_loc: location)
678
+ InterpolatedRegularExpressionNode.new(source, node_id, location, flags, opening_loc, parts, closing_loc)
679
+ end
680
+
681
+ # Create a new InterpolatedStringNode node.
682
+ #
683
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?opening_loc: Location?, ?parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode | InterpolatedStringNode], ?closing_loc: Location?) -> InterpolatedStringNode
684
+ def interpolated_string_node(source: default_source, node_id: 0, location: default_location, flags: 0, opening_loc: nil, parts: [], closing_loc: nil)
685
+ InterpolatedStringNode.new(source, node_id, location, flags, opening_loc, parts, closing_loc)
686
+ end
687
+
688
+ # Create a new InterpolatedSymbolNode node.
689
+ #
690
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?opening_loc: Location?, ?parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode], ?closing_loc: Location?) -> InterpolatedSymbolNode
691
+ def interpolated_symbol_node(source: default_source, node_id: 0, location: default_location, flags: 0, opening_loc: nil, parts: [], closing_loc: nil)
692
+ InterpolatedSymbolNode.new(source, node_id, location, flags, opening_loc, parts, closing_loc)
693
+ end
694
+
695
+ # Create a new InterpolatedXStringNode node.
696
+ #
697
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?opening_loc: Location, ?parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode], ?closing_loc: Location) -> InterpolatedXStringNode
698
+ def interpolated_x_string_node(source: default_source, node_id: 0, location: default_location, flags: 0, opening_loc: location, parts: [], closing_loc: location)
699
+ InterpolatedXStringNode.new(source, node_id, location, flags, opening_loc, parts, closing_loc)
700
+ end
701
+
702
+ # Create a new ItLocalVariableReadNode node.
703
+ #
704
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer) -> ItLocalVariableReadNode
705
+ def it_local_variable_read_node(source: default_source, node_id: 0, location: default_location, flags: 0)
706
+ ItLocalVariableReadNode.new(source, node_id, location, flags)
707
+ end
708
+
709
+ # Create a new ItParametersNode node.
710
+ #
711
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer) -> ItParametersNode
712
+ def it_parameters_node(source: default_source, node_id: 0, location: default_location, flags: 0)
713
+ ItParametersNode.new(source, node_id, location, flags)
714
+ end
715
+
716
+ # Create a new KeywordHashNode node.
717
+ #
718
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?elements: Array[AssocNode | AssocSplatNode]) -> KeywordHashNode
719
+ def keyword_hash_node(source: default_source, node_id: 0, location: default_location, flags: 0, elements: [])
720
+ KeywordHashNode.new(source, node_id, location, flags, elements)
721
+ end
722
+
723
+ # Create a new KeywordRestParameterNode node.
724
+ #
725
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol?, ?name_loc: Location?, ?operator_loc: Location) -> KeywordRestParameterNode
726
+ def keyword_rest_parameter_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: nil, name_loc: nil, operator_loc: location)
727
+ KeywordRestParameterNode.new(source, node_id, location, flags, name, name_loc, operator_loc)
728
+ end
729
+
730
+ # Create a new LambdaNode node.
731
+ #
732
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?locals: Array[Symbol], ?operator_loc: Location, ?opening_loc: Location, ?closing_loc: Location, ?parameters: (BlockParametersNode | NumberedParametersNode | ItParametersNode)?, ?body: (StatementsNode | BeginNode)?) -> LambdaNode
733
+ def lambda_node(source: default_source, node_id: 0, location: default_location, flags: 0, locals: [], operator_loc: location, opening_loc: location, closing_loc: location, parameters: nil, body: nil)
734
+ LambdaNode.new(source, node_id, location, flags, locals, operator_loc, opening_loc, closing_loc, parameters, body)
735
+ end
736
+
737
+ # Create a new LocalVariableAndWriteNode node.
738
+ #
739
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node, ?name: Symbol, ?depth: Integer) -> LocalVariableAndWriteNode
740
+ def local_variable_and_write_node(source: default_source, node_id: 0, location: default_location, flags: 0, name_loc: location, operator_loc: location, value: default_node(source, location), name: :"", depth: 0)
741
+ LocalVariableAndWriteNode.new(source, node_id, location, flags, name_loc, operator_loc, value, name, depth)
742
+ end
743
+
744
+ # Create a new LocalVariableOperatorWriteNode node.
745
+ #
746
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?name_loc: Location, ?binary_operator_loc: Location, ?value: Prism::node, ?name: Symbol, ?binary_operator: Symbol, ?depth: Integer) -> LocalVariableOperatorWriteNode
747
+ def local_variable_operator_write_node(source: default_source, node_id: 0, location: default_location, flags: 0, name_loc: location, binary_operator_loc: location, value: default_node(source, location), name: :"", binary_operator: :"", depth: 0)
748
+ LocalVariableOperatorWriteNode.new(source, node_id, location, flags, name_loc, binary_operator_loc, value, name, binary_operator, depth)
749
+ end
750
+
751
+ # Create a new LocalVariableOrWriteNode node.
752
+ #
753
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node, ?name: Symbol, ?depth: Integer) -> LocalVariableOrWriteNode
754
+ def local_variable_or_write_node(source: default_source, node_id: 0, location: default_location, flags: 0, name_loc: location, operator_loc: location, value: default_node(source, location), name: :"", depth: 0)
755
+ LocalVariableOrWriteNode.new(source, node_id, location, flags, name_loc, operator_loc, value, name, depth)
756
+ end
757
+
758
+ # Create a new LocalVariableReadNode node.
759
+ #
760
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?depth: Integer) -> LocalVariableReadNode
761
+ def local_variable_read_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :"", depth: 0)
762
+ LocalVariableReadNode.new(source, node_id, location, flags, name, depth)
763
+ end
764
+
765
+ # Create a new LocalVariableTargetNode node.
766
+ #
767
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?depth: Integer) -> LocalVariableTargetNode
768
+ def local_variable_target_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :"", depth: 0)
769
+ LocalVariableTargetNode.new(source, node_id, location, flags, name, depth)
770
+ end
771
+
772
+ # Create a new LocalVariableWriteNode node.
773
+ #
774
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?depth: Integer, ?name_loc: Location, ?value: Prism::node, ?operator_loc: Location) -> LocalVariableWriteNode
775
+ def local_variable_write_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :"", depth: 0, name_loc: location, value: default_node(source, location), operator_loc: location)
776
+ LocalVariableWriteNode.new(source, node_id, location, flags, name, depth, name_loc, value, operator_loc)
777
+ end
778
+
779
+ # Create a new MatchLastLineNode node.
780
+ #
781
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?opening_loc: Location, ?content_loc: Location, ?closing_loc: Location, ?unescaped: String) -> MatchLastLineNode
782
+ def match_last_line_node(source: default_source, node_id: 0, location: default_location, flags: 0, opening_loc: location, content_loc: location, closing_loc: location, unescaped: "")
783
+ MatchLastLineNode.new(source, node_id, location, flags, opening_loc, content_loc, closing_loc, unescaped)
784
+ end
785
+
786
+ # Create a new MatchPredicateNode node.
787
+ #
788
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?value: Prism::node, ?pattern: Prism::node, ?keyword_loc: Location) -> MatchPredicateNode
789
+ def match_predicate_node(source: default_source, node_id: 0, location: default_location, flags: 0, value: default_node(source, location), pattern: default_node(source, location), keyword_loc: location)
790
+ MatchPredicateNode.new(source, node_id, location, flags, value, pattern, keyword_loc)
791
+ end
792
+
793
+ # Create a new MatchRequiredNode node.
794
+ #
795
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?value: Prism::node, ?pattern: Prism::node, ?operator_loc: Location) -> MatchRequiredNode
796
+ def match_required_node(source: default_source, node_id: 0, location: default_location, flags: 0, value: default_node(source, location), pattern: default_node(source, location), operator_loc: location)
797
+ MatchRequiredNode.new(source, node_id, location, flags, value, pattern, operator_loc)
798
+ end
799
+
800
+ # Create a new MatchWriteNode node.
801
+ #
802
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?call: CallNode, ?targets: Array[LocalVariableTargetNode]) -> MatchWriteNode
803
+ def match_write_node(source: default_source, node_id: 0, location: default_location, flags: 0, call: call_node(source: source), targets: [])
804
+ MatchWriteNode.new(source, node_id, location, flags, call, targets)
805
+ end
806
+
807
+ # Create a new ModuleNode node.
808
+ #
809
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?locals: Array[Symbol], ?module_keyword_loc: Location, ?constant_path: (ConstantReadNode | ConstantPathNode), ?body: (StatementsNode | BeginNode)?, ?end_keyword_loc: Location, ?name: Symbol) -> ModuleNode
810
+ def module_node(source: default_source, node_id: 0, location: default_location, flags: 0, locals: [], module_keyword_loc: location, constant_path: constant_read_node(source: source), body: nil, end_keyword_loc: location, name: :"")
811
+ ModuleNode.new(source, node_id, location, flags, locals, module_keyword_loc, constant_path, body, end_keyword_loc, name)
812
+ end
813
+
814
+ # Create a new MultiTargetNode node.
815
+ #
816
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?lefts: Array[LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode | RequiredParameterNode], ?rest: (ImplicitRestNode | SplatNode)?, ?rights: Array[LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode | RequiredParameterNode], ?lparen_loc: Location?, ?rparen_loc: Location?) -> MultiTargetNode
817
+ def multi_target_node(source: default_source, node_id: 0, location: default_location, flags: 0, lefts: [], rest: nil, rights: [], lparen_loc: nil, rparen_loc: nil)
818
+ MultiTargetNode.new(source, node_id, location, flags, lefts, rest, rights, lparen_loc, rparen_loc)
819
+ end
820
+
821
+ # Create a new MultiWriteNode node.
822
+ #
823
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?lefts: Array[LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode], ?rest: (ImplicitRestNode | SplatNode)?, ?rights: Array[LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode], ?lparen_loc: Location?, ?rparen_loc: Location?, ?operator_loc: Location, ?value: Prism::node) -> MultiWriteNode
824
+ def multi_write_node(source: default_source, node_id: 0, location: default_location, flags: 0, lefts: [], rest: nil, rights: [], lparen_loc: nil, rparen_loc: nil, operator_loc: location, value: default_node(source, location))
825
+ MultiWriteNode.new(source, node_id, location, flags, lefts, rest, rights, lparen_loc, rparen_loc, operator_loc, value)
826
+ end
827
+
828
+ # Create a new NextNode node.
829
+ #
830
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?arguments: ArgumentsNode?, ?keyword_loc: Location) -> NextNode
831
+ def next_node(source: default_source, node_id: 0, location: default_location, flags: 0, arguments: nil, keyword_loc: location)
832
+ NextNode.new(source, node_id, location, flags, arguments, keyword_loc)
833
+ end
834
+
835
+ # Create a new NilNode node.
836
+ #
837
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer) -> NilNode
838
+ def nil_node(source: default_source, node_id: 0, location: default_location, flags: 0)
839
+ NilNode.new(source, node_id, location, flags)
840
+ end
841
+
842
+ # Create a new NoBlockParameterNode node.
843
+ #
844
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?operator_loc: Location, ?keyword_loc: Location) -> NoBlockParameterNode
845
+ def no_block_parameter_node(source: default_source, node_id: 0, location: default_location, flags: 0, operator_loc: location, keyword_loc: location)
846
+ NoBlockParameterNode.new(source, node_id, location, flags, operator_loc, keyword_loc)
847
+ end
848
+
849
+ # Create a new NoKeywordsParameterNode node.
850
+ #
851
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?operator_loc: Location, ?keyword_loc: Location) -> NoKeywordsParameterNode
852
+ def no_keywords_parameter_node(source: default_source, node_id: 0, location: default_location, flags: 0, operator_loc: location, keyword_loc: location)
853
+ NoKeywordsParameterNode.new(source, node_id, location, flags, operator_loc, keyword_loc)
854
+ end
855
+
856
+ # Create a new NumberedParametersNode node.
857
+ #
858
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?maximum: Integer) -> NumberedParametersNode
859
+ def numbered_parameters_node(source: default_source, node_id: 0, location: default_location, flags: 0, maximum: 0)
860
+ NumberedParametersNode.new(source, node_id, location, flags, maximum)
861
+ end
862
+
863
+ # Create a new NumberedReferenceReadNode node.
864
+ #
865
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?number: Integer) -> NumberedReferenceReadNode
866
+ def numbered_reference_read_node(source: default_source, node_id: 0, location: default_location, flags: 0, number: 0)
867
+ NumberedReferenceReadNode.new(source, node_id, location, flags, number)
868
+ end
869
+
870
+ # Create a new OptionalKeywordParameterNode node.
871
+ #
872
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?value: Prism::node) -> OptionalKeywordParameterNode
873
+ def optional_keyword_parameter_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :"", name_loc: location, value: default_node(source, location))
874
+ OptionalKeywordParameterNode.new(source, node_id, location, flags, name, name_loc, value)
875
+ end
876
+
877
+ # Create a new OptionalParameterNode node.
878
+ #
879
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node) -> OptionalParameterNode
880
+ def optional_parameter_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :"", name_loc: location, operator_loc: location, value: default_node(source, location))
881
+ OptionalParameterNode.new(source, node_id, location, flags, name, name_loc, operator_loc, value)
882
+ end
883
+
884
+ # Create a new OrNode node.
885
+ #
886
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?left: Prism::node, ?right: Prism::node, ?operator_loc: Location) -> OrNode
887
+ def or_node(source: default_source, node_id: 0, location: default_location, flags: 0, left: default_node(source, location), right: default_node(source, location), operator_loc: location)
888
+ OrNode.new(source, node_id, location, flags, left, right, operator_loc)
889
+ end
890
+
891
+ # Create a new ParametersNode node.
892
+ #
893
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?requireds: Array[RequiredParameterNode | MultiTargetNode], ?optionals: Array[OptionalParameterNode], ?rest: (RestParameterNode | ImplicitRestNode)?, ?posts: Array[RequiredParameterNode | MultiTargetNode], ?keywords: Array[RequiredKeywordParameterNode | OptionalKeywordParameterNode], ?keyword_rest: (KeywordRestParameterNode | ForwardingParameterNode | NoKeywordsParameterNode)?, ?block: (BlockParameterNode | NoBlockParameterNode)?) -> ParametersNode
894
+ def parameters_node(source: default_source, node_id: 0, location: default_location, flags: 0, requireds: [], optionals: [], rest: nil, posts: [], keywords: [], keyword_rest: nil, block: nil)
895
+ ParametersNode.new(source, node_id, location, flags, requireds, optionals, rest, posts, keywords, keyword_rest, block)
896
+ end
897
+
898
+ # Create a new ParenthesesNode node.
899
+ #
900
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?body: Prism::node?, ?opening_loc: Location, ?closing_loc: Location) -> ParenthesesNode
901
+ def parentheses_node(source: default_source, node_id: 0, location: default_location, flags: 0, body: nil, opening_loc: location, closing_loc: location)
902
+ ParenthesesNode.new(source, node_id, location, flags, body, opening_loc, closing_loc)
903
+ end
904
+
905
+ # Create a new PinnedExpressionNode node.
906
+ #
907
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?expression: Prism::node, ?operator_loc: Location, ?lparen_loc: Location, ?rparen_loc: Location) -> PinnedExpressionNode
908
+ def pinned_expression_node(source: default_source, node_id: 0, location: default_location, flags: 0, expression: default_node(source, location), operator_loc: location, lparen_loc: location, rparen_loc: location)
909
+ PinnedExpressionNode.new(source, node_id, location, flags, expression, operator_loc, lparen_loc, rparen_loc)
910
+ end
911
+
912
+ # Create a new PinnedVariableNode node.
913
+ #
914
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?variable: (LocalVariableReadNode | InstanceVariableReadNode | ClassVariableReadNode | GlobalVariableReadNode | BackReferenceReadNode | NumberedReferenceReadNode | ItLocalVariableReadNode), ?operator_loc: Location) -> PinnedVariableNode
915
+ def pinned_variable_node(source: default_source, node_id: 0, location: default_location, flags: 0, variable: local_variable_read_node(source: source), operator_loc: location)
916
+ PinnedVariableNode.new(source, node_id, location, flags, variable, operator_loc)
917
+ end
918
+
919
+ # Create a new PostExecutionNode node.
920
+ #
921
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?statements: StatementsNode?, ?keyword_loc: Location, ?opening_loc: Location, ?closing_loc: Location) -> PostExecutionNode
922
+ def post_execution_node(source: default_source, node_id: 0, location: default_location, flags: 0, statements: nil, keyword_loc: location, opening_loc: location, closing_loc: location)
923
+ PostExecutionNode.new(source, node_id, location, flags, statements, keyword_loc, opening_loc, closing_loc)
924
+ end
925
+
926
+ # Create a new PreExecutionNode node.
927
+ #
928
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?statements: StatementsNode?, ?keyword_loc: Location, ?opening_loc: Location, ?closing_loc: Location) -> PreExecutionNode
929
+ def pre_execution_node(source: default_source, node_id: 0, location: default_location, flags: 0, statements: nil, keyword_loc: location, opening_loc: location, closing_loc: location)
930
+ PreExecutionNode.new(source, node_id, location, flags, statements, keyword_loc, opening_loc, closing_loc)
931
+ end
932
+
933
+ # Create a new ProgramNode node.
934
+ #
935
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?locals: Array[Symbol], ?statements: StatementsNode) -> ProgramNode
936
+ def program_node(source: default_source, node_id: 0, location: default_location, flags: 0, locals: [], statements: statements_node(source: source))
937
+ ProgramNode.new(source, node_id, location, flags, locals, statements)
938
+ end
939
+
940
+ # Create a new RangeNode node.
941
+ #
942
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?left: Prism::node?, ?right: Prism::node?, ?operator_loc: Location) -> RangeNode
943
+ def range_node(source: default_source, node_id: 0, location: default_location, flags: 0, left: nil, right: nil, operator_loc: location)
944
+ RangeNode.new(source, node_id, location, flags, left, right, operator_loc)
945
+ end
946
+
947
+ # Create a new RationalNode node.
948
+ #
949
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?numerator: Integer, ?denominator: Integer) -> RationalNode
950
+ def rational_node(source: default_source, node_id: 0, location: default_location, flags: 0, numerator: 0, denominator: 0)
951
+ RationalNode.new(source, node_id, location, flags, numerator, denominator)
952
+ end
953
+
954
+ # Create a new RedoNode node.
955
+ #
956
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer) -> RedoNode
957
+ def redo_node(source: default_source, node_id: 0, location: default_location, flags: 0)
958
+ RedoNode.new(source, node_id, location, flags)
959
+ end
960
+
961
+ # Create a new RegularExpressionNode node.
962
+ #
963
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?opening_loc: Location, ?content_loc: Location, ?closing_loc: Location, ?unescaped: String) -> RegularExpressionNode
964
+ def regular_expression_node(source: default_source, node_id: 0, location: default_location, flags: 0, opening_loc: location, content_loc: location, closing_loc: location, unescaped: "")
965
+ RegularExpressionNode.new(source, node_id, location, flags, opening_loc, content_loc, closing_loc, unescaped)
966
+ end
967
+
968
+ # Create a new RequiredKeywordParameterNode node.
969
+ #
970
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location) -> RequiredKeywordParameterNode
971
+ def required_keyword_parameter_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :"", name_loc: location)
972
+ RequiredKeywordParameterNode.new(source, node_id, location, flags, name, name_loc)
973
+ end
974
+
975
+ # Create a new RequiredParameterNode node.
976
+ #
977
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol) -> RequiredParameterNode
978
+ def required_parameter_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :"")
979
+ RequiredParameterNode.new(source, node_id, location, flags, name)
980
+ end
981
+
982
+ # Create a new RescueModifierNode node.
983
+ #
984
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?expression: Prism::node, ?keyword_loc: Location, ?rescue_expression: Prism::node) -> RescueModifierNode
985
+ def rescue_modifier_node(source: default_source, node_id: 0, location: default_location, flags: 0, expression: default_node(source, location), keyword_loc: location, rescue_expression: default_node(source, location))
986
+ RescueModifierNode.new(source, node_id, location, flags, expression, keyword_loc, rescue_expression)
987
+ end
988
+
989
+ # Create a new RescueNode node.
990
+ #
991
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?keyword_loc: Location, ?exceptions: Array[Prism::node], ?operator_loc: Location?, ?reference: (LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode)?, ?then_keyword_loc: Location?, ?statements: StatementsNode?, ?subsequent: RescueNode?) -> RescueNode
992
+ def rescue_node(source: default_source, node_id: 0, location: default_location, flags: 0, keyword_loc: location, exceptions: [], operator_loc: nil, reference: nil, then_keyword_loc: nil, statements: nil, subsequent: nil)
993
+ RescueNode.new(source, node_id, location, flags, keyword_loc, exceptions, operator_loc, reference, then_keyword_loc, statements, subsequent)
994
+ end
995
+
996
+ # Create a new RestParameterNode node.
997
+ #
998
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol?, ?name_loc: Location?, ?operator_loc: Location) -> RestParameterNode
999
+ def rest_parameter_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: nil, name_loc: nil, operator_loc: location)
1000
+ RestParameterNode.new(source, node_id, location, flags, name, name_loc, operator_loc)
1001
+ end
1002
+
1003
+ # Create a new RetryNode node.
1004
+ #
1005
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer) -> RetryNode
1006
+ def retry_node(source: default_source, node_id: 0, location: default_location, flags: 0)
1007
+ RetryNode.new(source, node_id, location, flags)
1008
+ end
1009
+
1010
+ # Create a new ReturnNode node.
1011
+ #
1012
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?keyword_loc: Location, ?arguments: ArgumentsNode?) -> ReturnNode
1013
+ def return_node(source: default_source, node_id: 0, location: default_location, flags: 0, keyword_loc: location, arguments: nil)
1014
+ ReturnNode.new(source, node_id, location, flags, keyword_loc, arguments)
1015
+ end
1016
+
1017
+ # Create a new SelfNode node.
1018
+ #
1019
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer) -> SelfNode
1020
+ def self_node(source: default_source, node_id: 0, location: default_location, flags: 0)
1021
+ SelfNode.new(source, node_id, location, flags)
1022
+ end
1023
+
1024
+ # Create a new ShareableConstantNode node.
1025
+ #
1026
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?write: (ConstantWriteNode | ConstantAndWriteNode | ConstantOrWriteNode | ConstantOperatorWriteNode | ConstantPathWriteNode | ConstantPathAndWriteNode | ConstantPathOrWriteNode | ConstantPathOperatorWriteNode)) -> ShareableConstantNode
1027
+ def shareable_constant_node(source: default_source, node_id: 0, location: default_location, flags: 0, write: constant_write_node(source: source))
1028
+ ShareableConstantNode.new(source, node_id, location, flags, write)
1029
+ end
1030
+
1031
+ # Create a new SingletonClassNode node.
1032
+ #
1033
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?locals: Array[Symbol], ?class_keyword_loc: Location, ?operator_loc: Location, ?expression: Prism::node, ?body: (StatementsNode | BeginNode)?, ?end_keyword_loc: Location) -> SingletonClassNode
1034
+ def singleton_class_node(source: default_source, node_id: 0, location: default_location, flags: 0, locals: [], class_keyword_loc: location, operator_loc: location, expression: default_node(source, location), body: nil, end_keyword_loc: location)
1035
+ SingletonClassNode.new(source, node_id, location, flags, locals, class_keyword_loc, operator_loc, expression, body, end_keyword_loc)
1036
+ end
1037
+
1038
+ # Create a new SourceEncodingNode node.
1039
+ #
1040
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer) -> SourceEncodingNode
1041
+ def source_encoding_node(source: default_source, node_id: 0, location: default_location, flags: 0)
1042
+ SourceEncodingNode.new(source, node_id, location, flags)
1043
+ end
1044
+
1045
+ # Create a new SourceFileNode node.
1046
+ #
1047
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?filepath: String) -> SourceFileNode
1048
+ def source_file_node(source: default_source, node_id: 0, location: default_location, flags: 0, filepath: "")
1049
+ SourceFileNode.new(source, node_id, location, flags, filepath)
1050
+ end
1051
+
1052
+ # Create a new SourceLineNode node.
1053
+ #
1054
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer) -> SourceLineNode
1055
+ def source_line_node(source: default_source, node_id: 0, location: default_location, flags: 0)
1056
+ SourceLineNode.new(source, node_id, location, flags)
1057
+ end
1058
+
1059
+ # Create a new SplatNode node.
1060
+ #
1061
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?operator_loc: Location, ?expression: Prism::node?) -> SplatNode
1062
+ def splat_node(source: default_source, node_id: 0, location: default_location, flags: 0, operator_loc: location, expression: nil)
1063
+ SplatNode.new(source, node_id, location, flags, operator_loc, expression)
1064
+ end
1065
+
1066
+ # Create a new StatementsNode node.
1067
+ #
1068
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?body: Array[Prism::node]) -> StatementsNode
1069
+ def statements_node(source: default_source, node_id: 0, location: default_location, flags: 0, body: [])
1070
+ StatementsNode.new(source, node_id, location, flags, body)
1071
+ end
1072
+
1073
+ # Create a new StringNode node.
1074
+ #
1075
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?opening_loc: Location?, ?content_loc: Location, ?closing_loc: Location?, ?unescaped: String) -> StringNode
1076
+ def string_node(source: default_source, node_id: 0, location: default_location, flags: 0, opening_loc: nil, content_loc: location, closing_loc: nil, unescaped: "")
1077
+ StringNode.new(source, node_id, location, flags, opening_loc, content_loc, closing_loc, unescaped)
1078
+ end
1079
+
1080
+ # Create a new SuperNode node.
1081
+ #
1082
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?keyword_loc: Location, ?lparen_loc: Location?, ?arguments: ArgumentsNode?, ?rparen_loc: Location?, ?block: (BlockNode | BlockArgumentNode)?) -> SuperNode
1083
+ def super_node(source: default_source, node_id: 0, location: default_location, flags: 0, keyword_loc: location, lparen_loc: nil, arguments: nil, rparen_loc: nil, block: nil)
1084
+ SuperNode.new(source, node_id, location, flags, keyword_loc, lparen_loc, arguments, rparen_loc, block)
1085
+ end
1086
+
1087
+ # Create a new SymbolNode node.
1088
+ #
1089
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?opening_loc: Location?, ?content_loc: Location, ?closing_loc: Location?, ?unescaped: String) -> SymbolNode
1090
+ def symbol_node(source: default_source, node_id: 0, location: default_location, flags: 0, opening_loc: nil, content_loc: location, closing_loc: nil, unescaped: "")
1091
+ SymbolNode.new(source, node_id, location, flags, opening_loc, content_loc, closing_loc, unescaped)
1092
+ end
1093
+
1094
+ # Create a new TrueNode node.
1095
+ #
1096
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer) -> TrueNode
1097
+ def true_node(source: default_source, node_id: 0, location: default_location, flags: 0)
1098
+ TrueNode.new(source, node_id, location, flags)
1099
+ end
1100
+
1101
+ # Create a new UndefNode node.
1102
+ #
1103
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?names: Array[SymbolNode | InterpolatedSymbolNode], ?keyword_loc: Location) -> UndefNode
1104
+ def undef_node(source: default_source, node_id: 0, location: default_location, flags: 0, names: [], keyword_loc: location)
1105
+ UndefNode.new(source, node_id, location, flags, names, keyword_loc)
1106
+ end
1107
+
1108
+ # Create a new UnlessNode node.
1109
+ #
1110
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?unless_keyword_loc: Location, ?predicate: Prism::node, ?then_keyword_loc: Location?, ?statements: StatementsNode?, ?else_clause: ElseNode?, ?end_keyword_loc: Location?) -> UnlessNode
1111
+ def unless_node(source: default_source, node_id: 0, location: default_location, flags: 0, unless_keyword_loc: location, predicate: default_node(source, location), then_keyword_loc: nil, statements: nil, else_clause: nil, end_keyword_loc: nil)
1112
+ UnlessNode.new(source, node_id, location, flags, unless_keyword_loc, predicate, then_keyword_loc, statements, else_clause, end_keyword_loc)
1113
+ end
1114
+
1115
+ # Create a new UntilNode node.
1116
+ #
1117
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?until_keyword_loc: Location, ?do_keyword_loc: Location?, ?end_keyword_loc: Location?, ?predicate: Prism::node, ?statements: StatementsNode?) -> UntilNode
1118
+ def until_node(source: default_source, node_id: 0, location: default_location, flags: 0, until_keyword_loc: location, do_keyword_loc: nil, end_keyword_loc: nil, predicate: default_node(source, location), statements: nil)
1119
+ UntilNode.new(source, node_id, location, flags, until_keyword_loc, do_keyword_loc, end_keyword_loc, predicate, statements)
1120
+ end
1121
+
1122
+ # Create a new WhenNode node.
1123
+ #
1124
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?when_keyword_loc: Location, ?conditions: Array[Prism::node], ?then_keyword_loc: Location?, ?statements: StatementsNode?) -> WhenNode
1125
+ def when_node(source: default_source, node_id: 0, location: default_location, flags: 0, when_keyword_loc: location, conditions: [], then_keyword_loc: nil, statements: nil)
1126
+ WhenNode.new(source, node_id, location, flags, when_keyword_loc, conditions, then_keyword_loc, statements)
1127
+ end
1128
+
1129
+ # Create a new WhileNode node.
1130
+ #
1131
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?while_keyword_loc: Location, ?do_keyword_loc: Location?, ?end_keyword_loc: Location?, ?predicate: Prism::node, ?statements: StatementsNode?) -> WhileNode
1132
+ def while_node(source: default_source, node_id: 0, location: default_location, flags: 0, while_keyword_loc: location, do_keyword_loc: nil, end_keyword_loc: nil, predicate: default_node(source, location), statements: nil)
1133
+ WhileNode.new(source, node_id, location, flags, while_keyword_loc, do_keyword_loc, end_keyword_loc, predicate, statements)
1134
+ end
1135
+
1136
+ # Create a new XStringNode node.
1137
+ #
1138
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?opening_loc: Location, ?content_loc: Location, ?closing_loc: Location, ?unescaped: String) -> XStringNode
1139
+ def x_string_node(source: default_source, node_id: 0, location: default_location, flags: 0, opening_loc: location, content_loc: location, closing_loc: location, unescaped: "")
1140
+ XStringNode.new(source, node_id, location, flags, opening_loc, content_loc, closing_loc, unescaped)
1141
+ end
1142
+
1143
+ # Create a new YieldNode node.
1144
+ #
1145
+ #: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?keyword_loc: Location, ?lparen_loc: Location?, ?arguments: ArgumentsNode?, ?rparen_loc: Location?) -> YieldNode
1146
+ def yield_node(source: default_source, node_id: 0, location: default_location, flags: 0, keyword_loc: location, lparen_loc: nil, arguments: nil, rparen_loc: nil)
1147
+ YieldNode.new(source, node_id, location, flags, keyword_loc, lparen_loc, arguments, rparen_loc)
1148
+ end
1149
+
1150
+ # Retrieve the value of one of the ArgumentsNodeFlags flags.
1151
+ #
1152
+ #: (Symbol name) -> Integer
1153
+ def arguments_node_flag(name)
1154
+ case name
1155
+ when :contains_forwarding then ArgumentsNodeFlags::CONTAINS_FORWARDING
1156
+ when :contains_keywords then ArgumentsNodeFlags::CONTAINS_KEYWORDS
1157
+ when :contains_keyword_splat then ArgumentsNodeFlags::CONTAINS_KEYWORD_SPLAT
1158
+ when :contains_splat then ArgumentsNodeFlags::CONTAINS_SPLAT
1159
+ when :contains_multiple_splats then ArgumentsNodeFlags::CONTAINS_MULTIPLE_SPLATS
1160
+ else Kernel.raise ArgumentError, "invalid ArgumentsNodeFlags flag: #{name.inspect}"
1161
+ end
1162
+ end
1163
+
1164
+ # Retrieve the value of one of the ArrayNodeFlags flags.
1165
+ #
1166
+ #: (Symbol name) -> Integer
1167
+ def array_node_flag(name)
1168
+ case name
1169
+ when :contains_splat then ArrayNodeFlags::CONTAINS_SPLAT
1170
+ else Kernel.raise ArgumentError, "invalid ArrayNodeFlags flag: #{name.inspect}"
1171
+ end
1172
+ end
1173
+
1174
+ # Retrieve the value of one of the CallNodeFlags flags.
1175
+ #
1176
+ #: (Symbol name) -> Integer
1177
+ def call_node_flag(name)
1178
+ case name
1179
+ when :safe_navigation then CallNodeFlags::SAFE_NAVIGATION
1180
+ when :variable_call then CallNodeFlags::VARIABLE_CALL
1181
+ when :attribute_write then CallNodeFlags::ATTRIBUTE_WRITE
1182
+ when :ignore_visibility then CallNodeFlags::IGNORE_VISIBILITY
1183
+ else Kernel.raise ArgumentError, "invalid CallNodeFlags flag: #{name.inspect}"
1184
+ end
1185
+ end
1186
+
1187
+ # Retrieve the value of one of the EncodingFlags flags.
1188
+ #
1189
+ #: (Symbol name) -> Integer
1190
+ def encoding_flag(name)
1191
+ case name
1192
+ when :forced_utf8_encoding then EncodingFlags::FORCED_UTF8_ENCODING
1193
+ when :forced_binary_encoding then EncodingFlags::FORCED_BINARY_ENCODING
1194
+ else Kernel.raise ArgumentError, "invalid EncodingFlags flag: #{name.inspect}"
1195
+ end
1196
+ end
1197
+
1198
+ # Retrieve the value of one of the IntegerBaseFlags flags.
1199
+ #
1200
+ #: (Symbol name) -> Integer
1201
+ def integer_base_flag(name)
1202
+ case name
1203
+ when :binary then IntegerBaseFlags::BINARY
1204
+ when :decimal then IntegerBaseFlags::DECIMAL
1205
+ when :octal then IntegerBaseFlags::OCTAL
1206
+ when :hexadecimal then IntegerBaseFlags::HEXADECIMAL
1207
+ else Kernel.raise ArgumentError, "invalid IntegerBaseFlags flag: #{name.inspect}"
1208
+ end
1209
+ end
1210
+
1211
+ # Retrieve the value of one of the InterpolatedStringNodeFlags flags.
1212
+ #
1213
+ #: (Symbol name) -> Integer
1214
+ def interpolated_string_node_flag(name)
1215
+ case name
1216
+ when :frozen then InterpolatedStringNodeFlags::FROZEN
1217
+ when :mutable then InterpolatedStringNodeFlags::MUTABLE
1218
+ else Kernel.raise ArgumentError, "invalid InterpolatedStringNodeFlags flag: #{name.inspect}"
1219
+ end
1220
+ end
1221
+
1222
+ # Retrieve the value of one of the KeywordHashNodeFlags flags.
1223
+ #
1224
+ #: (Symbol name) -> Integer
1225
+ def keyword_hash_node_flag(name)
1226
+ case name
1227
+ when :symbol_keys then KeywordHashNodeFlags::SYMBOL_KEYS
1228
+ else Kernel.raise ArgumentError, "invalid KeywordHashNodeFlags flag: #{name.inspect}"
1229
+ end
1230
+ end
1231
+
1232
+ # Retrieve the value of one of the LoopFlags flags.
1233
+ #
1234
+ #: (Symbol name) -> Integer
1235
+ def loop_flag(name)
1236
+ case name
1237
+ when :begin_modifier then LoopFlags::BEGIN_MODIFIER
1238
+ else Kernel.raise ArgumentError, "invalid LoopFlags flag: #{name.inspect}"
1239
+ end
1240
+ end
1241
+
1242
+ # Retrieve the value of one of the ParameterFlags flags.
1243
+ #
1244
+ #: (Symbol name) -> Integer
1245
+ def parameter_flag(name)
1246
+ case name
1247
+ when :repeated_parameter then ParameterFlags::REPEATED_PARAMETER
1248
+ else Kernel.raise ArgumentError, "invalid ParameterFlags flag: #{name.inspect}"
1249
+ end
1250
+ end
1251
+
1252
+ # Retrieve the value of one of the ParenthesesNodeFlags flags.
1253
+ #
1254
+ #: (Symbol name) -> Integer
1255
+ def parentheses_node_flag(name)
1256
+ case name
1257
+ when :multiple_statements then ParenthesesNodeFlags::MULTIPLE_STATEMENTS
1258
+ else Kernel.raise ArgumentError, "invalid ParenthesesNodeFlags flag: #{name.inspect}"
1259
+ end
1260
+ end
1261
+
1262
+ # Retrieve the value of one of the RangeFlags flags.
1263
+ #
1264
+ #: (Symbol name) -> Integer
1265
+ def range_flag(name)
1266
+ case name
1267
+ when :exclude_end then RangeFlags::EXCLUDE_END
1268
+ else Kernel.raise ArgumentError, "invalid RangeFlags flag: #{name.inspect}"
1269
+ end
1270
+ end
1271
+
1272
+ # Retrieve the value of one of the RegularExpressionFlags flags.
1273
+ #
1274
+ #: (Symbol name) -> Integer
1275
+ def regular_expression_flag(name)
1276
+ case name
1277
+ when :ignore_case then RegularExpressionFlags::IGNORE_CASE
1278
+ when :extended then RegularExpressionFlags::EXTENDED
1279
+ when :multi_line then RegularExpressionFlags::MULTI_LINE
1280
+ when :once then RegularExpressionFlags::ONCE
1281
+ when :euc_jp then RegularExpressionFlags::EUC_JP
1282
+ when :ascii_8bit then RegularExpressionFlags::ASCII_8BIT
1283
+ when :windows_31j then RegularExpressionFlags::WINDOWS_31J
1284
+ when :utf_8 then RegularExpressionFlags::UTF_8
1285
+ when :forced_utf8_encoding then RegularExpressionFlags::FORCED_UTF8_ENCODING
1286
+ when :forced_binary_encoding then RegularExpressionFlags::FORCED_BINARY_ENCODING
1287
+ when :forced_us_ascii_encoding then RegularExpressionFlags::FORCED_US_ASCII_ENCODING
1288
+ else Kernel.raise ArgumentError, "invalid RegularExpressionFlags flag: #{name.inspect}"
1289
+ end
1290
+ end
1291
+
1292
+ # Retrieve the value of one of the ShareableConstantNodeFlags flags.
1293
+ #
1294
+ #: (Symbol name) -> Integer
1295
+ def shareable_constant_node_flag(name)
1296
+ case name
1297
+ when :literal then ShareableConstantNodeFlags::LITERAL
1298
+ when :experimental_everything then ShareableConstantNodeFlags::EXPERIMENTAL_EVERYTHING
1299
+ when :experimental_copy then ShareableConstantNodeFlags::EXPERIMENTAL_COPY
1300
+ else Kernel.raise ArgumentError, "invalid ShareableConstantNodeFlags flag: #{name.inspect}"
1301
+ end
1302
+ end
1303
+
1304
+ # Retrieve the value of one of the StringFlags flags.
1305
+ #
1306
+ #: (Symbol name) -> Integer
1307
+ def string_flag(name)
1308
+ case name
1309
+ when :forced_utf8_encoding then StringFlags::FORCED_UTF8_ENCODING
1310
+ when :forced_binary_encoding then StringFlags::FORCED_BINARY_ENCODING
1311
+ when :frozen then StringFlags::FROZEN
1312
+ when :mutable then StringFlags::MUTABLE
1313
+ else Kernel.raise ArgumentError, "invalid StringFlags flag: #{name.inspect}"
1314
+ end
1315
+ end
1316
+
1317
+ # Retrieve the value of one of the SymbolFlags flags.
1318
+ #
1319
+ #: (Symbol name) -> Integer
1320
+ def symbol_flag(name)
1321
+ case name
1322
+ when :forced_utf8_encoding then SymbolFlags::FORCED_UTF8_ENCODING
1323
+ when :forced_binary_encoding then SymbolFlags::FORCED_BINARY_ENCODING
1324
+ when :forced_us_ascii_encoding then SymbolFlags::FORCED_US_ASCII_ENCODING
1325
+ else Kernel.raise ArgumentError, "invalid SymbolFlags flag: #{name.inspect}"
1326
+ end
1327
+ end
1328
+
1329
+ private
1330
+
1331
+ # The default source object that gets attached to nodes and locations if no
1332
+ # source is specified.
1333
+ #
1334
+ #: () -> Source
1335
+ def default_source
1336
+ Source.for("", 1, [0])
1337
+ end
1338
+
1339
+ # The default location object that gets attached to nodes if no location is
1340
+ # specified, which uses the given source.
1341
+ #
1342
+ #: () -> Location
1343
+ def default_location
1344
+ Location.new(default_source, 0, 0)
1345
+ end
1346
+
1347
+ # The default node that gets attached to nodes if no node is specified for a
1348
+ # required node field.
1349
+ #
1350
+ #: (Source source, Location location) -> node
1351
+ def default_node(source, location)
1352
+ ErrorRecoveryNode.new(source, -1, location, 0, nil)
1353
+ end
1354
+
1355
+ private
1356
+
1357
+ # Build the newline byte offset array for the given source string.
1358
+ #
1359
+ #: (String source) -> Array[Integer]
1360
+ def build_offsets(source)
1361
+ offsets = [0]
1362
+ start = 0
1363
+ while (index = source.byteindex("\n", start))
1364
+ offsets << (start = index + 1)
1365
+ end
1366
+ offsets
1367
+ end
1368
+ end
1369
+ end