jruby-prism-parser 0.24.0-java → 1.4.0-java

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (148) hide show
  1. checksums.yaml +4 -4
  2. data/BSDmakefile +58 -0
  3. data/CHANGELOG.md +269 -1
  4. data/CONTRIBUTING.md +0 -4
  5. data/Makefile +25 -18
  6. data/README.md +57 -6
  7. data/config.yml +1724 -140
  8. data/docs/build_system.md +39 -11
  9. data/docs/configuration.md +4 -0
  10. data/docs/cruby_compilation.md +1 -1
  11. data/docs/fuzzing.md +1 -1
  12. data/docs/parser_translation.md +14 -9
  13. data/docs/parsing_rules.md +4 -1
  14. data/docs/releasing.md +8 -10
  15. data/docs/relocation.md +34 -0
  16. data/docs/ripper_translation.md +72 -0
  17. data/docs/ruby_api.md +2 -1
  18. data/docs/serialization.md +29 -5
  19. data/ext/prism/api_node.c +3395 -1999
  20. data/ext/prism/api_pack.c +9 -0
  21. data/ext/prism/extconf.rb +55 -34
  22. data/ext/prism/extension.c +597 -346
  23. data/ext/prism/extension.h +6 -5
  24. data/include/prism/ast.h +2612 -455
  25. data/include/prism/defines.h +160 -2
  26. data/include/prism/diagnostic.h +188 -76
  27. data/include/prism/encoding.h +22 -4
  28. data/include/prism/node.h +89 -17
  29. data/include/prism/options.h +224 -12
  30. data/include/prism/pack.h +11 -0
  31. data/include/prism/parser.h +267 -66
  32. data/include/prism/prettyprint.h +8 -0
  33. data/include/prism/regexp.h +18 -8
  34. data/include/prism/static_literals.h +121 -0
  35. data/include/prism/util/pm_buffer.h +75 -2
  36. data/include/prism/util/pm_char.h +1 -2
  37. data/include/prism/util/pm_constant_pool.h +18 -9
  38. data/include/prism/util/pm_integer.h +126 -0
  39. data/include/prism/util/pm_list.h +1 -1
  40. data/include/prism/util/pm_newline_list.h +19 -0
  41. data/include/prism/util/pm_string.h +48 -8
  42. data/include/prism/version.h +3 -3
  43. data/include/prism.h +99 -5
  44. data/jruby-prism.jar +0 -0
  45. data/lib/prism/compiler.rb +11 -1
  46. data/lib/prism/desugar_compiler.rb +113 -74
  47. data/lib/prism/dispatcher.rb +45 -1
  48. data/lib/prism/dot_visitor.rb +201 -77
  49. data/lib/prism/dsl.rb +673 -461
  50. data/lib/prism/ffi.rb +233 -45
  51. data/lib/prism/inspect_visitor.rb +2389 -0
  52. data/lib/prism/lex_compat.rb +35 -16
  53. data/lib/prism/mutation_compiler.rb +24 -8
  54. data/lib/prism/node.rb +7731 -8460
  55. data/lib/prism/node_ext.rb +328 -32
  56. data/lib/prism/pack.rb +4 -0
  57. data/lib/prism/parse_result/comments.rb +34 -24
  58. data/lib/prism/parse_result/errors.rb +65 -0
  59. data/lib/prism/parse_result/newlines.rb +102 -12
  60. data/lib/prism/parse_result.rb +448 -44
  61. data/lib/prism/pattern.rb +28 -10
  62. data/lib/prism/polyfill/append_as_bytes.rb +15 -0
  63. data/lib/prism/polyfill/byteindex.rb +13 -0
  64. data/lib/prism/polyfill/unpack1.rb +14 -0
  65. data/lib/prism/reflection.rb +413 -0
  66. data/lib/prism/relocation.rb +504 -0
  67. data/lib/prism/serialize.rb +1940 -1198
  68. data/lib/prism/string_query.rb +30 -0
  69. data/lib/prism/translation/parser/builder.rb +61 -0
  70. data/lib/prism/translation/parser/compiler.rb +569 -195
  71. data/lib/prism/translation/parser/lexer.rb +516 -39
  72. data/lib/prism/translation/parser.rb +177 -12
  73. data/lib/prism/translation/parser33.rb +1 -1
  74. data/lib/prism/translation/parser34.rb +1 -1
  75. data/lib/prism/translation/parser35.rb +12 -0
  76. data/lib/prism/translation/ripper/sexp.rb +125 -0
  77. data/lib/prism/translation/ripper/shim.rb +5 -0
  78. data/lib/prism/translation/ripper.rb +3224 -462
  79. data/lib/prism/translation/ruby_parser.rb +194 -69
  80. data/lib/prism/translation.rb +4 -1
  81. data/lib/prism/version.rb +1 -1
  82. data/lib/prism/visitor.rb +13 -0
  83. data/lib/prism.rb +17 -27
  84. data/prism.gemspec +57 -17
  85. data/rbi/prism/compiler.rbi +12 -0
  86. data/rbi/prism/dsl.rbi +524 -0
  87. data/rbi/prism/inspect_visitor.rbi +12 -0
  88. data/rbi/prism/node.rbi +8722 -0
  89. data/rbi/prism/node_ext.rbi +107 -0
  90. data/rbi/prism/parse_result.rbi +404 -0
  91. data/rbi/prism/reflection.rbi +58 -0
  92. data/rbi/prism/string_query.rbi +12 -0
  93. data/rbi/prism/translation/parser.rbi +11 -0
  94. data/rbi/prism/translation/parser33.rbi +6 -0
  95. data/rbi/prism/translation/parser34.rbi +6 -0
  96. data/rbi/prism/translation/parser35.rbi +6 -0
  97. data/rbi/prism/translation/ripper.rbi +15 -0
  98. data/rbi/prism/visitor.rbi +473 -0
  99. data/rbi/prism.rbi +44 -7745
  100. data/sig/prism/compiler.rbs +9 -0
  101. data/sig/prism/dispatcher.rbs +16 -0
  102. data/sig/prism/dot_visitor.rbs +6 -0
  103. data/sig/prism/dsl.rbs +351 -0
  104. data/sig/prism/inspect_visitor.rbs +22 -0
  105. data/sig/prism/lex_compat.rbs +10 -0
  106. data/sig/prism/mutation_compiler.rbs +159 -0
  107. data/sig/prism/node.rbs +3614 -0
  108. data/sig/prism/node_ext.rbs +82 -0
  109. data/sig/prism/pack.rbs +43 -0
  110. data/sig/prism/parse_result.rbs +192 -0
  111. data/sig/prism/pattern.rbs +13 -0
  112. data/sig/prism/reflection.rbs +50 -0
  113. data/sig/prism/relocation.rbs +185 -0
  114. data/sig/prism/serialize.rbs +8 -0
  115. data/sig/prism/string_query.rbs +11 -0
  116. data/sig/prism/visitor.rbs +169 -0
  117. data/sig/prism.rbs +248 -4767
  118. data/src/diagnostic.c +672 -230
  119. data/src/encoding.c +211 -108
  120. data/src/node.c +7541 -1653
  121. data/src/options.c +135 -20
  122. data/src/pack.c +33 -17
  123. data/src/prettyprint.c +1543 -1485
  124. data/src/prism.c +7813 -3050
  125. data/src/regexp.c +225 -73
  126. data/src/serialize.c +101 -77
  127. data/src/static_literals.c +617 -0
  128. data/src/token_type.c +14 -13
  129. data/src/util/pm_buffer.c +187 -20
  130. data/src/util/pm_char.c +5 -5
  131. data/src/util/pm_constant_pool.c +39 -19
  132. data/src/util/pm_integer.c +670 -0
  133. data/src/util/pm_list.c +1 -1
  134. data/src/util/pm_newline_list.c +43 -5
  135. data/src/util/pm_string.c +213 -33
  136. data/src/util/pm_strncasecmp.c +13 -1
  137. data/src/util/pm_strpbrk.c +32 -6
  138. metadata +55 -19
  139. data/docs/ripper.md +0 -36
  140. data/include/prism/util/pm_state_stack.h +0 -42
  141. data/include/prism/util/pm_string_list.h +0 -44
  142. data/lib/prism/debug.rb +0 -206
  143. data/lib/prism/node_inspector.rb +0 -68
  144. data/lib/prism/translation/parser/rubocop.rb +0 -45
  145. data/rbi/prism_static.rbi +0 -207
  146. data/sig/prism_static.rbs +0 -201
  147. data/src/util/pm_state_stack.c +0 -25
  148. data/src/util/pm_string_list.c +0 -28
data/lib/prism/dsl.rb CHANGED
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  =begin
3
4
  This file is generated by the templates/template.rb script and should not be
4
5
  modified manually. See templates/lib/prism/dsl.rb.erb
@@ -9,780 +10,991 @@ module Prism
9
10
  # The DSL module provides a set of methods that can be used to create prism
10
11
  # nodes in a more concise manner. For example, instead of writing:
11
12
  #
12
- # source = Prism::Source.new("[1]")
13
+ # source = Prism::Source.for("[1]")
13
14
  #
14
15
  # Prism::ArrayNode.new(
16
+ # source,
17
+ # 0,
18
+ # Prism::Location.new(source, 0, 3),
19
+ # 0,
15
20
  # [
16
21
  # Prism::IntegerNode.new(
17
- # Prism::IntegerBaseFlags::DECIMAL,
22
+ # source,
23
+ # 0,
18
24
  # Prism::Location.new(source, 1, 1),
19
- # source
25
+ # Prism::IntegerBaseFlags::DECIMAL,
26
+ # 1
20
27
  # )
21
28
  # ],
22
29
  # Prism::Location.new(source, 0, 1),
23
- # Prism::Location.new(source, 2, 1),
24
- # source
30
+ # Prism::Location.new(source, 2, 1)
25
31
  # )
26
32
  #
27
33
  # you could instead write:
28
34
  #
29
- # source = Prism::Source.new("[1]")
35
+ # class Builder
36
+ # include Prism::DSL
30
37
  #
31
- # ArrayNode(
32
- # IntegerNode(Prism::IntegerBaseFlags::DECIMAL, Location(source, 1, 1)), source),
33
- # Location(source, 0, 1),
34
- # Location(source, 2, 1),
35
- # source
36
- # )
38
+ # attr_reader :default_source
39
+ #
40
+ # def initialize
41
+ # @default_source = source("[1]")
42
+ # end
37
43
  #
38
- # This is mostly helpful in the context of writing tests, but can also be used
39
- # to generate trees programmatically.
44
+ # def build
45
+ # array_node(
46
+ # location: location(start_offset: 0, length: 3),
47
+ # elements: [
48
+ # integer_node(
49
+ # location: location(start_offset: 1, length: 1),
50
+ # flags: integer_base_flag(:decimal),
51
+ # value: 1
52
+ # )
53
+ # ],
54
+ # opening_loc: location(start_offset: 0, length: 1),
55
+ # closing_loc: location(start_offset: 2, length: 1)
56
+ # )
57
+ # end
58
+ # end
59
+ #
60
+ # This is mostly helpful in the context of generating trees programmatically.
40
61
  module DSL
41
- private
62
+ # Provide all of these methods as module methods as well, to allow for
63
+ # building nodes like Prism::DSL.nil_node.
64
+ extend self
65
+
66
+ # Create a new Source object.
67
+ def source(string)
68
+ Source.for(string)
69
+ end
42
70
 
43
- # Create a new Location object
44
- def Location(source = nil, start_offset = 0, length = 0)
71
+ # Create a new Location object.
72
+ def location(source: default_source, start_offset: 0, length: 0)
45
73
  Location.new(source, start_offset, length)
46
74
  end
47
75
 
48
- # Create a new AliasGlobalVariableNode node
49
- def AliasGlobalVariableNode(new_name, old_name, keyword_loc, source = nil, location = Location())
50
- AliasGlobalVariableNode.new(source, new_name, old_name, keyword_loc, location)
76
+ # Create a new AliasGlobalVariableNode node.
77
+ 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)
78
+ AliasGlobalVariableNode.new(source, node_id, location, flags, new_name, old_name, keyword_loc)
79
+ end
80
+
81
+ # Create a new AliasMethodNode node.
82
+ 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)
83
+ AliasMethodNode.new(source, node_id, location, flags, new_name, old_name, keyword_loc)
84
+ end
85
+
86
+ # Create a new AlternationPatternNode node.
87
+ 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)
88
+ AlternationPatternNode.new(source, node_id, location, flags, left, right, operator_loc)
89
+ end
90
+
91
+ # Create a new AndNode node.
92
+ 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)
93
+ AndNode.new(source, node_id, location, flags, left, right, operator_loc)
94
+ end
95
+
96
+ # Create a new ArgumentsNode node.
97
+ def arguments_node(source: default_source, node_id: 0, location: default_location, flags: 0, arguments: [])
98
+ ArgumentsNode.new(source, node_id, location, flags, arguments)
99
+ end
100
+
101
+ # Create a new ArrayNode node.
102
+ def array_node(source: default_source, node_id: 0, location: default_location, flags: 0, elements: [], opening_loc: nil, closing_loc: nil)
103
+ ArrayNode.new(source, node_id, location, flags, elements, opening_loc, closing_loc)
104
+ end
105
+
106
+ # Create a new ArrayPatternNode node.
107
+ 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)
108
+ ArrayPatternNode.new(source, node_id, location, flags, constant, requireds, rest, posts, opening_loc, closing_loc)
109
+ end
110
+
111
+ # Create a new AssocNode node.
112
+ 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)
113
+ AssocNode.new(source, node_id, location, flags, key, value, operator_loc)
51
114
  end
52
115
 
53
- # Create a new AliasMethodNode node
54
- def AliasMethodNode(new_name, old_name, keyword_loc, source = nil, location = Location())
55
- AliasMethodNode.new(source, new_name, old_name, keyword_loc, location)
116
+ # Create a new AssocSplatNode node.
117
+ def assoc_splat_node(source: default_source, node_id: 0, location: default_location, flags: 0, value: nil, operator_loc: location)
118
+ AssocSplatNode.new(source, node_id, location, flags, value, operator_loc)
56
119
  end
57
120
 
58
- # Create a new AlternationPatternNode node
59
- def AlternationPatternNode(left, right, operator_loc, source = nil, location = Location())
60
- AlternationPatternNode.new(source, left, right, operator_loc, location)
121
+ # Create a new BackReferenceReadNode node.
122
+ def back_reference_read_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :"")
123
+ BackReferenceReadNode.new(source, node_id, location, flags, name)
61
124
  end
62
125
 
63
- # Create a new AndNode node
64
- def AndNode(left, right, operator_loc, source = nil, location = Location())
65
- AndNode.new(source, left, right, operator_loc, location)
126
+ # Create a new BeginNode node.
127
+ 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)
128
+ BeginNode.new(source, node_id, location, flags, begin_keyword_loc, statements, rescue_clause, else_clause, ensure_clause, end_keyword_loc)
66
129
  end
67
130
 
68
- # Create a new ArgumentsNode node
69
- def ArgumentsNode(flags, arguments, source = nil, location = Location())
70
- ArgumentsNode.new(source, flags, arguments, location)
131
+ # Create a new BlockArgumentNode node.
132
+ def block_argument_node(source: default_source, node_id: 0, location: default_location, flags: 0, expression: nil, operator_loc: location)
133
+ BlockArgumentNode.new(source, node_id, location, flags, expression, operator_loc)
71
134
  end
72
135
 
73
- # Create a new ArrayNode node
74
- def ArrayNode(flags, elements, opening_loc, closing_loc, source = nil, location = Location())
75
- ArrayNode.new(source, flags, elements, opening_loc, closing_loc, location)
136
+ # Create a new BlockLocalVariableNode node.
137
+ def block_local_variable_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :"")
138
+ BlockLocalVariableNode.new(source, node_id, location, flags, name)
76
139
  end
77
140
 
78
- # Create a new ArrayPatternNode node
79
- def ArrayPatternNode(constant, requireds, rest, posts, opening_loc, closing_loc, source = nil, location = Location())
80
- ArrayPatternNode.new(source, constant, requireds, rest, posts, opening_loc, closing_loc, location)
141
+ # Create a new BlockNode node.
142
+ 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)
143
+ BlockNode.new(source, node_id, location, flags, locals, parameters, body, opening_loc, closing_loc)
81
144
  end
82
145
 
83
- # Create a new AssocNode node
84
- def AssocNode(key, value, operator_loc, source = nil, location = Location())
85
- AssocNode.new(source, key, value, operator_loc, location)
146
+ # Create a new BlockParameterNode node.
147
+ def block_parameter_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: nil, name_loc: nil, operator_loc: location)
148
+ BlockParameterNode.new(source, node_id, location, flags, name, name_loc, operator_loc)
86
149
  end
87
150
 
88
- # Create a new AssocSplatNode node
89
- def AssocSplatNode(value, operator_loc, source = nil, location = Location())
90
- AssocSplatNode.new(source, value, operator_loc, location)
151
+ # Create a new BlockParametersNode node.
152
+ def block_parameters_node(source: default_source, node_id: 0, location: default_location, flags: 0, parameters: nil, locals: [], opening_loc: nil, closing_loc: nil)
153
+ BlockParametersNode.new(source, node_id, location, flags, parameters, locals, opening_loc, closing_loc)
91
154
  end
92
155
 
93
- # Create a new BackReferenceReadNode node
94
- def BackReferenceReadNode(name, source = nil, location = Location())
95
- BackReferenceReadNode.new(source, name, location)
156
+ # Create a new BreakNode node.
157
+ def break_node(source: default_source, node_id: 0, location: default_location, flags: 0, arguments: nil, keyword_loc: location)
158
+ BreakNode.new(source, node_id, location, flags, arguments, keyword_loc)
96
159
  end
97
160
 
98
- # Create a new BeginNode node
99
- def BeginNode(begin_keyword_loc, statements, rescue_clause, else_clause, ensure_clause, end_keyword_loc, source = nil, location = Location())
100
- BeginNode.new(source, begin_keyword_loc, statements, rescue_clause, else_clause, ensure_clause, end_keyword_loc, location)
161
+ # Create a new CallAndWriteNode node.
162
+ 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))
163
+ CallAndWriteNode.new(source, node_id, location, flags, receiver, call_operator_loc, message_loc, read_name, write_name, operator_loc, value)
101
164
  end
102
165
 
103
- # Create a new BlockArgumentNode node
104
- def BlockArgumentNode(expression, operator_loc, source = nil, location = Location())
105
- BlockArgumentNode.new(source, expression, operator_loc, location)
166
+ # Create a new CallNode node.
167
+ 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, block: nil)
168
+ CallNode.new(source, node_id, location, flags, receiver, call_operator_loc, name, message_loc, opening_loc, arguments, closing_loc, block)
106
169
  end
107
170
 
108
- # Create a new BlockLocalVariableNode node
109
- def BlockLocalVariableNode(flags, name, source = nil, location = Location())
110
- BlockLocalVariableNode.new(source, flags, name, location)
171
+ # Create a new CallOperatorWriteNode node.
172
+ 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))
173
+ CallOperatorWriteNode.new(source, node_id, location, flags, receiver, call_operator_loc, message_loc, read_name, write_name, binary_operator, binary_operator_loc, value)
111
174
  end
112
175
 
113
- # Create a new BlockNode node
114
- def BlockNode(locals, parameters, body, opening_loc, closing_loc, source = nil, location = Location())
115
- BlockNode.new(source, locals, parameters, body, opening_loc, closing_loc, location)
176
+ # Create a new CallOrWriteNode node.
177
+ 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))
178
+ CallOrWriteNode.new(source, node_id, location, flags, receiver, call_operator_loc, message_loc, read_name, write_name, operator_loc, value)
116
179
  end
117
180
 
118
- # Create a new BlockParameterNode node
119
- def BlockParameterNode(flags, name, name_loc, operator_loc, source = nil, location = Location())
120
- BlockParameterNode.new(source, flags, name, name_loc, operator_loc, location)
181
+ # Create a new CallTargetNode node.
182
+ 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)
183
+ CallTargetNode.new(source, node_id, location, flags, receiver, call_operator_loc, name, message_loc)
121
184
  end
122
185
 
123
- # Create a new BlockParametersNode node
124
- def BlockParametersNode(parameters, locals, opening_loc, closing_loc, source = nil, location = Location())
125
- BlockParametersNode.new(source, parameters, locals, opening_loc, closing_loc, location)
186
+ # Create a new CapturePatternNode node.
187
+ 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)
188
+ CapturePatternNode.new(source, node_id, location, flags, value, target, operator_loc)
126
189
  end
127
190
 
128
- # Create a new BreakNode node
129
- def BreakNode(arguments, keyword_loc, source = nil, location = Location())
130
- BreakNode.new(source, arguments, keyword_loc, location)
191
+ # Create a new CaseMatchNode node.
192
+ 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)
193
+ CaseMatchNode.new(source, node_id, location, flags, predicate, conditions, else_clause, case_keyword_loc, end_keyword_loc)
131
194
  end
132
195
 
133
- # Create a new CallAndWriteNode node
134
- def CallAndWriteNode(flags, receiver, call_operator_loc, message_loc, read_name, write_name, operator_loc, value, source = nil, location = Location())
135
- CallAndWriteNode.new(source, flags, receiver, call_operator_loc, message_loc, read_name, write_name, operator_loc, value, location)
196
+ # Create a new CaseNode node.
197
+ 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)
198
+ CaseNode.new(source, node_id, location, flags, predicate, conditions, else_clause, case_keyword_loc, end_keyword_loc)
136
199
  end
137
200
 
138
- # Create a new CallNode node
139
- def CallNode(flags, receiver, call_operator_loc, name, message_loc, opening_loc, arguments, closing_loc, block, source = nil, location = Location())
140
- CallNode.new(source, flags, receiver, call_operator_loc, name, message_loc, opening_loc, arguments, closing_loc, block, location)
201
+ # Create a new ClassNode node.
202
+ 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: :"")
203
+ ClassNode.new(source, node_id, location, flags, locals, class_keyword_loc, constant_path, inheritance_operator_loc, superclass, body, end_keyword_loc, name)
141
204
  end
142
205
 
143
- # Create a new CallOperatorWriteNode node
144
- def CallOperatorWriteNode(flags, receiver, call_operator_loc, message_loc, read_name, write_name, operator, operator_loc, value, source = nil, location = Location())
145
- CallOperatorWriteNode.new(source, flags, receiver, call_operator_loc, message_loc, read_name, write_name, operator, operator_loc, value, location)
206
+ # Create a new ClassVariableAndWriteNode node.
207
+ 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))
208
+ ClassVariableAndWriteNode.new(source, node_id, location, flags, name, name_loc, operator_loc, value)
146
209
  end
147
210
 
148
- # Create a new CallOrWriteNode node
149
- def CallOrWriteNode(flags, receiver, call_operator_loc, message_loc, read_name, write_name, operator_loc, value, source = nil, location = Location())
150
- CallOrWriteNode.new(source, flags, receiver, call_operator_loc, message_loc, read_name, write_name, operator_loc, value, location)
211
+ # Create a new ClassVariableOperatorWriteNode node.
212
+ 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: :"")
213
+ ClassVariableOperatorWriteNode.new(source, node_id, location, flags, name, name_loc, binary_operator_loc, value, binary_operator)
151
214
  end
152
215
 
153
- # Create a new CallTargetNode node
154
- def CallTargetNode(flags, receiver, call_operator_loc, name, message_loc, source = nil, location = Location())
155
- CallTargetNode.new(source, flags, receiver, call_operator_loc, name, message_loc, location)
216
+ # Create a new ClassVariableOrWriteNode node.
217
+ 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))
218
+ ClassVariableOrWriteNode.new(source, node_id, location, flags, name, name_loc, operator_loc, value)
156
219
  end
157
220
 
158
- # Create a new CapturePatternNode node
159
- def CapturePatternNode(value, target, operator_loc, source = nil, location = Location())
160
- CapturePatternNode.new(source, value, target, operator_loc, location)
221
+ # Create a new ClassVariableReadNode node.
222
+ def class_variable_read_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :"")
223
+ ClassVariableReadNode.new(source, node_id, location, flags, name)
161
224
  end
162
225
 
163
- # Create a new CaseMatchNode node
164
- def CaseMatchNode(predicate, conditions, consequent, case_keyword_loc, end_keyword_loc, source = nil, location = Location())
165
- CaseMatchNode.new(source, predicate, conditions, consequent, case_keyword_loc, end_keyword_loc, location)
226
+ # Create a new ClassVariableTargetNode node.
227
+ def class_variable_target_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :"")
228
+ ClassVariableTargetNode.new(source, node_id, location, flags, name)
166
229
  end
167
230
 
168
- # Create a new CaseNode node
169
- def CaseNode(predicate, conditions, consequent, case_keyword_loc, end_keyword_loc, source = nil, location = Location())
170
- CaseNode.new(source, predicate, conditions, consequent, case_keyword_loc, end_keyword_loc, location)
231
+ # Create a new ClassVariableWriteNode node.
232
+ 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)
233
+ ClassVariableWriteNode.new(source, node_id, location, flags, name, name_loc, value, operator_loc)
171
234
  end
172
235
 
173
- # Create a new ClassNode node
174
- def ClassNode(locals, class_keyword_loc, constant_path, inheritance_operator_loc, superclass, body, end_keyword_loc, name, source = nil, location = Location())
175
- ClassNode.new(source, locals, class_keyword_loc, constant_path, inheritance_operator_loc, superclass, body, end_keyword_loc, name, location)
236
+ # Create a new ConstantAndWriteNode node.
237
+ 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))
238
+ ConstantAndWriteNode.new(source, node_id, location, flags, name, name_loc, operator_loc, value)
176
239
  end
177
240
 
178
- # Create a new ClassVariableAndWriteNode node
179
- def ClassVariableAndWriteNode(name, name_loc, operator_loc, value, source = nil, location = Location())
180
- ClassVariableAndWriteNode.new(source, name, name_loc, operator_loc, value, location)
241
+ # Create a new ConstantOperatorWriteNode node.
242
+ 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: :"")
243
+ ConstantOperatorWriteNode.new(source, node_id, location, flags, name, name_loc, binary_operator_loc, value, binary_operator)
181
244
  end
182
245
 
183
- # Create a new ClassVariableOperatorWriteNode node
184
- def ClassVariableOperatorWriteNode(name, name_loc, operator_loc, value, operator, source = nil, location = Location())
185
- ClassVariableOperatorWriteNode.new(source, name, name_loc, operator_loc, value, operator, location)
246
+ # Create a new ConstantOrWriteNode node.
247
+ 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))
248
+ ConstantOrWriteNode.new(source, node_id, location, flags, name, name_loc, operator_loc, value)
186
249
  end
187
250
 
188
- # Create a new ClassVariableOrWriteNode node
189
- def ClassVariableOrWriteNode(name, name_loc, operator_loc, value, source = nil, location = Location())
190
- ClassVariableOrWriteNode.new(source, name, name_loc, operator_loc, value, location)
251
+ # Create a new ConstantPathAndWriteNode node.
252
+ 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))
253
+ ConstantPathAndWriteNode.new(source, node_id, location, flags, target, operator_loc, value)
191
254
  end
192
255
 
193
- # Create a new ClassVariableReadNode node
194
- def ClassVariableReadNode(name, source = nil, location = Location())
195
- ClassVariableReadNode.new(source, name, location)
256
+ # Create a new ConstantPathNode node.
257
+ 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)
258
+ ConstantPathNode.new(source, node_id, location, flags, parent, name, delimiter_loc, name_loc)
196
259
  end
197
260
 
198
- # Create a new ClassVariableTargetNode node
199
- def ClassVariableTargetNode(name, source = nil, location = Location())
200
- ClassVariableTargetNode.new(source, name, location)
261
+ # Create a new ConstantPathOperatorWriteNode node.
262
+ 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: :"")
263
+ ConstantPathOperatorWriteNode.new(source, node_id, location, flags, target, binary_operator_loc, value, binary_operator)
201
264
  end
202
265
 
203
- # Create a new ClassVariableWriteNode node
204
- def ClassVariableWriteNode(name, name_loc, value, operator_loc, source = nil, location = Location())
205
- ClassVariableWriteNode.new(source, name, name_loc, value, operator_loc, location)
266
+ # Create a new ConstantPathOrWriteNode node.
267
+ 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))
268
+ ConstantPathOrWriteNode.new(source, node_id, location, flags, target, operator_loc, value)
206
269
  end
207
270
 
208
- # Create a new ConstantAndWriteNode node
209
- def ConstantAndWriteNode(name, name_loc, operator_loc, value, source = nil, location = Location())
210
- ConstantAndWriteNode.new(source, name, name_loc, operator_loc, value, location)
271
+ # Create a new ConstantPathTargetNode node.
272
+ 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)
273
+ ConstantPathTargetNode.new(source, node_id, location, flags, parent, name, delimiter_loc, name_loc)
211
274
  end
212
275
 
213
- # Create a new ConstantOperatorWriteNode node
214
- def ConstantOperatorWriteNode(name, name_loc, operator_loc, value, operator, source = nil, location = Location())
215
- ConstantOperatorWriteNode.new(source, name, name_loc, operator_loc, value, operator, location)
276
+ # Create a new ConstantPathWriteNode node.
277
+ 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))
278
+ ConstantPathWriteNode.new(source, node_id, location, flags, target, operator_loc, value)
216
279
  end
217
280
 
218
- # Create a new ConstantOrWriteNode node
219
- def ConstantOrWriteNode(name, name_loc, operator_loc, value, source = nil, location = Location())
220
- ConstantOrWriteNode.new(source, name, name_loc, operator_loc, value, location)
281
+ # Create a new ConstantReadNode node.
282
+ def constant_read_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :"")
283
+ ConstantReadNode.new(source, node_id, location, flags, name)
221
284
  end
222
285
 
223
- # Create a new ConstantPathAndWriteNode node
224
- def ConstantPathAndWriteNode(target, operator_loc, value, source = nil, location = Location())
225
- ConstantPathAndWriteNode.new(source, target, operator_loc, value, location)
286
+ # Create a new ConstantTargetNode node.
287
+ def constant_target_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :"")
288
+ ConstantTargetNode.new(source, node_id, location, flags, name)
226
289
  end
227
290
 
228
- # Create a new ConstantPathNode node
229
- def ConstantPathNode(parent, child, delimiter_loc, source = nil, location = Location())
230
- ConstantPathNode.new(source, parent, child, delimiter_loc, location)
291
+ # Create a new ConstantWriteNode node.
292
+ 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)
293
+ ConstantWriteNode.new(source, node_id, location, flags, name, name_loc, value, operator_loc)
231
294
  end
232
295
 
233
- # Create a new ConstantPathOperatorWriteNode node
234
- def ConstantPathOperatorWriteNode(target, operator_loc, value, operator, source = nil, location = Location())
235
- ConstantPathOperatorWriteNode.new(source, target, operator_loc, value, operator, location)
296
+ # Create a new DefNode node.
297
+ 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)
298
+ 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)
236
299
  end
237
300
 
238
- # Create a new ConstantPathOrWriteNode node
239
- def ConstantPathOrWriteNode(target, operator_loc, value, source = nil, location = Location())
240
- ConstantPathOrWriteNode.new(source, target, operator_loc, value, location)
301
+ # Create a new DefinedNode node.
302
+ 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)
303
+ DefinedNode.new(source, node_id, location, flags, lparen_loc, value, rparen_loc, keyword_loc)
241
304
  end
242
305
 
243
- # Create a new ConstantPathTargetNode node
244
- def ConstantPathTargetNode(parent, child, delimiter_loc, source = nil, location = Location())
245
- ConstantPathTargetNode.new(source, parent, child, delimiter_loc, location)
306
+ # Create a new ElseNode node.
307
+ def else_node(source: default_source, node_id: 0, location: default_location, flags: 0, else_keyword_loc: location, statements: nil, end_keyword_loc: nil)
308
+ ElseNode.new(source, node_id, location, flags, else_keyword_loc, statements, end_keyword_loc)
246
309
  end
247
310
 
248
- # Create a new ConstantPathWriteNode node
249
- def ConstantPathWriteNode(target, operator_loc, value, source = nil, location = Location())
250
- ConstantPathWriteNode.new(source, target, operator_loc, value, location)
311
+ # Create a new EmbeddedStatementsNode node.
312
+ def embedded_statements_node(source: default_source, node_id: 0, location: default_location, flags: 0, opening_loc: location, statements: nil, closing_loc: location)
313
+ EmbeddedStatementsNode.new(source, node_id, location, flags, opening_loc, statements, closing_loc)
251
314
  end
252
315
 
253
- # Create a new ConstantReadNode node
254
- def ConstantReadNode(name, source = nil, location = Location())
255
- ConstantReadNode.new(source, name, location)
316
+ # Create a new EmbeddedVariableNode node.
317
+ 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))
318
+ EmbeddedVariableNode.new(source, node_id, location, flags, operator_loc, variable)
256
319
  end
257
320
 
258
- # Create a new ConstantTargetNode node
259
- def ConstantTargetNode(name, source = nil, location = Location())
260
- ConstantTargetNode.new(source, name, location)
321
+ # Create a new EnsureNode node.
322
+ def ensure_node(source: default_source, node_id: 0, location: default_location, flags: 0, ensure_keyword_loc: location, statements: nil, end_keyword_loc: location)
323
+ EnsureNode.new(source, node_id, location, flags, ensure_keyword_loc, statements, end_keyword_loc)
261
324
  end
262
325
 
263
- # Create a new ConstantWriteNode node
264
- def ConstantWriteNode(name, name_loc, value, operator_loc, source = nil, location = Location())
265
- ConstantWriteNode.new(source, name, name_loc, value, operator_loc, location)
326
+ # Create a new FalseNode node.
327
+ def false_node(source: default_source, node_id: 0, location: default_location, flags: 0)
328
+ FalseNode.new(source, node_id, location, flags)
266
329
  end
267
330
 
268
- # Create a new DefNode node
269
- def DefNode(name, name_loc, receiver, parameters, body, locals, def_keyword_loc, operator_loc, lparen_loc, rparen_loc, equal_loc, end_keyword_loc, source = nil, location = Location())
270
- DefNode.new(source, name, name_loc, receiver, parameters, body, locals, def_keyword_loc, operator_loc, lparen_loc, rparen_loc, equal_loc, end_keyword_loc, location)
331
+ # Create a new FindPatternNode node.
332
+ 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)
333
+ FindPatternNode.new(source, node_id, location, flags, constant, left, requireds, right, opening_loc, closing_loc)
271
334
  end
272
335
 
273
- # Create a new DefinedNode node
274
- def DefinedNode(lparen_loc, value, rparen_loc, keyword_loc, source = nil, location = Location())
275
- DefinedNode.new(source, lparen_loc, value, rparen_loc, keyword_loc, location)
336
+ # Create a new FlipFlopNode node.
337
+ def flip_flop_node(source: default_source, node_id: 0, location: default_location, flags: 0, left: nil, right: nil, operator_loc: location)
338
+ FlipFlopNode.new(source, node_id, location, flags, left, right, operator_loc)
276
339
  end
277
340
 
278
- # Create a new ElseNode node
279
- def ElseNode(else_keyword_loc, statements, end_keyword_loc, source = nil, location = Location())
280
- ElseNode.new(source, else_keyword_loc, statements, end_keyword_loc, location)
341
+ # Create a new FloatNode node.
342
+ def float_node(source: default_source, node_id: 0, location: default_location, flags: 0, value: 0.0)
343
+ FloatNode.new(source, node_id, location, flags, value)
281
344
  end
282
345
 
283
- # Create a new EmbeddedStatementsNode node
284
- def EmbeddedStatementsNode(opening_loc, statements, closing_loc, source = nil, location = Location())
285
- EmbeddedStatementsNode.new(source, opening_loc, statements, closing_loc, location)
346
+ # Create a new ForNode node.
347
+ 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)
348
+ ForNode.new(source, node_id, location, flags, index, collection, statements, for_keyword_loc, in_keyword_loc, do_keyword_loc, end_keyword_loc)
286
349
  end
287
350
 
288
- # Create a new EmbeddedVariableNode node
289
- def EmbeddedVariableNode(operator_loc, variable, source = nil, location = Location())
290
- EmbeddedVariableNode.new(source, operator_loc, variable, location)
351
+ # Create a new ForwardingArgumentsNode node.
352
+ def forwarding_arguments_node(source: default_source, node_id: 0, location: default_location, flags: 0)
353
+ ForwardingArgumentsNode.new(source, node_id, location, flags)
291
354
  end
292
355
 
293
- # Create a new EnsureNode node
294
- def EnsureNode(ensure_keyword_loc, statements, end_keyword_loc, source = nil, location = Location())
295
- EnsureNode.new(source, ensure_keyword_loc, statements, end_keyword_loc, location)
356
+ # Create a new ForwardingParameterNode node.
357
+ def forwarding_parameter_node(source: default_source, node_id: 0, location: default_location, flags: 0)
358
+ ForwardingParameterNode.new(source, node_id, location, flags)
296
359
  end
297
360
 
298
- # Create a new FalseNode node
299
- def FalseNode(source = nil, location = Location())
300
- FalseNode.new(source, location)
361
+ # Create a new ForwardingSuperNode node.
362
+ def forwarding_super_node(source: default_source, node_id: 0, location: default_location, flags: 0, block: nil)
363
+ ForwardingSuperNode.new(source, node_id, location, flags, block)
301
364
  end
302
365
 
303
- # Create a new FindPatternNode node
304
- def FindPatternNode(constant, left, requireds, right, opening_loc, closing_loc, source = nil, location = Location())
305
- FindPatternNode.new(source, constant, left, requireds, right, opening_loc, closing_loc, location)
366
+ # Create a new GlobalVariableAndWriteNode node.
367
+ 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))
368
+ GlobalVariableAndWriteNode.new(source, node_id, location, flags, name, name_loc, operator_loc, value)
306
369
  end
307
370
 
308
- # Create a new FlipFlopNode node
309
- def FlipFlopNode(flags, left, right, operator_loc, source = nil, location = Location())
310
- FlipFlopNode.new(source, flags, left, right, operator_loc, location)
371
+ # Create a new GlobalVariableOperatorWriteNode node.
372
+ 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: :"")
373
+ GlobalVariableOperatorWriteNode.new(source, node_id, location, flags, name, name_loc, binary_operator_loc, value, binary_operator)
311
374
  end
312
375
 
313
- # Create a new FloatNode node
314
- def FloatNode(source = nil, location = Location())
315
- FloatNode.new(source, location)
376
+ # Create a new GlobalVariableOrWriteNode node.
377
+ 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))
378
+ GlobalVariableOrWriteNode.new(source, node_id, location, flags, name, name_loc, operator_loc, value)
316
379
  end
317
380
 
318
- # Create a new ForNode node
319
- def ForNode(index, collection, statements, for_keyword_loc, in_keyword_loc, do_keyword_loc, end_keyword_loc, source = nil, location = Location())
320
- ForNode.new(source, index, collection, statements, for_keyword_loc, in_keyword_loc, do_keyword_loc, end_keyword_loc, location)
381
+ # Create a new GlobalVariableReadNode node.
382
+ def global_variable_read_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :"")
383
+ GlobalVariableReadNode.new(source, node_id, location, flags, name)
321
384
  end
322
385
 
323
- # Create a new ForwardingArgumentsNode node
324
- def ForwardingArgumentsNode(source = nil, location = Location())
325
- ForwardingArgumentsNode.new(source, location)
386
+ # Create a new GlobalVariableTargetNode node.
387
+ def global_variable_target_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :"")
388
+ GlobalVariableTargetNode.new(source, node_id, location, flags, name)
326
389
  end
327
390
 
328
- # Create a new ForwardingParameterNode node
329
- def ForwardingParameterNode(source = nil, location = Location())
330
- ForwardingParameterNode.new(source, location)
391
+ # Create a new GlobalVariableWriteNode node.
392
+ 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)
393
+ GlobalVariableWriteNode.new(source, node_id, location, flags, name, name_loc, value, operator_loc)
331
394
  end
332
395
 
333
- # Create a new ForwardingSuperNode node
334
- def ForwardingSuperNode(block, source = nil, location = Location())
335
- ForwardingSuperNode.new(source, block, location)
396
+ # Create a new HashNode node.
397
+ def hash_node(source: default_source, node_id: 0, location: default_location, flags: 0, opening_loc: location, elements: [], closing_loc: location)
398
+ HashNode.new(source, node_id, location, flags, opening_loc, elements, closing_loc)
336
399
  end
337
400
 
338
- # Create a new GlobalVariableAndWriteNode node
339
- def GlobalVariableAndWriteNode(name, name_loc, operator_loc, value, source = nil, location = Location())
340
- GlobalVariableAndWriteNode.new(source, name, name_loc, operator_loc, value, location)
401
+ # Create a new HashPatternNode node.
402
+ 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)
403
+ HashPatternNode.new(source, node_id, location, flags, constant, elements, rest, opening_loc, closing_loc)
341
404
  end
342
405
 
343
- # Create a new GlobalVariableOperatorWriteNode node
344
- def GlobalVariableOperatorWriteNode(name, name_loc, operator_loc, value, operator, source = nil, location = Location())
345
- GlobalVariableOperatorWriteNode.new(source, name, name_loc, operator_loc, value, operator, location)
406
+ # Create a new IfNode node.
407
+ 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)
408
+ IfNode.new(source, node_id, location, flags, if_keyword_loc, predicate, then_keyword_loc, statements, subsequent, end_keyword_loc)
346
409
  end
347
410
 
348
- # Create a new GlobalVariableOrWriteNode node
349
- def GlobalVariableOrWriteNode(name, name_loc, operator_loc, value, source = nil, location = Location())
350
- GlobalVariableOrWriteNode.new(source, name, name_loc, operator_loc, value, location)
411
+ # Create a new ImaginaryNode node.
412
+ def imaginary_node(source: default_source, node_id: 0, location: default_location, flags: 0, numeric: float_node(source: source))
413
+ ImaginaryNode.new(source, node_id, location, flags, numeric)
351
414
  end
352
415
 
353
- # Create a new GlobalVariableReadNode node
354
- def GlobalVariableReadNode(name, source = nil, location = Location())
355
- GlobalVariableReadNode.new(source, name, location)
416
+ # Create a new ImplicitNode node.
417
+ def implicit_node(source: default_source, node_id: 0, location: default_location, flags: 0, value: local_variable_read_node(source: source))
418
+ ImplicitNode.new(source, node_id, location, flags, value)
356
419
  end
357
420
 
358
- # Create a new GlobalVariableTargetNode node
359
- def GlobalVariableTargetNode(name, source = nil, location = Location())
360
- GlobalVariableTargetNode.new(source, name, location)
421
+ # Create a new ImplicitRestNode node.
422
+ def implicit_rest_node(source: default_source, node_id: 0, location: default_location, flags: 0)
423
+ ImplicitRestNode.new(source, node_id, location, flags)
361
424
  end
362
425
 
363
- # Create a new GlobalVariableWriteNode node
364
- def GlobalVariableWriteNode(name, name_loc, value, operator_loc, source = nil, location = Location())
365
- GlobalVariableWriteNode.new(source, name, name_loc, value, operator_loc, location)
426
+ # Create a new InNode node.
427
+ def in_node(source: default_source, node_id: 0, location: default_location, flags: 0, pattern: default_node(source, location), statements: nil, in_loc: location, then_loc: nil)
428
+ InNode.new(source, node_id, location, flags, pattern, statements, in_loc, then_loc)
366
429
  end
367
430
 
368
- # Create a new HashNode node
369
- def HashNode(opening_loc, elements, closing_loc, source = nil, location = Location())
370
- HashNode.new(source, opening_loc, elements, closing_loc, location)
431
+ # Create a new IndexAndWriteNode node.
432
+ 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))
433
+ IndexAndWriteNode.new(source, node_id, location, flags, receiver, call_operator_loc, opening_loc, arguments, closing_loc, block, operator_loc, value)
371
434
  end
372
435
 
373
- # Create a new HashPatternNode node
374
- def HashPatternNode(constant, elements, rest, opening_loc, closing_loc, source = nil, location = Location())
375
- HashPatternNode.new(source, constant, elements, rest, opening_loc, closing_loc, location)
436
+ # Create a new IndexOperatorWriteNode node.
437
+ 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))
438
+ IndexOperatorWriteNode.new(source, node_id, location, flags, receiver, call_operator_loc, opening_loc, arguments, closing_loc, block, binary_operator, binary_operator_loc, value)
376
439
  end
377
440
 
378
- # Create a new IfNode node
379
- def IfNode(if_keyword_loc, predicate, then_keyword_loc, statements, consequent, end_keyword_loc, source = nil, location = Location())
380
- IfNode.new(source, if_keyword_loc, predicate, then_keyword_loc, statements, consequent, end_keyword_loc, location)
441
+ # Create a new IndexOrWriteNode node.
442
+ 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))
443
+ IndexOrWriteNode.new(source, node_id, location, flags, receiver, call_operator_loc, opening_loc, arguments, closing_loc, block, operator_loc, value)
381
444
  end
382
445
 
383
- # Create a new ImaginaryNode node
384
- def ImaginaryNode(numeric, source = nil, location = Location())
385
- ImaginaryNode.new(source, numeric, location)
446
+ # Create a new IndexTargetNode node.
447
+ 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)
448
+ IndexTargetNode.new(source, node_id, location, flags, receiver, opening_loc, arguments, closing_loc, block)
386
449
  end
387
450
 
388
- # Create a new ImplicitNode node
389
- def ImplicitNode(value, source = nil, location = Location())
390
- ImplicitNode.new(source, value, location)
451
+ # Create a new InstanceVariableAndWriteNode node.
452
+ 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))
453
+ InstanceVariableAndWriteNode.new(source, node_id, location, flags, name, name_loc, operator_loc, value)
391
454
  end
392
455
 
393
- # Create a new ImplicitRestNode node
394
- def ImplicitRestNode(source = nil, location = Location())
395
- ImplicitRestNode.new(source, location)
456
+ # Create a new InstanceVariableOperatorWriteNode node.
457
+ 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: :"")
458
+ InstanceVariableOperatorWriteNode.new(source, node_id, location, flags, name, name_loc, binary_operator_loc, value, binary_operator)
396
459
  end
397
460
 
398
- # Create a new InNode node
399
- def InNode(pattern, statements, in_loc, then_loc, source = nil, location = Location())
400
- InNode.new(source, pattern, statements, in_loc, then_loc, location)
461
+ # Create a new InstanceVariableOrWriteNode node.
462
+ 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))
463
+ InstanceVariableOrWriteNode.new(source, node_id, location, flags, name, name_loc, operator_loc, value)
401
464
  end
402
465
 
403
- # Create a new IndexAndWriteNode node
404
- def IndexAndWriteNode(flags, receiver, call_operator_loc, opening_loc, arguments, closing_loc, block, operator_loc, value, source = nil, location = Location())
405
- IndexAndWriteNode.new(source, flags, receiver, call_operator_loc, opening_loc, arguments, closing_loc, block, operator_loc, value, location)
466
+ # Create a new InstanceVariableReadNode node.
467
+ def instance_variable_read_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :"")
468
+ InstanceVariableReadNode.new(source, node_id, location, flags, name)
406
469
  end
407
470
 
408
- # Create a new IndexOperatorWriteNode node
409
- def IndexOperatorWriteNode(flags, receiver, call_operator_loc, opening_loc, arguments, closing_loc, block, operator, operator_loc, value, source = nil, location = Location())
410
- IndexOperatorWriteNode.new(source, flags, receiver, call_operator_loc, opening_loc, arguments, closing_loc, block, operator, operator_loc, value, location)
471
+ # Create a new InstanceVariableTargetNode node.
472
+ def instance_variable_target_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :"")
473
+ InstanceVariableTargetNode.new(source, node_id, location, flags, name)
411
474
  end
412
475
 
413
- # Create a new IndexOrWriteNode node
414
- def IndexOrWriteNode(flags, receiver, call_operator_loc, opening_loc, arguments, closing_loc, block, operator_loc, value, source = nil, location = Location())
415
- IndexOrWriteNode.new(source, flags, receiver, call_operator_loc, opening_loc, arguments, closing_loc, block, operator_loc, value, location)
476
+ # Create a new InstanceVariableWriteNode node.
477
+ 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)
478
+ InstanceVariableWriteNode.new(source, node_id, location, flags, name, name_loc, value, operator_loc)
416
479
  end
417
480
 
418
- # Create a new IndexTargetNode node
419
- def IndexTargetNode(flags, receiver, opening_loc, arguments, closing_loc, block, source = nil, location = Location())
420
- IndexTargetNode.new(source, flags, receiver, opening_loc, arguments, closing_loc, block, location)
481
+ # Create a new IntegerNode node.
482
+ def integer_node(source: default_source, node_id: 0, location: default_location, flags: 0, value: 0)
483
+ IntegerNode.new(source, node_id, location, flags, value)
421
484
  end
422
485
 
423
- # Create a new InstanceVariableAndWriteNode node
424
- def InstanceVariableAndWriteNode(name, name_loc, operator_loc, value, source = nil, location = Location())
425
- InstanceVariableAndWriteNode.new(source, name, name_loc, operator_loc, value, location)
486
+ # Create a new InterpolatedMatchLastLineNode node.
487
+ def interpolated_match_last_line_node(source: default_source, node_id: 0, location: default_location, flags: 0, opening_loc: location, parts: [], closing_loc: location)
488
+ InterpolatedMatchLastLineNode.new(source, node_id, location, flags, opening_loc, parts, closing_loc)
426
489
  end
427
490
 
428
- # Create a new InstanceVariableOperatorWriteNode node
429
- def InstanceVariableOperatorWriteNode(name, name_loc, operator_loc, value, operator, source = nil, location = Location())
430
- InstanceVariableOperatorWriteNode.new(source, name, name_loc, operator_loc, value, operator, location)
491
+ # Create a new InterpolatedRegularExpressionNode node.
492
+ def interpolated_regular_expression_node(source: default_source, node_id: 0, location: default_location, flags: 0, opening_loc: location, parts: [], closing_loc: location)
493
+ InterpolatedRegularExpressionNode.new(source, node_id, location, flags, opening_loc, parts, closing_loc)
431
494
  end
432
495
 
433
- # Create a new InstanceVariableOrWriteNode node
434
- def InstanceVariableOrWriteNode(name, name_loc, operator_loc, value, source = nil, location = Location())
435
- InstanceVariableOrWriteNode.new(source, name, name_loc, operator_loc, value, location)
496
+ # Create a new InterpolatedStringNode node.
497
+ def interpolated_string_node(source: default_source, node_id: 0, location: default_location, flags: 0, opening_loc: nil, parts: [], closing_loc: nil)
498
+ InterpolatedStringNode.new(source, node_id, location, flags, opening_loc, parts, closing_loc)
436
499
  end
437
500
 
438
- # Create a new InstanceVariableReadNode node
439
- def InstanceVariableReadNode(name, source = nil, location = Location())
440
- InstanceVariableReadNode.new(source, name, location)
501
+ # Create a new InterpolatedSymbolNode node.
502
+ def interpolated_symbol_node(source: default_source, node_id: 0, location: default_location, flags: 0, opening_loc: nil, parts: [], closing_loc: nil)
503
+ InterpolatedSymbolNode.new(source, node_id, location, flags, opening_loc, parts, closing_loc)
441
504
  end
442
505
 
443
- # Create a new InstanceVariableTargetNode node
444
- def InstanceVariableTargetNode(name, source = nil, location = Location())
445
- InstanceVariableTargetNode.new(source, name, location)
506
+ # Create a new InterpolatedXStringNode node.
507
+ def interpolated_x_string_node(source: default_source, node_id: 0, location: default_location, flags: 0, opening_loc: location, parts: [], closing_loc: location)
508
+ InterpolatedXStringNode.new(source, node_id, location, flags, opening_loc, parts, closing_loc)
446
509
  end
447
510
 
448
- # Create a new InstanceVariableWriteNode node
449
- def InstanceVariableWriteNode(name, name_loc, value, operator_loc, source = nil, location = Location())
450
- InstanceVariableWriteNode.new(source, name, name_loc, value, operator_loc, location)
511
+ # Create a new ItLocalVariableReadNode node.
512
+ def it_local_variable_read_node(source: default_source, node_id: 0, location: default_location, flags: 0)
513
+ ItLocalVariableReadNode.new(source, node_id, location, flags)
451
514
  end
452
515
 
453
- # Create a new IntegerNode node
454
- def IntegerNode(flags, source = nil, location = Location())
455
- IntegerNode.new(source, flags, location)
516
+ # Create a new ItParametersNode node.
517
+ def it_parameters_node(source: default_source, node_id: 0, location: default_location, flags: 0)
518
+ ItParametersNode.new(source, node_id, location, flags)
456
519
  end
457
520
 
458
- # Create a new InterpolatedMatchLastLineNode node
459
- def InterpolatedMatchLastLineNode(flags, opening_loc, parts, closing_loc, source = nil, location = Location())
460
- InterpolatedMatchLastLineNode.new(source, flags, opening_loc, parts, closing_loc, location)
521
+ # Create a new KeywordHashNode node.
522
+ def keyword_hash_node(source: default_source, node_id: 0, location: default_location, flags: 0, elements: [])
523
+ KeywordHashNode.new(source, node_id, location, flags, elements)
461
524
  end
462
525
 
463
- # Create a new InterpolatedRegularExpressionNode node
464
- def InterpolatedRegularExpressionNode(flags, opening_loc, parts, closing_loc, source = nil, location = Location())
465
- InterpolatedRegularExpressionNode.new(source, flags, opening_loc, parts, closing_loc, location)
526
+ # Create a new KeywordRestParameterNode node.
527
+ def keyword_rest_parameter_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: nil, name_loc: nil, operator_loc: location)
528
+ KeywordRestParameterNode.new(source, node_id, location, flags, name, name_loc, operator_loc)
466
529
  end
467
530
 
468
- # Create a new InterpolatedStringNode node
469
- def InterpolatedStringNode(opening_loc, parts, closing_loc, source = nil, location = Location())
470
- InterpolatedStringNode.new(source, opening_loc, parts, closing_loc, location)
531
+ # Create a new LambdaNode node.
532
+ 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)
533
+ LambdaNode.new(source, node_id, location, flags, locals, operator_loc, opening_loc, closing_loc, parameters, body)
471
534
  end
472
535
 
473
- # Create a new InterpolatedSymbolNode node
474
- def InterpolatedSymbolNode(opening_loc, parts, closing_loc, source = nil, location = Location())
475
- InterpolatedSymbolNode.new(source, opening_loc, parts, closing_loc, location)
536
+ # Create a new LocalVariableAndWriteNode node.
537
+ 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)
538
+ LocalVariableAndWriteNode.new(source, node_id, location, flags, name_loc, operator_loc, value, name, depth)
476
539
  end
477
540
 
478
- # Create a new InterpolatedXStringNode node
479
- def InterpolatedXStringNode(opening_loc, parts, closing_loc, source = nil, location = Location())
480
- InterpolatedXStringNode.new(source, opening_loc, parts, closing_loc, location)
541
+ # Create a new LocalVariableOperatorWriteNode node.
542
+ 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)
543
+ LocalVariableOperatorWriteNode.new(source, node_id, location, flags, name_loc, binary_operator_loc, value, name, binary_operator, depth)
481
544
  end
482
545
 
483
- # Create a new KeywordHashNode node
484
- def KeywordHashNode(flags, elements, source = nil, location = Location())
485
- KeywordHashNode.new(source, flags, elements, location)
546
+ # Create a new LocalVariableOrWriteNode node.
547
+ 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)
548
+ LocalVariableOrWriteNode.new(source, node_id, location, flags, name_loc, operator_loc, value, name, depth)
486
549
  end
487
550
 
488
- # Create a new KeywordRestParameterNode node
489
- def KeywordRestParameterNode(flags, name, name_loc, operator_loc, source = nil, location = Location())
490
- KeywordRestParameterNode.new(source, flags, name, name_loc, operator_loc, location)
551
+ # Create a new LocalVariableReadNode node.
552
+ def local_variable_read_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :"", depth: 0)
553
+ LocalVariableReadNode.new(source, node_id, location, flags, name, depth)
491
554
  end
492
555
 
493
- # Create a new LambdaNode node
494
- def LambdaNode(locals, operator_loc, opening_loc, closing_loc, parameters, body, source = nil, location = Location())
495
- LambdaNode.new(source, locals, operator_loc, opening_loc, closing_loc, parameters, body, location)
556
+ # Create a new LocalVariableTargetNode node.
557
+ def local_variable_target_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :"", depth: 0)
558
+ LocalVariableTargetNode.new(source, node_id, location, flags, name, depth)
496
559
  end
497
560
 
498
- # Create a new LocalVariableAndWriteNode node
499
- def LocalVariableAndWriteNode(name_loc, operator_loc, value, name, depth, source = nil, location = Location())
500
- LocalVariableAndWriteNode.new(source, name_loc, operator_loc, value, name, depth, location)
561
+ # Create a new LocalVariableWriteNode node.
562
+ 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)
563
+ LocalVariableWriteNode.new(source, node_id, location, flags, name, depth, name_loc, value, operator_loc)
501
564
  end
502
565
 
503
- # Create a new LocalVariableOperatorWriteNode node
504
- def LocalVariableOperatorWriteNode(name_loc, operator_loc, value, name, operator, depth, source = nil, location = Location())
505
- LocalVariableOperatorWriteNode.new(source, name_loc, operator_loc, value, name, operator, depth, location)
566
+ # Create a new MatchLastLineNode node.
567
+ 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: "")
568
+ MatchLastLineNode.new(source, node_id, location, flags, opening_loc, content_loc, closing_loc, unescaped)
506
569
  end
507
570
 
508
- # Create a new LocalVariableOrWriteNode node
509
- def LocalVariableOrWriteNode(name_loc, operator_loc, value, name, depth, source = nil, location = Location())
510
- LocalVariableOrWriteNode.new(source, name_loc, operator_loc, value, name, depth, location)
571
+ # Create a new MatchPredicateNode node.
572
+ 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), operator_loc: location)
573
+ MatchPredicateNode.new(source, node_id, location, flags, value, pattern, operator_loc)
511
574
  end
512
575
 
513
- # Create a new LocalVariableReadNode node
514
- def LocalVariableReadNode(name, depth, source = nil, location = Location())
515
- LocalVariableReadNode.new(source, name, depth, location)
576
+ # Create a new MatchRequiredNode node.
577
+ 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)
578
+ MatchRequiredNode.new(source, node_id, location, flags, value, pattern, operator_loc)
516
579
  end
517
580
 
518
- # Create a new LocalVariableTargetNode node
519
- def LocalVariableTargetNode(name, depth, source = nil, location = Location())
520
- LocalVariableTargetNode.new(source, name, depth, location)
581
+ # Create a new MatchWriteNode node.
582
+ def match_write_node(source: default_source, node_id: 0, location: default_location, flags: 0, call: call_node(source: source), targets: [])
583
+ MatchWriteNode.new(source, node_id, location, flags, call, targets)
521
584
  end
522
585
 
523
- # Create a new LocalVariableWriteNode node
524
- def LocalVariableWriteNode(name, depth, name_loc, value, operator_loc, source = nil, location = Location())
525
- LocalVariableWriteNode.new(source, name, depth, name_loc, value, operator_loc, location)
586
+ # Create a new MissingNode node.
587
+ def missing_node(source: default_source, node_id: 0, location: default_location, flags: 0)
588
+ MissingNode.new(source, node_id, location, flags)
526
589
  end
527
590
 
528
- # Create a new MatchLastLineNode node
529
- def MatchLastLineNode(flags, opening_loc, content_loc, closing_loc, unescaped, source = nil, location = Location())
530
- MatchLastLineNode.new(source, flags, opening_loc, content_loc, closing_loc, unescaped, location)
591
+ # Create a new ModuleNode node.
592
+ 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: :"")
593
+ ModuleNode.new(source, node_id, location, flags, locals, module_keyword_loc, constant_path, body, end_keyword_loc, name)
531
594
  end
532
595
 
533
- # Create a new MatchPredicateNode node
534
- def MatchPredicateNode(value, pattern, operator_loc, source = nil, location = Location())
535
- MatchPredicateNode.new(source, value, pattern, operator_loc, location)
596
+ # Create a new MultiTargetNode node.
597
+ 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)
598
+ MultiTargetNode.new(source, node_id, location, flags, lefts, rest, rights, lparen_loc, rparen_loc)
536
599
  end
537
600
 
538
- # Create a new MatchRequiredNode node
539
- def MatchRequiredNode(value, pattern, operator_loc, source = nil, location = Location())
540
- MatchRequiredNode.new(source, value, pattern, operator_loc, location)
601
+ # Create a new MultiWriteNode node.
602
+ 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))
603
+ MultiWriteNode.new(source, node_id, location, flags, lefts, rest, rights, lparen_loc, rparen_loc, operator_loc, value)
541
604
  end
542
605
 
543
- # Create a new MatchWriteNode node
544
- def MatchWriteNode(call, targets, source = nil, location = Location())
545
- MatchWriteNode.new(source, call, targets, location)
606
+ # Create a new NextNode node.
607
+ def next_node(source: default_source, node_id: 0, location: default_location, flags: 0, arguments: nil, keyword_loc: location)
608
+ NextNode.new(source, node_id, location, flags, arguments, keyword_loc)
546
609
  end
547
610
 
548
- # Create a new MissingNode node
549
- def MissingNode(source = nil, location = Location())
550
- MissingNode.new(source, location)
611
+ # Create a new NilNode node.
612
+ def nil_node(source: default_source, node_id: 0, location: default_location, flags: 0)
613
+ NilNode.new(source, node_id, location, flags)
551
614
  end
552
615
 
553
- # Create a new ModuleNode node
554
- def ModuleNode(locals, module_keyword_loc, constant_path, body, end_keyword_loc, name, source = nil, location = Location())
555
- ModuleNode.new(source, locals, module_keyword_loc, constant_path, body, end_keyword_loc, name, location)
616
+ # Create a new NoKeywordsParameterNode node.
617
+ def no_keywords_parameter_node(source: default_source, node_id: 0, location: default_location, flags: 0, operator_loc: location, keyword_loc: location)
618
+ NoKeywordsParameterNode.new(source, node_id, location, flags, operator_loc, keyword_loc)
556
619
  end
557
620
 
558
- # Create a new MultiTargetNode node
559
- def MultiTargetNode(lefts, rest, rights, lparen_loc, rparen_loc, source = nil, location = Location())
560
- MultiTargetNode.new(source, lefts, rest, rights, lparen_loc, rparen_loc, location)
621
+ # Create a new NumberedParametersNode node.
622
+ def numbered_parameters_node(source: default_source, node_id: 0, location: default_location, flags: 0, maximum: 0)
623
+ NumberedParametersNode.new(source, node_id, location, flags, maximum)
561
624
  end
562
625
 
563
- # Create a new MultiWriteNode node
564
- def MultiWriteNode(lefts, rest, rights, lparen_loc, rparen_loc, operator_loc, value, source = nil, location = Location())
565
- MultiWriteNode.new(source, lefts, rest, rights, lparen_loc, rparen_loc, operator_loc, value, location)
626
+ # Create a new NumberedReferenceReadNode node.
627
+ def numbered_reference_read_node(source: default_source, node_id: 0, location: default_location, flags: 0, number: 0)
628
+ NumberedReferenceReadNode.new(source, node_id, location, flags, number)
566
629
  end
567
630
 
568
- # Create a new NextNode node
569
- def NextNode(arguments, keyword_loc, source = nil, location = Location())
570
- NextNode.new(source, arguments, keyword_loc, location)
631
+ # Create a new OptionalKeywordParameterNode node.
632
+ 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))
633
+ OptionalKeywordParameterNode.new(source, node_id, location, flags, name, name_loc, value)
571
634
  end
572
635
 
573
- # Create a new NilNode node
574
- def NilNode(source = nil, location = Location())
575
- NilNode.new(source, location)
636
+ # Create a new OptionalParameterNode node.
637
+ 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))
638
+ OptionalParameterNode.new(source, node_id, location, flags, name, name_loc, operator_loc, value)
576
639
  end
577
640
 
578
- # Create a new NoKeywordsParameterNode node
579
- def NoKeywordsParameterNode(operator_loc, keyword_loc, source = nil, location = Location())
580
- NoKeywordsParameterNode.new(source, operator_loc, keyword_loc, location)
641
+ # Create a new OrNode node.
642
+ 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)
643
+ OrNode.new(source, node_id, location, flags, left, right, operator_loc)
581
644
  end
582
645
 
583
- # Create a new NumberedParametersNode node
584
- def NumberedParametersNode(maximum, source = nil, location = Location())
585
- NumberedParametersNode.new(source, maximum, location)
646
+ # Create a new ParametersNode node.
647
+ 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)
648
+ ParametersNode.new(source, node_id, location, flags, requireds, optionals, rest, posts, keywords, keyword_rest, block)
586
649
  end
587
650
 
588
- # Create a new NumberedReferenceReadNode node
589
- def NumberedReferenceReadNode(number, source = nil, location = Location())
590
- NumberedReferenceReadNode.new(source, number, location)
651
+ # Create a new ParenthesesNode node.
652
+ def parentheses_node(source: default_source, node_id: 0, location: default_location, flags: 0, body: nil, opening_loc: location, closing_loc: location)
653
+ ParenthesesNode.new(source, node_id, location, flags, body, opening_loc, closing_loc)
591
654
  end
592
655
 
593
- # Create a new OptionalKeywordParameterNode node
594
- def OptionalKeywordParameterNode(flags, name, name_loc, value, source = nil, location = Location())
595
- OptionalKeywordParameterNode.new(source, flags, name, name_loc, value, location)
656
+ # Create a new PinnedExpressionNode node.
657
+ 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)
658
+ PinnedExpressionNode.new(source, node_id, location, flags, expression, operator_loc, lparen_loc, rparen_loc)
596
659
  end
597
660
 
598
- # Create a new OptionalParameterNode node
599
- def OptionalParameterNode(flags, name, name_loc, operator_loc, value, source = nil, location = Location())
600
- OptionalParameterNode.new(source, flags, name, name_loc, operator_loc, value, location)
661
+ # Create a new PinnedVariableNode node.
662
+ 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)
663
+ PinnedVariableNode.new(source, node_id, location, flags, variable, operator_loc)
601
664
  end
602
665
 
603
- # Create a new OrNode node
604
- def OrNode(left, right, operator_loc, source = nil, location = Location())
605
- OrNode.new(source, left, right, operator_loc, location)
666
+ # Create a new PostExecutionNode node.
667
+ 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)
668
+ PostExecutionNode.new(source, node_id, location, flags, statements, keyword_loc, opening_loc, closing_loc)
606
669
  end
607
670
 
608
- # Create a new ParametersNode node
609
- def ParametersNode(requireds, optionals, rest, posts, keywords, keyword_rest, block, source = nil, location = Location())
610
- ParametersNode.new(source, requireds, optionals, rest, posts, keywords, keyword_rest, block, location)
671
+ # Create a new PreExecutionNode node.
672
+ 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)
673
+ PreExecutionNode.new(source, node_id, location, flags, statements, keyword_loc, opening_loc, closing_loc)
611
674
  end
612
675
 
613
- # Create a new ParenthesesNode node
614
- def ParenthesesNode(body, opening_loc, closing_loc, source = nil, location = Location())
615
- ParenthesesNode.new(source, body, opening_loc, closing_loc, location)
676
+ # Create a new ProgramNode node.
677
+ def program_node(source: default_source, node_id: 0, location: default_location, flags: 0, locals: [], statements: statements_node(source: source))
678
+ ProgramNode.new(source, node_id, location, flags, locals, statements)
616
679
  end
617
680
 
618
- # Create a new PinnedExpressionNode node
619
- def PinnedExpressionNode(expression, operator_loc, lparen_loc, rparen_loc, source = nil, location = Location())
620
- PinnedExpressionNode.new(source, expression, operator_loc, lparen_loc, rparen_loc, location)
681
+ # Create a new RangeNode node.
682
+ def range_node(source: default_source, node_id: 0, location: default_location, flags: 0, left: nil, right: nil, operator_loc: location)
683
+ RangeNode.new(source, node_id, location, flags, left, right, operator_loc)
621
684
  end
622
685
 
623
- # Create a new PinnedVariableNode node
624
- def PinnedVariableNode(variable, operator_loc, source = nil, location = Location())
625
- PinnedVariableNode.new(source, variable, operator_loc, location)
686
+ # Create a new RationalNode node.
687
+ def rational_node(source: default_source, node_id: 0, location: default_location, flags: 0, numerator: 0, denominator: 0)
688
+ RationalNode.new(source, node_id, location, flags, numerator, denominator)
626
689
  end
627
690
 
628
- # Create a new PostExecutionNode node
629
- def PostExecutionNode(statements, keyword_loc, opening_loc, closing_loc, source = nil, location = Location())
630
- PostExecutionNode.new(source, statements, keyword_loc, opening_loc, closing_loc, location)
691
+ # Create a new RedoNode node.
692
+ def redo_node(source: default_source, node_id: 0, location: default_location, flags: 0)
693
+ RedoNode.new(source, node_id, location, flags)
631
694
  end
632
695
 
633
- # Create a new PreExecutionNode node
634
- def PreExecutionNode(statements, keyword_loc, opening_loc, closing_loc, source = nil, location = Location())
635
- PreExecutionNode.new(source, statements, keyword_loc, opening_loc, closing_loc, location)
696
+ # Create a new RegularExpressionNode node.
697
+ 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: "")
698
+ RegularExpressionNode.new(source, node_id, location, flags, opening_loc, content_loc, closing_loc, unescaped)
636
699
  end
637
700
 
638
- # Create a new ProgramNode node
639
- def ProgramNode(locals, statements, source = nil, location = Location())
640
- ProgramNode.new(source, locals, statements, location)
701
+ # Create a new RequiredKeywordParameterNode node.
702
+ def required_keyword_parameter_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :"", name_loc: location)
703
+ RequiredKeywordParameterNode.new(source, node_id, location, flags, name, name_loc)
641
704
  end
642
705
 
643
- # Create a new RangeNode node
644
- def RangeNode(flags, left, right, operator_loc, source = nil, location = Location())
645
- RangeNode.new(source, flags, left, right, operator_loc, location)
706
+ # Create a new RequiredParameterNode node.
707
+ def required_parameter_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :"")
708
+ RequiredParameterNode.new(source, node_id, location, flags, name)
646
709
  end
647
710
 
648
- # Create a new RationalNode node
649
- def RationalNode(numeric, source = nil, location = Location())
650
- RationalNode.new(source, numeric, location)
711
+ # Create a new RescueModifierNode node.
712
+ 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))
713
+ RescueModifierNode.new(source, node_id, location, flags, expression, keyword_loc, rescue_expression)
651
714
  end
652
715
 
653
- # Create a new RedoNode node
654
- def RedoNode(source = nil, location = Location())
655
- RedoNode.new(source, location)
716
+ # Create a new RescueNode node.
717
+ 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)
718
+ RescueNode.new(source, node_id, location, flags, keyword_loc, exceptions, operator_loc, reference, then_keyword_loc, statements, subsequent)
656
719
  end
657
720
 
658
- # Create a new RegularExpressionNode node
659
- def RegularExpressionNode(flags, opening_loc, content_loc, closing_loc, unescaped, source = nil, location = Location())
660
- RegularExpressionNode.new(source, flags, opening_loc, content_loc, closing_loc, unescaped, location)
721
+ # Create a new RestParameterNode node.
722
+ def rest_parameter_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: nil, name_loc: nil, operator_loc: location)
723
+ RestParameterNode.new(source, node_id, location, flags, name, name_loc, operator_loc)
661
724
  end
662
725
 
663
- # Create a new RequiredKeywordParameterNode node
664
- def RequiredKeywordParameterNode(flags, name, name_loc, source = nil, location = Location())
665
- RequiredKeywordParameterNode.new(source, flags, name, name_loc, location)
726
+ # Create a new RetryNode node.
727
+ def retry_node(source: default_source, node_id: 0, location: default_location, flags: 0)
728
+ RetryNode.new(source, node_id, location, flags)
666
729
  end
667
730
 
668
- # Create a new RequiredParameterNode node
669
- def RequiredParameterNode(flags, name, source = nil, location = Location())
670
- RequiredParameterNode.new(source, flags, name, location)
731
+ # Create a new ReturnNode node.
732
+ def return_node(source: default_source, node_id: 0, location: default_location, flags: 0, keyword_loc: location, arguments: nil)
733
+ ReturnNode.new(source, node_id, location, flags, keyword_loc, arguments)
671
734
  end
672
735
 
673
- # Create a new RescueModifierNode node
674
- def RescueModifierNode(expression, keyword_loc, rescue_expression, source = nil, location = Location())
675
- RescueModifierNode.new(source, expression, keyword_loc, rescue_expression, location)
736
+ # Create a new SelfNode node.
737
+ def self_node(source: default_source, node_id: 0, location: default_location, flags: 0)
738
+ SelfNode.new(source, node_id, location, flags)
676
739
  end
677
740
 
678
- # Create a new RescueNode node
679
- def RescueNode(keyword_loc, exceptions, operator_loc, reference, statements, consequent, source = nil, location = Location())
680
- RescueNode.new(source, keyword_loc, exceptions, operator_loc, reference, statements, consequent, location)
741
+ # Create a new ShareableConstantNode node.
742
+ def shareable_constant_node(source: default_source, node_id: 0, location: default_location, flags: 0, write: constant_write_node(source: source))
743
+ ShareableConstantNode.new(source, node_id, location, flags, write)
681
744
  end
682
745
 
683
- # Create a new RestParameterNode node
684
- def RestParameterNode(flags, name, name_loc, operator_loc, source = nil, location = Location())
685
- RestParameterNode.new(source, flags, name, name_loc, operator_loc, location)
746
+ # Create a new SingletonClassNode node.
747
+ 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)
748
+ SingletonClassNode.new(source, node_id, location, flags, locals, class_keyword_loc, operator_loc, expression, body, end_keyword_loc)
686
749
  end
687
750
 
688
- # Create a new RetryNode node
689
- def RetryNode(source = nil, location = Location())
690
- RetryNode.new(source, location)
751
+ # Create a new SourceEncodingNode node.
752
+ def source_encoding_node(source: default_source, node_id: 0, location: default_location, flags: 0)
753
+ SourceEncodingNode.new(source, node_id, location, flags)
691
754
  end
692
755
 
693
- # Create a new ReturnNode node
694
- def ReturnNode(keyword_loc, arguments, source = nil, location = Location())
695
- ReturnNode.new(source, keyword_loc, arguments, location)
756
+ # Create a new SourceFileNode node.
757
+ def source_file_node(source: default_source, node_id: 0, location: default_location, flags: 0, filepath: "")
758
+ SourceFileNode.new(source, node_id, location, flags, filepath)
696
759
  end
697
760
 
698
- # Create a new SelfNode node
699
- def SelfNode(source = nil, location = Location())
700
- SelfNode.new(source, location)
761
+ # Create a new SourceLineNode node.
762
+ def source_line_node(source: default_source, node_id: 0, location: default_location, flags: 0)
763
+ SourceLineNode.new(source, node_id, location, flags)
701
764
  end
702
765
 
703
- # Create a new SingletonClassNode node
704
- def SingletonClassNode(locals, class_keyword_loc, operator_loc, expression, body, end_keyword_loc, source = nil, location = Location())
705
- SingletonClassNode.new(source, locals, class_keyword_loc, operator_loc, expression, body, end_keyword_loc, location)
766
+ # Create a new SplatNode node.
767
+ def splat_node(source: default_source, node_id: 0, location: default_location, flags: 0, operator_loc: location, expression: nil)
768
+ SplatNode.new(source, node_id, location, flags, operator_loc, expression)
706
769
  end
707
770
 
708
- # Create a new SourceEncodingNode node
709
- def SourceEncodingNode(source = nil, location = Location())
710
- SourceEncodingNode.new(source, location)
771
+ # Create a new StatementsNode node.
772
+ def statements_node(source: default_source, node_id: 0, location: default_location, flags: 0, body: [])
773
+ StatementsNode.new(source, node_id, location, flags, body)
711
774
  end
712
775
 
713
- # Create a new SourceFileNode node
714
- def SourceFileNode(filepath, source = nil, location = Location())
715
- SourceFileNode.new(source, filepath, location)
776
+ # Create a new StringNode node.
777
+ def string_node(source: default_source, node_id: 0, location: default_location, flags: 0, opening_loc: nil, content_loc: location, closing_loc: nil, unescaped: "")
778
+ StringNode.new(source, node_id, location, flags, opening_loc, content_loc, closing_loc, unescaped)
716
779
  end
717
780
 
718
- # Create a new SourceLineNode node
719
- def SourceLineNode(source = nil, location = Location())
720
- SourceLineNode.new(source, location)
781
+ # Create a new SuperNode node.
782
+ 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)
783
+ SuperNode.new(source, node_id, location, flags, keyword_loc, lparen_loc, arguments, rparen_loc, block)
721
784
  end
722
785
 
723
- # Create a new SplatNode node
724
- def SplatNode(operator_loc, expression, source = nil, location = Location())
725
- SplatNode.new(source, operator_loc, expression, location)
786
+ # Create a new SymbolNode node.
787
+ def symbol_node(source: default_source, node_id: 0, location: default_location, flags: 0, opening_loc: nil, value_loc: nil, closing_loc: nil, unescaped: "")
788
+ SymbolNode.new(source, node_id, location, flags, opening_loc, value_loc, closing_loc, unescaped)
726
789
  end
727
790
 
728
- # Create a new StatementsNode node
729
- def StatementsNode(body, source = nil, location = Location())
730
- StatementsNode.new(source, body, location)
791
+ # Create a new TrueNode node.
792
+ def true_node(source: default_source, node_id: 0, location: default_location, flags: 0)
793
+ TrueNode.new(source, node_id, location, flags)
731
794
  end
732
795
 
733
- # Create a new StringNode node
734
- def StringNode(flags, opening_loc, content_loc, closing_loc, unescaped, source = nil, location = Location())
735
- StringNode.new(source, flags, opening_loc, content_loc, closing_loc, unescaped, location)
796
+ # Create a new UndefNode node.
797
+ def undef_node(source: default_source, node_id: 0, location: default_location, flags: 0, names: [], keyword_loc: location)
798
+ UndefNode.new(source, node_id, location, flags, names, keyword_loc)
736
799
  end
737
800
 
738
- # Create a new SuperNode node
739
- def SuperNode(keyword_loc, lparen_loc, arguments, rparen_loc, block, source = nil, location = Location())
740
- SuperNode.new(source, keyword_loc, lparen_loc, arguments, rparen_loc, block, location)
801
+ # Create a new UnlessNode node.
802
+ def unless_node(source: default_source, node_id: 0, location: default_location, flags: 0, keyword_loc: location, predicate: default_node(source, location), then_keyword_loc: nil, statements: nil, else_clause: nil, end_keyword_loc: nil)
803
+ UnlessNode.new(source, node_id, location, flags, keyword_loc, predicate, then_keyword_loc, statements, else_clause, end_keyword_loc)
741
804
  end
742
805
 
743
- # Create a new SymbolNode node
744
- def SymbolNode(flags, opening_loc, value_loc, closing_loc, unescaped, source = nil, location = Location())
745
- SymbolNode.new(source, flags, opening_loc, value_loc, closing_loc, unescaped, location)
806
+ # Create a new UntilNode node.
807
+ def until_node(source: default_source, node_id: 0, location: default_location, flags: 0, keyword_loc: location, do_keyword_loc: nil, closing_loc: nil, predicate: default_node(source, location), statements: nil)
808
+ UntilNode.new(source, node_id, location, flags, keyword_loc, do_keyword_loc, closing_loc, predicate, statements)
746
809
  end
747
810
 
748
- # Create a new TrueNode node
749
- def TrueNode(source = nil, location = Location())
750
- TrueNode.new(source, location)
811
+ # Create a new WhenNode node.
812
+ def when_node(source: default_source, node_id: 0, location: default_location, flags: 0, keyword_loc: location, conditions: [], then_keyword_loc: nil, statements: nil)
813
+ WhenNode.new(source, node_id, location, flags, keyword_loc, conditions, then_keyword_loc, statements)
751
814
  end
752
815
 
753
- # Create a new UndefNode node
754
- def UndefNode(names, keyword_loc, source = nil, location = Location())
755
- UndefNode.new(source, names, keyword_loc, location)
816
+ # Create a new WhileNode node.
817
+ def while_node(source: default_source, node_id: 0, location: default_location, flags: 0, keyword_loc: location, do_keyword_loc: nil, closing_loc: nil, predicate: default_node(source, location), statements: nil)
818
+ WhileNode.new(source, node_id, location, flags, keyword_loc, do_keyword_loc, closing_loc, predicate, statements)
756
819
  end
757
820
 
758
- # Create a new UnlessNode node
759
- def UnlessNode(keyword_loc, predicate, then_keyword_loc, statements, consequent, end_keyword_loc, source = nil, location = Location())
760
- UnlessNode.new(source, keyword_loc, predicate, then_keyword_loc, statements, consequent, end_keyword_loc, location)
821
+ # Create a new XStringNode node.
822
+ 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: "")
823
+ XStringNode.new(source, node_id, location, flags, opening_loc, content_loc, closing_loc, unescaped)
761
824
  end
762
825
 
763
- # Create a new UntilNode node
764
- def UntilNode(flags, keyword_loc, closing_loc, predicate, statements, source = nil, location = Location())
765
- UntilNode.new(source, flags, keyword_loc, closing_loc, predicate, statements, location)
826
+ # Create a new YieldNode node.
827
+ 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)
828
+ YieldNode.new(source, node_id, location, flags, keyword_loc, lparen_loc, arguments, rparen_loc)
766
829
  end
767
830
 
768
- # Create a new WhenNode node
769
- def WhenNode(keyword_loc, conditions, statements, source = nil, location = Location())
770
- WhenNode.new(source, keyword_loc, conditions, statements, location)
831
+ # Retrieve the value of one of the ArgumentsNodeFlags flags.
832
+ def arguments_node_flag(name)
833
+ case name
834
+ when :contains_forwarding then ArgumentsNodeFlags::CONTAINS_FORWARDING
835
+ when :contains_keywords then ArgumentsNodeFlags::CONTAINS_KEYWORDS
836
+ when :contains_keyword_splat then ArgumentsNodeFlags::CONTAINS_KEYWORD_SPLAT
837
+ when :contains_splat then ArgumentsNodeFlags::CONTAINS_SPLAT
838
+ when :contains_multiple_splats then ArgumentsNodeFlags::CONTAINS_MULTIPLE_SPLATS
839
+ else Kernel.raise ArgumentError, "invalid ArgumentsNodeFlags flag: #{name.inspect}"
840
+ end
771
841
  end
772
842
 
773
- # Create a new WhileNode node
774
- def WhileNode(flags, keyword_loc, closing_loc, predicate, statements, source = nil, location = Location())
775
- WhileNode.new(source, flags, keyword_loc, closing_loc, predicate, statements, location)
843
+ # Retrieve the value of one of the ArrayNodeFlags flags.
844
+ def array_node_flag(name)
845
+ case name
846
+ when :contains_splat then ArrayNodeFlags::CONTAINS_SPLAT
847
+ else Kernel.raise ArgumentError, "invalid ArrayNodeFlags flag: #{name.inspect}"
848
+ end
849
+ end
850
+
851
+ # Retrieve the value of one of the CallNodeFlags flags.
852
+ def call_node_flag(name)
853
+ case name
854
+ when :safe_navigation then CallNodeFlags::SAFE_NAVIGATION
855
+ when :variable_call then CallNodeFlags::VARIABLE_CALL
856
+ when :attribute_write then CallNodeFlags::ATTRIBUTE_WRITE
857
+ when :ignore_visibility then CallNodeFlags::IGNORE_VISIBILITY
858
+ else Kernel.raise ArgumentError, "invalid CallNodeFlags flag: #{name.inspect}"
859
+ end
860
+ end
861
+
862
+ # Retrieve the value of one of the EncodingFlags flags.
863
+ def encoding_flag(name)
864
+ case name
865
+ when :forced_utf8_encoding then EncodingFlags::FORCED_UTF8_ENCODING
866
+ when :forced_binary_encoding then EncodingFlags::FORCED_BINARY_ENCODING
867
+ else Kernel.raise ArgumentError, "invalid EncodingFlags flag: #{name.inspect}"
868
+ end
869
+ end
870
+
871
+ # Retrieve the value of one of the IntegerBaseFlags flags.
872
+ def integer_base_flag(name)
873
+ case name
874
+ when :binary then IntegerBaseFlags::BINARY
875
+ when :decimal then IntegerBaseFlags::DECIMAL
876
+ when :octal then IntegerBaseFlags::OCTAL
877
+ when :hexadecimal then IntegerBaseFlags::HEXADECIMAL
878
+ else Kernel.raise ArgumentError, "invalid IntegerBaseFlags flag: #{name.inspect}"
879
+ end
880
+ end
881
+
882
+ # Retrieve the value of one of the InterpolatedStringNodeFlags flags.
883
+ def interpolated_string_node_flag(name)
884
+ case name
885
+ when :frozen then InterpolatedStringNodeFlags::FROZEN
886
+ when :mutable then InterpolatedStringNodeFlags::MUTABLE
887
+ else Kernel.raise ArgumentError, "invalid InterpolatedStringNodeFlags flag: #{name.inspect}"
888
+ end
889
+ end
890
+
891
+ # Retrieve the value of one of the KeywordHashNodeFlags flags.
892
+ def keyword_hash_node_flag(name)
893
+ case name
894
+ when :symbol_keys then KeywordHashNodeFlags::SYMBOL_KEYS
895
+ else Kernel.raise ArgumentError, "invalid KeywordHashNodeFlags flag: #{name.inspect}"
896
+ end
897
+ end
898
+
899
+ # Retrieve the value of one of the LoopFlags flags.
900
+ def loop_flag(name)
901
+ case name
902
+ when :begin_modifier then LoopFlags::BEGIN_MODIFIER
903
+ else Kernel.raise ArgumentError, "invalid LoopFlags flag: #{name.inspect}"
904
+ end
905
+ end
906
+
907
+ # Retrieve the value of one of the ParameterFlags flags.
908
+ def parameter_flag(name)
909
+ case name
910
+ when :repeated_parameter then ParameterFlags::REPEATED_PARAMETER
911
+ else Kernel.raise ArgumentError, "invalid ParameterFlags flag: #{name.inspect}"
912
+ end
913
+ end
914
+
915
+ # Retrieve the value of one of the ParenthesesNodeFlags flags.
916
+ def parentheses_node_flag(name)
917
+ case name
918
+ when :multiple_statements then ParenthesesNodeFlags::MULTIPLE_STATEMENTS
919
+ else Kernel.raise ArgumentError, "invalid ParenthesesNodeFlags flag: #{name.inspect}"
920
+ end
921
+ end
922
+
923
+ # Retrieve the value of one of the RangeFlags flags.
924
+ def range_flag(name)
925
+ case name
926
+ when :exclude_end then RangeFlags::EXCLUDE_END
927
+ else Kernel.raise ArgumentError, "invalid RangeFlags flag: #{name.inspect}"
928
+ end
929
+ end
930
+
931
+ # Retrieve the value of one of the RegularExpressionFlags flags.
932
+ def regular_expression_flag(name)
933
+ case name
934
+ when :ignore_case then RegularExpressionFlags::IGNORE_CASE
935
+ when :extended then RegularExpressionFlags::EXTENDED
936
+ when :multi_line then RegularExpressionFlags::MULTI_LINE
937
+ when :once then RegularExpressionFlags::ONCE
938
+ when :euc_jp then RegularExpressionFlags::EUC_JP
939
+ when :ascii_8bit then RegularExpressionFlags::ASCII_8BIT
940
+ when :windows_31j then RegularExpressionFlags::WINDOWS_31J
941
+ when :utf_8 then RegularExpressionFlags::UTF_8
942
+ when :forced_utf8_encoding then RegularExpressionFlags::FORCED_UTF8_ENCODING
943
+ when :forced_binary_encoding then RegularExpressionFlags::FORCED_BINARY_ENCODING
944
+ when :forced_us_ascii_encoding then RegularExpressionFlags::FORCED_US_ASCII_ENCODING
945
+ else Kernel.raise ArgumentError, "invalid RegularExpressionFlags flag: #{name.inspect}"
946
+ end
947
+ end
948
+
949
+ # Retrieve the value of one of the ShareableConstantNodeFlags flags.
950
+ def shareable_constant_node_flag(name)
951
+ case name
952
+ when :literal then ShareableConstantNodeFlags::LITERAL
953
+ when :experimental_everything then ShareableConstantNodeFlags::EXPERIMENTAL_EVERYTHING
954
+ when :experimental_copy then ShareableConstantNodeFlags::EXPERIMENTAL_COPY
955
+ else Kernel.raise ArgumentError, "invalid ShareableConstantNodeFlags flag: #{name.inspect}"
956
+ end
957
+ end
958
+
959
+ # Retrieve the value of one of the StringFlags flags.
960
+ def string_flag(name)
961
+ case name
962
+ when :forced_utf8_encoding then StringFlags::FORCED_UTF8_ENCODING
963
+ when :forced_binary_encoding then StringFlags::FORCED_BINARY_ENCODING
964
+ when :frozen then StringFlags::FROZEN
965
+ when :mutable then StringFlags::MUTABLE
966
+ else Kernel.raise ArgumentError, "invalid StringFlags flag: #{name.inspect}"
967
+ end
968
+ end
969
+
970
+ # Retrieve the value of one of the SymbolFlags flags.
971
+ def symbol_flag(name)
972
+ case name
973
+ when :forced_utf8_encoding then SymbolFlags::FORCED_UTF8_ENCODING
974
+ when :forced_binary_encoding then SymbolFlags::FORCED_BINARY_ENCODING
975
+ when :forced_us_ascii_encoding then SymbolFlags::FORCED_US_ASCII_ENCODING
976
+ else Kernel.raise ArgumentError, "invalid SymbolFlags flag: #{name.inspect}"
977
+ end
978
+ end
979
+
980
+ private
981
+
982
+ # The default source object that gets attached to nodes and locations if no
983
+ # source is specified.
984
+ def default_source
985
+ Source.for("")
776
986
  end
777
987
 
778
- # Create a new XStringNode node
779
- def XStringNode(flags, opening_loc, content_loc, closing_loc, unescaped, source = nil, location = Location())
780
- XStringNode.new(source, flags, opening_loc, content_loc, closing_loc, unescaped, location)
988
+ # The default location object that gets attached to nodes if no location is
989
+ # specified, which uses the given source.
990
+ def default_location
991
+ Location.new(default_source, 0, 0)
781
992
  end
782
993
 
783
- # Create a new YieldNode node
784
- def YieldNode(keyword_loc, lparen_loc, arguments, rparen_loc, source = nil, location = Location())
785
- YieldNode.new(source, keyword_loc, lparen_loc, arguments, rparen_loc, location)
994
+ # The default node that gets attached to nodes if no node is specified for a
995
+ # required node field.
996
+ def default_node(source, location)
997
+ MissingNode.new(source, -1, location, 0)
786
998
  end
787
999
  end
788
1000
  end