prism 0.23.0 → 0.25.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (117) hide show
  1. checksums.yaml +4 -4
  2. data/BSDmakefile +58 -0
  3. data/CHANGELOG.md +65 -1
  4. data/Makefile +5 -2
  5. data/README.md +45 -6
  6. data/config.yml +499 -4
  7. data/docs/build_system.md +31 -0
  8. data/docs/configuration.md +2 -0
  9. data/docs/cruby_compilation.md +1 -1
  10. data/docs/parser_translation.md +14 -9
  11. data/docs/releasing.md +3 -3
  12. data/docs/ripper_translation.md +50 -0
  13. data/docs/ruby_api.md +1 -0
  14. data/docs/serialization.md +26 -5
  15. data/ext/prism/api_node.c +2342 -1801
  16. data/ext/prism/api_pack.c +9 -0
  17. data/ext/prism/extconf.rb +27 -11
  18. data/ext/prism/extension.c +313 -66
  19. data/ext/prism/extension.h +5 -4
  20. data/include/prism/ast.h +213 -64
  21. data/include/prism/defines.h +106 -2
  22. data/include/prism/diagnostic.h +134 -71
  23. data/include/prism/encoding.h +22 -4
  24. data/include/prism/node.h +93 -0
  25. data/include/prism/options.h +82 -7
  26. data/include/prism/pack.h +11 -0
  27. data/include/prism/parser.h +198 -53
  28. data/include/prism/prettyprint.h +8 -0
  29. data/include/prism/static_literals.h +118 -0
  30. data/include/prism/util/pm_buffer.h +65 -2
  31. data/include/prism/util/pm_constant_pool.h +18 -1
  32. data/include/prism/util/pm_integer.h +119 -0
  33. data/include/prism/util/pm_list.h +1 -1
  34. data/include/prism/util/pm_newline_list.h +12 -3
  35. data/include/prism/util/pm_string.h +26 -2
  36. data/include/prism/version.h +2 -2
  37. data/include/prism.h +59 -1
  38. data/lib/prism/compiler.rb +8 -1
  39. data/lib/prism/debug.rb +46 -3
  40. data/lib/prism/desugar_compiler.rb +225 -80
  41. data/lib/prism/dispatcher.rb +29 -0
  42. data/lib/prism/dot_visitor.rb +87 -16
  43. data/lib/prism/dsl.rb +315 -300
  44. data/lib/prism/ffi.rb +165 -84
  45. data/lib/prism/lex_compat.rb +17 -15
  46. data/lib/prism/mutation_compiler.rb +11 -0
  47. data/lib/prism/node.rb +4857 -3750
  48. data/lib/prism/node_ext.rb +77 -29
  49. data/lib/prism/pack.rb +4 -0
  50. data/lib/prism/parse_result/comments.rb +34 -17
  51. data/lib/prism/parse_result/newlines.rb +3 -1
  52. data/lib/prism/parse_result.rb +88 -34
  53. data/lib/prism/pattern.rb +16 -4
  54. data/lib/prism/polyfill/string.rb +12 -0
  55. data/lib/prism/serialize.rb +960 -327
  56. data/lib/prism/translation/parser/compiler.rb +152 -50
  57. data/lib/prism/translation/parser/lexer.rb +103 -22
  58. data/lib/prism/translation/parser/rubocop.rb +47 -11
  59. data/lib/prism/translation/parser.rb +134 -10
  60. data/lib/prism/translation/parser33.rb +12 -0
  61. data/lib/prism/translation/parser34.rb +12 -0
  62. data/lib/prism/translation/ripper/sexp.rb +125 -0
  63. data/lib/prism/translation/ripper/shim.rb +5 -0
  64. data/lib/prism/translation/ripper.rb +3248 -379
  65. data/lib/prism/translation/ruby_parser.rb +35 -18
  66. data/lib/prism/translation.rb +3 -1
  67. data/lib/prism/visitor.rb +10 -0
  68. data/lib/prism.rb +8 -2
  69. data/prism.gemspec +35 -4
  70. data/rbi/prism/compiler.rbi +14 -0
  71. data/rbi/prism/desugar_compiler.rbi +5 -0
  72. data/rbi/prism/mutation_compiler.rbi +5 -0
  73. data/rbi/prism/node.rbi +8221 -0
  74. data/rbi/prism/node_ext.rbi +102 -0
  75. data/rbi/prism/parse_result.rbi +304 -0
  76. data/rbi/prism/translation/parser/compiler.rbi +13 -0
  77. data/rbi/prism/translation/ripper/ripper_compiler.rbi +5 -0
  78. data/rbi/prism/translation/ripper.rbi +25 -0
  79. data/rbi/prism/translation/ruby_parser.rbi +11 -0
  80. data/rbi/prism/visitor.rbi +470 -0
  81. data/rbi/prism.rbi +39 -7749
  82. data/sig/prism/compiler.rbs +9 -0
  83. data/sig/prism/dispatcher.rbs +16 -0
  84. data/sig/prism/dot_visitor.rbs +6 -0
  85. data/sig/prism/dsl.rbs +462 -0
  86. data/sig/prism/mutation_compiler.rbs +158 -0
  87. data/sig/prism/node.rbs +3529 -0
  88. data/sig/prism/node_ext.rbs +78 -0
  89. data/sig/prism/pack.rbs +43 -0
  90. data/sig/prism/parse_result.rbs +127 -0
  91. data/sig/prism/pattern.rbs +13 -0
  92. data/sig/prism/serialize.rbs +7 -0
  93. data/sig/prism/visitor.rbs +168 -0
  94. data/sig/prism.rbs +188 -4767
  95. data/src/diagnostic.c +575 -230
  96. data/src/encoding.c +211 -108
  97. data/src/node.c +7526 -447
  98. data/src/options.c +36 -12
  99. data/src/pack.c +33 -17
  100. data/src/prettyprint.c +1297 -1388
  101. data/src/prism.c +3665 -1121
  102. data/src/regexp.c +17 -2
  103. data/src/serialize.c +47 -28
  104. data/src/static_literals.c +552 -0
  105. data/src/token_type.c +1 -0
  106. data/src/util/pm_buffer.c +147 -20
  107. data/src/util/pm_char.c +4 -4
  108. data/src/util/pm_constant_pool.c +35 -11
  109. data/src/util/pm_integer.c +629 -0
  110. data/src/util/pm_list.c +1 -1
  111. data/src/util/pm_newline_list.c +20 -8
  112. data/src/util/pm_string.c +134 -5
  113. data/src/util/pm_string_list.c +2 -2
  114. metadata +37 -6
  115. data/docs/ripper.md +0 -36
  116. data/rbi/prism_static.rbi +0 -207
  117. data/sig/prism_static.rbs +0 -201
data/lib/prism/dsl.rb CHANGED
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  =begin
3
4
  This file is generated by the templates/template.rb script and should not be
4
5
  modified manually. See templates/lib/prism/dsl.rb.erb
@@ -15,11 +16,14 @@ module Prism
15
16
  # [
16
17
  # Prism::IntegerNode.new(
17
18
  # Prism::IntegerBaseFlags::DECIMAL,
19
+ # 1,
18
20
  # Prism::Location.new(source, 1, 1),
21
+ # source
19
22
  # )
20
23
  # ],
21
24
  # Prism::Location.new(source, 0, 1),
22
- # Prism::Location.new(source, 2, 1)
25
+ # Prism::Location.new(source, 2, 1),
26
+ # source
23
27
  # )
24
28
  #
25
29
  # you could instead write:
@@ -27,9 +31,10 @@ module Prism
27
31
  # source = Prism::Source.new("[1]")
28
32
  #
29
33
  # ArrayNode(
30
- # IntegerNode(Prism::IntegerBaseFlags::DECIMAL, Location(source, 1, 1))),
34
+ # IntegerNode(Prism::IntegerBaseFlags::DECIMAL, 1, Location(source, 1, 1)), source),
31
35
  # Location(source, 0, 1),
32
- # Location(source, 2, 1)
36
+ # Location(source, 2, 1),
37
+ # source
33
38
  # )
34
39
  #
35
40
  # This is mostly helpful in the context of writing tests, but can also be used
@@ -39,747 +44,757 @@ module Prism
39
44
 
40
45
  # Create a new Location object
41
46
  def Location(source = nil, start_offset = 0, length = 0)
42
- Location.new(source, start_offset, length)
47
+ Location.new(source, start_offset, length) # steep:ignore
43
48
  end
44
49
 
45
50
  # Create a new AliasGlobalVariableNode node
46
- def AliasGlobalVariableNode(new_name, old_name, keyword_loc, location = Location())
47
- AliasGlobalVariableNode.new(new_name, old_name, keyword_loc, location)
51
+ def AliasGlobalVariableNode(new_name, old_name, keyword_loc, source = nil, location = Location())
52
+ AliasGlobalVariableNode.new(source, new_name, old_name, keyword_loc, location)
48
53
  end
49
54
 
50
55
  # Create a new AliasMethodNode node
51
- def AliasMethodNode(new_name, old_name, keyword_loc, location = Location())
52
- AliasMethodNode.new(new_name, old_name, keyword_loc, location)
56
+ def AliasMethodNode(new_name, old_name, keyword_loc, source = nil, location = Location())
57
+ AliasMethodNode.new(source, new_name, old_name, keyword_loc, location)
53
58
  end
54
59
 
55
60
  # Create a new AlternationPatternNode node
56
- def AlternationPatternNode(left, right, operator_loc, location = Location())
57
- AlternationPatternNode.new(left, right, operator_loc, location)
61
+ def AlternationPatternNode(left, right, operator_loc, source = nil, location = Location())
62
+ AlternationPatternNode.new(source, left, right, operator_loc, location)
58
63
  end
59
64
 
60
65
  # Create a new AndNode node
61
- def AndNode(left, right, operator_loc, location = Location())
62
- AndNode.new(left, right, operator_loc, location)
66
+ def AndNode(left, right, operator_loc, source = nil, location = Location())
67
+ AndNode.new(source, left, right, operator_loc, location)
63
68
  end
64
69
 
65
70
  # Create a new ArgumentsNode node
66
- def ArgumentsNode(flags, arguments, location = Location())
67
- ArgumentsNode.new(flags, arguments, location)
71
+ def ArgumentsNode(flags, arguments, source = nil, location = Location())
72
+ ArgumentsNode.new(source, flags, arguments, location)
68
73
  end
69
74
 
70
75
  # Create a new ArrayNode node
71
- def ArrayNode(flags, elements, opening_loc, closing_loc, location = Location())
72
- ArrayNode.new(flags, elements, opening_loc, closing_loc, location)
76
+ def ArrayNode(flags, elements, opening_loc, closing_loc, source = nil, location = Location())
77
+ ArrayNode.new(source, flags, elements, opening_loc, closing_loc, location)
73
78
  end
74
79
 
75
80
  # Create a new ArrayPatternNode node
76
- def ArrayPatternNode(constant, requireds, rest, posts, opening_loc, closing_loc, location = Location())
77
- ArrayPatternNode.new(constant, requireds, rest, posts, opening_loc, closing_loc, location)
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)
78
83
  end
79
84
 
80
85
  # Create a new AssocNode node
81
- def AssocNode(key, value, operator_loc, location = Location())
82
- AssocNode.new(key, value, operator_loc, location)
86
+ def AssocNode(key, value, operator_loc, source = nil, location = Location())
87
+ AssocNode.new(source, key, value, operator_loc, location)
83
88
  end
84
89
 
85
90
  # Create a new AssocSplatNode node
86
- def AssocSplatNode(value, operator_loc, location = Location())
87
- AssocSplatNode.new(value, operator_loc, location)
91
+ def AssocSplatNode(value, operator_loc, source = nil, location = Location())
92
+ AssocSplatNode.new(source, value, operator_loc, location)
88
93
  end
89
94
 
90
95
  # Create a new BackReferenceReadNode node
91
- def BackReferenceReadNode(name, location = Location())
92
- BackReferenceReadNode.new(name, location)
96
+ def BackReferenceReadNode(name, source = nil, location = Location())
97
+ BackReferenceReadNode.new(source, name, location)
93
98
  end
94
99
 
95
100
  # Create a new BeginNode node
96
- def BeginNode(begin_keyword_loc, statements, rescue_clause, else_clause, ensure_clause, end_keyword_loc, location = Location())
97
- BeginNode.new(begin_keyword_loc, statements, rescue_clause, else_clause, ensure_clause, end_keyword_loc, location)
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)
98
103
  end
99
104
 
100
105
  # Create a new BlockArgumentNode node
101
- def BlockArgumentNode(expression, operator_loc, location = Location())
102
- BlockArgumentNode.new(expression, operator_loc, location)
106
+ def BlockArgumentNode(expression, operator_loc, source = nil, location = Location())
107
+ BlockArgumentNode.new(source, expression, operator_loc, location)
103
108
  end
104
109
 
105
110
  # Create a new BlockLocalVariableNode node
106
- def BlockLocalVariableNode(flags, name, location = Location())
107
- BlockLocalVariableNode.new(flags, name, location)
111
+ def BlockLocalVariableNode(flags, name, source = nil, location = Location())
112
+ BlockLocalVariableNode.new(source, flags, name, location)
108
113
  end
109
114
 
110
115
  # Create a new BlockNode node
111
- def BlockNode(locals, parameters, body, opening_loc, closing_loc, location = Location())
112
- BlockNode.new(locals, parameters, body, opening_loc, closing_loc, location)
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)
113
118
  end
114
119
 
115
120
  # Create a new BlockParameterNode node
116
- def BlockParameterNode(flags, name, name_loc, operator_loc, location = Location())
117
- BlockParameterNode.new(flags, name, name_loc, operator_loc, location)
121
+ def BlockParameterNode(flags, name, name_loc, operator_loc, source = nil, location = Location())
122
+ BlockParameterNode.new(source, flags, name, name_loc, operator_loc, location)
118
123
  end
119
124
 
120
125
  # Create a new BlockParametersNode node
121
- def BlockParametersNode(parameters, locals, opening_loc, closing_loc, location = Location())
122
- BlockParametersNode.new(parameters, locals, opening_loc, closing_loc, location)
126
+ def BlockParametersNode(parameters, locals, opening_loc, closing_loc, source = nil, location = Location())
127
+ BlockParametersNode.new(source, parameters, locals, opening_loc, closing_loc, location)
123
128
  end
124
129
 
125
130
  # Create a new BreakNode node
126
- def BreakNode(arguments, keyword_loc, location = Location())
127
- BreakNode.new(arguments, keyword_loc, location)
131
+ def BreakNode(arguments, keyword_loc, source = nil, location = Location())
132
+ BreakNode.new(source, arguments, keyword_loc, location)
128
133
  end
129
134
 
130
135
  # Create a new CallAndWriteNode node
131
- def CallAndWriteNode(flags, receiver, call_operator_loc, message_loc, read_name, write_name, operator_loc, value, location = Location())
132
- CallAndWriteNode.new(flags, receiver, call_operator_loc, message_loc, read_name, write_name, operator_loc, value, location)
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)
133
138
  end
134
139
 
135
140
  # Create a new CallNode node
136
- def CallNode(flags, receiver, call_operator_loc, name, message_loc, opening_loc, arguments, closing_loc, block, location = Location())
137
- CallNode.new(flags, receiver, call_operator_loc, name, message_loc, opening_loc, arguments, closing_loc, block, location)
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)
138
143
  end
139
144
 
140
145
  # Create a new CallOperatorWriteNode node
141
- def CallOperatorWriteNode(flags, receiver, call_operator_loc, message_loc, read_name, write_name, operator, operator_loc, value, location = Location())
142
- CallOperatorWriteNode.new(flags, receiver, call_operator_loc, message_loc, read_name, write_name, operator, operator_loc, value, location)
146
+ def CallOperatorWriteNode(flags, receiver, call_operator_loc, message_loc, read_name, write_name, operator, operator_loc, value, source = nil, location = Location())
147
+ CallOperatorWriteNode.new(source, flags, receiver, call_operator_loc, message_loc, read_name, write_name, operator, operator_loc, value, location)
143
148
  end
144
149
 
145
150
  # Create a new CallOrWriteNode node
146
- def CallOrWriteNode(flags, receiver, call_operator_loc, message_loc, read_name, write_name, operator_loc, value, location = Location())
147
- CallOrWriteNode.new(flags, receiver, call_operator_loc, message_loc, read_name, write_name, operator_loc, value, location)
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)
148
153
  end
149
154
 
150
155
  # Create a new CallTargetNode node
151
- def CallTargetNode(flags, receiver, call_operator_loc, name, message_loc, location = Location())
152
- CallTargetNode.new(flags, receiver, call_operator_loc, name, message_loc, location)
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)
153
158
  end
154
159
 
155
160
  # Create a new CapturePatternNode node
156
- def CapturePatternNode(value, target, operator_loc, location = Location())
157
- CapturePatternNode.new(value, target, operator_loc, location)
161
+ def CapturePatternNode(value, target, operator_loc, source = nil, location = Location())
162
+ CapturePatternNode.new(source, value, target, operator_loc, location)
158
163
  end
159
164
 
160
165
  # Create a new CaseMatchNode node
161
- def CaseMatchNode(predicate, conditions, consequent, case_keyword_loc, end_keyword_loc, location = Location())
162
- CaseMatchNode.new(predicate, conditions, consequent, case_keyword_loc, end_keyword_loc, location)
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)
163
168
  end
164
169
 
165
170
  # Create a new CaseNode node
166
- def CaseNode(predicate, conditions, consequent, case_keyword_loc, end_keyword_loc, location = Location())
167
- CaseNode.new(predicate, conditions, consequent, case_keyword_loc, end_keyword_loc, location)
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)
168
173
  end
169
174
 
170
175
  # Create a new ClassNode node
171
- def ClassNode(locals, class_keyword_loc, constant_path, inheritance_operator_loc, superclass, body, end_keyword_loc, name, location = Location())
172
- ClassNode.new(locals, class_keyword_loc, constant_path, inheritance_operator_loc, superclass, body, end_keyword_loc, name, location)
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)
173
178
  end
174
179
 
175
180
  # Create a new ClassVariableAndWriteNode node
176
- def ClassVariableAndWriteNode(name, name_loc, operator_loc, value, location = Location())
177
- ClassVariableAndWriteNode.new(name, name_loc, operator_loc, value, location)
181
+ def ClassVariableAndWriteNode(name, name_loc, operator_loc, value, source = nil, location = Location())
182
+ ClassVariableAndWriteNode.new(source, name, name_loc, operator_loc, value, location)
178
183
  end
179
184
 
180
185
  # Create a new ClassVariableOperatorWriteNode node
181
- def ClassVariableOperatorWriteNode(name, name_loc, operator_loc, value, operator, location = Location())
182
- ClassVariableOperatorWriteNode.new(name, name_loc, operator_loc, value, operator, location)
186
+ def ClassVariableOperatorWriteNode(name, name_loc, operator_loc, value, operator, source = nil, location = Location())
187
+ ClassVariableOperatorWriteNode.new(source, name, name_loc, operator_loc, value, operator, location)
183
188
  end
184
189
 
185
190
  # Create a new ClassVariableOrWriteNode node
186
- def ClassVariableOrWriteNode(name, name_loc, operator_loc, value, location = Location())
187
- ClassVariableOrWriteNode.new(name, name_loc, operator_loc, value, location)
191
+ def ClassVariableOrWriteNode(name, name_loc, operator_loc, value, source = nil, location = Location())
192
+ ClassVariableOrWriteNode.new(source, name, name_loc, operator_loc, value, location)
188
193
  end
189
194
 
190
195
  # Create a new ClassVariableReadNode node
191
- def ClassVariableReadNode(name, location = Location())
192
- ClassVariableReadNode.new(name, location)
196
+ def ClassVariableReadNode(name, source = nil, location = Location())
197
+ ClassVariableReadNode.new(source, name, location)
193
198
  end
194
199
 
195
200
  # Create a new ClassVariableTargetNode node
196
- def ClassVariableTargetNode(name, location = Location())
197
- ClassVariableTargetNode.new(name, location)
201
+ def ClassVariableTargetNode(name, source = nil, location = Location())
202
+ ClassVariableTargetNode.new(source, name, location)
198
203
  end
199
204
 
200
205
  # Create a new ClassVariableWriteNode node
201
- def ClassVariableWriteNode(name, name_loc, value, operator_loc, location = Location())
202
- ClassVariableWriteNode.new(name, name_loc, value, operator_loc, location)
206
+ def ClassVariableWriteNode(name, name_loc, value, operator_loc, source = nil, location = Location())
207
+ ClassVariableWriteNode.new(source, name, name_loc, value, operator_loc, location)
203
208
  end
204
209
 
205
210
  # Create a new ConstantAndWriteNode node
206
- def ConstantAndWriteNode(name, name_loc, operator_loc, value, location = Location())
207
- ConstantAndWriteNode.new(name, name_loc, operator_loc, value, location)
211
+ def ConstantAndWriteNode(name, name_loc, operator_loc, value, source = nil, location = Location())
212
+ ConstantAndWriteNode.new(source, name, name_loc, operator_loc, value, location)
208
213
  end
209
214
 
210
215
  # Create a new ConstantOperatorWriteNode node
211
- def ConstantOperatorWriteNode(name, name_loc, operator_loc, value, operator, location = Location())
212
- ConstantOperatorWriteNode.new(name, name_loc, operator_loc, value, operator, location)
216
+ def ConstantOperatorWriteNode(name, name_loc, operator_loc, value, operator, source = nil, location = Location())
217
+ ConstantOperatorWriteNode.new(source, name, name_loc, operator_loc, value, operator, location)
213
218
  end
214
219
 
215
220
  # Create a new ConstantOrWriteNode node
216
- def ConstantOrWriteNode(name, name_loc, operator_loc, value, location = Location())
217
- ConstantOrWriteNode.new(name, name_loc, operator_loc, value, location)
221
+ def ConstantOrWriteNode(name, name_loc, operator_loc, value, source = nil, location = Location())
222
+ ConstantOrWriteNode.new(source, name, name_loc, operator_loc, value, location)
218
223
  end
219
224
 
220
225
  # Create a new ConstantPathAndWriteNode node
221
- def ConstantPathAndWriteNode(target, operator_loc, value, location = Location())
222
- ConstantPathAndWriteNode.new(target, operator_loc, value, location)
226
+ def ConstantPathAndWriteNode(target, operator_loc, value, source = nil, location = Location())
227
+ ConstantPathAndWriteNode.new(source, target, operator_loc, value, location)
223
228
  end
224
229
 
225
230
  # Create a new ConstantPathNode node
226
- def ConstantPathNode(parent, child, delimiter_loc, location = Location())
227
- ConstantPathNode.new(parent, child, delimiter_loc, location)
231
+ def ConstantPathNode(parent, child, delimiter_loc, source = nil, location = Location())
232
+ ConstantPathNode.new(source, parent, child, delimiter_loc, location)
228
233
  end
229
234
 
230
235
  # Create a new ConstantPathOperatorWriteNode node
231
- def ConstantPathOperatorWriteNode(target, operator_loc, value, operator, location = Location())
232
- ConstantPathOperatorWriteNode.new(target, operator_loc, value, operator, location)
236
+ def ConstantPathOperatorWriteNode(target, operator_loc, value, operator, source = nil, location = Location())
237
+ ConstantPathOperatorWriteNode.new(source, target, operator_loc, value, operator, location)
233
238
  end
234
239
 
235
240
  # Create a new ConstantPathOrWriteNode node
236
- def ConstantPathOrWriteNode(target, operator_loc, value, location = Location())
237
- ConstantPathOrWriteNode.new(target, operator_loc, value, location)
241
+ def ConstantPathOrWriteNode(target, operator_loc, value, source = nil, location = Location())
242
+ ConstantPathOrWriteNode.new(source, target, operator_loc, value, location)
238
243
  end
239
244
 
240
245
  # Create a new ConstantPathTargetNode node
241
- def ConstantPathTargetNode(parent, child, delimiter_loc, location = Location())
242
- ConstantPathTargetNode.new(parent, child, delimiter_loc, location)
246
+ def ConstantPathTargetNode(parent, child, delimiter_loc, source = nil, location = Location())
247
+ ConstantPathTargetNode.new(source, parent, child, delimiter_loc, location)
243
248
  end
244
249
 
245
250
  # Create a new ConstantPathWriteNode node
246
- def ConstantPathWriteNode(target, operator_loc, value, location = Location())
247
- ConstantPathWriteNode.new(target, operator_loc, value, location)
251
+ def ConstantPathWriteNode(target, operator_loc, value, source = nil, location = Location())
252
+ ConstantPathWriteNode.new(source, target, operator_loc, value, location)
248
253
  end
249
254
 
250
255
  # Create a new ConstantReadNode node
251
- def ConstantReadNode(name, location = Location())
252
- ConstantReadNode.new(name, location)
256
+ def ConstantReadNode(name, source = nil, location = Location())
257
+ ConstantReadNode.new(source, name, location)
253
258
  end
254
259
 
255
260
  # Create a new ConstantTargetNode node
256
- def ConstantTargetNode(name, location = Location())
257
- ConstantTargetNode.new(name, location)
261
+ def ConstantTargetNode(name, source = nil, location = Location())
262
+ ConstantTargetNode.new(source, name, location)
258
263
  end
259
264
 
260
265
  # Create a new ConstantWriteNode node
261
- def ConstantWriteNode(name, name_loc, value, operator_loc, location = Location())
262
- ConstantWriteNode.new(name, name_loc, value, operator_loc, location)
266
+ def ConstantWriteNode(name, name_loc, value, operator_loc, source = nil, location = Location())
267
+ ConstantWriteNode.new(source, name, name_loc, value, operator_loc, location)
263
268
  end
264
269
 
265
270
  # Create a new DefNode node
266
- def DefNode(name, name_loc, receiver, parameters, body, locals, def_keyword_loc, operator_loc, lparen_loc, rparen_loc, equal_loc, end_keyword_loc, location = Location())
267
- DefNode.new(name, name_loc, receiver, parameters, body, locals, def_keyword_loc, operator_loc, lparen_loc, rparen_loc, equal_loc, end_keyword_loc, location)
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)
268
273
  end
269
274
 
270
275
  # Create a new DefinedNode node
271
- def DefinedNode(lparen_loc, value, rparen_loc, keyword_loc, location = Location())
272
- DefinedNode.new(lparen_loc, value, rparen_loc, keyword_loc, location)
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)
273
278
  end
274
279
 
275
280
  # Create a new ElseNode node
276
- def ElseNode(else_keyword_loc, statements, end_keyword_loc, location = Location())
277
- ElseNode.new(else_keyword_loc, statements, end_keyword_loc, location)
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)
278
283
  end
279
284
 
280
285
  # Create a new EmbeddedStatementsNode node
281
- def EmbeddedStatementsNode(opening_loc, statements, closing_loc, location = Location())
282
- EmbeddedStatementsNode.new(opening_loc, statements, closing_loc, location)
286
+ def EmbeddedStatementsNode(opening_loc, statements, closing_loc, source = nil, location = Location())
287
+ EmbeddedStatementsNode.new(source, opening_loc, statements, closing_loc, location)
283
288
  end
284
289
 
285
290
  # Create a new EmbeddedVariableNode node
286
- def EmbeddedVariableNode(operator_loc, variable, location = Location())
287
- EmbeddedVariableNode.new(operator_loc, variable, location)
291
+ def EmbeddedVariableNode(operator_loc, variable, source = nil, location = Location())
292
+ EmbeddedVariableNode.new(source, operator_loc, variable, location)
288
293
  end
289
294
 
290
295
  # Create a new EnsureNode node
291
- def EnsureNode(ensure_keyword_loc, statements, end_keyword_loc, location = Location())
292
- EnsureNode.new(ensure_keyword_loc, statements, end_keyword_loc, location)
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)
293
298
  end
294
299
 
295
300
  # Create a new FalseNode node
296
- def FalseNode(location = Location())
297
- FalseNode.new(location)
301
+ def FalseNode(source = nil, location = Location())
302
+ FalseNode.new(source, location)
298
303
  end
299
304
 
300
305
  # Create a new FindPatternNode node
301
- def FindPatternNode(constant, left, requireds, right, opening_loc, closing_loc, location = Location())
302
- FindPatternNode.new(constant, left, requireds, right, opening_loc, closing_loc, location)
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)
303
308
  end
304
309
 
305
310
  # Create a new FlipFlopNode node
306
- def FlipFlopNode(flags, left, right, operator_loc, location = Location())
307
- FlipFlopNode.new(flags, left, right, operator_loc, location)
311
+ def FlipFlopNode(flags, left, right, operator_loc, source = nil, location = Location())
312
+ FlipFlopNode.new(source, flags, left, right, operator_loc, location)
308
313
  end
309
314
 
310
315
  # Create a new FloatNode node
311
- def FloatNode(location = Location())
312
- FloatNode.new(location)
316
+ def FloatNode(value, source = nil, location = Location())
317
+ FloatNode.new(source, value, location)
313
318
  end
314
319
 
315
320
  # Create a new ForNode node
316
- def ForNode(index, collection, statements, for_keyword_loc, in_keyword_loc, do_keyword_loc, end_keyword_loc, location = Location())
317
- ForNode.new(index, collection, statements, for_keyword_loc, in_keyword_loc, do_keyword_loc, end_keyword_loc, location)
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)
318
323
  end
319
324
 
320
325
  # Create a new ForwardingArgumentsNode node
321
- def ForwardingArgumentsNode(location = Location())
322
- ForwardingArgumentsNode.new(location)
326
+ def ForwardingArgumentsNode(source = nil, location = Location())
327
+ ForwardingArgumentsNode.new(source, location)
323
328
  end
324
329
 
325
330
  # Create a new ForwardingParameterNode node
326
- def ForwardingParameterNode(location = Location())
327
- ForwardingParameterNode.new(location)
331
+ def ForwardingParameterNode(source = nil, location = Location())
332
+ ForwardingParameterNode.new(source, location)
328
333
  end
329
334
 
330
335
  # Create a new ForwardingSuperNode node
331
- def ForwardingSuperNode(block, location = Location())
332
- ForwardingSuperNode.new(block, location)
336
+ def ForwardingSuperNode(block, source = nil, location = Location())
337
+ ForwardingSuperNode.new(source, block, location)
333
338
  end
334
339
 
335
340
  # Create a new GlobalVariableAndWriteNode node
336
- def GlobalVariableAndWriteNode(name, name_loc, operator_loc, value, location = Location())
337
- GlobalVariableAndWriteNode.new(name, name_loc, operator_loc, value, location)
341
+ def GlobalVariableAndWriteNode(name, name_loc, operator_loc, value, source = nil, location = Location())
342
+ GlobalVariableAndWriteNode.new(source, name, name_loc, operator_loc, value, location)
338
343
  end
339
344
 
340
345
  # Create a new GlobalVariableOperatorWriteNode node
341
- def GlobalVariableOperatorWriteNode(name, name_loc, operator_loc, value, operator, location = Location())
342
- GlobalVariableOperatorWriteNode.new(name, name_loc, operator_loc, value, operator, location)
346
+ def GlobalVariableOperatorWriteNode(name, name_loc, operator_loc, value, operator, source = nil, location = Location())
347
+ GlobalVariableOperatorWriteNode.new(source, name, name_loc, operator_loc, value, operator, location)
343
348
  end
344
349
 
345
350
  # Create a new GlobalVariableOrWriteNode node
346
- def GlobalVariableOrWriteNode(name, name_loc, operator_loc, value, location = Location())
347
- GlobalVariableOrWriteNode.new(name, name_loc, operator_loc, value, location)
351
+ def GlobalVariableOrWriteNode(name, name_loc, operator_loc, value, source = nil, location = Location())
352
+ GlobalVariableOrWriteNode.new(source, name, name_loc, operator_loc, value, location)
348
353
  end
349
354
 
350
355
  # Create a new GlobalVariableReadNode node
351
- def GlobalVariableReadNode(name, location = Location())
352
- GlobalVariableReadNode.new(name, location)
356
+ def GlobalVariableReadNode(name, source = nil, location = Location())
357
+ GlobalVariableReadNode.new(source, name, location)
353
358
  end
354
359
 
355
360
  # Create a new GlobalVariableTargetNode node
356
- def GlobalVariableTargetNode(name, location = Location())
357
- GlobalVariableTargetNode.new(name, location)
361
+ def GlobalVariableTargetNode(name, source = nil, location = Location())
362
+ GlobalVariableTargetNode.new(source, name, location)
358
363
  end
359
364
 
360
365
  # Create a new GlobalVariableWriteNode node
361
- def GlobalVariableWriteNode(name, name_loc, value, operator_loc, location = Location())
362
- GlobalVariableWriteNode.new(name, name_loc, value, operator_loc, location)
366
+ def GlobalVariableWriteNode(name, name_loc, value, operator_loc, source = nil, location = Location())
367
+ GlobalVariableWriteNode.new(source, name, name_loc, value, operator_loc, location)
363
368
  end
364
369
 
365
370
  # Create a new HashNode node
366
- def HashNode(opening_loc, elements, closing_loc, location = Location())
367
- HashNode.new(opening_loc, elements, closing_loc, location)
371
+ def HashNode(opening_loc, elements, closing_loc, source = nil, location = Location())
372
+ HashNode.new(source, opening_loc, elements, closing_loc, location)
368
373
  end
369
374
 
370
375
  # Create a new HashPatternNode node
371
- def HashPatternNode(constant, elements, rest, opening_loc, closing_loc, location = Location())
372
- HashPatternNode.new(constant, elements, rest, opening_loc, closing_loc, location)
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)
373
378
  end
374
379
 
375
380
  # Create a new IfNode node
376
- def IfNode(if_keyword_loc, predicate, then_keyword_loc, statements, consequent, end_keyword_loc, location = Location())
377
- IfNode.new(if_keyword_loc, predicate, then_keyword_loc, statements, consequent, end_keyword_loc, location)
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)
378
383
  end
379
384
 
380
385
  # Create a new ImaginaryNode node
381
- def ImaginaryNode(numeric, location = Location())
382
- ImaginaryNode.new(numeric, location)
386
+ def ImaginaryNode(numeric, source = nil, location = Location())
387
+ ImaginaryNode.new(source, numeric, location)
383
388
  end
384
389
 
385
390
  # Create a new ImplicitNode node
386
- def ImplicitNode(value, location = Location())
387
- ImplicitNode.new(value, location)
391
+ def ImplicitNode(value, source = nil, location = Location())
392
+ ImplicitNode.new(source, value, location)
388
393
  end
389
394
 
390
395
  # Create a new ImplicitRestNode node
391
- def ImplicitRestNode(location = Location())
392
- ImplicitRestNode.new(location)
396
+ def ImplicitRestNode(source = nil, location = Location())
397
+ ImplicitRestNode.new(source, location)
393
398
  end
394
399
 
395
400
  # Create a new InNode node
396
- def InNode(pattern, statements, in_loc, then_loc, location = Location())
397
- InNode.new(pattern, statements, in_loc, then_loc, location)
401
+ def InNode(pattern, statements, in_loc, then_loc, source = nil, location = Location())
402
+ InNode.new(source, pattern, statements, in_loc, then_loc, location)
398
403
  end
399
404
 
400
405
  # Create a new IndexAndWriteNode node
401
- def IndexAndWriteNode(flags, receiver, call_operator_loc, opening_loc, arguments, closing_loc, block, operator_loc, value, location = Location())
402
- IndexAndWriteNode.new(flags, receiver, call_operator_loc, opening_loc, arguments, closing_loc, block, operator_loc, value, location)
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)
403
408
  end
404
409
 
405
410
  # Create a new IndexOperatorWriteNode node
406
- def IndexOperatorWriteNode(flags, receiver, call_operator_loc, opening_loc, arguments, closing_loc, block, operator, operator_loc, value, location = Location())
407
- IndexOperatorWriteNode.new(flags, receiver, call_operator_loc, opening_loc, arguments, closing_loc, block, operator, operator_loc, value, location)
411
+ def IndexOperatorWriteNode(flags, receiver, call_operator_loc, opening_loc, arguments, closing_loc, block, operator, operator_loc, value, source = nil, location = Location())
412
+ IndexOperatorWriteNode.new(source, flags, receiver, call_operator_loc, opening_loc, arguments, closing_loc, block, operator, operator_loc, value, location)
408
413
  end
409
414
 
410
415
  # Create a new IndexOrWriteNode node
411
- def IndexOrWriteNode(flags, receiver, call_operator_loc, opening_loc, arguments, closing_loc, block, operator_loc, value, location = Location())
412
- IndexOrWriteNode.new(flags, receiver, call_operator_loc, opening_loc, arguments, closing_loc, block, operator_loc, value, location)
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)
413
418
  end
414
419
 
415
420
  # Create a new IndexTargetNode node
416
- def IndexTargetNode(flags, receiver, opening_loc, arguments, closing_loc, block, location = Location())
417
- IndexTargetNode.new(flags, receiver, opening_loc, arguments, closing_loc, block, location)
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)
418
423
  end
419
424
 
420
425
  # Create a new InstanceVariableAndWriteNode node
421
- def InstanceVariableAndWriteNode(name, name_loc, operator_loc, value, location = Location())
422
- InstanceVariableAndWriteNode.new(name, name_loc, operator_loc, value, location)
426
+ def InstanceVariableAndWriteNode(name, name_loc, operator_loc, value, source = nil, location = Location())
427
+ InstanceVariableAndWriteNode.new(source, name, name_loc, operator_loc, value, location)
423
428
  end
424
429
 
425
430
  # Create a new InstanceVariableOperatorWriteNode node
426
- def InstanceVariableOperatorWriteNode(name, name_loc, operator_loc, value, operator, location = Location())
427
- InstanceVariableOperatorWriteNode.new(name, name_loc, operator_loc, value, operator, location)
431
+ def InstanceVariableOperatorWriteNode(name, name_loc, operator_loc, value, operator, source = nil, location = Location())
432
+ InstanceVariableOperatorWriteNode.new(source, name, name_loc, operator_loc, value, operator, location)
428
433
  end
429
434
 
430
435
  # Create a new InstanceVariableOrWriteNode node
431
- def InstanceVariableOrWriteNode(name, name_loc, operator_loc, value, location = Location())
432
- InstanceVariableOrWriteNode.new(name, name_loc, operator_loc, value, location)
436
+ def InstanceVariableOrWriteNode(name, name_loc, operator_loc, value, source = nil, location = Location())
437
+ InstanceVariableOrWriteNode.new(source, name, name_loc, operator_loc, value, location)
433
438
  end
434
439
 
435
440
  # Create a new InstanceVariableReadNode node
436
- def InstanceVariableReadNode(name, location = Location())
437
- InstanceVariableReadNode.new(name, location)
441
+ def InstanceVariableReadNode(name, source = nil, location = Location())
442
+ InstanceVariableReadNode.new(source, name, location)
438
443
  end
439
444
 
440
445
  # Create a new InstanceVariableTargetNode node
441
- def InstanceVariableTargetNode(name, location = Location())
442
- InstanceVariableTargetNode.new(name, location)
446
+ def InstanceVariableTargetNode(name, source = nil, location = Location())
447
+ InstanceVariableTargetNode.new(source, name, location)
443
448
  end
444
449
 
445
450
  # Create a new InstanceVariableWriteNode node
446
- def InstanceVariableWriteNode(name, name_loc, value, operator_loc, location = Location())
447
- InstanceVariableWriteNode.new(name, name_loc, value, operator_loc, location)
451
+ def InstanceVariableWriteNode(name, name_loc, value, operator_loc, source = nil, location = Location())
452
+ InstanceVariableWriteNode.new(source, name, name_loc, value, operator_loc, location)
448
453
  end
449
454
 
450
455
  # Create a new IntegerNode node
451
- def IntegerNode(flags, location = Location())
452
- IntegerNode.new(flags, location)
456
+ def IntegerNode(flags, value, source = nil, location = Location())
457
+ IntegerNode.new(source, flags, value, location)
453
458
  end
454
459
 
455
460
  # Create a new InterpolatedMatchLastLineNode node
456
- def InterpolatedMatchLastLineNode(flags, opening_loc, parts, closing_loc, location = Location())
457
- InterpolatedMatchLastLineNode.new(flags, opening_loc, parts, closing_loc, location)
461
+ def InterpolatedMatchLastLineNode(flags, opening_loc, parts, closing_loc, source = nil, location = Location())
462
+ InterpolatedMatchLastLineNode.new(source, flags, opening_loc, parts, closing_loc, location)
458
463
  end
459
464
 
460
465
  # Create a new InterpolatedRegularExpressionNode node
461
- def InterpolatedRegularExpressionNode(flags, opening_loc, parts, closing_loc, location = Location())
462
- InterpolatedRegularExpressionNode.new(flags, opening_loc, parts, closing_loc, location)
466
+ def InterpolatedRegularExpressionNode(flags, opening_loc, parts, closing_loc, source = nil, location = Location())
467
+ InterpolatedRegularExpressionNode.new(source, flags, opening_loc, parts, closing_loc, location)
463
468
  end
464
469
 
465
470
  # Create a new InterpolatedStringNode node
466
- def InterpolatedStringNode(opening_loc, parts, closing_loc, location = Location())
467
- InterpolatedStringNode.new(opening_loc, parts, closing_loc, location)
471
+ def InterpolatedStringNode(flags, opening_loc, parts, closing_loc, source = nil, location = Location())
472
+ InterpolatedStringNode.new(source, flags, opening_loc, parts, closing_loc, location)
468
473
  end
469
474
 
470
475
  # Create a new InterpolatedSymbolNode node
471
- def InterpolatedSymbolNode(opening_loc, parts, closing_loc, location = Location())
472
- InterpolatedSymbolNode.new(opening_loc, parts, closing_loc, location)
476
+ def InterpolatedSymbolNode(opening_loc, parts, closing_loc, source = nil, location = Location())
477
+ InterpolatedSymbolNode.new(source, opening_loc, parts, closing_loc, location)
473
478
  end
474
479
 
475
480
  # Create a new InterpolatedXStringNode node
476
- def InterpolatedXStringNode(opening_loc, parts, closing_loc, location = Location())
477
- InterpolatedXStringNode.new(opening_loc, parts, closing_loc, location)
481
+ def InterpolatedXStringNode(opening_loc, parts, closing_loc, source = nil, location = Location())
482
+ InterpolatedXStringNode.new(source, opening_loc, parts, closing_loc, location)
483
+ end
484
+
485
+ # Create a new ItParametersNode node
486
+ def ItParametersNode(source = nil, location = Location())
487
+ ItParametersNode.new(source, location)
478
488
  end
479
489
 
480
490
  # Create a new KeywordHashNode node
481
- def KeywordHashNode(flags, elements, location = Location())
482
- KeywordHashNode.new(flags, elements, location)
491
+ def KeywordHashNode(flags, elements, source = nil, location = Location())
492
+ KeywordHashNode.new(source, flags, elements, location)
483
493
  end
484
494
 
485
495
  # Create a new KeywordRestParameterNode node
486
- def KeywordRestParameterNode(flags, name, name_loc, operator_loc, location = Location())
487
- KeywordRestParameterNode.new(flags, name, name_loc, operator_loc, location)
496
+ def KeywordRestParameterNode(flags, name, name_loc, operator_loc, source = nil, location = Location())
497
+ KeywordRestParameterNode.new(source, flags, name, name_loc, operator_loc, location)
488
498
  end
489
499
 
490
500
  # Create a new LambdaNode node
491
- def LambdaNode(locals, operator_loc, opening_loc, closing_loc, parameters, body, location = Location())
492
- LambdaNode.new(locals, operator_loc, opening_loc, closing_loc, parameters, body, location)
501
+ def LambdaNode(locals, operator_loc, opening_loc, closing_loc, parameters, body, source = nil, location = Location())
502
+ LambdaNode.new(source, locals, operator_loc, opening_loc, closing_loc, parameters, body, location)
493
503
  end
494
504
 
495
505
  # Create a new LocalVariableAndWriteNode node
496
- def LocalVariableAndWriteNode(name_loc, operator_loc, value, name, depth, location = Location())
497
- LocalVariableAndWriteNode.new(name_loc, operator_loc, value, name, depth, location)
506
+ def LocalVariableAndWriteNode(name_loc, operator_loc, value, name, depth, source = nil, location = Location())
507
+ LocalVariableAndWriteNode.new(source, name_loc, operator_loc, value, name, depth, location)
498
508
  end
499
509
 
500
510
  # Create a new LocalVariableOperatorWriteNode node
501
- def LocalVariableOperatorWriteNode(name_loc, operator_loc, value, name, operator, depth, location = Location())
502
- LocalVariableOperatorWriteNode.new(name_loc, operator_loc, value, name, operator, depth, location)
511
+ def LocalVariableOperatorWriteNode(name_loc, operator_loc, value, name, operator, depth, source = nil, location = Location())
512
+ LocalVariableOperatorWriteNode.new(source, name_loc, operator_loc, value, name, operator, depth, location)
503
513
  end
504
514
 
505
515
  # Create a new LocalVariableOrWriteNode node
506
- def LocalVariableOrWriteNode(name_loc, operator_loc, value, name, depth, location = Location())
507
- LocalVariableOrWriteNode.new(name_loc, operator_loc, value, name, depth, location)
516
+ def LocalVariableOrWriteNode(name_loc, operator_loc, value, name, depth, source = nil, location = Location())
517
+ LocalVariableOrWriteNode.new(source, name_loc, operator_loc, value, name, depth, location)
508
518
  end
509
519
 
510
520
  # Create a new LocalVariableReadNode node
511
- def LocalVariableReadNode(name, depth, location = Location())
512
- LocalVariableReadNode.new(name, depth, location)
521
+ def LocalVariableReadNode(name, depth, source = nil, location = Location())
522
+ LocalVariableReadNode.new(source, name, depth, location)
513
523
  end
514
524
 
515
525
  # Create a new LocalVariableTargetNode node
516
- def LocalVariableTargetNode(name, depth, location = Location())
517
- LocalVariableTargetNode.new(name, depth, location)
526
+ def LocalVariableTargetNode(name, depth, source = nil, location = Location())
527
+ LocalVariableTargetNode.new(source, name, depth, location)
518
528
  end
519
529
 
520
530
  # Create a new LocalVariableWriteNode node
521
- def LocalVariableWriteNode(name, depth, name_loc, value, operator_loc, location = Location())
522
- LocalVariableWriteNode.new(name, depth, name_loc, value, operator_loc, location)
531
+ def LocalVariableWriteNode(name, depth, name_loc, value, operator_loc, source = nil, location = Location())
532
+ LocalVariableWriteNode.new(source, name, depth, name_loc, value, operator_loc, location)
523
533
  end
524
534
 
525
535
  # Create a new MatchLastLineNode node
526
- def MatchLastLineNode(flags, opening_loc, content_loc, closing_loc, unescaped, location = Location())
527
- MatchLastLineNode.new(flags, opening_loc, content_loc, closing_loc, unescaped, location)
536
+ def MatchLastLineNode(flags, opening_loc, content_loc, closing_loc, unescaped, source = nil, location = Location())
537
+ MatchLastLineNode.new(source, flags, opening_loc, content_loc, closing_loc, unescaped, location)
528
538
  end
529
539
 
530
540
  # Create a new MatchPredicateNode node
531
- def MatchPredicateNode(value, pattern, operator_loc, location = Location())
532
- MatchPredicateNode.new(value, pattern, operator_loc, location)
541
+ def MatchPredicateNode(value, pattern, operator_loc, source = nil, location = Location())
542
+ MatchPredicateNode.new(source, value, pattern, operator_loc, location)
533
543
  end
534
544
 
535
545
  # Create a new MatchRequiredNode node
536
- def MatchRequiredNode(value, pattern, operator_loc, location = Location())
537
- MatchRequiredNode.new(value, pattern, operator_loc, location)
546
+ def MatchRequiredNode(value, pattern, operator_loc, source = nil, location = Location())
547
+ MatchRequiredNode.new(source, value, pattern, operator_loc, location)
538
548
  end
539
549
 
540
550
  # Create a new MatchWriteNode node
541
- def MatchWriteNode(call, targets, location = Location())
542
- MatchWriteNode.new(call, targets, location)
551
+ def MatchWriteNode(call, targets, source = nil, location = Location())
552
+ MatchWriteNode.new(source, call, targets, location)
543
553
  end
544
554
 
545
555
  # Create a new MissingNode node
546
- def MissingNode(location = Location())
547
- MissingNode.new(location)
556
+ def MissingNode(source = nil, location = Location())
557
+ MissingNode.new(source, location)
548
558
  end
549
559
 
550
560
  # Create a new ModuleNode node
551
- def ModuleNode(locals, module_keyword_loc, constant_path, body, end_keyword_loc, name, location = Location())
552
- ModuleNode.new(locals, module_keyword_loc, constant_path, body, end_keyword_loc, name, location)
561
+ def ModuleNode(locals, module_keyword_loc, constant_path, body, end_keyword_loc, name, source = nil, location = Location())
562
+ ModuleNode.new(source, locals, module_keyword_loc, constant_path, body, end_keyword_loc, name, location)
553
563
  end
554
564
 
555
565
  # Create a new MultiTargetNode node
556
- def MultiTargetNode(lefts, rest, rights, lparen_loc, rparen_loc, location = Location())
557
- MultiTargetNode.new(lefts, rest, rights, lparen_loc, rparen_loc, location)
566
+ def MultiTargetNode(lefts, rest, rights, lparen_loc, rparen_loc, source = nil, location = Location())
567
+ MultiTargetNode.new(source, lefts, rest, rights, lparen_loc, rparen_loc, location)
558
568
  end
559
569
 
560
570
  # Create a new MultiWriteNode node
561
- def MultiWriteNode(lefts, rest, rights, lparen_loc, rparen_loc, operator_loc, value, location = Location())
562
- MultiWriteNode.new(lefts, rest, rights, lparen_loc, rparen_loc, operator_loc, value, location)
571
+ def MultiWriteNode(lefts, rest, rights, lparen_loc, rparen_loc, operator_loc, value, source = nil, location = Location())
572
+ MultiWriteNode.new(source, lefts, rest, rights, lparen_loc, rparen_loc, operator_loc, value, location)
563
573
  end
564
574
 
565
575
  # Create a new NextNode node
566
- def NextNode(arguments, keyword_loc, location = Location())
567
- NextNode.new(arguments, keyword_loc, location)
576
+ def NextNode(arguments, keyword_loc, source = nil, location = Location())
577
+ NextNode.new(source, arguments, keyword_loc, location)
568
578
  end
569
579
 
570
580
  # Create a new NilNode node
571
- def NilNode(location = Location())
572
- NilNode.new(location)
581
+ def NilNode(source = nil, location = Location())
582
+ NilNode.new(source, location)
573
583
  end
574
584
 
575
585
  # Create a new NoKeywordsParameterNode node
576
- def NoKeywordsParameterNode(operator_loc, keyword_loc, location = Location())
577
- NoKeywordsParameterNode.new(operator_loc, keyword_loc, location)
586
+ def NoKeywordsParameterNode(operator_loc, keyword_loc, source = nil, location = Location())
587
+ NoKeywordsParameterNode.new(source, operator_loc, keyword_loc, location)
578
588
  end
579
589
 
580
590
  # Create a new NumberedParametersNode node
581
- def NumberedParametersNode(maximum, location = Location())
582
- NumberedParametersNode.new(maximum, location)
591
+ def NumberedParametersNode(maximum, source = nil, location = Location())
592
+ NumberedParametersNode.new(source, maximum, location)
583
593
  end
584
594
 
585
595
  # Create a new NumberedReferenceReadNode node
586
- def NumberedReferenceReadNode(number, location = Location())
587
- NumberedReferenceReadNode.new(number, location)
596
+ def NumberedReferenceReadNode(number, source = nil, location = Location())
597
+ NumberedReferenceReadNode.new(source, number, location)
588
598
  end
589
599
 
590
600
  # Create a new OptionalKeywordParameterNode node
591
- def OptionalKeywordParameterNode(flags, name, name_loc, value, location = Location())
592
- OptionalKeywordParameterNode.new(flags, name, name_loc, value, location)
601
+ def OptionalKeywordParameterNode(flags, name, name_loc, value, source = nil, location = Location())
602
+ OptionalKeywordParameterNode.new(source, flags, name, name_loc, value, location)
593
603
  end
594
604
 
595
605
  # Create a new OptionalParameterNode node
596
- def OptionalParameterNode(flags, name, name_loc, operator_loc, value, location = Location())
597
- OptionalParameterNode.new(flags, name, name_loc, operator_loc, value, location)
606
+ def OptionalParameterNode(flags, name, name_loc, operator_loc, value, source = nil, location = Location())
607
+ OptionalParameterNode.new(source, flags, name, name_loc, operator_loc, value, location)
598
608
  end
599
609
 
600
610
  # Create a new OrNode node
601
- def OrNode(left, right, operator_loc, location = Location())
602
- OrNode.new(left, right, operator_loc, location)
611
+ def OrNode(left, right, operator_loc, source = nil, location = Location())
612
+ OrNode.new(source, left, right, operator_loc, location)
603
613
  end
604
614
 
605
615
  # Create a new ParametersNode node
606
- def ParametersNode(requireds, optionals, rest, posts, keywords, keyword_rest, block, location = Location())
607
- ParametersNode.new(requireds, optionals, rest, posts, keywords, keyword_rest, block, location)
616
+ def ParametersNode(requireds, optionals, rest, posts, keywords, keyword_rest, block, source = nil, location = Location())
617
+ ParametersNode.new(source, requireds, optionals, rest, posts, keywords, keyword_rest, block, location)
608
618
  end
609
619
 
610
620
  # Create a new ParenthesesNode node
611
- def ParenthesesNode(body, opening_loc, closing_loc, location = Location())
612
- ParenthesesNode.new(body, opening_loc, closing_loc, location)
621
+ def ParenthesesNode(body, opening_loc, closing_loc, source = nil, location = Location())
622
+ ParenthesesNode.new(source, body, opening_loc, closing_loc, location)
613
623
  end
614
624
 
615
625
  # Create a new PinnedExpressionNode node
616
- def PinnedExpressionNode(expression, operator_loc, lparen_loc, rparen_loc, location = Location())
617
- PinnedExpressionNode.new(expression, operator_loc, lparen_loc, rparen_loc, location)
626
+ def PinnedExpressionNode(expression, operator_loc, lparen_loc, rparen_loc, source = nil, location = Location())
627
+ PinnedExpressionNode.new(source, expression, operator_loc, lparen_loc, rparen_loc, location)
618
628
  end
619
629
 
620
630
  # Create a new PinnedVariableNode node
621
- def PinnedVariableNode(variable, operator_loc, location = Location())
622
- PinnedVariableNode.new(variable, operator_loc, location)
631
+ def PinnedVariableNode(variable, operator_loc, source = nil, location = Location())
632
+ PinnedVariableNode.new(source, variable, operator_loc, location)
623
633
  end
624
634
 
625
635
  # Create a new PostExecutionNode node
626
- def PostExecutionNode(statements, keyword_loc, opening_loc, closing_loc, location = Location())
627
- PostExecutionNode.new(statements, keyword_loc, opening_loc, closing_loc, location)
636
+ def PostExecutionNode(statements, keyword_loc, opening_loc, closing_loc, source = nil, location = Location())
637
+ PostExecutionNode.new(source, statements, keyword_loc, opening_loc, closing_loc, location)
628
638
  end
629
639
 
630
640
  # Create a new PreExecutionNode node
631
- def PreExecutionNode(statements, keyword_loc, opening_loc, closing_loc, location = Location())
632
- PreExecutionNode.new(statements, keyword_loc, opening_loc, closing_loc, location)
641
+ def PreExecutionNode(statements, keyword_loc, opening_loc, closing_loc, source = nil, location = Location())
642
+ PreExecutionNode.new(source, statements, keyword_loc, opening_loc, closing_loc, location)
633
643
  end
634
644
 
635
645
  # Create a new ProgramNode node
636
- def ProgramNode(locals, statements, location = Location())
637
- ProgramNode.new(locals, statements, location)
646
+ def ProgramNode(locals, statements, source = nil, location = Location())
647
+ ProgramNode.new(source, locals, statements, location)
638
648
  end
639
649
 
640
650
  # Create a new RangeNode node
641
- def RangeNode(flags, left, right, operator_loc, location = Location())
642
- RangeNode.new(flags, left, right, operator_loc, location)
651
+ def RangeNode(flags, left, right, operator_loc, source = nil, location = Location())
652
+ RangeNode.new(source, flags, left, right, operator_loc, location)
643
653
  end
644
654
 
645
655
  # Create a new RationalNode node
646
- def RationalNode(numeric, location = Location())
647
- RationalNode.new(numeric, location)
656
+ def RationalNode(numeric, source = nil, location = Location())
657
+ RationalNode.new(source, numeric, location)
648
658
  end
649
659
 
650
660
  # Create a new RedoNode node
651
- def RedoNode(location = Location())
652
- RedoNode.new(location)
661
+ def RedoNode(source = nil, location = Location())
662
+ RedoNode.new(source, location)
653
663
  end
654
664
 
655
665
  # Create a new RegularExpressionNode node
656
- def RegularExpressionNode(flags, opening_loc, content_loc, closing_loc, unescaped, location = Location())
657
- RegularExpressionNode.new(flags, opening_loc, content_loc, closing_loc, unescaped, location)
666
+ def RegularExpressionNode(flags, opening_loc, content_loc, closing_loc, unescaped, source = nil, location = Location())
667
+ RegularExpressionNode.new(source, flags, opening_loc, content_loc, closing_loc, unescaped, location)
658
668
  end
659
669
 
660
670
  # Create a new RequiredKeywordParameterNode node
661
- def RequiredKeywordParameterNode(flags, name, name_loc, location = Location())
662
- RequiredKeywordParameterNode.new(flags, name, name_loc, location)
671
+ def RequiredKeywordParameterNode(flags, name, name_loc, source = nil, location = Location())
672
+ RequiredKeywordParameterNode.new(source, flags, name, name_loc, location)
663
673
  end
664
674
 
665
675
  # Create a new RequiredParameterNode node
666
- def RequiredParameterNode(flags, name, location = Location())
667
- RequiredParameterNode.new(flags, name, location)
676
+ def RequiredParameterNode(flags, name, source = nil, location = Location())
677
+ RequiredParameterNode.new(source, flags, name, location)
668
678
  end
669
679
 
670
680
  # Create a new RescueModifierNode node
671
- def RescueModifierNode(expression, keyword_loc, rescue_expression, location = Location())
672
- RescueModifierNode.new(expression, keyword_loc, rescue_expression, location)
681
+ def RescueModifierNode(expression, keyword_loc, rescue_expression, source = nil, location = Location())
682
+ RescueModifierNode.new(source, expression, keyword_loc, rescue_expression, location)
673
683
  end
674
684
 
675
685
  # Create a new RescueNode node
676
- def RescueNode(keyword_loc, exceptions, operator_loc, reference, statements, consequent, location = Location())
677
- RescueNode.new(keyword_loc, exceptions, operator_loc, reference, statements, consequent, location)
686
+ def RescueNode(keyword_loc, exceptions, operator_loc, reference, statements, consequent, source = nil, location = Location())
687
+ RescueNode.new(source, keyword_loc, exceptions, operator_loc, reference, statements, consequent, location)
678
688
  end
679
689
 
680
690
  # Create a new RestParameterNode node
681
- def RestParameterNode(flags, name, name_loc, operator_loc, location = Location())
682
- RestParameterNode.new(flags, name, name_loc, operator_loc, location)
691
+ def RestParameterNode(flags, name, name_loc, operator_loc, source = nil, location = Location())
692
+ RestParameterNode.new(source, flags, name, name_loc, operator_loc, location)
683
693
  end
684
694
 
685
695
  # Create a new RetryNode node
686
- def RetryNode(location = Location())
687
- RetryNode.new(location)
696
+ def RetryNode(source = nil, location = Location())
697
+ RetryNode.new(source, location)
688
698
  end
689
699
 
690
700
  # Create a new ReturnNode node
691
- def ReturnNode(keyword_loc, arguments, location = Location())
692
- ReturnNode.new(keyword_loc, arguments, location)
701
+ def ReturnNode(keyword_loc, arguments, source = nil, location = Location())
702
+ ReturnNode.new(source, keyword_loc, arguments, location)
693
703
  end
694
704
 
695
705
  # Create a new SelfNode node
696
- def SelfNode(location = Location())
697
- SelfNode.new(location)
706
+ def SelfNode(source = nil, location = Location())
707
+ SelfNode.new(source, location)
708
+ end
709
+
710
+ # Create a new ShareableConstantNode node
711
+ def ShareableConstantNode(flags, write, source = nil, location = Location())
712
+ ShareableConstantNode.new(source, flags, write, location)
698
713
  end
699
714
 
700
715
  # Create a new SingletonClassNode node
701
- def SingletonClassNode(locals, class_keyword_loc, operator_loc, expression, body, end_keyword_loc, location = Location())
702
- SingletonClassNode.new(locals, class_keyword_loc, operator_loc, expression, body, end_keyword_loc, location)
716
+ def SingletonClassNode(locals, class_keyword_loc, operator_loc, expression, body, end_keyword_loc, source = nil, location = Location())
717
+ SingletonClassNode.new(source, locals, class_keyword_loc, operator_loc, expression, body, end_keyword_loc, location)
703
718
  end
704
719
 
705
720
  # Create a new SourceEncodingNode node
706
- def SourceEncodingNode(location = Location())
707
- SourceEncodingNode.new(location)
721
+ def SourceEncodingNode(source = nil, location = Location())
722
+ SourceEncodingNode.new(source, location)
708
723
  end
709
724
 
710
725
  # Create a new SourceFileNode node
711
- def SourceFileNode(filepath, location = Location())
712
- SourceFileNode.new(filepath, location)
726
+ def SourceFileNode(flags, filepath, source = nil, location = Location())
727
+ SourceFileNode.new(source, flags, filepath, location)
713
728
  end
714
729
 
715
730
  # Create a new SourceLineNode node
716
- def SourceLineNode(location = Location())
717
- SourceLineNode.new(location)
731
+ def SourceLineNode(source = nil, location = Location())
732
+ SourceLineNode.new(source, location)
718
733
  end
719
734
 
720
735
  # Create a new SplatNode node
721
- def SplatNode(operator_loc, expression, location = Location())
722
- SplatNode.new(operator_loc, expression, location)
736
+ def SplatNode(operator_loc, expression, source = nil, location = Location())
737
+ SplatNode.new(source, operator_loc, expression, location)
723
738
  end
724
739
 
725
740
  # Create a new StatementsNode node
726
- def StatementsNode(body, location = Location())
727
- StatementsNode.new(body, location)
741
+ def StatementsNode(body, source = nil, location = Location())
742
+ StatementsNode.new(source, body, location)
728
743
  end
729
744
 
730
745
  # Create a new StringNode node
731
- def StringNode(flags, opening_loc, content_loc, closing_loc, unescaped, location = Location())
732
- StringNode.new(flags, opening_loc, content_loc, closing_loc, unescaped, location)
746
+ def StringNode(flags, opening_loc, content_loc, closing_loc, unescaped, source = nil, location = Location())
747
+ StringNode.new(source, flags, opening_loc, content_loc, closing_loc, unescaped, location)
733
748
  end
734
749
 
735
750
  # Create a new SuperNode node
736
- def SuperNode(keyword_loc, lparen_loc, arguments, rparen_loc, block, location = Location())
737
- SuperNode.new(keyword_loc, lparen_loc, arguments, rparen_loc, block, location)
751
+ def SuperNode(keyword_loc, lparen_loc, arguments, rparen_loc, block, source = nil, location = Location())
752
+ SuperNode.new(source, keyword_loc, lparen_loc, arguments, rparen_loc, block, location)
738
753
  end
739
754
 
740
755
  # Create a new SymbolNode node
741
- def SymbolNode(flags, opening_loc, value_loc, closing_loc, unescaped, location = Location())
742
- SymbolNode.new(flags, opening_loc, value_loc, closing_loc, unescaped, location)
756
+ def SymbolNode(flags, opening_loc, value_loc, closing_loc, unescaped, source = nil, location = Location())
757
+ SymbolNode.new(source, flags, opening_loc, value_loc, closing_loc, unescaped, location)
743
758
  end
744
759
 
745
760
  # Create a new TrueNode node
746
- def TrueNode(location = Location())
747
- TrueNode.new(location)
761
+ def TrueNode(source = nil, location = Location())
762
+ TrueNode.new(source, location)
748
763
  end
749
764
 
750
765
  # Create a new UndefNode node
751
- def UndefNode(names, keyword_loc, location = Location())
752
- UndefNode.new(names, keyword_loc, location)
766
+ def UndefNode(names, keyword_loc, source = nil, location = Location())
767
+ UndefNode.new(source, names, keyword_loc, location)
753
768
  end
754
769
 
755
770
  # Create a new UnlessNode node
756
- def UnlessNode(keyword_loc, predicate, then_keyword_loc, statements, consequent, end_keyword_loc, location = Location())
757
- UnlessNode.new(keyword_loc, predicate, then_keyword_loc, statements, consequent, end_keyword_loc, location)
771
+ def UnlessNode(keyword_loc, predicate, then_keyword_loc, statements, consequent, end_keyword_loc, source = nil, location = Location())
772
+ UnlessNode.new(source, keyword_loc, predicate, then_keyword_loc, statements, consequent, end_keyword_loc, location)
758
773
  end
759
774
 
760
775
  # Create a new UntilNode node
761
- def UntilNode(flags, keyword_loc, closing_loc, predicate, statements, location = Location())
762
- UntilNode.new(flags, keyword_loc, closing_loc, predicate, statements, location)
776
+ def UntilNode(flags, keyword_loc, closing_loc, predicate, statements, source = nil, location = Location())
777
+ UntilNode.new(source, flags, keyword_loc, closing_loc, predicate, statements, location)
763
778
  end
764
779
 
765
780
  # Create a new WhenNode node
766
- def WhenNode(keyword_loc, conditions, statements, location = Location())
767
- WhenNode.new(keyword_loc, conditions, statements, location)
781
+ def WhenNode(keyword_loc, conditions, then_keyword_loc, statements, source = nil, location = Location())
782
+ WhenNode.new(source, keyword_loc, conditions, then_keyword_loc, statements, location)
768
783
  end
769
784
 
770
785
  # Create a new WhileNode node
771
- def WhileNode(flags, keyword_loc, closing_loc, predicate, statements, location = Location())
772
- WhileNode.new(flags, keyword_loc, closing_loc, predicate, statements, location)
786
+ def WhileNode(flags, keyword_loc, closing_loc, predicate, statements, source = nil, location = Location())
787
+ WhileNode.new(source, flags, keyword_loc, closing_loc, predicate, statements, location)
773
788
  end
774
789
 
775
790
  # Create a new XStringNode node
776
- def XStringNode(flags, opening_loc, content_loc, closing_loc, unescaped, location = Location())
777
- XStringNode.new(flags, opening_loc, content_loc, closing_loc, unescaped, location)
791
+ def XStringNode(flags, opening_loc, content_loc, closing_loc, unescaped, source = nil, location = Location())
792
+ XStringNode.new(source, flags, opening_loc, content_loc, closing_loc, unescaped, location)
778
793
  end
779
794
 
780
795
  # Create a new YieldNode node
781
- def YieldNode(keyword_loc, lparen_loc, arguments, rparen_loc, location = Location())
782
- YieldNode.new(keyword_loc, lparen_loc, arguments, rparen_loc, location)
796
+ def YieldNode(keyword_loc, lparen_loc, arguments, rparen_loc, source = nil, location = Location())
797
+ YieldNode.new(source, keyword_loc, lparen_loc, arguments, rparen_loc, location)
783
798
  end
784
799
  end
785
800
  end