prism 0.30.0 → 1.0.0

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