herb 0.7.2-x86_64-linux-musl → 0.7.3-x86_64-linux-musl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Makefile +2 -0
- data/README.md +1 -1
- data/Rakefile +46 -1
- data/config.yml +714 -0
- data/ext/herb/extconf.rb +2 -1
- data/ext/herb/nodes.c +1 -1
- data/herb.gemspec +3 -0
- data/lib/herb/3.0/herb.so +0 -0
- data/lib/herb/3.1/herb.so +0 -0
- data/lib/herb/3.2/herb.so +0 -0
- data/lib/herb/3.3/herb.so +0 -0
- data/lib/herb/3.4/herb.so +0 -0
- data/lib/herb/version.rb +1 -1
- data/src/analyze.c +5 -9
- data/src/analyze_helpers.c +17 -6
- data/src/include/pretty_print.h +1 -1
- data/src/include/version.h +1 -1
- data/src/parser.c +1 -0
- data/src/pretty_print.c +1 -1
- data/templates/ext/herb/error_helpers.c.erb +85 -0
- data/templates/ext/herb/error_helpers.h.erb +12 -0
- data/templates/ext/herb/nodes.c.erb +90 -0
- data/templates/ext/herb/nodes.h.erb +9 -0
- data/templates/javascript/packages/core/src/errors.ts.erb +193 -0
- data/templates/javascript/packages/core/src/node-type-guards.ts.erb +325 -0
- data/templates/javascript/packages/core/src/nodes.ts.erb +414 -0
- data/templates/javascript/packages/core/src/visitor.ts.erb +29 -0
- data/templates/javascript/packages/node/extension/error_helpers.cpp.erb +113 -0
- data/templates/javascript/packages/node/extension/error_helpers.h.erb +17 -0
- data/templates/javascript/packages/node/extension/nodes.cpp.erb +111 -0
- data/templates/javascript/packages/node/extension/nodes.h.erb +17 -0
- data/templates/lib/herb/ast/nodes.rb.erb +117 -0
- data/templates/lib/herb/errors.rb.erb +106 -0
- data/templates/lib/herb/visitor.rb.erb +28 -0
- data/templates/sig/serialized_ast_errors.rbs.erb +10 -0
- data/templates/sig/serialized_ast_nodes.rbs.erb +10 -0
- data/templates/src/ast_nodes.c.erb +145 -0
- data/templates/src/ast_pretty_print.c.erb +97 -0
- data/templates/src/errors.c.erb +245 -0
- data/templates/src/include/ast_nodes.h.erb +46 -0
- data/templates/src/include/ast_pretty_print.h.erb +14 -0
- data/templates/src/include/errors.h.erb +58 -0
- data/templates/src/visitor.c.erb +47 -0
- data/templates/template.rb +406 -0
- data/templates/wasm/error_helpers.cpp.erb +93 -0
- data/templates/wasm/error_helpers.h.erb +15 -0
- data/templates/wasm/nodes.cpp.erb +79 -0
- data/templates/wasm/nodes.h.erb +15 -0
- data/vendor/prism/Rakefile +75 -0
- data/vendor/prism/config.yml +4713 -0
- data/vendor/prism/include/prism/ast.h +8190 -0
- data/vendor/prism/include/prism/defines.h +260 -0
- data/vendor/prism/include/prism/diagnostic.h +455 -0
- data/vendor/prism/include/prism/encoding.h +283 -0
- data/vendor/prism/include/prism/node.h +129 -0
- data/vendor/prism/include/prism/options.h +482 -0
- data/vendor/prism/include/prism/pack.h +163 -0
- data/vendor/prism/include/prism/parser.h +933 -0
- data/vendor/prism/include/prism/prettyprint.h +34 -0
- data/vendor/prism/include/prism/regexp.h +43 -0
- data/vendor/prism/include/prism/static_literals.h +121 -0
- data/vendor/prism/include/prism/util/pm_buffer.h +236 -0
- data/vendor/prism/include/prism/util/pm_char.h +204 -0
- data/vendor/prism/include/prism/util/pm_constant_pool.h +218 -0
- data/vendor/prism/include/prism/util/pm_integer.h +130 -0
- data/vendor/prism/include/prism/util/pm_list.h +103 -0
- data/vendor/prism/include/prism/util/pm_memchr.h +29 -0
- data/vendor/prism/include/prism/util/pm_newline_list.h +113 -0
- data/vendor/prism/include/prism/util/pm_string.h +200 -0
- data/vendor/prism/include/prism/util/pm_strncasecmp.h +32 -0
- data/vendor/prism/include/prism/util/pm_strpbrk.h +46 -0
- data/vendor/prism/include/prism/version.h +29 -0
- data/vendor/prism/include/prism.h +408 -0
- data/vendor/prism/src/diagnostic.c +848 -0
- data/vendor/prism/src/encoding.c +5235 -0
- data/vendor/prism/src/node.c +8676 -0
- data/vendor/prism/src/options.c +328 -0
- data/vendor/prism/src/pack.c +509 -0
- data/vendor/prism/src/prettyprint.c +8941 -0
- data/vendor/prism/src/prism.c +23302 -0
- data/vendor/prism/src/regexp.c +790 -0
- data/vendor/prism/src/serialize.c +2268 -0
- data/vendor/prism/src/static_literals.c +617 -0
- data/vendor/prism/src/token_type.c +703 -0
- data/vendor/prism/src/util/pm_buffer.c +357 -0
- data/vendor/prism/src/util/pm_char.c +318 -0
- data/vendor/prism/src/util/pm_constant_pool.c +342 -0
- data/vendor/prism/src/util/pm_integer.c +670 -0
- data/vendor/prism/src/util/pm_list.c +49 -0
- data/vendor/prism/src/util/pm_memchr.c +35 -0
- data/vendor/prism/src/util/pm_newline_list.c +125 -0
- data/vendor/prism/src/util/pm_string.c +383 -0
- data/vendor/prism/src/util/pm_strncasecmp.c +36 -0
- data/vendor/prism/src/util/pm_strpbrk.c +206 -0
- data/vendor/prism/templates/ext/prism/api_node.c.erb +282 -0
- data/vendor/prism/templates/include/prism/ast.h.erb +226 -0
- data/vendor/prism/templates/include/prism/diagnostic.h.erb +130 -0
- data/vendor/prism/templates/java/org/prism/AbstractNodeVisitor.java.erb +22 -0
- data/vendor/prism/templates/java/org/prism/Loader.java.erb +434 -0
- data/vendor/prism/templates/java/org/prism/Nodes.java.erb +403 -0
- data/vendor/prism/templates/javascript/src/deserialize.js.erb +448 -0
- data/vendor/prism/templates/javascript/src/nodes.js.erb +197 -0
- data/vendor/prism/templates/javascript/src/visitor.js.erb +78 -0
- data/vendor/prism/templates/lib/prism/compiler.rb.erb +43 -0
- data/vendor/prism/templates/lib/prism/dispatcher.rb.erb +103 -0
- data/vendor/prism/templates/lib/prism/dot_visitor.rb.erb +189 -0
- data/vendor/prism/templates/lib/prism/dsl.rb.erb +133 -0
- data/vendor/prism/templates/lib/prism/inspect_visitor.rb.erb +131 -0
- data/vendor/prism/templates/lib/prism/mutation_compiler.rb.erb +19 -0
- data/vendor/prism/templates/lib/prism/node.rb.erb +515 -0
- data/vendor/prism/templates/lib/prism/reflection.rb.erb +136 -0
- data/vendor/prism/templates/lib/prism/serialize.rb.erb +602 -0
- data/vendor/prism/templates/lib/prism/visitor.rb.erb +55 -0
- data/vendor/prism/templates/rbi/prism/dsl.rbi.erb +68 -0
- data/vendor/prism/templates/rbi/prism/node.rbi.erb +164 -0
- data/vendor/prism/templates/rbi/prism/visitor.rbi.erb +18 -0
- data/vendor/prism/templates/sig/prism/_private/dot_visitor.rbs.erb +45 -0
- data/vendor/prism/templates/sig/prism/dsl.rbs.erb +31 -0
- data/vendor/prism/templates/sig/prism/mutation_compiler.rbs.erb +7 -0
- data/vendor/prism/templates/sig/prism/node.rbs.erb +132 -0
- data/vendor/prism/templates/sig/prism/visitor.rbs.erb +17 -0
- data/vendor/prism/templates/sig/prism.rbs.erb +89 -0
- data/vendor/prism/templates/src/diagnostic.c.erb +523 -0
- data/vendor/prism/templates/src/node.c.erb +333 -0
- data/vendor/prism/templates/src/prettyprint.c.erb +166 -0
- data/vendor/prism/templates/src/serialize.c.erb +406 -0
- data/vendor/prism/templates/src/token_type.c.erb +369 -0
- data/vendor/prism/templates/template.rb +689 -0
- metadata +112 -2
@@ -0,0 +1,4713 @@
|
|
1
|
+
errors:
|
2
|
+
- ALIAS_ARGUMENT
|
3
|
+
- ALIAS_ARGUMENT_NUMBERED_REFERENCE
|
4
|
+
- AMPAMPEQ_MULTI_ASSIGN
|
5
|
+
- ARGUMENT_AFTER_BLOCK
|
6
|
+
- ARGUMENT_AFTER_FORWARDING_ELLIPSES
|
7
|
+
- ARGUMENT_BARE_HASH
|
8
|
+
- ARGUMENT_BLOCK_FORWARDING
|
9
|
+
- ARGUMENT_BLOCK_MULTI
|
10
|
+
- ARGUMENT_CONFLICT_AMPERSAND
|
11
|
+
- ARGUMENT_CONFLICT_STAR
|
12
|
+
- ARGUMENT_CONFLICT_STAR_STAR
|
13
|
+
- ARGUMENT_FORMAL_CLASS
|
14
|
+
- ARGUMENT_FORMAL_CONSTANT
|
15
|
+
- ARGUMENT_FORMAL_GLOBAL
|
16
|
+
- ARGUMENT_FORMAL_IVAR
|
17
|
+
- ARGUMENT_FORWARDING_UNBOUND
|
18
|
+
- ARGUMENT_NO_FORWARDING_AMPERSAND
|
19
|
+
- ARGUMENT_NO_FORWARDING_ELLIPSES
|
20
|
+
- ARGUMENT_NO_FORWARDING_STAR
|
21
|
+
- ARGUMENT_NO_FORWARDING_STAR_STAR
|
22
|
+
- ARGUMENT_SPLAT_AFTER_ASSOC_SPLAT
|
23
|
+
- ARGUMENT_SPLAT_AFTER_SPLAT
|
24
|
+
- ARGUMENT_TERM_PAREN
|
25
|
+
- ARGUMENT_UNEXPECTED_BLOCK
|
26
|
+
- ARRAY_ELEMENT
|
27
|
+
- ARRAY_EXPRESSION
|
28
|
+
- ARRAY_EXPRESSION_AFTER_STAR
|
29
|
+
- ARRAY_SEPARATOR
|
30
|
+
- ARRAY_TERM
|
31
|
+
- BEGIN_LONELY_ELSE
|
32
|
+
- BEGIN_TERM
|
33
|
+
- BEGIN_UPCASE_BRACE
|
34
|
+
- BEGIN_UPCASE_TERM
|
35
|
+
- BEGIN_UPCASE_TOPLEVEL
|
36
|
+
- BLOCK_PARAM_LOCAL_VARIABLE
|
37
|
+
- BLOCK_PARAM_PIPE_TERM
|
38
|
+
- BLOCK_TERM_BRACE
|
39
|
+
- BLOCK_TERM_END
|
40
|
+
- CANNOT_PARSE_EXPRESSION
|
41
|
+
- CANNOT_PARSE_STRING_PART
|
42
|
+
- CASE_EXPRESSION_AFTER_CASE
|
43
|
+
- CASE_EXPRESSION_AFTER_WHEN
|
44
|
+
- CASE_MATCH_MISSING_PREDICATE
|
45
|
+
- CASE_MISSING_CONDITIONS
|
46
|
+
- CASE_TERM
|
47
|
+
- CLASS_IN_METHOD
|
48
|
+
- CLASS_NAME
|
49
|
+
- CLASS_SUPERCLASS
|
50
|
+
- CLASS_TERM
|
51
|
+
- CLASS_UNEXPECTED_END
|
52
|
+
- CLASS_VARIABLE_BARE
|
53
|
+
- CONDITIONAL_ELSIF_PREDICATE
|
54
|
+
- CONDITIONAL_IF_PREDICATE
|
55
|
+
- CONDITIONAL_PREDICATE_TERM
|
56
|
+
- CONDITIONAL_TERM
|
57
|
+
- CONDITIONAL_TERM_ELSE
|
58
|
+
- CONDITIONAL_UNLESS_PREDICATE
|
59
|
+
- CONDITIONAL_UNTIL_PREDICATE
|
60
|
+
- CONDITIONAL_WHILE_PREDICATE
|
61
|
+
- CONSTANT_PATH_COLON_COLON_CONSTANT
|
62
|
+
- DEF_ENDLESS
|
63
|
+
- DEF_ENDLESS_SETTER
|
64
|
+
- DEF_NAME
|
65
|
+
- DEF_PARAMS_TERM
|
66
|
+
- DEF_PARAMS_TERM_PAREN
|
67
|
+
- DEF_RECEIVER
|
68
|
+
- DEF_RECEIVER_TERM
|
69
|
+
- DEF_TERM
|
70
|
+
- DEFINED_EXPRESSION
|
71
|
+
- EMBDOC_TERM
|
72
|
+
- EMBEXPR_END
|
73
|
+
- EMBVAR_INVALID
|
74
|
+
- END_UPCASE_BRACE
|
75
|
+
- END_UPCASE_TERM
|
76
|
+
- ESCAPE_INVALID_CONTROL
|
77
|
+
- ESCAPE_INVALID_CONTROL_REPEAT
|
78
|
+
- ESCAPE_INVALID_HEXADECIMAL
|
79
|
+
- ESCAPE_INVALID_META
|
80
|
+
- ESCAPE_INVALID_META_REPEAT
|
81
|
+
- ESCAPE_INVALID_UNICODE
|
82
|
+
- ESCAPE_INVALID_UNICODE_CM_FLAGS
|
83
|
+
- ESCAPE_INVALID_UNICODE_LIST
|
84
|
+
- ESCAPE_INVALID_UNICODE_LITERAL
|
85
|
+
- ESCAPE_INVALID_UNICODE_LONG
|
86
|
+
- ESCAPE_INVALID_UNICODE_SHORT
|
87
|
+
- ESCAPE_INVALID_UNICODE_TERM
|
88
|
+
- EXPECT_ARGUMENT
|
89
|
+
- EXPECT_EOL_AFTER_STATEMENT
|
90
|
+
- EXPECT_EXPRESSION_AFTER_AMPAMPEQ
|
91
|
+
- EXPECT_EXPRESSION_AFTER_COMMA
|
92
|
+
- EXPECT_EXPRESSION_AFTER_EQUAL
|
93
|
+
- EXPECT_EXPRESSION_AFTER_LESS_LESS
|
94
|
+
- EXPECT_EXPRESSION_AFTER_LPAREN
|
95
|
+
- EXPECT_EXPRESSION_AFTER_OPERATOR
|
96
|
+
- EXPECT_EXPRESSION_AFTER_PIPEPIPEEQ
|
97
|
+
- EXPECT_EXPRESSION_AFTER_QUESTION
|
98
|
+
- EXPECT_EXPRESSION_AFTER_SPLAT
|
99
|
+
- EXPECT_EXPRESSION_AFTER_SPLAT_HASH
|
100
|
+
- EXPECT_EXPRESSION_AFTER_STAR
|
101
|
+
- EXPECT_FOR_DELIMITER
|
102
|
+
- EXPECT_IDENT_REQ_PARAMETER
|
103
|
+
- EXPECT_IN_DELIMITER
|
104
|
+
- EXPECT_LPAREN_AFTER_NOT_LPAREN
|
105
|
+
- EXPECT_LPAREN_AFTER_NOT_OTHER
|
106
|
+
- EXPECT_LPAREN_REQ_PARAMETER
|
107
|
+
- EXPECT_MESSAGE
|
108
|
+
- EXPECT_RBRACKET
|
109
|
+
- EXPECT_RPAREN
|
110
|
+
- EXPECT_RPAREN_AFTER_MULTI
|
111
|
+
- EXPECT_RPAREN_REQ_PARAMETER
|
112
|
+
- EXPECT_SINGLETON_CLASS_DELIMITER
|
113
|
+
- EXPECT_STRING_CONTENT
|
114
|
+
- EXPECT_WHEN_DELIMITER
|
115
|
+
- EXPRESSION_BARE_HASH
|
116
|
+
- EXPRESSION_NOT_WRITABLE
|
117
|
+
- EXPRESSION_NOT_WRITABLE_ENCODING
|
118
|
+
- EXPRESSION_NOT_WRITABLE_FALSE
|
119
|
+
- EXPRESSION_NOT_WRITABLE_FILE
|
120
|
+
- EXPRESSION_NOT_WRITABLE_LINE
|
121
|
+
- EXPRESSION_NOT_WRITABLE_NIL
|
122
|
+
- EXPRESSION_NOT_WRITABLE_NUMBERED
|
123
|
+
- EXPRESSION_NOT_WRITABLE_SELF
|
124
|
+
- EXPRESSION_NOT_WRITABLE_TRUE
|
125
|
+
- FLOAT_PARSE
|
126
|
+
- FOR_COLLECTION
|
127
|
+
- FOR_IN
|
128
|
+
- FOR_INDEX
|
129
|
+
- FOR_TERM
|
130
|
+
- GLOBAL_VARIABLE_BARE
|
131
|
+
- HASH_EXPRESSION_AFTER_LABEL
|
132
|
+
- HASH_KEY
|
133
|
+
- HASH_ROCKET
|
134
|
+
- HASH_TERM
|
135
|
+
- HASH_VALUE
|
136
|
+
- HEREDOC_IDENTIFIER
|
137
|
+
- HEREDOC_TERM
|
138
|
+
- INCOMPLETE_QUESTION_MARK
|
139
|
+
- INCOMPLETE_VARIABLE_CLASS
|
140
|
+
- INCOMPLETE_VARIABLE_CLASS_3_3
|
141
|
+
- INCOMPLETE_VARIABLE_INSTANCE
|
142
|
+
- INCOMPLETE_VARIABLE_INSTANCE_3_3
|
143
|
+
- INSTANCE_VARIABLE_BARE
|
144
|
+
- INVALID_BLOCK_EXIT
|
145
|
+
- INVALID_CHARACTER
|
146
|
+
- INVALID_COMMA
|
147
|
+
- INVALID_ENCODING_MAGIC_COMMENT
|
148
|
+
- INVALID_ESCAPE_CHARACTER
|
149
|
+
- INVALID_FLOAT_EXPONENT
|
150
|
+
- INVALID_LOCAL_VARIABLE_READ
|
151
|
+
- INVALID_LOCAL_VARIABLE_WRITE
|
152
|
+
- INVALID_MULTIBYTE_CHAR
|
153
|
+
- INVALID_MULTIBYTE_CHARACTER
|
154
|
+
- INVALID_MULTIBYTE_ESCAPE
|
155
|
+
- INVALID_NUMBER_BINARY
|
156
|
+
- INVALID_NUMBER_DECIMAL
|
157
|
+
- INVALID_NUMBER_FRACTION
|
158
|
+
- INVALID_NUMBER_HEXADECIMAL
|
159
|
+
- INVALID_NUMBER_OCTAL
|
160
|
+
- INVALID_NUMBER_UNDERSCORE_INNER
|
161
|
+
- INVALID_NUMBER_UNDERSCORE_TRAILING
|
162
|
+
- INVALID_PERCENT
|
163
|
+
- INVALID_PERCENT_EOF
|
164
|
+
- INVALID_PRINTABLE_CHARACTER
|
165
|
+
- INVALID_RETRY_AFTER_ELSE
|
166
|
+
- INVALID_RETRY_AFTER_ENSURE
|
167
|
+
- INVALID_RETRY_WITHOUT_RESCUE
|
168
|
+
- INVALID_SYMBOL
|
169
|
+
- INVALID_VARIABLE_GLOBAL
|
170
|
+
- INVALID_VARIABLE_GLOBAL_3_3
|
171
|
+
- INVALID_YIELD
|
172
|
+
- IT_NOT_ALLOWED_NUMBERED
|
173
|
+
- IT_NOT_ALLOWED_ORDINARY
|
174
|
+
- LAMBDA_OPEN
|
175
|
+
- LAMBDA_TERM_BRACE
|
176
|
+
- LAMBDA_TERM_END
|
177
|
+
- LIST_I_LOWER_ELEMENT
|
178
|
+
- LIST_I_LOWER_TERM
|
179
|
+
- LIST_I_UPPER_ELEMENT
|
180
|
+
- LIST_I_UPPER_TERM
|
181
|
+
- LIST_W_LOWER_ELEMENT
|
182
|
+
- LIST_W_LOWER_TERM
|
183
|
+
- LIST_W_UPPER_ELEMENT
|
184
|
+
- LIST_W_UPPER_TERM
|
185
|
+
- MALLOC_FAILED
|
186
|
+
- MIXED_ENCODING
|
187
|
+
- MODULE_IN_METHOD
|
188
|
+
- MODULE_NAME
|
189
|
+
- MODULE_TERM
|
190
|
+
- MULTI_ASSIGN_MULTI_SPLATS
|
191
|
+
- MULTI_ASSIGN_UNEXPECTED_REST
|
192
|
+
- NESTING_TOO_DEEP
|
193
|
+
- NO_LOCAL_VARIABLE
|
194
|
+
- NON_ASSOCIATIVE_OPERATOR
|
195
|
+
- NOT_EXPRESSION
|
196
|
+
- NUMBER_LITERAL_UNDERSCORE
|
197
|
+
- NUMBERED_PARAMETER_INNER_BLOCK
|
198
|
+
- NUMBERED_PARAMETER_IT
|
199
|
+
- NUMBERED_PARAMETER_ORDINARY
|
200
|
+
- NUMBERED_PARAMETER_OUTER_BLOCK
|
201
|
+
- OPERATOR_MULTI_ASSIGN
|
202
|
+
- OPERATOR_WRITE_ARGUMENTS
|
203
|
+
- OPERATOR_WRITE_BLOCK
|
204
|
+
- PARAMETER_ASSOC_SPLAT_MULTI
|
205
|
+
- PARAMETER_BLOCK_MULTI
|
206
|
+
- PARAMETER_CIRCULAR
|
207
|
+
- PARAMETER_FORWARDING_AFTER_REST
|
208
|
+
- PARAMETER_METHOD_NAME
|
209
|
+
- PARAMETER_NAME_DUPLICATED
|
210
|
+
- PARAMETER_NO_DEFAULT
|
211
|
+
- PARAMETER_NO_DEFAULT_KW
|
212
|
+
- PARAMETER_NUMBERED_RESERVED
|
213
|
+
- PARAMETER_ORDER
|
214
|
+
- PARAMETER_SPLAT_MULTI
|
215
|
+
- PARAMETER_STAR
|
216
|
+
- PARAMETER_UNEXPECTED_FWD
|
217
|
+
- PARAMETER_UNEXPECTED_NO_KW
|
218
|
+
- PARAMETER_WILD_LOOSE_COMMA
|
219
|
+
- PATTERN_ARRAY_MULTIPLE_RESTS
|
220
|
+
- PATTERN_CAPTURE_DUPLICATE
|
221
|
+
- PATTERN_EXPRESSION_AFTER_BRACKET
|
222
|
+
- PATTERN_EXPRESSION_AFTER_COMMA
|
223
|
+
- PATTERN_EXPRESSION_AFTER_HROCKET
|
224
|
+
- PATTERN_EXPRESSION_AFTER_IN
|
225
|
+
- PATTERN_EXPRESSION_AFTER_KEY
|
226
|
+
- PATTERN_EXPRESSION_AFTER_PAREN
|
227
|
+
- PATTERN_EXPRESSION_AFTER_PIN
|
228
|
+
- PATTERN_EXPRESSION_AFTER_PIPE
|
229
|
+
- PATTERN_EXPRESSION_AFTER_RANGE
|
230
|
+
- PATTERN_EXPRESSION_AFTER_REST
|
231
|
+
- PATTERN_FIND_MISSING_INNER
|
232
|
+
- PATTERN_HASH_IMPLICIT
|
233
|
+
- PATTERN_HASH_KEY
|
234
|
+
- PATTERN_HASH_KEY_DUPLICATE
|
235
|
+
- PATTERN_HASH_KEY_INTERPOLATED
|
236
|
+
- PATTERN_HASH_KEY_LABEL
|
237
|
+
- PATTERN_HASH_KEY_LOCALS
|
238
|
+
- PATTERN_IDENT_AFTER_HROCKET
|
239
|
+
- PATTERN_LABEL_AFTER_COMMA
|
240
|
+
- PATTERN_REST
|
241
|
+
- PATTERN_TERM_BRACE
|
242
|
+
- PATTERN_TERM_BRACKET
|
243
|
+
- PATTERN_TERM_PAREN
|
244
|
+
- PIPEPIPEEQ_MULTI_ASSIGN
|
245
|
+
- REGEXP_ENCODING_OPTION_MISMATCH
|
246
|
+
- REGEXP_INCOMPAT_CHAR_ENCODING
|
247
|
+
- REGEXP_INVALID_UNICODE_RANGE
|
248
|
+
- REGEXP_NON_ESCAPED_MBC
|
249
|
+
- REGEXP_PARSE_ERROR
|
250
|
+
- REGEXP_TERM
|
251
|
+
- REGEXP_UNKNOWN_OPTIONS
|
252
|
+
- REGEXP_UTF8_CHAR_NON_UTF8_REGEXP
|
253
|
+
- RESCUE_EXPRESSION
|
254
|
+
- RESCUE_MODIFIER_VALUE
|
255
|
+
- RESCUE_TERM
|
256
|
+
- RESCUE_VARIABLE
|
257
|
+
- RETURN_INVALID
|
258
|
+
- SCRIPT_NOT_FOUND
|
259
|
+
- SINGLETON_FOR_LITERALS
|
260
|
+
- STATEMENT_ALIAS
|
261
|
+
- STATEMENT_POSTEXE_END
|
262
|
+
- STATEMENT_PREEXE_BEGIN
|
263
|
+
- STATEMENT_UNDEF
|
264
|
+
- STRING_CONCATENATION
|
265
|
+
- STRING_INTERPOLATED_TERM
|
266
|
+
- STRING_LITERAL_EOF
|
267
|
+
- STRING_LITERAL_TERM
|
268
|
+
- SYMBOL_INVALID
|
269
|
+
- SYMBOL_TERM_DYNAMIC
|
270
|
+
- SYMBOL_TERM_INTERPOLATED
|
271
|
+
- TERNARY_COLON
|
272
|
+
- TERNARY_EXPRESSION_FALSE
|
273
|
+
- TERNARY_EXPRESSION_TRUE
|
274
|
+
- UNARY_DISALLOWED
|
275
|
+
- UNARY_RECEIVER
|
276
|
+
- UNDEF_ARGUMENT
|
277
|
+
- UNEXPECTED_BLOCK_ARGUMENT
|
278
|
+
- UNEXPECTED_INDEX_BLOCK
|
279
|
+
- UNEXPECTED_INDEX_KEYWORDS
|
280
|
+
- UNEXPECTED_LABEL
|
281
|
+
- UNEXPECTED_MULTI_WRITE
|
282
|
+
- UNEXPECTED_RANGE_OPERATOR
|
283
|
+
- UNEXPECTED_SAFE_NAVIGATION
|
284
|
+
- UNEXPECTED_TOKEN_CLOSE_CONTEXT
|
285
|
+
- UNEXPECTED_TOKEN_IGNORE
|
286
|
+
- UNTIL_TERM
|
287
|
+
- VOID_EXPRESSION
|
288
|
+
- WHILE_TERM
|
289
|
+
- WRITE_TARGET_IN_METHOD
|
290
|
+
- WRITE_TARGET_READONLY
|
291
|
+
- WRITE_TARGET_UNEXPECTED
|
292
|
+
- XSTRING_TERM
|
293
|
+
warnings:
|
294
|
+
- AMBIGUOUS_BINARY_OPERATOR
|
295
|
+
- AMBIGUOUS_FIRST_ARGUMENT_MINUS
|
296
|
+
- AMBIGUOUS_FIRST_ARGUMENT_PLUS
|
297
|
+
- AMBIGUOUS_PREFIX_AMPERSAND
|
298
|
+
- AMBIGUOUS_PREFIX_STAR
|
299
|
+
- AMBIGUOUS_PREFIX_STAR_STAR
|
300
|
+
- AMBIGUOUS_SLASH
|
301
|
+
- COMPARISON_AFTER_COMPARISON
|
302
|
+
- DOT_DOT_DOT_EOL
|
303
|
+
- EQUAL_IN_CONDITIONAL
|
304
|
+
- EQUAL_IN_CONDITIONAL_3_3
|
305
|
+
- END_IN_METHOD
|
306
|
+
- DUPLICATED_HASH_KEY
|
307
|
+
- DUPLICATED_WHEN_CLAUSE
|
308
|
+
- FLOAT_OUT_OF_RANGE
|
309
|
+
- IGNORED_FROZEN_STRING_LITERAL
|
310
|
+
- INDENTATION_MISMATCH
|
311
|
+
- INTEGER_IN_FLIP_FLOP
|
312
|
+
- INVALID_CHARACTER
|
313
|
+
- INVALID_MAGIC_COMMENT_VALUE
|
314
|
+
- INVALID_NUMBERED_REFERENCE
|
315
|
+
- KEYWORD_EOL
|
316
|
+
- LITERAL_IN_CONDITION_DEFAULT
|
317
|
+
- LITERAL_IN_CONDITION_VERBOSE
|
318
|
+
- SHAREABLE_CONSTANT_VALUE_LINE
|
319
|
+
- SHEBANG_CARRIAGE_RETURN
|
320
|
+
- UNEXPECTED_CARRIAGE_RETURN
|
321
|
+
- UNREACHABLE_STATEMENT
|
322
|
+
- UNUSED_LOCAL_VARIABLE
|
323
|
+
- VOID_STATEMENT
|
324
|
+
tokens:
|
325
|
+
# The order of the tokens at the beginning is important, because we use them
|
326
|
+
# for a lookup table.
|
327
|
+
- name: EOF
|
328
|
+
value: 1
|
329
|
+
comment: final token in the file
|
330
|
+
- name: BRACE_RIGHT
|
331
|
+
comment: "}"
|
332
|
+
- name: COMMA
|
333
|
+
comment: ","
|
334
|
+
- name: EMBEXPR_END
|
335
|
+
comment: "}"
|
336
|
+
- name: KEYWORD_DO
|
337
|
+
comment: "do"
|
338
|
+
- name: KEYWORD_ELSE
|
339
|
+
comment: "else"
|
340
|
+
- name: KEYWORD_ELSIF
|
341
|
+
comment: "elsif"
|
342
|
+
- name: KEYWORD_END
|
343
|
+
comment: "end"
|
344
|
+
- name: KEYWORD_ENSURE
|
345
|
+
comment: "ensure"
|
346
|
+
- name: KEYWORD_IN
|
347
|
+
comment: "in"
|
348
|
+
- name: KEYWORD_RESCUE
|
349
|
+
comment: "rescue"
|
350
|
+
- name: KEYWORD_THEN
|
351
|
+
comment: "then"
|
352
|
+
- name: KEYWORD_WHEN
|
353
|
+
comment: "when"
|
354
|
+
- name: NEWLINE
|
355
|
+
comment: "a newline character outside of other tokens"
|
356
|
+
- name: PARENTHESIS_RIGHT
|
357
|
+
comment: ")"
|
358
|
+
- name: SEMICOLON
|
359
|
+
comment: ";"
|
360
|
+
# Tokens from here on are not used for lookup, and can be in any order.
|
361
|
+
- name: AMPERSAND
|
362
|
+
comment: "&"
|
363
|
+
- name: AMPERSAND_AMPERSAND
|
364
|
+
comment: "&&"
|
365
|
+
- name: AMPERSAND_AMPERSAND_EQUAL
|
366
|
+
comment: "&&="
|
367
|
+
- name: AMPERSAND_DOT
|
368
|
+
comment: "&."
|
369
|
+
- name: AMPERSAND_EQUAL
|
370
|
+
comment: "&="
|
371
|
+
- name: BACKTICK
|
372
|
+
comment: "`"
|
373
|
+
- name: BACK_REFERENCE
|
374
|
+
comment: "a back reference"
|
375
|
+
- name: BANG
|
376
|
+
comment: "! or !@"
|
377
|
+
- name: BANG_EQUAL
|
378
|
+
comment: "!="
|
379
|
+
- name: BANG_TILDE
|
380
|
+
comment: "!~"
|
381
|
+
- name: BRACE_LEFT
|
382
|
+
comment: "{"
|
383
|
+
- name: BRACKET_LEFT
|
384
|
+
comment: "["
|
385
|
+
- name: BRACKET_LEFT_ARRAY
|
386
|
+
comment: "[ for the beginning of an array"
|
387
|
+
- name: BRACKET_LEFT_RIGHT
|
388
|
+
comment: "[]"
|
389
|
+
- name: BRACKET_LEFT_RIGHT_EQUAL
|
390
|
+
comment: "[]="
|
391
|
+
- name: BRACKET_RIGHT
|
392
|
+
comment: "]"
|
393
|
+
- name: CARET
|
394
|
+
comment: "^"
|
395
|
+
- name: CARET_EQUAL
|
396
|
+
comment: "^="
|
397
|
+
- name: CHARACTER_LITERAL
|
398
|
+
comment: "a character literal"
|
399
|
+
- name: CLASS_VARIABLE
|
400
|
+
comment: "a class variable"
|
401
|
+
- name: COLON
|
402
|
+
comment: ":"
|
403
|
+
- name: COLON_COLON
|
404
|
+
comment: "::"
|
405
|
+
- name: COMMENT
|
406
|
+
comment: "a comment"
|
407
|
+
- name: CONSTANT
|
408
|
+
comment: "a constant"
|
409
|
+
- name: DOT
|
410
|
+
comment: "the . call operator"
|
411
|
+
- name: DOT_DOT
|
412
|
+
comment: "the .. range operator"
|
413
|
+
- name: DOT_DOT_DOT
|
414
|
+
comment: "the ... range operator or forwarding parameter"
|
415
|
+
- name: EMBDOC_BEGIN
|
416
|
+
comment: "=begin"
|
417
|
+
- name: EMBDOC_END
|
418
|
+
comment: "=end"
|
419
|
+
- name: EMBDOC_LINE
|
420
|
+
comment: "a line inside of embedded documentation"
|
421
|
+
- name: EMBEXPR_BEGIN
|
422
|
+
comment: "#{"
|
423
|
+
- name: EMBVAR
|
424
|
+
comment: "#"
|
425
|
+
- name: EQUAL
|
426
|
+
comment: "="
|
427
|
+
- name: EQUAL_EQUAL
|
428
|
+
comment: "=="
|
429
|
+
- name: EQUAL_EQUAL_EQUAL
|
430
|
+
comment: "==="
|
431
|
+
- name: EQUAL_GREATER
|
432
|
+
comment: "=>"
|
433
|
+
- name: EQUAL_TILDE
|
434
|
+
comment: "=~"
|
435
|
+
- name: FLOAT
|
436
|
+
comment: "a floating point number"
|
437
|
+
- name: FLOAT_IMAGINARY
|
438
|
+
comment: "a floating pointer number with an imaginary suffix"
|
439
|
+
- name: FLOAT_RATIONAL
|
440
|
+
comment: "a floating pointer number with a rational suffix"
|
441
|
+
- name: FLOAT_RATIONAL_IMAGINARY
|
442
|
+
comment: "a floating pointer number with a rational and imaginary suffix"
|
443
|
+
- name: GLOBAL_VARIABLE
|
444
|
+
comment: "a global variable"
|
445
|
+
- name: GREATER
|
446
|
+
comment: ">"
|
447
|
+
- name: GREATER_EQUAL
|
448
|
+
comment: ">="
|
449
|
+
- name: GREATER_GREATER
|
450
|
+
comment: ">>"
|
451
|
+
- name: GREATER_GREATER_EQUAL
|
452
|
+
comment: ">>="
|
453
|
+
- name: HEREDOC_END
|
454
|
+
comment: "the end of a heredoc"
|
455
|
+
- name: HEREDOC_START
|
456
|
+
comment: "the start of a heredoc"
|
457
|
+
- name: IDENTIFIER
|
458
|
+
comment: "an identifier"
|
459
|
+
- name: IGNORED_NEWLINE
|
460
|
+
comment: "an ignored newline"
|
461
|
+
- name: INSTANCE_VARIABLE
|
462
|
+
comment: "an instance variable"
|
463
|
+
- name: INTEGER
|
464
|
+
comment: "an integer (any base)"
|
465
|
+
- name: INTEGER_IMAGINARY
|
466
|
+
comment: "an integer with an imaginary suffix"
|
467
|
+
- name: INTEGER_RATIONAL
|
468
|
+
comment: "an integer with a rational suffix"
|
469
|
+
- name: INTEGER_RATIONAL_IMAGINARY
|
470
|
+
comment: "an integer with a rational and imaginary suffix"
|
471
|
+
- name: KEYWORD_ALIAS
|
472
|
+
comment: "alias"
|
473
|
+
- name: KEYWORD_AND
|
474
|
+
comment: "and"
|
475
|
+
- name: KEYWORD_BEGIN
|
476
|
+
comment: "begin"
|
477
|
+
- name: KEYWORD_BEGIN_UPCASE
|
478
|
+
comment: "BEGIN"
|
479
|
+
- name: KEYWORD_BREAK
|
480
|
+
comment: "break"
|
481
|
+
- name: KEYWORD_CASE
|
482
|
+
comment: "case"
|
483
|
+
- name: KEYWORD_CLASS
|
484
|
+
comment: "class"
|
485
|
+
- name: KEYWORD_DEF
|
486
|
+
comment: "def"
|
487
|
+
- name: KEYWORD_DEFINED
|
488
|
+
comment: "defined?"
|
489
|
+
- name: KEYWORD_DO_LOOP
|
490
|
+
comment: "do keyword for a predicate in a while, until, or for loop"
|
491
|
+
- name: KEYWORD_END_UPCASE
|
492
|
+
comment: "END"
|
493
|
+
- name: KEYWORD_FALSE
|
494
|
+
comment: "false"
|
495
|
+
- name: KEYWORD_FOR
|
496
|
+
comment: "for"
|
497
|
+
- name: KEYWORD_IF
|
498
|
+
comment: "if"
|
499
|
+
- name: KEYWORD_IF_MODIFIER
|
500
|
+
comment: "if in the modifier form"
|
501
|
+
- name: KEYWORD_MODULE
|
502
|
+
comment: "module"
|
503
|
+
- name: KEYWORD_NEXT
|
504
|
+
comment: "next"
|
505
|
+
- name: KEYWORD_NIL
|
506
|
+
comment: "nil"
|
507
|
+
- name: KEYWORD_NOT
|
508
|
+
comment: "not"
|
509
|
+
- name: KEYWORD_OR
|
510
|
+
comment: "or"
|
511
|
+
- name: KEYWORD_REDO
|
512
|
+
comment: "redo"
|
513
|
+
- name: KEYWORD_RESCUE_MODIFIER
|
514
|
+
comment: "rescue in the modifier form"
|
515
|
+
- name: KEYWORD_RETRY
|
516
|
+
comment: "retry"
|
517
|
+
- name: KEYWORD_RETURN
|
518
|
+
comment: "return"
|
519
|
+
- name: KEYWORD_SELF
|
520
|
+
comment: "self"
|
521
|
+
- name: KEYWORD_SUPER
|
522
|
+
comment: "super"
|
523
|
+
- name: KEYWORD_TRUE
|
524
|
+
comment: "true"
|
525
|
+
- name: KEYWORD_UNDEF
|
526
|
+
comment: "undef"
|
527
|
+
- name: KEYWORD_UNLESS
|
528
|
+
comment: "unless"
|
529
|
+
- name: KEYWORD_UNLESS_MODIFIER
|
530
|
+
comment: "unless in the modifier form"
|
531
|
+
- name: KEYWORD_UNTIL
|
532
|
+
comment: "until"
|
533
|
+
- name: KEYWORD_UNTIL_MODIFIER
|
534
|
+
comment: "until in the modifier form"
|
535
|
+
- name: KEYWORD_WHILE
|
536
|
+
comment: "while"
|
537
|
+
- name: KEYWORD_WHILE_MODIFIER
|
538
|
+
comment: "while in the modifier form"
|
539
|
+
- name: KEYWORD_YIELD
|
540
|
+
comment: "yield"
|
541
|
+
- name: KEYWORD___ENCODING__
|
542
|
+
comment: "__ENCODING__"
|
543
|
+
- name: KEYWORD___FILE__
|
544
|
+
comment: "__FILE__"
|
545
|
+
- name: KEYWORD___LINE__
|
546
|
+
comment: "__LINE__"
|
547
|
+
- name: LABEL
|
548
|
+
comment: "a label"
|
549
|
+
- name: LABEL_END
|
550
|
+
comment: "the end of a label"
|
551
|
+
- name: LAMBDA_BEGIN
|
552
|
+
comment: "{"
|
553
|
+
- name: LESS
|
554
|
+
comment: "<"
|
555
|
+
- name: LESS_EQUAL
|
556
|
+
comment: "<="
|
557
|
+
- name: LESS_EQUAL_GREATER
|
558
|
+
comment: "<=>"
|
559
|
+
- name: LESS_LESS
|
560
|
+
comment: "<<"
|
561
|
+
- name: LESS_LESS_EQUAL
|
562
|
+
comment: "<<="
|
563
|
+
- name: METHOD_NAME
|
564
|
+
comment: "a method name"
|
565
|
+
- name: MINUS
|
566
|
+
comment: "-"
|
567
|
+
- name: MINUS_EQUAL
|
568
|
+
comment: "-="
|
569
|
+
- name: MINUS_GREATER
|
570
|
+
comment: "->"
|
571
|
+
- name: NUMBERED_REFERENCE
|
572
|
+
comment: "a numbered reference to a capture group in the previous regular expression match"
|
573
|
+
- name: PARENTHESIS_LEFT
|
574
|
+
comment: "("
|
575
|
+
- name: PARENTHESIS_LEFT_PARENTHESES
|
576
|
+
comment: "( for a parentheses node"
|
577
|
+
- name: PERCENT
|
578
|
+
comment: "%"
|
579
|
+
- name: PERCENT_EQUAL
|
580
|
+
comment: "%="
|
581
|
+
- name: PERCENT_LOWER_I
|
582
|
+
comment: "%i"
|
583
|
+
- name: PERCENT_LOWER_W
|
584
|
+
comment: "%w"
|
585
|
+
- name: PERCENT_LOWER_X
|
586
|
+
comment: "%x"
|
587
|
+
- name: PERCENT_UPPER_I
|
588
|
+
comment: "%I"
|
589
|
+
- name: PERCENT_UPPER_W
|
590
|
+
comment: "%W"
|
591
|
+
- name: PIPE
|
592
|
+
comment: "|"
|
593
|
+
- name: PIPE_EQUAL
|
594
|
+
comment: "|="
|
595
|
+
- name: PIPE_PIPE
|
596
|
+
comment: "||"
|
597
|
+
- name: PIPE_PIPE_EQUAL
|
598
|
+
comment: "||="
|
599
|
+
- name: PLUS
|
600
|
+
comment: "+"
|
601
|
+
- name: PLUS_EQUAL
|
602
|
+
comment: "+="
|
603
|
+
- name: QUESTION_MARK
|
604
|
+
comment: "?"
|
605
|
+
- name: REGEXP_BEGIN
|
606
|
+
comment: "the beginning of a regular expression"
|
607
|
+
- name: REGEXP_END
|
608
|
+
comment: "the end of a regular expression"
|
609
|
+
- name: SLASH
|
610
|
+
comment: "/"
|
611
|
+
- name: SLASH_EQUAL
|
612
|
+
comment: "/="
|
613
|
+
- name: STAR
|
614
|
+
comment: "*"
|
615
|
+
- name: STAR_EQUAL
|
616
|
+
comment: "*="
|
617
|
+
- name: STAR_STAR
|
618
|
+
comment: "**"
|
619
|
+
- name: STAR_STAR_EQUAL
|
620
|
+
comment: "**="
|
621
|
+
- name: STRING_BEGIN
|
622
|
+
comment: "the beginning of a string"
|
623
|
+
- name: STRING_CONTENT
|
624
|
+
comment: "the contents of a string"
|
625
|
+
- name: STRING_END
|
626
|
+
comment: "the end of a string"
|
627
|
+
- name: SYMBOL_BEGIN
|
628
|
+
comment: "the beginning of a symbol"
|
629
|
+
- name: TILDE
|
630
|
+
comment: "~ or ~@"
|
631
|
+
- name: UAMPERSAND
|
632
|
+
comment: "unary &"
|
633
|
+
- name: UCOLON_COLON
|
634
|
+
comment: "unary ::"
|
635
|
+
- name: UDOT_DOT
|
636
|
+
comment: "unary .. operator"
|
637
|
+
- name: UDOT_DOT_DOT
|
638
|
+
comment: "unary ... operator"
|
639
|
+
- name: UMINUS
|
640
|
+
comment: "-@"
|
641
|
+
- name: UMINUS_NUM
|
642
|
+
comment: "-@ for a number"
|
643
|
+
- name: UPLUS
|
644
|
+
comment: "+@"
|
645
|
+
- name: USTAR
|
646
|
+
comment: "unary *"
|
647
|
+
- name: USTAR_STAR
|
648
|
+
comment: "unary **"
|
649
|
+
- name: WORDS_SEP
|
650
|
+
comment: "a separator between words in a list"
|
651
|
+
- name: __END__
|
652
|
+
comment: "marker for the point in the file at which the parser should stop"
|
653
|
+
- name: MISSING
|
654
|
+
comment: "a token that was expected but not found"
|
655
|
+
- name: NOT_PROVIDED
|
656
|
+
comment: "a token that was not present but it is okay"
|
657
|
+
flags:
|
658
|
+
- name: ArgumentsNodeFlags
|
659
|
+
values:
|
660
|
+
- name: CONTAINS_FORWARDING
|
661
|
+
comment: "if the arguments contain forwarding"
|
662
|
+
- name: CONTAINS_KEYWORDS
|
663
|
+
comment: "if the arguments contain keywords"
|
664
|
+
- name: CONTAINS_KEYWORD_SPLAT
|
665
|
+
comment: "if the arguments contain a keyword splat"
|
666
|
+
- name: CONTAINS_SPLAT
|
667
|
+
comment: "if the arguments contain a splat"
|
668
|
+
- name: CONTAINS_MULTIPLE_SPLATS
|
669
|
+
comment: "if the arguments contain multiple splats"
|
670
|
+
comment: Flags for arguments nodes.
|
671
|
+
- name: ArrayNodeFlags
|
672
|
+
values:
|
673
|
+
- name: CONTAINS_SPLAT
|
674
|
+
comment: "if array contains splat nodes"
|
675
|
+
comment: Flags for array nodes.
|
676
|
+
- name: CallNodeFlags
|
677
|
+
values:
|
678
|
+
- name: SAFE_NAVIGATION
|
679
|
+
comment: "&. operator"
|
680
|
+
- name: VARIABLE_CALL
|
681
|
+
comment: "a call that could have been a local variable"
|
682
|
+
- name: ATTRIBUTE_WRITE
|
683
|
+
comment: "a call that is an attribute write, so the value being written should be returned"
|
684
|
+
- name: IGNORE_VISIBILITY
|
685
|
+
comment: "a call that ignores method visibility"
|
686
|
+
comment: Flags for call nodes.
|
687
|
+
- name: EncodingFlags
|
688
|
+
values:
|
689
|
+
- name: FORCED_UTF8_ENCODING
|
690
|
+
comment: "internal bytes forced the encoding to UTF-8"
|
691
|
+
- name: FORCED_BINARY_ENCODING
|
692
|
+
comment: "internal bytes forced the encoding to binary"
|
693
|
+
comment: Flags for nodes that have unescaped content.
|
694
|
+
- name: IntegerBaseFlags
|
695
|
+
values:
|
696
|
+
- name: BINARY
|
697
|
+
comment: "0b prefix"
|
698
|
+
- name: DECIMAL
|
699
|
+
comment: "0d or no prefix"
|
700
|
+
- name: OCTAL
|
701
|
+
comment: "0o or 0 prefix"
|
702
|
+
- name: HEXADECIMAL
|
703
|
+
comment: "0x prefix"
|
704
|
+
comment: Flags for integer nodes that correspond to the base of the integer.
|
705
|
+
- name: InterpolatedStringNodeFlags
|
706
|
+
values:
|
707
|
+
- name: FROZEN
|
708
|
+
comment: "frozen by virtue of a `frozen_string_literal: true` comment or `--enable-frozen-string-literal`; only for adjacent string literals like `'a' 'b'`"
|
709
|
+
- name: MUTABLE
|
710
|
+
comment: "mutable by virtue of a `frozen_string_literal: false` comment or `--disable-frozen-string-literal`; only for adjacent string literals like `'a' 'b'`"
|
711
|
+
comment: Flags for interpolated string nodes that indicated mutability if they are also marked as literals.
|
712
|
+
- name: KeywordHashNodeFlags
|
713
|
+
values:
|
714
|
+
- name: SYMBOL_KEYS
|
715
|
+
comment: "a keyword hash which only has `AssocNode` elements all with symbol keys, which means the elements can be treated as keyword arguments"
|
716
|
+
comment: Flags for keyword hash nodes.
|
717
|
+
- name: LoopFlags
|
718
|
+
values:
|
719
|
+
- name: BEGIN_MODIFIER
|
720
|
+
comment: "a loop after a begin statement, so the body is executed first before the condition"
|
721
|
+
comment: Flags for while and until loop nodes.
|
722
|
+
- name: ParameterFlags
|
723
|
+
values:
|
724
|
+
- name: REPEATED_PARAMETER
|
725
|
+
comment: "a parameter name that has been repeated in the method signature"
|
726
|
+
comment: Flags for parameter nodes.
|
727
|
+
- name: ParenthesesNodeFlags
|
728
|
+
values:
|
729
|
+
- name: MULTIPLE_STATEMENTS
|
730
|
+
comment: "parentheses that contain multiple potentially void statements"
|
731
|
+
comment: Flags for parentheses nodes.
|
732
|
+
- name: RangeFlags
|
733
|
+
values:
|
734
|
+
- name: EXCLUDE_END
|
735
|
+
comment: "... operator"
|
736
|
+
comment: Flags for range and flip-flop nodes.
|
737
|
+
- name: RegularExpressionFlags
|
738
|
+
values:
|
739
|
+
- name: IGNORE_CASE
|
740
|
+
comment: "i - ignores the case of characters when matching"
|
741
|
+
- name: EXTENDED
|
742
|
+
comment: "x - ignores whitespace and allows comments in regular expressions"
|
743
|
+
- name: MULTI_LINE
|
744
|
+
comment: "m - allows $ to match the end of lines within strings"
|
745
|
+
- name: ONCE
|
746
|
+
comment: "o - only interpolates values into the regular expression once"
|
747
|
+
- name: EUC_JP
|
748
|
+
comment: "e - forces the EUC-JP encoding"
|
749
|
+
- name: ASCII_8BIT
|
750
|
+
comment: "n - forces the ASCII-8BIT encoding"
|
751
|
+
- name: WINDOWS_31J
|
752
|
+
comment: "s - forces the Windows-31J encoding"
|
753
|
+
- name: UTF_8
|
754
|
+
comment: "u - forces the UTF-8 encoding"
|
755
|
+
- name: FORCED_UTF8_ENCODING
|
756
|
+
comment: "internal bytes forced the encoding to UTF-8"
|
757
|
+
- name: FORCED_BINARY_ENCODING
|
758
|
+
comment: "internal bytes forced the encoding to binary"
|
759
|
+
- name: FORCED_US_ASCII_ENCODING
|
760
|
+
comment: "internal bytes forced the encoding to US-ASCII"
|
761
|
+
comment: Flags for regular expression and match last line nodes.
|
762
|
+
- name: ShareableConstantNodeFlags
|
763
|
+
values:
|
764
|
+
- name: LITERAL
|
765
|
+
comment: "constant writes that should be modified with shareable constant value literal"
|
766
|
+
- name: EXPERIMENTAL_EVERYTHING
|
767
|
+
comment: "constant writes that should be modified with shareable constant value experimental everything"
|
768
|
+
- name: EXPERIMENTAL_COPY
|
769
|
+
comment: "constant writes that should be modified with shareable constant value experimental copy"
|
770
|
+
comment: Flags for shareable constant nodes.
|
771
|
+
- name: StringFlags
|
772
|
+
values:
|
773
|
+
- name: FORCED_UTF8_ENCODING
|
774
|
+
comment: "internal bytes forced the encoding to UTF-8"
|
775
|
+
- name: FORCED_BINARY_ENCODING
|
776
|
+
comment: "internal bytes forced the encoding to binary"
|
777
|
+
- name: FROZEN
|
778
|
+
comment: "frozen by virtue of a `frozen_string_literal: true` comment or `--enable-frozen-string-literal`"
|
779
|
+
- name: MUTABLE
|
780
|
+
comment: "mutable by virtue of a `frozen_string_literal: false` comment or `--disable-frozen-string-literal`"
|
781
|
+
comment: Flags for string nodes.
|
782
|
+
- name: SymbolFlags
|
783
|
+
values:
|
784
|
+
- name: FORCED_UTF8_ENCODING
|
785
|
+
comment: "internal bytes forced the encoding to UTF-8"
|
786
|
+
- name: FORCED_BINARY_ENCODING
|
787
|
+
comment: "internal bytes forced the encoding to binary"
|
788
|
+
- name: FORCED_US_ASCII_ENCODING
|
789
|
+
comment: "internal bytes forced the encoding to US-ASCII"
|
790
|
+
comment: Flags for symbol nodes.
|
791
|
+
nodes:
|
792
|
+
- name: AliasGlobalVariableNode
|
793
|
+
fields:
|
794
|
+
- name: new_name
|
795
|
+
type: node
|
796
|
+
kind:
|
797
|
+
- GlobalVariableReadNode
|
798
|
+
- BackReferenceReadNode
|
799
|
+
- NumberedReferenceReadNode
|
800
|
+
comment: |
|
801
|
+
Represents the new name of the global variable that can be used after aliasing.
|
802
|
+
|
803
|
+
alias $foo $bar
|
804
|
+
^^^^
|
805
|
+
- name: old_name
|
806
|
+
type: node
|
807
|
+
kind:
|
808
|
+
- GlobalVariableReadNode
|
809
|
+
- BackReferenceReadNode
|
810
|
+
- NumberedReferenceReadNode
|
811
|
+
- on error: SymbolNode # alias $a b
|
812
|
+
- on error: MissingNode # alias $a 42
|
813
|
+
comment: |
|
814
|
+
Represents the old name of the global variable that can be used before aliasing.
|
815
|
+
|
816
|
+
alias $foo $bar
|
817
|
+
^^^^
|
818
|
+
- name: keyword_loc
|
819
|
+
type: location
|
820
|
+
comment: |
|
821
|
+
The location of the `alias` keyword.
|
822
|
+
|
823
|
+
alias $foo $bar
|
824
|
+
^^^^^
|
825
|
+
comment: |
|
826
|
+
Represents the use of the `alias` keyword to alias a global variable.
|
827
|
+
|
828
|
+
alias $foo $bar
|
829
|
+
^^^^^^^^^^^^^^^
|
830
|
+
- name: AliasMethodNode
|
831
|
+
fields:
|
832
|
+
- name: new_name
|
833
|
+
type: node
|
834
|
+
kind:
|
835
|
+
- SymbolNode
|
836
|
+
- InterpolatedSymbolNode
|
837
|
+
comment: |
|
838
|
+
Represents the new name of the method that will be aliased.
|
839
|
+
|
840
|
+
alias foo bar
|
841
|
+
^^^
|
842
|
+
|
843
|
+
alias :foo :bar
|
844
|
+
^^^^
|
845
|
+
|
846
|
+
alias :"#{foo}" :"#{bar}"
|
847
|
+
^^^^^^^^^
|
848
|
+
- name: old_name
|
849
|
+
type: node
|
850
|
+
kind:
|
851
|
+
- SymbolNode
|
852
|
+
- InterpolatedSymbolNode
|
853
|
+
- on error: GlobalVariableReadNode # alias a $b
|
854
|
+
- on error: MissingNode # alias a 42
|
855
|
+
comment: |
|
856
|
+
Represents the old name of the method that will be aliased.
|
857
|
+
|
858
|
+
alias foo bar
|
859
|
+
^^^
|
860
|
+
|
861
|
+
alias :foo :bar
|
862
|
+
^^^^
|
863
|
+
|
864
|
+
alias :"#{foo}" :"#{bar}"
|
865
|
+
^^^^^^^^^
|
866
|
+
- name: keyword_loc
|
867
|
+
type: location
|
868
|
+
comment: |
|
869
|
+
Represents the location of the `alias` keyword.
|
870
|
+
|
871
|
+
alias foo bar
|
872
|
+
^^^^^
|
873
|
+
comment: |
|
874
|
+
Represents the use of the `alias` keyword to alias a method.
|
875
|
+
|
876
|
+
alias foo bar
|
877
|
+
^^^^^^^^^^^^^
|
878
|
+
- name: AlternationPatternNode
|
879
|
+
fields:
|
880
|
+
- name: left
|
881
|
+
type: node
|
882
|
+
kind: pattern expression
|
883
|
+
comment: |
|
884
|
+
Represents the left side of the expression.
|
885
|
+
|
886
|
+
foo => bar | baz
|
887
|
+
^^^
|
888
|
+
- name: right
|
889
|
+
type: node
|
890
|
+
kind: pattern expression
|
891
|
+
comment: |
|
892
|
+
Represents the right side of the expression.
|
893
|
+
|
894
|
+
foo => bar | baz
|
895
|
+
^^^
|
896
|
+
- name: operator_loc
|
897
|
+
type: location
|
898
|
+
comment: |
|
899
|
+
Represents the alternation operator location.
|
900
|
+
|
901
|
+
foo => bar | baz
|
902
|
+
^
|
903
|
+
comment: |
|
904
|
+
Represents an alternation pattern in pattern matching.
|
905
|
+
|
906
|
+
foo => bar | baz
|
907
|
+
^^^^^^^^^
|
908
|
+
- name: AndNode
|
909
|
+
fields:
|
910
|
+
- name: left
|
911
|
+
type: node
|
912
|
+
kind: non-void expression
|
913
|
+
comment: |
|
914
|
+
Represents the left side of the expression. It can be any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression).
|
915
|
+
|
916
|
+
left and right
|
917
|
+
^^^^
|
918
|
+
|
919
|
+
1 && 2
|
920
|
+
^
|
921
|
+
- name: right
|
922
|
+
type: node
|
923
|
+
kind: Node
|
924
|
+
comment: |
|
925
|
+
Represents the right side of the expression.
|
926
|
+
|
927
|
+
left && right
|
928
|
+
^^^^^
|
929
|
+
|
930
|
+
1 and 2
|
931
|
+
^
|
932
|
+
- name: operator_loc
|
933
|
+
type: location
|
934
|
+
comment: |
|
935
|
+
The location of the `and` keyword or the `&&` operator.
|
936
|
+
|
937
|
+
left and right
|
938
|
+
^^^
|
939
|
+
comment: |
|
940
|
+
Represents the use of the `&&` operator or the `and` keyword.
|
941
|
+
|
942
|
+
left and right
|
943
|
+
^^^^^^^^^^^^^^
|
944
|
+
- name: ArgumentsNode
|
945
|
+
flags: ArgumentsNodeFlags
|
946
|
+
fields:
|
947
|
+
- name: arguments
|
948
|
+
type: node[]
|
949
|
+
kind: non-void expression
|
950
|
+
comment: |
|
951
|
+
The list of arguments, if present. These can be any [non-void expressions](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression).
|
952
|
+
|
953
|
+
foo(bar, baz)
|
954
|
+
^^^^^^^^
|
955
|
+
comment: |
|
956
|
+
Represents a set of arguments to a method or a keyword.
|
957
|
+
|
958
|
+
return foo, bar, baz
|
959
|
+
^^^^^^^^^^^^^
|
960
|
+
- name: ArrayNode
|
961
|
+
flags: ArrayNodeFlags
|
962
|
+
fields:
|
963
|
+
- name: elements
|
964
|
+
type: node[]
|
965
|
+
kind: non-void expression
|
966
|
+
comment: Represent the list of zero or more [non-void expressions](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression) within the array.
|
967
|
+
- name: opening_loc
|
968
|
+
type: location?
|
969
|
+
comment: |
|
970
|
+
Represents the optional source location for the opening token.
|
971
|
+
|
972
|
+
[1,2,3] # "["
|
973
|
+
%w[foo bar baz] # "%w["
|
974
|
+
%I(apple orange banana) # "%I("
|
975
|
+
foo = 1, 2, 3 # nil
|
976
|
+
- name: closing_loc
|
977
|
+
type: location?
|
978
|
+
comment: |
|
979
|
+
Represents the optional source location for the closing token.
|
980
|
+
|
981
|
+
[1,2,3] # "]"
|
982
|
+
%w[foo bar baz] # "]"
|
983
|
+
%I(apple orange banana) # ")"
|
984
|
+
foo = 1, 2, 3 # nil
|
985
|
+
comment: |
|
986
|
+
Represents an array literal. This can be a regular array using brackets or a special array using % like %w or %i.
|
987
|
+
|
988
|
+
[1, 2, 3]
|
989
|
+
^^^^^^^^^
|
990
|
+
- name: ArrayPatternNode
|
991
|
+
fields:
|
992
|
+
- name: constant
|
993
|
+
type: node?
|
994
|
+
kind:
|
995
|
+
- ConstantPathNode
|
996
|
+
- ConstantReadNode
|
997
|
+
comment: |
|
998
|
+
Represents the optional constant preceding the Array
|
999
|
+
|
1000
|
+
foo in Bar[]
|
1001
|
+
^^^
|
1002
|
+
|
1003
|
+
foo in Bar[1, 2, 3]
|
1004
|
+
^^^
|
1005
|
+
|
1006
|
+
foo in Bar::Baz[1, 2, 3]
|
1007
|
+
^^^^^^^^
|
1008
|
+
- name: requireds
|
1009
|
+
type: node[]
|
1010
|
+
kind: pattern expression
|
1011
|
+
comment: |
|
1012
|
+
Represents the required elements of the array pattern.
|
1013
|
+
|
1014
|
+
foo in [1, 2]
|
1015
|
+
^ ^
|
1016
|
+
- name: rest
|
1017
|
+
type: node?
|
1018
|
+
kind: pattern expression
|
1019
|
+
comment: |
|
1020
|
+
Represents the rest element of the array pattern.
|
1021
|
+
|
1022
|
+
foo in *bar
|
1023
|
+
^^^^
|
1024
|
+
- name: posts
|
1025
|
+
type: node[]
|
1026
|
+
kind: pattern expression
|
1027
|
+
comment: |
|
1028
|
+
Represents the elements after the rest element of the array pattern.
|
1029
|
+
|
1030
|
+
foo in *bar, baz
|
1031
|
+
^^^
|
1032
|
+
- name: opening_loc
|
1033
|
+
type: location?
|
1034
|
+
comment: |
|
1035
|
+
Represents the opening location of the array pattern.
|
1036
|
+
|
1037
|
+
foo in [1, 2]
|
1038
|
+
^
|
1039
|
+
- name: closing_loc
|
1040
|
+
type: location?
|
1041
|
+
comment: |
|
1042
|
+
Represents the closing location of the array pattern.
|
1043
|
+
|
1044
|
+
foo in [1, 2]
|
1045
|
+
^
|
1046
|
+
comment: |
|
1047
|
+
Represents an array pattern in pattern matching.
|
1048
|
+
|
1049
|
+
foo in 1, 2
|
1050
|
+
^^^^^^^^^^^
|
1051
|
+
|
1052
|
+
foo in [1, 2]
|
1053
|
+
^^^^^^^^^^^^^
|
1054
|
+
|
1055
|
+
foo in *bar
|
1056
|
+
^^^^^^^^^^^
|
1057
|
+
|
1058
|
+
foo in Bar[]
|
1059
|
+
^^^^^^^^^^^^
|
1060
|
+
|
1061
|
+
foo in Bar[1, 2, 3]
|
1062
|
+
^^^^^^^^^^^^^^^^^^^
|
1063
|
+
- name: AssocNode
|
1064
|
+
fields:
|
1065
|
+
- name: key
|
1066
|
+
type: node
|
1067
|
+
kind: non-void expression
|
1068
|
+
comment: |
|
1069
|
+
The key of the association. This can be any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression).
|
1070
|
+
|
1071
|
+
{ a: b }
|
1072
|
+
^
|
1073
|
+
|
1074
|
+
{ foo => bar }
|
1075
|
+
^^^
|
1076
|
+
|
1077
|
+
{ def a; end => 1 }
|
1078
|
+
^^^^^^^^^^
|
1079
|
+
- name: value
|
1080
|
+
type: node
|
1081
|
+
kind: non-void expression
|
1082
|
+
comment: |
|
1083
|
+
The value of the association, if present. This can be any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression).
|
1084
|
+
|
1085
|
+
{ foo => bar }
|
1086
|
+
^^^
|
1087
|
+
|
1088
|
+
{ x: 1 }
|
1089
|
+
^
|
1090
|
+
- name: operator_loc
|
1091
|
+
type: location?
|
1092
|
+
comment: |
|
1093
|
+
The location of the `=>` operator, if present.
|
1094
|
+
|
1095
|
+
{ foo => bar }
|
1096
|
+
^^
|
1097
|
+
comment: |
|
1098
|
+
Represents a hash key/value pair.
|
1099
|
+
|
1100
|
+
{ a => b }
|
1101
|
+
^^^^^^
|
1102
|
+
- name: AssocSplatNode
|
1103
|
+
fields:
|
1104
|
+
- name: value
|
1105
|
+
type: node?
|
1106
|
+
kind: non-void expression
|
1107
|
+
comment: |
|
1108
|
+
The value to be splatted, if present. Will be missing when keyword rest argument forwarding is used.
|
1109
|
+
|
1110
|
+
{ **foo }
|
1111
|
+
^^^
|
1112
|
+
- name: operator_loc
|
1113
|
+
type: location
|
1114
|
+
comment: |
|
1115
|
+
The location of the `**` operator.
|
1116
|
+
|
1117
|
+
{ **x }
|
1118
|
+
^^
|
1119
|
+
comment: |
|
1120
|
+
Represents a splat in a hash literal.
|
1121
|
+
|
1122
|
+
{ **foo }
|
1123
|
+
^^^^^
|
1124
|
+
- name: BackReferenceReadNode
|
1125
|
+
fields:
|
1126
|
+
- name: name
|
1127
|
+
type: constant
|
1128
|
+
comment: |
|
1129
|
+
The name of the back-reference variable, including the leading `$`.
|
1130
|
+
|
1131
|
+
$& # name `:$&`
|
1132
|
+
|
1133
|
+
$+ # name `:$+`
|
1134
|
+
comment: |
|
1135
|
+
Represents reading a reference to a field in the previous match.
|
1136
|
+
|
1137
|
+
$'
|
1138
|
+
^^
|
1139
|
+
- name: BeginNode
|
1140
|
+
fields:
|
1141
|
+
- name: begin_keyword_loc
|
1142
|
+
type: location?
|
1143
|
+
comment: |
|
1144
|
+
Represents the location of the `begin` keyword.
|
1145
|
+
|
1146
|
+
begin x end
|
1147
|
+
^^^^^
|
1148
|
+
- name: statements
|
1149
|
+
type: node?
|
1150
|
+
kind: StatementsNode
|
1151
|
+
comment: |
|
1152
|
+
Represents the statements within the begin block.
|
1153
|
+
|
1154
|
+
begin x end
|
1155
|
+
^
|
1156
|
+
- name: rescue_clause
|
1157
|
+
type: node?
|
1158
|
+
kind: RescueNode
|
1159
|
+
comment: |
|
1160
|
+
Represents the rescue clause within the begin block.
|
1161
|
+
|
1162
|
+
begin x; rescue y; end
|
1163
|
+
^^^^^^^^
|
1164
|
+
- name: else_clause
|
1165
|
+
type: node?
|
1166
|
+
kind: ElseNode
|
1167
|
+
comment: |
|
1168
|
+
Represents the else clause within the begin block.
|
1169
|
+
|
1170
|
+
begin x; rescue y; else z; end
|
1171
|
+
^^^^^^
|
1172
|
+
- name: ensure_clause
|
1173
|
+
type: node?
|
1174
|
+
kind: EnsureNode
|
1175
|
+
comment: |
|
1176
|
+
Represents the ensure clause within the begin block.
|
1177
|
+
|
1178
|
+
begin x; ensure y; end
|
1179
|
+
^^^^^^^^
|
1180
|
+
- name: end_keyword_loc
|
1181
|
+
type: location?
|
1182
|
+
comment: |
|
1183
|
+
Represents the location of the `end` keyword.
|
1184
|
+
|
1185
|
+
begin x end
|
1186
|
+
^^^
|
1187
|
+
newline: false
|
1188
|
+
comment: |
|
1189
|
+
Represents a begin statement.
|
1190
|
+
|
1191
|
+
begin
|
1192
|
+
foo
|
1193
|
+
end
|
1194
|
+
^^^^^
|
1195
|
+
- name: BlockArgumentNode
|
1196
|
+
fields:
|
1197
|
+
- name: expression
|
1198
|
+
type: node?
|
1199
|
+
kind: non-void expression
|
1200
|
+
comment: |
|
1201
|
+
The expression that is being passed as a block argument. This can be any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression).
|
1202
|
+
|
1203
|
+
foo(&args)
|
1204
|
+
^^^^^
|
1205
|
+
- name: operator_loc
|
1206
|
+
type: location
|
1207
|
+
comment: |
|
1208
|
+
Represents the location of the `&` operator.
|
1209
|
+
|
1210
|
+
foo(&args)
|
1211
|
+
^
|
1212
|
+
comment: |
|
1213
|
+
Represents a block argument using `&`.
|
1214
|
+
|
1215
|
+
bar(&args)
|
1216
|
+
^^^^^^^^^^
|
1217
|
+
- name: BlockLocalVariableNode
|
1218
|
+
flags: ParameterFlags
|
1219
|
+
fields:
|
1220
|
+
- name: name
|
1221
|
+
type: constant
|
1222
|
+
comment: |
|
1223
|
+
The name of the block local variable.
|
1224
|
+
|
1225
|
+
a { |; b| } # name `:b`
|
1226
|
+
^
|
1227
|
+
comment: |
|
1228
|
+
Represents a block local variable.
|
1229
|
+
|
1230
|
+
a { |; b| }
|
1231
|
+
^
|
1232
|
+
- name: BlockNode
|
1233
|
+
fields:
|
1234
|
+
- name: locals
|
1235
|
+
type: constant[]
|
1236
|
+
comment: |
|
1237
|
+
The local variables declared in the block.
|
1238
|
+
|
1239
|
+
[1, 2, 3].each { |i| puts x } # locals: [:i]
|
1240
|
+
^
|
1241
|
+
- name: parameters
|
1242
|
+
type: node?
|
1243
|
+
kind:
|
1244
|
+
- BlockParametersNode
|
1245
|
+
- NumberedParametersNode
|
1246
|
+
- ItParametersNode
|
1247
|
+
comment: |
|
1248
|
+
The parameters of the block.
|
1249
|
+
|
1250
|
+
[1, 2, 3].each { |i| puts x }
|
1251
|
+
^^^
|
1252
|
+
[1, 2, 3].each { puts _1 }
|
1253
|
+
^^^^^^^^^^^
|
1254
|
+
[1, 2, 3].each { puts it }
|
1255
|
+
^^^^^^^^^^^
|
1256
|
+
- name: body
|
1257
|
+
type: node?
|
1258
|
+
kind:
|
1259
|
+
- StatementsNode
|
1260
|
+
- BeginNode
|
1261
|
+
comment: |
|
1262
|
+
The body of the block.
|
1263
|
+
|
1264
|
+
[1, 2, 3].each { |i| puts x }
|
1265
|
+
^^^^^^
|
1266
|
+
- name: opening_loc
|
1267
|
+
type: location
|
1268
|
+
comment: |
|
1269
|
+
Represents the location of the opening `|`.
|
1270
|
+
|
1271
|
+
[1, 2, 3].each { |i| puts x }
|
1272
|
+
^
|
1273
|
+
- name: closing_loc
|
1274
|
+
type: location
|
1275
|
+
comment: |
|
1276
|
+
Represents the location of the closing `|`.
|
1277
|
+
|
1278
|
+
[1, 2, 3].each { |i| puts x }
|
1279
|
+
^
|
1280
|
+
comment: |
|
1281
|
+
Represents a block of ruby code.
|
1282
|
+
|
1283
|
+
[1, 2, 3].each { |i| puts x }
|
1284
|
+
^^^^^^^^^^^^^^
|
1285
|
+
- name: BlockParameterNode
|
1286
|
+
flags: ParameterFlags
|
1287
|
+
fields:
|
1288
|
+
- name: name
|
1289
|
+
type: constant?
|
1290
|
+
comment: |
|
1291
|
+
The name of the block parameter.
|
1292
|
+
|
1293
|
+
def a(&b) # name `:b`
|
1294
|
+
^
|
1295
|
+
end
|
1296
|
+
- name: name_loc
|
1297
|
+
type: location?
|
1298
|
+
comment: |
|
1299
|
+
Represents the location of the block parameter name.
|
1300
|
+
|
1301
|
+
def a(&b)
|
1302
|
+
^
|
1303
|
+
- name: operator_loc
|
1304
|
+
type: location
|
1305
|
+
comment: |
|
1306
|
+
Represents the location of the `&` operator.
|
1307
|
+
|
1308
|
+
def a(&b)
|
1309
|
+
^
|
1310
|
+
end
|
1311
|
+
comment: |
|
1312
|
+
Represents a block parameter of a method, block, or lambda definition.
|
1313
|
+
|
1314
|
+
def a(&b)
|
1315
|
+
^^
|
1316
|
+
end
|
1317
|
+
- name: BlockParametersNode
|
1318
|
+
fields:
|
1319
|
+
- name: parameters
|
1320
|
+
type: node?
|
1321
|
+
kind: ParametersNode
|
1322
|
+
comment: |
|
1323
|
+
Represents the parameters of the block.
|
1324
|
+
|
1325
|
+
-> (a, b = 1; local) { }
|
1326
|
+
^^^^^^^^
|
1327
|
+
|
1328
|
+
foo do |a, b = 1; local|
|
1329
|
+
^^^^^^^^
|
1330
|
+
end
|
1331
|
+
- name: locals
|
1332
|
+
type: node[]
|
1333
|
+
kind: BlockLocalVariableNode
|
1334
|
+
comment: |
|
1335
|
+
Represents the local variables of the block.
|
1336
|
+
|
1337
|
+
-> (a, b = 1; local) { }
|
1338
|
+
^^^^^
|
1339
|
+
|
1340
|
+
foo do |a, b = 1; local|
|
1341
|
+
^^^^^
|
1342
|
+
end
|
1343
|
+
- name: opening_loc
|
1344
|
+
type: location?
|
1345
|
+
comment: |
|
1346
|
+
Represents the opening location of the block parameters.
|
1347
|
+
|
1348
|
+
-> (a, b = 1; local) { }
|
1349
|
+
^
|
1350
|
+
|
1351
|
+
foo do |a, b = 1; local|
|
1352
|
+
^
|
1353
|
+
end
|
1354
|
+
- name: closing_loc
|
1355
|
+
type: location?
|
1356
|
+
comment: |
|
1357
|
+
Represents the closing location of the block parameters.
|
1358
|
+
|
1359
|
+
-> (a, b = 1; local) { }
|
1360
|
+
^
|
1361
|
+
|
1362
|
+
foo do |a, b = 1; local|
|
1363
|
+
^
|
1364
|
+
end
|
1365
|
+
comment: |
|
1366
|
+
Represents a block's parameters declaration.
|
1367
|
+
|
1368
|
+
-> (a, b = 1; local) { }
|
1369
|
+
^^^^^^^^^^^^^^^^^
|
1370
|
+
|
1371
|
+
foo do |a, b = 1; local|
|
1372
|
+
^^^^^^^^^^^^^^^^^
|
1373
|
+
end
|
1374
|
+
- name: BreakNode
|
1375
|
+
fields:
|
1376
|
+
- name: arguments
|
1377
|
+
type: node?
|
1378
|
+
kind: ArgumentsNode
|
1379
|
+
comment: |
|
1380
|
+
The arguments to the break statement, if present. These can be any [non-void expressions](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression).
|
1381
|
+
|
1382
|
+
break foo
|
1383
|
+
^^^
|
1384
|
+
- name: keyword_loc
|
1385
|
+
type: location
|
1386
|
+
comment: |
|
1387
|
+
The location of the `break` keyword.
|
1388
|
+
|
1389
|
+
break foo
|
1390
|
+
^^^^^
|
1391
|
+
comment: |
|
1392
|
+
Represents the use of the `break` keyword.
|
1393
|
+
|
1394
|
+
break foo
|
1395
|
+
^^^^^^^^^
|
1396
|
+
- name: CallAndWriteNode
|
1397
|
+
flags: CallNodeFlags
|
1398
|
+
fields:
|
1399
|
+
- name: receiver
|
1400
|
+
type: node?
|
1401
|
+
kind: non-void expression
|
1402
|
+
comment: |
|
1403
|
+
The object that the method is being called on. This can be either `nil` or any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression).
|
1404
|
+
|
1405
|
+
foo.bar &&= value
|
1406
|
+
^^^
|
1407
|
+
- name: call_operator_loc
|
1408
|
+
type: location?
|
1409
|
+
comment: |
|
1410
|
+
Represents the location of the call operator.
|
1411
|
+
|
1412
|
+
foo.bar &&= value
|
1413
|
+
^
|
1414
|
+
- name: message_loc
|
1415
|
+
type: location?
|
1416
|
+
comment: |
|
1417
|
+
Represents the location of the message.
|
1418
|
+
|
1419
|
+
foo.bar &&= value
|
1420
|
+
^^^
|
1421
|
+
- name: read_name
|
1422
|
+
type: constant
|
1423
|
+
comment: |
|
1424
|
+
Represents the name of the method being called.
|
1425
|
+
|
1426
|
+
foo.bar &&= value # read_name `:bar`
|
1427
|
+
^^^
|
1428
|
+
- name: write_name
|
1429
|
+
type: constant
|
1430
|
+
comment: |
|
1431
|
+
Represents the name of the method being written to.
|
1432
|
+
|
1433
|
+
foo.bar &&= value # write_name `:bar=`
|
1434
|
+
^^^
|
1435
|
+
- name: operator_loc
|
1436
|
+
type: location
|
1437
|
+
comment: |
|
1438
|
+
Represents the location of the operator.
|
1439
|
+
|
1440
|
+
foo.bar &&= value
|
1441
|
+
^^^
|
1442
|
+
- name: value
|
1443
|
+
type: node
|
1444
|
+
kind: non-void expression
|
1445
|
+
comment: |
|
1446
|
+
Represents the value being assigned.
|
1447
|
+
|
1448
|
+
foo.bar &&= value
|
1449
|
+
^^^^^
|
1450
|
+
comment: |
|
1451
|
+
Represents the use of the `&&=` operator on a call.
|
1452
|
+
|
1453
|
+
foo.bar &&= value
|
1454
|
+
^^^^^^^^^^^^^^^^^
|
1455
|
+
- name: CallNode
|
1456
|
+
flags: CallNodeFlags
|
1457
|
+
fields:
|
1458
|
+
- name: receiver
|
1459
|
+
type: node?
|
1460
|
+
kind: non-void expression
|
1461
|
+
comment: |
|
1462
|
+
The object that the method is being called on. This can be either `nil` or any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression).
|
1463
|
+
|
1464
|
+
foo.bar
|
1465
|
+
^^^
|
1466
|
+
|
1467
|
+
+foo
|
1468
|
+
^^^
|
1469
|
+
|
1470
|
+
foo + bar
|
1471
|
+
^^^
|
1472
|
+
- name: call_operator_loc
|
1473
|
+
type: location?
|
1474
|
+
comment: |
|
1475
|
+
Represents the location of the call operator.
|
1476
|
+
|
1477
|
+
foo.bar
|
1478
|
+
^
|
1479
|
+
|
1480
|
+
foo&.bar
|
1481
|
+
^^
|
1482
|
+
- name: name
|
1483
|
+
type: constant
|
1484
|
+
comment: |
|
1485
|
+
Represents the name of the method being called.
|
1486
|
+
|
1487
|
+
foo.bar # name `:foo`
|
1488
|
+
^^^
|
1489
|
+
- name: message_loc
|
1490
|
+
type: location?
|
1491
|
+
comment: |
|
1492
|
+
Represents the location of the message.
|
1493
|
+
|
1494
|
+
foo.bar
|
1495
|
+
^^^
|
1496
|
+
- name: opening_loc
|
1497
|
+
type: location?
|
1498
|
+
comment: |
|
1499
|
+
Represents the location of the left parenthesis.
|
1500
|
+
foo(bar)
|
1501
|
+
^
|
1502
|
+
- name: arguments
|
1503
|
+
type: node?
|
1504
|
+
kind: ArgumentsNode
|
1505
|
+
comment: |
|
1506
|
+
Represents the arguments to the method call. These can be any [non-void expressions](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression).
|
1507
|
+
|
1508
|
+
foo(bar)
|
1509
|
+
^^^
|
1510
|
+
- name: closing_loc
|
1511
|
+
type: location?
|
1512
|
+
comment: |
|
1513
|
+
Represents the location of the right parenthesis.
|
1514
|
+
|
1515
|
+
foo(bar)
|
1516
|
+
^
|
1517
|
+
- name: block
|
1518
|
+
type: node?
|
1519
|
+
kind:
|
1520
|
+
- BlockNode
|
1521
|
+
- BlockArgumentNode
|
1522
|
+
comment: |
|
1523
|
+
Represents the block that is being passed to the method.
|
1524
|
+
|
1525
|
+
foo { |a| a }
|
1526
|
+
^^^^^^^^^
|
1527
|
+
comment: |
|
1528
|
+
Represents a method call, in all of the various forms that can take.
|
1529
|
+
|
1530
|
+
foo
|
1531
|
+
^^^
|
1532
|
+
|
1533
|
+
foo()
|
1534
|
+
^^^^^
|
1535
|
+
|
1536
|
+
+foo
|
1537
|
+
^^^^
|
1538
|
+
|
1539
|
+
foo + bar
|
1540
|
+
^^^^^^^^^
|
1541
|
+
|
1542
|
+
foo.bar
|
1543
|
+
^^^^^^^
|
1544
|
+
|
1545
|
+
foo&.bar
|
1546
|
+
^^^^^^^^
|
1547
|
+
- name: CallOperatorWriteNode
|
1548
|
+
flags: CallNodeFlags
|
1549
|
+
fields:
|
1550
|
+
- name: receiver
|
1551
|
+
type: node?
|
1552
|
+
kind: non-void expression
|
1553
|
+
comment: |
|
1554
|
+
The object that the method is being called on. This can be either `nil` or any [non-void expressions](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression).
|
1555
|
+
|
1556
|
+
foo.bar += value
|
1557
|
+
^^^
|
1558
|
+
- name: call_operator_loc
|
1559
|
+
type: location?
|
1560
|
+
comment: |
|
1561
|
+
Represents the location of the call operator.
|
1562
|
+
|
1563
|
+
foo.bar += value
|
1564
|
+
^
|
1565
|
+
- name: message_loc
|
1566
|
+
type: location?
|
1567
|
+
comment: |
|
1568
|
+
Represents the location of the message.
|
1569
|
+
|
1570
|
+
foo.bar += value
|
1571
|
+
^^^
|
1572
|
+
- name: read_name
|
1573
|
+
type: constant
|
1574
|
+
comment: |
|
1575
|
+
Represents the name of the method being called.
|
1576
|
+
|
1577
|
+
foo.bar += value # read_name `:bar`
|
1578
|
+
^^^
|
1579
|
+
- name: write_name
|
1580
|
+
type: constant
|
1581
|
+
comment: |
|
1582
|
+
Represents the name of the method being written to.
|
1583
|
+
|
1584
|
+
foo.bar += value # write_name `:bar=`
|
1585
|
+
^^^
|
1586
|
+
- name: binary_operator
|
1587
|
+
type: constant
|
1588
|
+
comment: |
|
1589
|
+
Represents the binary operator being used.
|
1590
|
+
|
1591
|
+
foo.bar += value # binary_operator `:+`
|
1592
|
+
^
|
1593
|
+
- name: binary_operator_loc
|
1594
|
+
type: location
|
1595
|
+
comment: |
|
1596
|
+
Represents the location of the binary operator.
|
1597
|
+
|
1598
|
+
foo.bar += value
|
1599
|
+
^^
|
1600
|
+
- name: value
|
1601
|
+
type: node
|
1602
|
+
kind: non-void expression
|
1603
|
+
comment: |
|
1604
|
+
Represents the value being assigned.
|
1605
|
+
|
1606
|
+
foo.bar += value
|
1607
|
+
^^^^^
|
1608
|
+
comment: |
|
1609
|
+
Represents the use of an assignment operator on a call.
|
1610
|
+
|
1611
|
+
foo.bar += baz
|
1612
|
+
^^^^^^^^^^^^^^
|
1613
|
+
- name: CallOrWriteNode
|
1614
|
+
flags: CallNodeFlags
|
1615
|
+
fields:
|
1616
|
+
- name: receiver
|
1617
|
+
type: node?
|
1618
|
+
kind: non-void expression
|
1619
|
+
comment: |
|
1620
|
+
The object that the method is being called on. This can be either `nil` or any [non-void expressions](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression).
|
1621
|
+
|
1622
|
+
foo.bar ||= value
|
1623
|
+
^^^
|
1624
|
+
- name: call_operator_loc
|
1625
|
+
type: location?
|
1626
|
+
comment: |
|
1627
|
+
Represents the location of the call operator.
|
1628
|
+
|
1629
|
+
foo.bar ||= value
|
1630
|
+
^
|
1631
|
+
- name: message_loc
|
1632
|
+
type: location?
|
1633
|
+
comment: |
|
1634
|
+
Represents the location of the message.
|
1635
|
+
|
1636
|
+
foo.bar ||= value
|
1637
|
+
^^^
|
1638
|
+
- name: read_name
|
1639
|
+
type: constant
|
1640
|
+
comment: |
|
1641
|
+
Represents the name of the method being called.
|
1642
|
+
|
1643
|
+
foo.bar ||= value # read_name `:bar`
|
1644
|
+
^^^
|
1645
|
+
- name: write_name
|
1646
|
+
type: constant
|
1647
|
+
comment: |
|
1648
|
+
Represents the name of the method being written to.
|
1649
|
+
|
1650
|
+
foo.bar ||= value # write_name `:bar=`
|
1651
|
+
^^^
|
1652
|
+
- name: operator_loc
|
1653
|
+
type: location
|
1654
|
+
comment: |
|
1655
|
+
Represents the location of the operator.
|
1656
|
+
|
1657
|
+
foo.bar ||= value
|
1658
|
+
^^^
|
1659
|
+
- name: value
|
1660
|
+
type: node
|
1661
|
+
kind: non-void expression
|
1662
|
+
comment: |
|
1663
|
+
Represents the value being assigned.
|
1664
|
+
|
1665
|
+
foo.bar ||= value
|
1666
|
+
^^^^^
|
1667
|
+
comment: |
|
1668
|
+
Represents the use of the `||=` operator on a call.
|
1669
|
+
|
1670
|
+
foo.bar ||= value
|
1671
|
+
^^^^^^^^^^^^^^^^^
|
1672
|
+
- name: CallTargetNode
|
1673
|
+
flags: CallNodeFlags
|
1674
|
+
fields:
|
1675
|
+
- name: receiver
|
1676
|
+
type: node
|
1677
|
+
kind: non-void expression
|
1678
|
+
comment: |
|
1679
|
+
The object that the method is being called on. This can be any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression).
|
1680
|
+
|
1681
|
+
foo.bar = 1
|
1682
|
+
^^^
|
1683
|
+
- name: call_operator_loc
|
1684
|
+
type: location
|
1685
|
+
comment: |
|
1686
|
+
Represents the location of the call operator.
|
1687
|
+
|
1688
|
+
foo.bar = 1
|
1689
|
+
^
|
1690
|
+
- name: name
|
1691
|
+
type: constant
|
1692
|
+
comment: |
|
1693
|
+
Represents the name of the method being called.
|
1694
|
+
|
1695
|
+
foo.bar = 1 # name `:foo`
|
1696
|
+
^^^
|
1697
|
+
- name: message_loc
|
1698
|
+
type: location
|
1699
|
+
comment: |
|
1700
|
+
Represents the location of the message.
|
1701
|
+
|
1702
|
+
foo.bar = 1
|
1703
|
+
^^^
|
1704
|
+
comment: |
|
1705
|
+
Represents assigning to a method call.
|
1706
|
+
|
1707
|
+
foo.bar, = 1
|
1708
|
+
^^^^^^^
|
1709
|
+
|
1710
|
+
begin
|
1711
|
+
rescue => foo.bar
|
1712
|
+
^^^^^^^
|
1713
|
+
end
|
1714
|
+
|
1715
|
+
for foo.bar in baz do end
|
1716
|
+
^^^^^^^
|
1717
|
+
- name: CapturePatternNode
|
1718
|
+
fields:
|
1719
|
+
- name: value
|
1720
|
+
type: node
|
1721
|
+
kind: pattern expression
|
1722
|
+
comment: |
|
1723
|
+
Represents the value to capture.
|
1724
|
+
|
1725
|
+
foo => bar
|
1726
|
+
^^^
|
1727
|
+
- name: target
|
1728
|
+
type: node
|
1729
|
+
kind: LocalVariableTargetNode
|
1730
|
+
comment: |
|
1731
|
+
Represents the target of the capture.
|
1732
|
+
|
1733
|
+
foo => bar
|
1734
|
+
^^^
|
1735
|
+
- name: operator_loc
|
1736
|
+
type: location
|
1737
|
+
comment: |
|
1738
|
+
Represents the location of the `=>` operator.
|
1739
|
+
|
1740
|
+
foo => bar
|
1741
|
+
^^
|
1742
|
+
comment: |
|
1743
|
+
Represents assigning to a local variable in pattern matching.
|
1744
|
+
|
1745
|
+
foo => [bar => baz]
|
1746
|
+
^^^^^^^^^^^^
|
1747
|
+
- name: CaseMatchNode
|
1748
|
+
fields:
|
1749
|
+
- name: predicate
|
1750
|
+
type: node?
|
1751
|
+
kind: non-void expression
|
1752
|
+
comment: |
|
1753
|
+
Represents the predicate of the case match. This can be either `nil` or any [non-void expressions](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression).
|
1754
|
+
|
1755
|
+
case true; in false; end
|
1756
|
+
^^^^
|
1757
|
+
- name: conditions
|
1758
|
+
type: node[]
|
1759
|
+
kind: InNode
|
1760
|
+
comment: |
|
1761
|
+
Represents the conditions of the case match.
|
1762
|
+
|
1763
|
+
case true; in false; end
|
1764
|
+
^^^^^^^^
|
1765
|
+
- name: else_clause
|
1766
|
+
type: node?
|
1767
|
+
kind: ElseNode
|
1768
|
+
comment: |
|
1769
|
+
Represents the else clause of the case match.
|
1770
|
+
|
1771
|
+
case true; in false; else; end
|
1772
|
+
^^^^
|
1773
|
+
- name: case_keyword_loc
|
1774
|
+
type: location
|
1775
|
+
comment: |
|
1776
|
+
Represents the location of the `case` keyword.
|
1777
|
+
|
1778
|
+
case true; in false; end
|
1779
|
+
^^^^
|
1780
|
+
- name: end_keyword_loc
|
1781
|
+
type: location
|
1782
|
+
comment: |
|
1783
|
+
Represents the location of the `end` keyword.
|
1784
|
+
|
1785
|
+
case true; in false; end
|
1786
|
+
^^^
|
1787
|
+
comment: |
|
1788
|
+
Represents the use of a case statement for pattern matching.
|
1789
|
+
|
1790
|
+
case true
|
1791
|
+
in false
|
1792
|
+
end
|
1793
|
+
^^^^^^^^^
|
1794
|
+
- name: CaseNode
|
1795
|
+
fields:
|
1796
|
+
- name: predicate
|
1797
|
+
type: node?
|
1798
|
+
kind: non-void expression
|
1799
|
+
comment: |
|
1800
|
+
Represents the predicate of the case statement. This can be either `nil` or any [non-void expressions](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression).
|
1801
|
+
|
1802
|
+
case true; when false; end
|
1803
|
+
^^^^
|
1804
|
+
- name: conditions
|
1805
|
+
type: node[]
|
1806
|
+
kind: WhenNode
|
1807
|
+
comment: |
|
1808
|
+
Represents the conditions of the case statement.
|
1809
|
+
|
1810
|
+
case true; when false; end
|
1811
|
+
^^^^^^^^^^
|
1812
|
+
- name: else_clause
|
1813
|
+
type: node?
|
1814
|
+
kind: ElseNode
|
1815
|
+
comment: |
|
1816
|
+
Represents the else clause of the case statement.
|
1817
|
+
|
1818
|
+
case true; when false; else; end
|
1819
|
+
^^^^
|
1820
|
+
- name: case_keyword_loc
|
1821
|
+
type: location
|
1822
|
+
comment: |
|
1823
|
+
Represents the location of the `case` keyword.
|
1824
|
+
|
1825
|
+
case true; when false; end
|
1826
|
+
^^^^
|
1827
|
+
- name: end_keyword_loc
|
1828
|
+
type: location
|
1829
|
+
comment: |
|
1830
|
+
Represents the location of the `end` keyword.
|
1831
|
+
|
1832
|
+
case true; when false; end
|
1833
|
+
^^^
|
1834
|
+
comment: |
|
1835
|
+
Represents the use of a case statement.
|
1836
|
+
|
1837
|
+
case true
|
1838
|
+
when false
|
1839
|
+
end
|
1840
|
+
^^^^^^^^^^
|
1841
|
+
- name: ClassNode
|
1842
|
+
fields:
|
1843
|
+
- name: locals
|
1844
|
+
type: constant[]
|
1845
|
+
- name: class_keyword_loc
|
1846
|
+
type: location
|
1847
|
+
comment: |
|
1848
|
+
Represents the location of the `class` keyword.
|
1849
|
+
|
1850
|
+
class Foo end
|
1851
|
+
^^^^^
|
1852
|
+
- name: constant_path
|
1853
|
+
type: node
|
1854
|
+
kind:
|
1855
|
+
- ConstantReadNode
|
1856
|
+
- ConstantPathNode
|
1857
|
+
- on error: CallNode # class 0.X end
|
1858
|
+
- name: inheritance_operator_loc
|
1859
|
+
type: location?
|
1860
|
+
comment: |
|
1861
|
+
Represents the location of the `<` operator.
|
1862
|
+
|
1863
|
+
class Foo < Bar
|
1864
|
+
^
|
1865
|
+
- name: superclass
|
1866
|
+
type: node?
|
1867
|
+
kind: non-void expression
|
1868
|
+
comment: |
|
1869
|
+
Represents the superclass of the class.
|
1870
|
+
|
1871
|
+
class Foo < Bar
|
1872
|
+
^^^
|
1873
|
+
- name: body
|
1874
|
+
type: node?
|
1875
|
+
kind:
|
1876
|
+
- StatementsNode
|
1877
|
+
- BeginNode
|
1878
|
+
comment: |
|
1879
|
+
Represents the body of the class.
|
1880
|
+
|
1881
|
+
class Foo
|
1882
|
+
foo
|
1883
|
+
^^^
|
1884
|
+
- name: end_keyword_loc
|
1885
|
+
type: location
|
1886
|
+
comment: |
|
1887
|
+
Represents the location of the `end` keyword.
|
1888
|
+
|
1889
|
+
class Foo end
|
1890
|
+
^^^
|
1891
|
+
- name: name
|
1892
|
+
type: constant
|
1893
|
+
comment: |
|
1894
|
+
The name of the class.
|
1895
|
+
|
1896
|
+
class Foo end # name `:Foo`
|
1897
|
+
comment: |
|
1898
|
+
Represents a class declaration involving the `class` keyword.
|
1899
|
+
|
1900
|
+
class Foo end
|
1901
|
+
^^^^^^^^^^^^^
|
1902
|
+
- name: ClassVariableAndWriteNode
|
1903
|
+
fields:
|
1904
|
+
- name: name
|
1905
|
+
type: constant
|
1906
|
+
comment: |
|
1907
|
+
The name of the class variable, which is a `@@` followed by an [identifier](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#identifiers).
|
1908
|
+
|
1909
|
+
@@target &&= value # name `:@@target`
|
1910
|
+
^^^^^^^^
|
1911
|
+
- name: name_loc
|
1912
|
+
type: location
|
1913
|
+
comment: |
|
1914
|
+
Represents the location of the variable name.
|
1915
|
+
|
1916
|
+
@@target &&= value
|
1917
|
+
^^^^^^^^
|
1918
|
+
- name: operator_loc
|
1919
|
+
type: location
|
1920
|
+
comment: |
|
1921
|
+
Represents the location of the `&&=` operator.
|
1922
|
+
|
1923
|
+
@@target &&= value
|
1924
|
+
^^^
|
1925
|
+
- name: value
|
1926
|
+
type: node
|
1927
|
+
kind: non-void expression
|
1928
|
+
comment: |
|
1929
|
+
Represents the value being assigned. This can be any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression).
|
1930
|
+
|
1931
|
+
@@target &&= value
|
1932
|
+
^^^^^
|
1933
|
+
comment: |
|
1934
|
+
Represents the use of the `&&=` operator for assignment to a class variable.
|
1935
|
+
|
1936
|
+
@@target &&= value
|
1937
|
+
^^^^^^^^^^^^^^^^^^
|
1938
|
+
- name: ClassVariableOperatorWriteNode
|
1939
|
+
fields:
|
1940
|
+
- name: name
|
1941
|
+
type: constant
|
1942
|
+
- name: name_loc
|
1943
|
+
type: location
|
1944
|
+
- name: binary_operator_loc
|
1945
|
+
type: location
|
1946
|
+
- name: value
|
1947
|
+
type: node
|
1948
|
+
kind: non-void expression
|
1949
|
+
- name: binary_operator
|
1950
|
+
type: constant
|
1951
|
+
comment: |
|
1952
|
+
Represents assigning to a class variable using an operator that isn't `=`.
|
1953
|
+
|
1954
|
+
@@target += value
|
1955
|
+
^^^^^^^^^^^^^^^^^
|
1956
|
+
- name: ClassVariableOrWriteNode
|
1957
|
+
fields:
|
1958
|
+
- name: name
|
1959
|
+
type: constant
|
1960
|
+
- name: name_loc
|
1961
|
+
type: location
|
1962
|
+
- name: operator_loc
|
1963
|
+
type: location
|
1964
|
+
- name: value
|
1965
|
+
type: node
|
1966
|
+
kind: non-void expression
|
1967
|
+
comment: |
|
1968
|
+
Represents the use of the `||=` operator for assignment to a class variable.
|
1969
|
+
|
1970
|
+
@@target ||= value
|
1971
|
+
^^^^^^^^^^^^^^^^^^
|
1972
|
+
- name: ClassVariableReadNode
|
1973
|
+
fields:
|
1974
|
+
- name: name
|
1975
|
+
type: constant
|
1976
|
+
comment: |
|
1977
|
+
The name of the class variable, which is a `@@` followed by an [identifier](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#identifiers).
|
1978
|
+
|
1979
|
+
@@abc # name `:@@abc`
|
1980
|
+
|
1981
|
+
@@_test # name `:@@_test`
|
1982
|
+
comment: |
|
1983
|
+
Represents referencing a class variable.
|
1984
|
+
|
1985
|
+
@@foo
|
1986
|
+
^^^^^
|
1987
|
+
- name: ClassVariableTargetNode
|
1988
|
+
fields:
|
1989
|
+
- name: name
|
1990
|
+
type: constant
|
1991
|
+
comment: |
|
1992
|
+
Represents writing to a class variable in a context that doesn't have an explicit value.
|
1993
|
+
|
1994
|
+
@@foo, @@bar = baz
|
1995
|
+
^^^^^ ^^^^^
|
1996
|
+
- name: ClassVariableWriteNode
|
1997
|
+
fields:
|
1998
|
+
- name: name
|
1999
|
+
type: constant
|
2000
|
+
comment: |
|
2001
|
+
The name of the class variable, which is a `@@` followed by an [identifier](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#identifiers).
|
2002
|
+
|
2003
|
+
@@abc = 123 # name `@@abc`
|
2004
|
+
|
2005
|
+
@@_test = :test # name `@@_test`
|
2006
|
+
- name: name_loc
|
2007
|
+
type: location
|
2008
|
+
comment: |
|
2009
|
+
The location of the variable name.
|
2010
|
+
|
2011
|
+
@@foo = :bar
|
2012
|
+
^^^^^
|
2013
|
+
- name: value
|
2014
|
+
type: node
|
2015
|
+
kind: non-void expression
|
2016
|
+
comment: |
|
2017
|
+
The value to write to the class variable. This can be any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression).
|
2018
|
+
|
2019
|
+
@@foo = :bar
|
2020
|
+
^^^^
|
2021
|
+
|
2022
|
+
@@_xyz = 123
|
2023
|
+
^^^
|
2024
|
+
- name: operator_loc
|
2025
|
+
type: location
|
2026
|
+
comment: |
|
2027
|
+
The location of the `=` operator.
|
2028
|
+
|
2029
|
+
@@foo = :bar
|
2030
|
+
^
|
2031
|
+
comment: |
|
2032
|
+
Represents writing to a class variable.
|
2033
|
+
|
2034
|
+
@@foo = 1
|
2035
|
+
^^^^^^^^^
|
2036
|
+
- name: ConstantAndWriteNode
|
2037
|
+
fields:
|
2038
|
+
- name: name
|
2039
|
+
type: constant
|
2040
|
+
- name: name_loc
|
2041
|
+
type: location
|
2042
|
+
- name: operator_loc
|
2043
|
+
type: location
|
2044
|
+
- name: value
|
2045
|
+
type: node
|
2046
|
+
kind: non-void expression
|
2047
|
+
comment: |
|
2048
|
+
Represents the use of the `&&=` operator for assignment to a constant.
|
2049
|
+
|
2050
|
+
Target &&= value
|
2051
|
+
^^^^^^^^^^^^^^^^
|
2052
|
+
- name: ConstantOperatorWriteNode
|
2053
|
+
fields:
|
2054
|
+
- name: name
|
2055
|
+
type: constant
|
2056
|
+
- name: name_loc
|
2057
|
+
type: location
|
2058
|
+
- name: binary_operator_loc
|
2059
|
+
type: location
|
2060
|
+
- name: value
|
2061
|
+
type: node
|
2062
|
+
kind: non-void expression
|
2063
|
+
- name: binary_operator
|
2064
|
+
type: constant
|
2065
|
+
comment: |
|
2066
|
+
Represents assigning to a constant using an operator that isn't `=`.
|
2067
|
+
|
2068
|
+
Target += value
|
2069
|
+
^^^^^^^^^^^^^^^
|
2070
|
+
- name: ConstantOrWriteNode
|
2071
|
+
fields:
|
2072
|
+
- name: name
|
2073
|
+
type: constant
|
2074
|
+
- name: name_loc
|
2075
|
+
type: location
|
2076
|
+
- name: operator_loc
|
2077
|
+
type: location
|
2078
|
+
- name: value
|
2079
|
+
type: node
|
2080
|
+
kind: non-void expression
|
2081
|
+
comment: |
|
2082
|
+
Represents the use of the `||=` operator for assignment to a constant.
|
2083
|
+
|
2084
|
+
Target ||= value
|
2085
|
+
^^^^^^^^^^^^^^^^
|
2086
|
+
- name: ConstantPathAndWriteNode
|
2087
|
+
fields:
|
2088
|
+
- name: target
|
2089
|
+
type: node
|
2090
|
+
kind: ConstantPathNode
|
2091
|
+
- name: operator_loc
|
2092
|
+
type: location
|
2093
|
+
- name: value
|
2094
|
+
type: node
|
2095
|
+
kind: non-void expression
|
2096
|
+
comment: |
|
2097
|
+
Represents the use of the `&&=` operator for assignment to a constant path.
|
2098
|
+
|
2099
|
+
Parent::Child &&= value
|
2100
|
+
^^^^^^^^^^^^^^^^^^^^^^^
|
2101
|
+
- name: ConstantPathNode
|
2102
|
+
fields:
|
2103
|
+
- name: parent
|
2104
|
+
type: node?
|
2105
|
+
kind: non-void expression
|
2106
|
+
comment: |
|
2107
|
+
The left-hand node of the path, if present. It can be `nil` or any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). It will be `nil` when the constant lookup is at the root of the module tree.
|
2108
|
+
|
2109
|
+
Foo::Bar
|
2110
|
+
^^^
|
2111
|
+
|
2112
|
+
self::Test
|
2113
|
+
^^^^
|
2114
|
+
|
2115
|
+
a.b::C
|
2116
|
+
^^^
|
2117
|
+
- name: name
|
2118
|
+
type: constant?
|
2119
|
+
comment: The name of the constant being accessed. This could be `nil` in the event of a syntax error.
|
2120
|
+
- name: delimiter_loc
|
2121
|
+
type: location
|
2122
|
+
comment: |
|
2123
|
+
The location of the `::` delimiter.
|
2124
|
+
|
2125
|
+
::Foo
|
2126
|
+
^^
|
2127
|
+
|
2128
|
+
One::Two
|
2129
|
+
^^
|
2130
|
+
- name: name_loc
|
2131
|
+
type: location
|
2132
|
+
comment: |
|
2133
|
+
The location of the name of the constant.
|
2134
|
+
|
2135
|
+
::Foo
|
2136
|
+
^^^
|
2137
|
+
|
2138
|
+
One::Two
|
2139
|
+
^^^
|
2140
|
+
comment: |
|
2141
|
+
Represents accessing a constant through a path of `::` operators.
|
2142
|
+
|
2143
|
+
Foo::Bar
|
2144
|
+
^^^^^^^^
|
2145
|
+
- name: ConstantPathOperatorWriteNode
|
2146
|
+
fields:
|
2147
|
+
- name: target
|
2148
|
+
type: node
|
2149
|
+
kind: ConstantPathNode
|
2150
|
+
- name: binary_operator_loc
|
2151
|
+
type: location
|
2152
|
+
- name: value
|
2153
|
+
type: node
|
2154
|
+
kind: non-void expression
|
2155
|
+
- name: binary_operator
|
2156
|
+
type: constant
|
2157
|
+
comment: |
|
2158
|
+
Represents assigning to a constant path using an operator that isn't `=`.
|
2159
|
+
|
2160
|
+
Parent::Child += value
|
2161
|
+
^^^^^^^^^^^^^^^^^^^^^^
|
2162
|
+
- name: ConstantPathOrWriteNode
|
2163
|
+
fields:
|
2164
|
+
- name: target
|
2165
|
+
type: node
|
2166
|
+
kind: ConstantPathNode
|
2167
|
+
- name: operator_loc
|
2168
|
+
type: location
|
2169
|
+
- name: value
|
2170
|
+
type: node
|
2171
|
+
kind: non-void expression
|
2172
|
+
comment: |
|
2173
|
+
Represents the use of the `||=` operator for assignment to a constant path.
|
2174
|
+
|
2175
|
+
Parent::Child ||= value
|
2176
|
+
^^^^^^^^^^^^^^^^^^^^^^^
|
2177
|
+
- name: ConstantPathTargetNode
|
2178
|
+
fields:
|
2179
|
+
- name: parent
|
2180
|
+
type: node?
|
2181
|
+
kind: non-void expression
|
2182
|
+
- name: name
|
2183
|
+
type: constant?
|
2184
|
+
- name: delimiter_loc
|
2185
|
+
type: location
|
2186
|
+
- name: name_loc
|
2187
|
+
type: location
|
2188
|
+
comment: |
|
2189
|
+
Represents writing to a constant path in a context that doesn't have an explicit value.
|
2190
|
+
|
2191
|
+
Foo::Foo, Bar::Bar = baz
|
2192
|
+
^^^^^^^^ ^^^^^^^^
|
2193
|
+
- name: ConstantPathWriteNode
|
2194
|
+
fields:
|
2195
|
+
- name: target
|
2196
|
+
type: node
|
2197
|
+
kind: ConstantPathNode
|
2198
|
+
comment: |
|
2199
|
+
A node representing the constant path being written to.
|
2200
|
+
|
2201
|
+
Foo::Bar = 1
|
2202
|
+
^^^^^^^^
|
2203
|
+
|
2204
|
+
::Foo = :abc
|
2205
|
+
^^^^^
|
2206
|
+
- name: operator_loc
|
2207
|
+
type: location
|
2208
|
+
comment: |
|
2209
|
+
The location of the `=` operator.
|
2210
|
+
|
2211
|
+
::ABC = 123
|
2212
|
+
^
|
2213
|
+
- name: value
|
2214
|
+
type: node
|
2215
|
+
kind: non-void expression
|
2216
|
+
comment: |
|
2217
|
+
The value to write to the constant path. It can be any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression).
|
2218
|
+
|
2219
|
+
FOO::BAR = :abc
|
2220
|
+
^^^^
|
2221
|
+
comment: |
|
2222
|
+
Represents writing to a constant path.
|
2223
|
+
|
2224
|
+
::Foo = 1
|
2225
|
+
^^^^^^^^^
|
2226
|
+
|
2227
|
+
Foo::Bar = 1
|
2228
|
+
^^^^^^^^^^^^
|
2229
|
+
|
2230
|
+
::Foo::Bar = 1
|
2231
|
+
^^^^^^^^^^^^^^
|
2232
|
+
- name: ConstantReadNode
|
2233
|
+
fields:
|
2234
|
+
- name: name
|
2235
|
+
type: constant
|
2236
|
+
comment: |
|
2237
|
+
The name of the [constant](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#constants).
|
2238
|
+
|
2239
|
+
X # name `:X`
|
2240
|
+
|
2241
|
+
SOME_CONSTANT # name `:SOME_CONSTANT`
|
2242
|
+
comment: |
|
2243
|
+
Represents referencing a constant.
|
2244
|
+
|
2245
|
+
Foo
|
2246
|
+
^^^
|
2247
|
+
- name: ConstantTargetNode
|
2248
|
+
fields:
|
2249
|
+
- name: name
|
2250
|
+
type: constant
|
2251
|
+
comment: |
|
2252
|
+
Represents writing to a constant in a context that doesn't have an explicit value.
|
2253
|
+
|
2254
|
+
Foo, Bar = baz
|
2255
|
+
^^^ ^^^
|
2256
|
+
- name: ConstantWriteNode
|
2257
|
+
fields:
|
2258
|
+
- name: name
|
2259
|
+
type: constant
|
2260
|
+
comment: |
|
2261
|
+
The name of the [constant](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#constants).
|
2262
|
+
|
2263
|
+
Foo = :bar # name `:Foo`
|
2264
|
+
|
2265
|
+
XYZ = 1 # name `:XYZ`
|
2266
|
+
- name: name_loc
|
2267
|
+
type: location
|
2268
|
+
comment: |
|
2269
|
+
The location of the constant name.
|
2270
|
+
|
2271
|
+
FOO = 1
|
2272
|
+
^^^
|
2273
|
+
- name: value
|
2274
|
+
type: node
|
2275
|
+
kind: non-void expression
|
2276
|
+
comment: |
|
2277
|
+
The value to write to the constant. It can be any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression).
|
2278
|
+
|
2279
|
+
FOO = :bar
|
2280
|
+
^^^^
|
2281
|
+
|
2282
|
+
MyClass = Class.new
|
2283
|
+
^^^^^^^^^
|
2284
|
+
- name: operator_loc
|
2285
|
+
type: location
|
2286
|
+
comment: |
|
2287
|
+
The location of the `=` operator.
|
2288
|
+
|
2289
|
+
FOO = :bar
|
2290
|
+
^
|
2291
|
+
comment: |
|
2292
|
+
Represents writing to a constant.
|
2293
|
+
|
2294
|
+
Foo = 1
|
2295
|
+
^^^^^^^
|
2296
|
+
- name: DefNode
|
2297
|
+
fields:
|
2298
|
+
- name: name
|
2299
|
+
type: constant
|
2300
|
+
- name: name_loc
|
2301
|
+
type: location
|
2302
|
+
- name: receiver
|
2303
|
+
type: node?
|
2304
|
+
kind: non-void expression
|
2305
|
+
- name: parameters
|
2306
|
+
type: node?
|
2307
|
+
kind: ParametersNode
|
2308
|
+
- name: body
|
2309
|
+
type: node?
|
2310
|
+
kind:
|
2311
|
+
- StatementsNode
|
2312
|
+
- BeginNode
|
2313
|
+
- name: locals
|
2314
|
+
type: constant[]
|
2315
|
+
- name: def_keyword_loc
|
2316
|
+
type: location
|
2317
|
+
- name: operator_loc
|
2318
|
+
type: location?
|
2319
|
+
- name: lparen_loc
|
2320
|
+
type: location?
|
2321
|
+
- name: rparen_loc
|
2322
|
+
type: location?
|
2323
|
+
- name: equal_loc
|
2324
|
+
type: location?
|
2325
|
+
- name: end_keyword_loc
|
2326
|
+
type: location?
|
2327
|
+
comment: |
|
2328
|
+
Represents a method definition.
|
2329
|
+
|
2330
|
+
def method
|
2331
|
+
end
|
2332
|
+
^^^^^^^^^^
|
2333
|
+
- name: DefinedNode
|
2334
|
+
fields:
|
2335
|
+
- name: lparen_loc
|
2336
|
+
type: location?
|
2337
|
+
- name: value
|
2338
|
+
type: node
|
2339
|
+
kind: Node # More than non-void expression as defined?(return) is allowed, yet defined?(BEGIN{}) is SyntaxError
|
2340
|
+
- name: rparen_loc
|
2341
|
+
type: location?
|
2342
|
+
- name: keyword_loc
|
2343
|
+
type: location
|
2344
|
+
comment: |
|
2345
|
+
Represents the use of the `defined?` keyword.
|
2346
|
+
|
2347
|
+
defined?(a)
|
2348
|
+
^^^^^^^^^^^
|
2349
|
+
- name: ElseNode
|
2350
|
+
fields:
|
2351
|
+
- name: else_keyword_loc
|
2352
|
+
type: location
|
2353
|
+
- name: statements
|
2354
|
+
type: node?
|
2355
|
+
kind: StatementsNode
|
2356
|
+
- name: end_keyword_loc
|
2357
|
+
type: location?
|
2358
|
+
comment: |
|
2359
|
+
Represents an `else` clause in a `case`, `if`, or `unless` statement.
|
2360
|
+
|
2361
|
+
if a then b else c end
|
2362
|
+
^^^^^^^^^^
|
2363
|
+
- name: EmbeddedStatementsNode
|
2364
|
+
fields:
|
2365
|
+
- name: opening_loc
|
2366
|
+
type: location
|
2367
|
+
- name: statements
|
2368
|
+
type: node?
|
2369
|
+
kind: StatementsNode
|
2370
|
+
- name: closing_loc
|
2371
|
+
type: location
|
2372
|
+
comment: |
|
2373
|
+
Represents an interpolated set of statements.
|
2374
|
+
|
2375
|
+
"foo #{bar}"
|
2376
|
+
^^^^^^
|
2377
|
+
- name: EmbeddedVariableNode
|
2378
|
+
fields:
|
2379
|
+
- name: operator_loc
|
2380
|
+
type: location
|
2381
|
+
- name: variable
|
2382
|
+
type: node
|
2383
|
+
kind:
|
2384
|
+
- InstanceVariableReadNode
|
2385
|
+
- ClassVariableReadNode
|
2386
|
+
- GlobalVariableReadNode
|
2387
|
+
- BackReferenceReadNode
|
2388
|
+
- NumberedReferenceReadNode
|
2389
|
+
comment: |
|
2390
|
+
Represents an interpolated variable.
|
2391
|
+
|
2392
|
+
"foo #@bar"
|
2393
|
+
^^^^^
|
2394
|
+
- name: EnsureNode
|
2395
|
+
fields:
|
2396
|
+
- name: ensure_keyword_loc
|
2397
|
+
type: location
|
2398
|
+
- name: statements
|
2399
|
+
type: node?
|
2400
|
+
kind: StatementsNode
|
2401
|
+
- name: end_keyword_loc
|
2402
|
+
type: location
|
2403
|
+
comment: |
|
2404
|
+
Represents an `ensure` clause in a `begin` statement.
|
2405
|
+
|
2406
|
+
begin
|
2407
|
+
foo
|
2408
|
+
ensure
|
2409
|
+
^^^^^^
|
2410
|
+
bar
|
2411
|
+
end
|
2412
|
+
- name: FalseNode
|
2413
|
+
comment: |
|
2414
|
+
Represents the use of the literal `false` keyword.
|
2415
|
+
|
2416
|
+
false
|
2417
|
+
^^^^^
|
2418
|
+
- name: FindPatternNode
|
2419
|
+
fields:
|
2420
|
+
- name: constant
|
2421
|
+
type: node?
|
2422
|
+
kind:
|
2423
|
+
- ConstantPathNode
|
2424
|
+
- ConstantReadNode
|
2425
|
+
comment: |
|
2426
|
+
Represents the optional constant preceding the pattern
|
2427
|
+
|
2428
|
+
foo in Foo(*bar, baz, *qux)
|
2429
|
+
^^^
|
2430
|
+
- name: left
|
2431
|
+
type: node
|
2432
|
+
kind: SplatNode
|
2433
|
+
comment: |
|
2434
|
+
Represents the first wildcard node in the pattern.
|
2435
|
+
|
2436
|
+
foo in *bar, baz, *qux
|
2437
|
+
^^^^
|
2438
|
+
|
2439
|
+
foo in Foo(*bar, baz, *qux)
|
2440
|
+
^^^^
|
2441
|
+
- name: requireds
|
2442
|
+
type: node[]
|
2443
|
+
kind: pattern expression
|
2444
|
+
comment: |
|
2445
|
+
Represents the nodes in between the wildcards.
|
2446
|
+
|
2447
|
+
foo in *bar, baz, *qux
|
2448
|
+
^^^
|
2449
|
+
|
2450
|
+
foo in Foo(*bar, baz, 1, *qux)
|
2451
|
+
^^^^^^
|
2452
|
+
- name: right
|
2453
|
+
type: node
|
2454
|
+
kind:
|
2455
|
+
- SplatNode
|
2456
|
+
- on error: MissingNode
|
2457
|
+
comment: |
|
2458
|
+
Represents the second wildcard node in the pattern.
|
2459
|
+
|
2460
|
+
foo in *bar, baz, *qux
|
2461
|
+
^^^^
|
2462
|
+
|
2463
|
+
foo in Foo(*bar, baz, *qux)
|
2464
|
+
^^^^
|
2465
|
+
- name: opening_loc
|
2466
|
+
type: location?
|
2467
|
+
comment: |
|
2468
|
+
The location of the opening brace.
|
2469
|
+
|
2470
|
+
foo in [*bar, baz, *qux]
|
2471
|
+
^
|
2472
|
+
|
2473
|
+
foo in Foo(*bar, baz, *qux)
|
2474
|
+
^
|
2475
|
+
- name: closing_loc
|
2476
|
+
type: location?
|
2477
|
+
comment: |
|
2478
|
+
The location of the closing brace.
|
2479
|
+
|
2480
|
+
foo in [*bar, baz, *qux]
|
2481
|
+
^
|
2482
|
+
|
2483
|
+
foo in Foo(*bar, baz, *qux)
|
2484
|
+
^
|
2485
|
+
comment: |
|
2486
|
+
Represents a find pattern in pattern matching.
|
2487
|
+
|
2488
|
+
foo in *bar, baz, *qux
|
2489
|
+
^^^^^^^^^^^^^^^
|
2490
|
+
|
2491
|
+
foo in [*bar, baz, *qux]
|
2492
|
+
^^^^^^^^^^^^^^^^^
|
2493
|
+
|
2494
|
+
foo in Foo(*bar, baz, *qux)
|
2495
|
+
^^^^^^^^^^^^^^^^^^^^
|
2496
|
+
|
2497
|
+
foo => *bar, baz, *qux
|
2498
|
+
^^^^^^^^^^^^^^^
|
2499
|
+
- name: FlipFlopNode
|
2500
|
+
flags: RangeFlags
|
2501
|
+
fields:
|
2502
|
+
- name: left
|
2503
|
+
type: node?
|
2504
|
+
kind: non-void expression
|
2505
|
+
- name: right
|
2506
|
+
type: node?
|
2507
|
+
kind: non-void expression
|
2508
|
+
- name: operator_loc
|
2509
|
+
type: location
|
2510
|
+
comment: |
|
2511
|
+
Represents the use of the `..` or `...` operators to create flip flops.
|
2512
|
+
|
2513
|
+
baz if foo .. bar
|
2514
|
+
^^^^^^^^^^
|
2515
|
+
- name: FloatNode
|
2516
|
+
fields:
|
2517
|
+
- name: value
|
2518
|
+
type: double
|
2519
|
+
comment: The value of the floating point number as a Float.
|
2520
|
+
comment: |
|
2521
|
+
Represents a floating point number literal.
|
2522
|
+
|
2523
|
+
1.0
|
2524
|
+
^^^
|
2525
|
+
- name: ForNode
|
2526
|
+
fields:
|
2527
|
+
- name: index
|
2528
|
+
type: node
|
2529
|
+
kind:
|
2530
|
+
- LocalVariableTargetNode
|
2531
|
+
- InstanceVariableTargetNode
|
2532
|
+
- ClassVariableTargetNode
|
2533
|
+
- GlobalVariableTargetNode
|
2534
|
+
- ConstantTargetNode
|
2535
|
+
- ConstantPathTargetNode
|
2536
|
+
- CallTargetNode
|
2537
|
+
- IndexTargetNode
|
2538
|
+
- MultiTargetNode
|
2539
|
+
- on error: BackReferenceReadNode # for $& in a end
|
2540
|
+
- on error: NumberedReferenceReadNode # for $1 in a end
|
2541
|
+
- on error: MissingNode # for in 1..10; end
|
2542
|
+
comment: |
|
2543
|
+
The index expression for `for` loops.
|
2544
|
+
|
2545
|
+
for i in a end
|
2546
|
+
^
|
2547
|
+
- name: collection
|
2548
|
+
type: node
|
2549
|
+
kind: non-void expression
|
2550
|
+
comment: |
|
2551
|
+
The collection to iterate over.
|
2552
|
+
|
2553
|
+
for i in a end
|
2554
|
+
^
|
2555
|
+
- name: statements
|
2556
|
+
type: node?
|
2557
|
+
kind: StatementsNode
|
2558
|
+
comment: |
|
2559
|
+
Represents the body of statements to execute for each iteration of the loop.
|
2560
|
+
|
2561
|
+
for i in a
|
2562
|
+
foo(i)
|
2563
|
+
^^^^^^
|
2564
|
+
end
|
2565
|
+
- name: for_keyword_loc
|
2566
|
+
type: location
|
2567
|
+
comment: |
|
2568
|
+
The location of the `for` keyword.
|
2569
|
+
|
2570
|
+
for i in a end
|
2571
|
+
^^^
|
2572
|
+
- name: in_keyword_loc
|
2573
|
+
type: location
|
2574
|
+
comment: |
|
2575
|
+
The location of the `in` keyword.
|
2576
|
+
|
2577
|
+
for i in a end
|
2578
|
+
^^
|
2579
|
+
- name: do_keyword_loc
|
2580
|
+
type: location?
|
2581
|
+
comment: |
|
2582
|
+
The location of the `do` keyword, if present.
|
2583
|
+
|
2584
|
+
for i in a do end
|
2585
|
+
^^
|
2586
|
+
- name: end_keyword_loc
|
2587
|
+
type: location
|
2588
|
+
comment: |
|
2589
|
+
The location of the `end` keyword.
|
2590
|
+
|
2591
|
+
for i in a end
|
2592
|
+
^^^
|
2593
|
+
comment: |
|
2594
|
+
Represents the use of the `for` keyword.
|
2595
|
+
|
2596
|
+
for i in a end
|
2597
|
+
^^^^^^^^^^^^^^
|
2598
|
+
- name: ForwardingArgumentsNode
|
2599
|
+
comment: |
|
2600
|
+
Represents forwarding all arguments to this method to another method.
|
2601
|
+
|
2602
|
+
def foo(...)
|
2603
|
+
bar(...)
|
2604
|
+
^^^
|
2605
|
+
end
|
2606
|
+
- name: ForwardingParameterNode
|
2607
|
+
comment: |
|
2608
|
+
Represents the use of the forwarding parameter in a method, block, or lambda declaration.
|
2609
|
+
|
2610
|
+
def foo(...)
|
2611
|
+
^^^
|
2612
|
+
end
|
2613
|
+
- name: ForwardingSuperNode
|
2614
|
+
fields:
|
2615
|
+
- name: block
|
2616
|
+
type: node?
|
2617
|
+
kind: BlockNode
|
2618
|
+
comment: |
|
2619
|
+
Represents the use of the `super` keyword without parentheses or arguments.
|
2620
|
+
|
2621
|
+
super
|
2622
|
+
^^^^^
|
2623
|
+
- name: GlobalVariableAndWriteNode
|
2624
|
+
fields:
|
2625
|
+
- name: name
|
2626
|
+
type: constant
|
2627
|
+
- name: name_loc
|
2628
|
+
type: location
|
2629
|
+
- name: operator_loc
|
2630
|
+
type: location
|
2631
|
+
- name: value
|
2632
|
+
type: node
|
2633
|
+
kind: non-void expression
|
2634
|
+
comment: |
|
2635
|
+
Represents the use of the `&&=` operator for assignment to a global variable.
|
2636
|
+
|
2637
|
+
$target &&= value
|
2638
|
+
^^^^^^^^^^^^^^^^^
|
2639
|
+
- name: GlobalVariableOperatorWriteNode
|
2640
|
+
fields:
|
2641
|
+
- name: name
|
2642
|
+
type: constant
|
2643
|
+
- name: name_loc
|
2644
|
+
type: location
|
2645
|
+
- name: binary_operator_loc
|
2646
|
+
type: location
|
2647
|
+
- name: value
|
2648
|
+
type: node
|
2649
|
+
kind: non-void expression
|
2650
|
+
- name: binary_operator
|
2651
|
+
type: constant
|
2652
|
+
comment: |
|
2653
|
+
Represents assigning to a global variable using an operator that isn't `=`.
|
2654
|
+
|
2655
|
+
$target += value
|
2656
|
+
^^^^^^^^^^^^^^^^
|
2657
|
+
- name: GlobalVariableOrWriteNode
|
2658
|
+
fields:
|
2659
|
+
- name: name
|
2660
|
+
type: constant
|
2661
|
+
- name: name_loc
|
2662
|
+
type: location
|
2663
|
+
- name: operator_loc
|
2664
|
+
type: location
|
2665
|
+
- name: value
|
2666
|
+
type: node
|
2667
|
+
kind: non-void expression
|
2668
|
+
comment: |
|
2669
|
+
Represents the use of the `||=` operator for assignment to a global variable.
|
2670
|
+
|
2671
|
+
$target ||= value
|
2672
|
+
^^^^^^^^^^^^^^^^^
|
2673
|
+
- name: GlobalVariableReadNode
|
2674
|
+
fields:
|
2675
|
+
- name: name
|
2676
|
+
type: constant
|
2677
|
+
comment: |
|
2678
|
+
The name of the global variable, which is a `$` followed by an [identifier](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#identifier). Alternatively, it can be one of the special global variables designated by a symbol.
|
2679
|
+
|
2680
|
+
$foo # name `:$foo`
|
2681
|
+
|
2682
|
+
$_Test # name `:$_Test`
|
2683
|
+
comment: |
|
2684
|
+
Represents referencing a global variable.
|
2685
|
+
|
2686
|
+
$foo
|
2687
|
+
^^^^
|
2688
|
+
- name: GlobalVariableTargetNode
|
2689
|
+
fields:
|
2690
|
+
- name: name
|
2691
|
+
type: constant
|
2692
|
+
comment: |
|
2693
|
+
Represents writing to a global variable in a context that doesn't have an explicit value.
|
2694
|
+
|
2695
|
+
$foo, $bar = baz
|
2696
|
+
^^^^ ^^^^
|
2697
|
+
- name: GlobalVariableWriteNode
|
2698
|
+
fields:
|
2699
|
+
- name: name
|
2700
|
+
type: constant
|
2701
|
+
comment: |
|
2702
|
+
The name of the global variable, which is a `$` followed by an [identifier](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#identifier). Alternatively, it can be one of the special global variables designated by a symbol.
|
2703
|
+
|
2704
|
+
$foo = :bar # name `:$foo`
|
2705
|
+
|
2706
|
+
$_Test = 123 # name `:$_Test`
|
2707
|
+
- name: name_loc
|
2708
|
+
type: location
|
2709
|
+
comment: |
|
2710
|
+
The location of the global variable's name.
|
2711
|
+
|
2712
|
+
$foo = :bar
|
2713
|
+
^^^^
|
2714
|
+
- name: value
|
2715
|
+
type: node
|
2716
|
+
kind: non-void expression
|
2717
|
+
comment: |
|
2718
|
+
The value to write to the global variable. It can be any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression).
|
2719
|
+
|
2720
|
+
$foo = :bar
|
2721
|
+
^^^^
|
2722
|
+
|
2723
|
+
$-xyz = 123
|
2724
|
+
^^^
|
2725
|
+
- name: operator_loc
|
2726
|
+
type: location
|
2727
|
+
comment: |
|
2728
|
+
The location of the `=` operator.
|
2729
|
+
|
2730
|
+
$foo = :bar
|
2731
|
+
^
|
2732
|
+
comment: |
|
2733
|
+
Represents writing to a global variable.
|
2734
|
+
|
2735
|
+
$foo = 1
|
2736
|
+
^^^^^^^^
|
2737
|
+
- name: HashNode
|
2738
|
+
fields:
|
2739
|
+
- name: opening_loc
|
2740
|
+
type: location
|
2741
|
+
comment: |
|
2742
|
+
The location of the opening brace.
|
2743
|
+
|
2744
|
+
{ a => b }
|
2745
|
+
^
|
2746
|
+
- name: elements
|
2747
|
+
type: node[]
|
2748
|
+
kind:
|
2749
|
+
- AssocNode
|
2750
|
+
- AssocSplatNode
|
2751
|
+
comment: |
|
2752
|
+
The elements of the hash. These can be either `AssocNode`s or `AssocSplatNode`s.
|
2753
|
+
|
2754
|
+
{ a: b }
|
2755
|
+
^^^^
|
2756
|
+
|
2757
|
+
{ **foo }
|
2758
|
+
^^^^^
|
2759
|
+
- name: closing_loc
|
2760
|
+
type: location
|
2761
|
+
comment: |
|
2762
|
+
The location of the closing brace.
|
2763
|
+
|
2764
|
+
{ a => b }
|
2765
|
+
^
|
2766
|
+
comment: |
|
2767
|
+
Represents a hash literal.
|
2768
|
+
|
2769
|
+
{ a => b }
|
2770
|
+
^^^^^^^^^^
|
2771
|
+
- name: HashPatternNode
|
2772
|
+
fields:
|
2773
|
+
- name: constant
|
2774
|
+
type: node?
|
2775
|
+
kind:
|
2776
|
+
- ConstantPathNode
|
2777
|
+
- ConstantReadNode
|
2778
|
+
comment: |
|
2779
|
+
Represents the optional constant preceding the Hash.
|
2780
|
+
|
2781
|
+
foo => Bar[a: 1, b: 2]
|
2782
|
+
^^^
|
2783
|
+
|
2784
|
+
foo => Bar::Baz[a: 1, b: 2]
|
2785
|
+
^^^^^^^^
|
2786
|
+
- name: elements
|
2787
|
+
type: node[]
|
2788
|
+
kind: AssocNode
|
2789
|
+
comment: |
|
2790
|
+
Represents the explicit named hash keys and values.
|
2791
|
+
|
2792
|
+
foo => { a: 1, b:, ** }
|
2793
|
+
^^^^^^^^
|
2794
|
+
- name: rest
|
2795
|
+
type: node?
|
2796
|
+
kind:
|
2797
|
+
- AssocSplatNode
|
2798
|
+
- NoKeywordsParameterNode
|
2799
|
+
comment: |
|
2800
|
+
Represents the rest of the Hash keys and values. This can be named, unnamed, or explicitly forbidden via `**nil`, this last one results in a `NoKeywordsParameterNode`.
|
2801
|
+
|
2802
|
+
foo => { a: 1, b:, **c }
|
2803
|
+
^^^
|
2804
|
+
|
2805
|
+
foo => { a: 1, b:, ** }
|
2806
|
+
^^
|
2807
|
+
|
2808
|
+
foo => { a: 1, b:, **nil }
|
2809
|
+
^^^^^
|
2810
|
+
- name: opening_loc
|
2811
|
+
type: location?
|
2812
|
+
comment: |
|
2813
|
+
The location of the opening brace.
|
2814
|
+
|
2815
|
+
foo => { a: 1 }
|
2816
|
+
^
|
2817
|
+
|
2818
|
+
foo => Bar[a: 1]
|
2819
|
+
^
|
2820
|
+
- name: closing_loc
|
2821
|
+
type: location?
|
2822
|
+
comment: |
|
2823
|
+
The location of the closing brace.
|
2824
|
+
|
2825
|
+
foo => { a: 1 }
|
2826
|
+
^
|
2827
|
+
|
2828
|
+
foo => Bar[a: 1]
|
2829
|
+
^
|
2830
|
+
comment: |
|
2831
|
+
Represents a hash pattern in pattern matching.
|
2832
|
+
|
2833
|
+
foo => { a: 1, b: 2 }
|
2834
|
+
^^^^^^^^^^^^^^
|
2835
|
+
|
2836
|
+
foo => { a: 1, b: 2, **c }
|
2837
|
+
^^^^^^^^^^^^^^^^^^^
|
2838
|
+
|
2839
|
+
foo => Bar[a: 1, b: 2]
|
2840
|
+
^^^^^^^^^^^^^^^
|
2841
|
+
|
2842
|
+
foo in { a: 1, b: 2 }
|
2843
|
+
^^^^^^^^^^^^^^
|
2844
|
+
- name: IfNode
|
2845
|
+
fields:
|
2846
|
+
- name: if_keyword_loc
|
2847
|
+
type: location?
|
2848
|
+
comment: |
|
2849
|
+
The location of the `if` keyword if present.
|
2850
|
+
|
2851
|
+
bar if foo
|
2852
|
+
^^
|
2853
|
+
|
2854
|
+
The `if_keyword_loc` field will be `nil` when the `IfNode` represents a ternary expression.
|
2855
|
+
- name: predicate
|
2856
|
+
type: node
|
2857
|
+
kind: non-void expression
|
2858
|
+
comment: |
|
2859
|
+
The node for the condition the `IfNode` is testing.
|
2860
|
+
|
2861
|
+
if foo
|
2862
|
+
^^^
|
2863
|
+
bar
|
2864
|
+
end
|
2865
|
+
|
2866
|
+
bar if foo
|
2867
|
+
^^^
|
2868
|
+
|
2869
|
+
foo ? bar : baz
|
2870
|
+
^^^
|
2871
|
+
- name: then_keyword_loc
|
2872
|
+
type: location?
|
2873
|
+
comment: |
|
2874
|
+
The location of the `then` keyword (if present) or the `?` in a ternary expression, `nil` otherwise.
|
2875
|
+
|
2876
|
+
if foo then bar end
|
2877
|
+
^^^^
|
2878
|
+
|
2879
|
+
a ? b : c
|
2880
|
+
^
|
2881
|
+
- name: statements
|
2882
|
+
type: node?
|
2883
|
+
kind: StatementsNode
|
2884
|
+
comment: |
|
2885
|
+
Represents the body of statements that will be executed when the predicate is evaluated as truthy. Will be `nil` when no body is provided.
|
2886
|
+
|
2887
|
+
if foo
|
2888
|
+
bar
|
2889
|
+
^^^
|
2890
|
+
baz
|
2891
|
+
^^^
|
2892
|
+
end
|
2893
|
+
- name: subsequent
|
2894
|
+
type: node?
|
2895
|
+
kind:
|
2896
|
+
- ElseNode
|
2897
|
+
- IfNode
|
2898
|
+
comment: |
|
2899
|
+
Represents an `ElseNode` or an `IfNode` when there is an `else` or an `elsif` in the `if` statement.
|
2900
|
+
|
2901
|
+
if foo
|
2902
|
+
bar
|
2903
|
+
elsif baz
|
2904
|
+
^^^^^^^^^
|
2905
|
+
qux
|
2906
|
+
^^^
|
2907
|
+
end
|
2908
|
+
^^^
|
2909
|
+
|
2910
|
+
if foo then bar else baz end
|
2911
|
+
^^^^^^^^^^^^
|
2912
|
+
- name: end_keyword_loc
|
2913
|
+
type: location?
|
2914
|
+
comment: |
|
2915
|
+
The location of the `end` keyword if present, `nil` otherwise.
|
2916
|
+
|
2917
|
+
if foo
|
2918
|
+
bar
|
2919
|
+
end
|
2920
|
+
^^^
|
2921
|
+
newline: predicate
|
2922
|
+
comment: |
|
2923
|
+
Represents the use of the `if` keyword, either in the block form or the modifier form, or a ternary expression.
|
2924
|
+
|
2925
|
+
bar if foo
|
2926
|
+
^^^^^^^^^^
|
2927
|
+
|
2928
|
+
if foo then bar end
|
2929
|
+
^^^^^^^^^^^^^^^^^^^
|
2930
|
+
|
2931
|
+
foo ? bar : baz
|
2932
|
+
^^^^^^^^^^^^^^^
|
2933
|
+
- name: ImaginaryNode
|
2934
|
+
fields:
|
2935
|
+
- name: numeric
|
2936
|
+
type: node
|
2937
|
+
kind:
|
2938
|
+
- FloatNode
|
2939
|
+
- IntegerNode
|
2940
|
+
- RationalNode
|
2941
|
+
comment: |
|
2942
|
+
Represents an imaginary number literal.
|
2943
|
+
|
2944
|
+
1.0i
|
2945
|
+
^^^^
|
2946
|
+
- name: ImplicitNode
|
2947
|
+
fields:
|
2948
|
+
- name: value
|
2949
|
+
type: node
|
2950
|
+
kind:
|
2951
|
+
- LocalVariableReadNode
|
2952
|
+
- CallNode
|
2953
|
+
- ConstantReadNode
|
2954
|
+
- LocalVariableTargetNode
|
2955
|
+
comment: |
|
2956
|
+
Represents a node that is implicitly being added to the tree but doesn't correspond directly to a node in the source.
|
2957
|
+
|
2958
|
+
{ foo: }
|
2959
|
+
^^^^
|
2960
|
+
|
2961
|
+
{ Foo: }
|
2962
|
+
^^^^
|
2963
|
+
|
2964
|
+
foo in { bar: }
|
2965
|
+
^^^^
|
2966
|
+
- name: ImplicitRestNode
|
2967
|
+
comment: |
|
2968
|
+
Represents using a trailing comma to indicate an implicit rest parameter.
|
2969
|
+
|
2970
|
+
foo { |bar,| }
|
2971
|
+
^
|
2972
|
+
|
2973
|
+
foo in [bar,]
|
2974
|
+
^
|
2975
|
+
|
2976
|
+
for foo, in bar do end
|
2977
|
+
^
|
2978
|
+
|
2979
|
+
foo, = bar
|
2980
|
+
^
|
2981
|
+
- name: InNode
|
2982
|
+
fields:
|
2983
|
+
- name: pattern
|
2984
|
+
type: node
|
2985
|
+
kind: pattern expression
|
2986
|
+
- name: statements
|
2987
|
+
type: node?
|
2988
|
+
kind: StatementsNode
|
2989
|
+
- name: in_loc
|
2990
|
+
type: location
|
2991
|
+
- name: then_loc
|
2992
|
+
type: location?
|
2993
|
+
comment: |
|
2994
|
+
Represents the use of the `in` keyword in a case statement.
|
2995
|
+
|
2996
|
+
case a; in b then c end
|
2997
|
+
^^^^^^^^^^^
|
2998
|
+
- name: IndexAndWriteNode
|
2999
|
+
flags: CallNodeFlags
|
3000
|
+
fields:
|
3001
|
+
- name: receiver
|
3002
|
+
type: node?
|
3003
|
+
kind: non-void expression
|
3004
|
+
- name: call_operator_loc
|
3005
|
+
type: location?
|
3006
|
+
- name: opening_loc
|
3007
|
+
type: location
|
3008
|
+
- name: arguments
|
3009
|
+
type: node?
|
3010
|
+
kind: ArgumentsNode
|
3011
|
+
- name: closing_loc
|
3012
|
+
type: location
|
3013
|
+
- name: block
|
3014
|
+
type: node?
|
3015
|
+
kind: BlockArgumentNode # foo[&b] &&= value, only valid on Ruby < 3.4
|
3016
|
+
- name: operator_loc
|
3017
|
+
type: location
|
3018
|
+
- name: value
|
3019
|
+
type: node
|
3020
|
+
kind: non-void expression
|
3021
|
+
comment: |
|
3022
|
+
Represents the use of the `&&=` operator on a call to the `[]` method.
|
3023
|
+
|
3024
|
+
foo.bar[baz] &&= value
|
3025
|
+
^^^^^^^^^^^^^^^^^^^^^^
|
3026
|
+
- name: IndexOperatorWriteNode
|
3027
|
+
flags: CallNodeFlags
|
3028
|
+
fields:
|
3029
|
+
- name: receiver
|
3030
|
+
type: node?
|
3031
|
+
kind: non-void expression
|
3032
|
+
- name: call_operator_loc
|
3033
|
+
type: location?
|
3034
|
+
- name: opening_loc
|
3035
|
+
type: location
|
3036
|
+
- name: arguments
|
3037
|
+
type: node?
|
3038
|
+
kind: ArgumentsNode
|
3039
|
+
- name: closing_loc
|
3040
|
+
type: location
|
3041
|
+
- name: block
|
3042
|
+
type: node?
|
3043
|
+
kind: BlockArgumentNode # foo[&b] += value, only valid on Ruby < 3.4
|
3044
|
+
- name: binary_operator
|
3045
|
+
type: constant
|
3046
|
+
- name: binary_operator_loc
|
3047
|
+
type: location
|
3048
|
+
- name: value
|
3049
|
+
type: node
|
3050
|
+
kind: non-void expression
|
3051
|
+
comment: |
|
3052
|
+
Represents the use of an assignment operator on a call to `[]`.
|
3053
|
+
|
3054
|
+
foo.bar[baz] += value
|
3055
|
+
^^^^^^^^^^^^^^^^^^^^^
|
3056
|
+
- name: IndexOrWriteNode
|
3057
|
+
flags: CallNodeFlags
|
3058
|
+
fields:
|
3059
|
+
- name: receiver
|
3060
|
+
type: node?
|
3061
|
+
kind: non-void expression
|
3062
|
+
- name: call_operator_loc
|
3063
|
+
type: location?
|
3064
|
+
- name: opening_loc
|
3065
|
+
type: location
|
3066
|
+
- name: arguments
|
3067
|
+
type: node?
|
3068
|
+
kind: ArgumentsNode
|
3069
|
+
- name: closing_loc
|
3070
|
+
type: location
|
3071
|
+
- name: block
|
3072
|
+
type: node?
|
3073
|
+
kind: BlockArgumentNode # foo[&b] ||= value, only valid on Ruby < 3.4
|
3074
|
+
- name: operator_loc
|
3075
|
+
type: location
|
3076
|
+
- name: value
|
3077
|
+
type: node
|
3078
|
+
kind: non-void expression
|
3079
|
+
comment: |
|
3080
|
+
Represents the use of the `||=` operator on a call to `[]`.
|
3081
|
+
|
3082
|
+
foo.bar[baz] ||= value
|
3083
|
+
^^^^^^^^^^^^^^^^^^^^^^
|
3084
|
+
- name: IndexTargetNode
|
3085
|
+
flags: CallNodeFlags
|
3086
|
+
fields:
|
3087
|
+
- name: receiver
|
3088
|
+
type: node
|
3089
|
+
kind: non-void expression
|
3090
|
+
- name: opening_loc
|
3091
|
+
type: location
|
3092
|
+
- name: arguments
|
3093
|
+
type: node?
|
3094
|
+
kind: ArgumentsNode
|
3095
|
+
- name: closing_loc
|
3096
|
+
type: location
|
3097
|
+
- name: block
|
3098
|
+
type: node?
|
3099
|
+
kind: BlockArgumentNode # foo[&b], = 1, only valid on Ruby < 3.4
|
3100
|
+
comment: |
|
3101
|
+
Represents assigning to an index.
|
3102
|
+
|
3103
|
+
foo[bar], = 1
|
3104
|
+
^^^^^^^^
|
3105
|
+
|
3106
|
+
begin
|
3107
|
+
rescue => foo[bar]
|
3108
|
+
^^^^^^^^
|
3109
|
+
end
|
3110
|
+
|
3111
|
+
for foo[bar] in baz do end
|
3112
|
+
^^^^^^^^
|
3113
|
+
- name: InstanceVariableAndWriteNode
|
3114
|
+
fields:
|
3115
|
+
- name: name
|
3116
|
+
type: constant
|
3117
|
+
- name: name_loc
|
3118
|
+
type: location
|
3119
|
+
- name: operator_loc
|
3120
|
+
type: location
|
3121
|
+
- name: value
|
3122
|
+
type: node
|
3123
|
+
kind: non-void expression
|
3124
|
+
comment: |
|
3125
|
+
Represents the use of the `&&=` operator for assignment to an instance variable.
|
3126
|
+
|
3127
|
+
@target &&= value
|
3128
|
+
^^^^^^^^^^^^^^^^^
|
3129
|
+
- name: InstanceVariableOperatorWriteNode
|
3130
|
+
fields:
|
3131
|
+
- name: name
|
3132
|
+
type: constant
|
3133
|
+
- name: name_loc
|
3134
|
+
type: location
|
3135
|
+
- name: binary_operator_loc
|
3136
|
+
type: location
|
3137
|
+
- name: value
|
3138
|
+
type: node
|
3139
|
+
kind: non-void expression
|
3140
|
+
- name: binary_operator
|
3141
|
+
type: constant
|
3142
|
+
comment: |
|
3143
|
+
Represents assigning to an instance variable using an operator that isn't `=`.
|
3144
|
+
|
3145
|
+
@target += value
|
3146
|
+
^^^^^^^^^^^^^^^^
|
3147
|
+
- name: InstanceVariableOrWriteNode
|
3148
|
+
fields:
|
3149
|
+
- name: name
|
3150
|
+
type: constant
|
3151
|
+
- name: name_loc
|
3152
|
+
type: location
|
3153
|
+
- name: operator_loc
|
3154
|
+
type: location
|
3155
|
+
- name: value
|
3156
|
+
type: node
|
3157
|
+
kind: non-void expression
|
3158
|
+
comment: |
|
3159
|
+
Represents the use of the `||=` operator for assignment to an instance variable.
|
3160
|
+
|
3161
|
+
@target ||= value
|
3162
|
+
^^^^^^^^^^^^^^^^^
|
3163
|
+
- name: InstanceVariableReadNode
|
3164
|
+
fields:
|
3165
|
+
- name: name
|
3166
|
+
type: constant
|
3167
|
+
comment: |
|
3168
|
+
The name of the instance variable, which is a `@` followed by an [identifier](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#identifiers).
|
3169
|
+
|
3170
|
+
@x # name `:@x`
|
3171
|
+
|
3172
|
+
@_test # name `:@_test`
|
3173
|
+
comment: |
|
3174
|
+
Represents referencing an instance variable.
|
3175
|
+
|
3176
|
+
@foo
|
3177
|
+
^^^^
|
3178
|
+
- name: InstanceVariableTargetNode
|
3179
|
+
fields:
|
3180
|
+
- name: name
|
3181
|
+
type: constant
|
3182
|
+
comment: |
|
3183
|
+
Represents writing to an instance variable in a context that doesn't have an explicit value.
|
3184
|
+
|
3185
|
+
@foo, @bar = baz
|
3186
|
+
^^^^ ^^^^
|
3187
|
+
- name: InstanceVariableWriteNode
|
3188
|
+
fields:
|
3189
|
+
- name: name
|
3190
|
+
type: constant
|
3191
|
+
comment: |
|
3192
|
+
The name of the instance variable, which is a `@` followed by an [identifier](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#identifiers).
|
3193
|
+
|
3194
|
+
@x = :y # name `:@x`
|
3195
|
+
|
3196
|
+
@_foo = "bar" # name `@_foo`
|
3197
|
+
- name: name_loc
|
3198
|
+
type: location
|
3199
|
+
comment: |
|
3200
|
+
The location of the variable name.
|
3201
|
+
|
3202
|
+
@_x = 1
|
3203
|
+
^^^
|
3204
|
+
- name: value
|
3205
|
+
type: node
|
3206
|
+
kind: non-void expression
|
3207
|
+
comment: |
|
3208
|
+
The value to write to the instance variable. It can be any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression).
|
3209
|
+
|
3210
|
+
@foo = :bar
|
3211
|
+
^^^^
|
3212
|
+
|
3213
|
+
@_x = 1234
|
3214
|
+
^^^^
|
3215
|
+
- name: operator_loc
|
3216
|
+
type: location
|
3217
|
+
comment: |
|
3218
|
+
The location of the `=` operator.
|
3219
|
+
|
3220
|
+
@x = y
|
3221
|
+
^
|
3222
|
+
comment: |
|
3223
|
+
Represents writing to an instance variable.
|
3224
|
+
|
3225
|
+
@foo = 1
|
3226
|
+
^^^^^^^^
|
3227
|
+
- name: IntegerNode
|
3228
|
+
flags: IntegerBaseFlags
|
3229
|
+
fields:
|
3230
|
+
- name: value
|
3231
|
+
type: integer
|
3232
|
+
comment: The value of the integer literal as a number.
|
3233
|
+
comment: |
|
3234
|
+
Represents an integer number literal.
|
3235
|
+
|
3236
|
+
1
|
3237
|
+
^
|
3238
|
+
- name: InterpolatedMatchLastLineNode
|
3239
|
+
flags: RegularExpressionFlags
|
3240
|
+
fields:
|
3241
|
+
- name: opening_loc
|
3242
|
+
type: location
|
3243
|
+
- name: parts
|
3244
|
+
type: node[]
|
3245
|
+
kind:
|
3246
|
+
- StringNode
|
3247
|
+
- EmbeddedStatementsNode
|
3248
|
+
- EmbeddedVariableNode
|
3249
|
+
- name: closing_loc
|
3250
|
+
type: location
|
3251
|
+
newline: parts
|
3252
|
+
comment: |
|
3253
|
+
Represents a regular expression literal that contains interpolation that is being used in the predicate of a conditional to implicitly match against the last line read by an IO object.
|
3254
|
+
|
3255
|
+
if /foo #{bar} baz/ then end
|
3256
|
+
^^^^^^^^^^^^^^^^
|
3257
|
+
- name: InterpolatedRegularExpressionNode
|
3258
|
+
flags: RegularExpressionFlags
|
3259
|
+
fields:
|
3260
|
+
- name: opening_loc
|
3261
|
+
type: location
|
3262
|
+
- name: parts
|
3263
|
+
type: node[]
|
3264
|
+
kind:
|
3265
|
+
- StringNode
|
3266
|
+
- EmbeddedStatementsNode
|
3267
|
+
- EmbeddedVariableNode
|
3268
|
+
- name: closing_loc
|
3269
|
+
type: location
|
3270
|
+
newline: parts
|
3271
|
+
comment: |
|
3272
|
+
Represents a regular expression literal that contains interpolation.
|
3273
|
+
|
3274
|
+
/foo #{bar} baz/
|
3275
|
+
^^^^^^^^^^^^^^^^
|
3276
|
+
- name: InterpolatedStringNode
|
3277
|
+
flags: InterpolatedStringNodeFlags
|
3278
|
+
fields:
|
3279
|
+
- name: opening_loc
|
3280
|
+
type: location?
|
3281
|
+
- name: parts
|
3282
|
+
type: node[]
|
3283
|
+
kind:
|
3284
|
+
- StringNode
|
3285
|
+
- EmbeddedStatementsNode
|
3286
|
+
- EmbeddedVariableNode
|
3287
|
+
- InterpolatedStringNode # `"a" "#{b}"`
|
3288
|
+
- on error: XStringNode # `<<`FOO` "bar"
|
3289
|
+
- name: closing_loc
|
3290
|
+
type: location?
|
3291
|
+
newline: parts
|
3292
|
+
comment: |
|
3293
|
+
Represents a string literal that contains interpolation.
|
3294
|
+
|
3295
|
+
"foo #{bar} baz"
|
3296
|
+
^^^^^^^^^^^^^^^^
|
3297
|
+
- name: InterpolatedSymbolNode
|
3298
|
+
fields:
|
3299
|
+
- name: opening_loc
|
3300
|
+
type: location?
|
3301
|
+
- name: parts
|
3302
|
+
type: node[]
|
3303
|
+
kind:
|
3304
|
+
- StringNode
|
3305
|
+
- EmbeddedStatementsNode
|
3306
|
+
- EmbeddedVariableNode
|
3307
|
+
- name: closing_loc
|
3308
|
+
type: location?
|
3309
|
+
newline: parts
|
3310
|
+
comment: |
|
3311
|
+
Represents a symbol literal that contains interpolation.
|
3312
|
+
|
3313
|
+
:"foo #{bar} baz"
|
3314
|
+
^^^^^^^^^^^^^^^^^
|
3315
|
+
- name: InterpolatedXStringNode
|
3316
|
+
fields:
|
3317
|
+
- name: opening_loc
|
3318
|
+
type: location
|
3319
|
+
- name: parts
|
3320
|
+
type: node[]
|
3321
|
+
kind:
|
3322
|
+
- StringNode
|
3323
|
+
- EmbeddedStatementsNode
|
3324
|
+
- EmbeddedVariableNode
|
3325
|
+
- name: closing_loc
|
3326
|
+
type: location
|
3327
|
+
newline: parts
|
3328
|
+
comment: |
|
3329
|
+
Represents an xstring literal that contains interpolation.
|
3330
|
+
|
3331
|
+
`foo #{bar} baz`
|
3332
|
+
^^^^^^^^^^^^^^^^
|
3333
|
+
- name: ItLocalVariableReadNode
|
3334
|
+
comment: |
|
3335
|
+
Represents reading from the implicit `it` local variable.
|
3336
|
+
|
3337
|
+
-> { it }
|
3338
|
+
^^
|
3339
|
+
- name: ItParametersNode
|
3340
|
+
comment: |
|
3341
|
+
Represents an implicit set of parameters through the use of the `it` keyword within a block or lambda.
|
3342
|
+
|
3343
|
+
-> { it + it }
|
3344
|
+
^^^^^^^^^^^^^^
|
3345
|
+
- name: KeywordHashNode
|
3346
|
+
flags: KeywordHashNodeFlags
|
3347
|
+
fields:
|
3348
|
+
- name: elements
|
3349
|
+
type: node[]
|
3350
|
+
kind:
|
3351
|
+
- AssocNode
|
3352
|
+
- AssocSplatNode
|
3353
|
+
comment: |
|
3354
|
+
Represents a hash literal without opening and closing braces.
|
3355
|
+
|
3356
|
+
foo(a: b)
|
3357
|
+
^^^^
|
3358
|
+
- name: KeywordRestParameterNode
|
3359
|
+
flags: ParameterFlags
|
3360
|
+
fields:
|
3361
|
+
- name: name
|
3362
|
+
type: constant?
|
3363
|
+
- name: name_loc
|
3364
|
+
type: location?
|
3365
|
+
- name: operator_loc
|
3366
|
+
type: location
|
3367
|
+
comment: |
|
3368
|
+
Represents a keyword rest parameter to a method, block, or lambda definition.
|
3369
|
+
|
3370
|
+
def a(**b)
|
3371
|
+
^^^
|
3372
|
+
end
|
3373
|
+
- name: LambdaNode
|
3374
|
+
fields:
|
3375
|
+
- name: locals
|
3376
|
+
type: constant[]
|
3377
|
+
- name: operator_loc
|
3378
|
+
type: location
|
3379
|
+
- name: opening_loc
|
3380
|
+
type: location
|
3381
|
+
- name: closing_loc
|
3382
|
+
type: location
|
3383
|
+
- name: parameters
|
3384
|
+
type: node?
|
3385
|
+
kind:
|
3386
|
+
- BlockParametersNode
|
3387
|
+
- NumberedParametersNode
|
3388
|
+
- ItParametersNode
|
3389
|
+
- name: body
|
3390
|
+
type: node?
|
3391
|
+
kind:
|
3392
|
+
- StatementsNode
|
3393
|
+
- BeginNode
|
3394
|
+
comment: |
|
3395
|
+
Represents using a lambda literal (not the lambda method call).
|
3396
|
+
|
3397
|
+
->(value) { value * 2 }
|
3398
|
+
^^^^^^^^^^^^^^^^^^^^^^^
|
3399
|
+
- name: LocalVariableAndWriteNode
|
3400
|
+
fields:
|
3401
|
+
- name: name_loc
|
3402
|
+
type: location
|
3403
|
+
- name: operator_loc
|
3404
|
+
type: location
|
3405
|
+
- name: value
|
3406
|
+
type: node
|
3407
|
+
kind: non-void expression
|
3408
|
+
- name: name
|
3409
|
+
type: constant
|
3410
|
+
- name: depth
|
3411
|
+
type: uint32
|
3412
|
+
comment: |
|
3413
|
+
Represents the use of the `&&=` operator for assignment to a local variable.
|
3414
|
+
|
3415
|
+
target &&= value
|
3416
|
+
^^^^^^^^^^^^^^^^
|
3417
|
+
- name: LocalVariableOperatorWriteNode
|
3418
|
+
fields:
|
3419
|
+
- name: name_loc
|
3420
|
+
type: location
|
3421
|
+
- name: binary_operator_loc
|
3422
|
+
type: location
|
3423
|
+
- name: value
|
3424
|
+
type: node
|
3425
|
+
kind: non-void expression
|
3426
|
+
- name: name
|
3427
|
+
type: constant
|
3428
|
+
- name: binary_operator
|
3429
|
+
type: constant
|
3430
|
+
- name: depth
|
3431
|
+
type: uint32
|
3432
|
+
comment: |
|
3433
|
+
Represents assigning to a local variable using an operator that isn't `=`.
|
3434
|
+
|
3435
|
+
target += value
|
3436
|
+
^^^^^^^^^^^^^^^
|
3437
|
+
- name: LocalVariableOrWriteNode
|
3438
|
+
fields:
|
3439
|
+
- name: name_loc
|
3440
|
+
type: location
|
3441
|
+
- name: operator_loc
|
3442
|
+
type: location
|
3443
|
+
- name: value
|
3444
|
+
type: node
|
3445
|
+
kind: non-void expression
|
3446
|
+
- name: name
|
3447
|
+
type: constant
|
3448
|
+
- name: depth
|
3449
|
+
type: uint32
|
3450
|
+
comment: |
|
3451
|
+
Represents the use of the `||=` operator for assignment to a local variable.
|
3452
|
+
|
3453
|
+
target ||= value
|
3454
|
+
^^^^^^^^^^^^^^^^
|
3455
|
+
- name: LocalVariableReadNode
|
3456
|
+
fields:
|
3457
|
+
- name: name
|
3458
|
+
type: constant
|
3459
|
+
comment: |
|
3460
|
+
The name of the local variable, which is an [identifier](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#identifiers).
|
3461
|
+
|
3462
|
+
x # name `:x`
|
3463
|
+
|
3464
|
+
_Test # name `:_Test`
|
3465
|
+
|
3466
|
+
Note that this can also be an underscore followed by a number for the default block parameters.
|
3467
|
+
|
3468
|
+
_1 # name `:_1`
|
3469
|
+
|
3470
|
+
- name: depth
|
3471
|
+
type: uint32
|
3472
|
+
comment: |
|
3473
|
+
The number of visible scopes that should be searched to find the origin of this local variable.
|
3474
|
+
|
3475
|
+
foo = 1; foo # depth 0
|
3476
|
+
|
3477
|
+
bar = 2; tap { bar } # depth 1
|
3478
|
+
|
3479
|
+
The specific rules for calculating the depth may differ from individual Ruby implementations, as they are not specified by the language. For more information, see [the Prism documentation](https://github.com/ruby/prism/blob/main/docs/local_variable_depth.md).
|
3480
|
+
comment: |
|
3481
|
+
Represents reading a local variable. Note that this requires that a local variable of the same name has already been written to in the same scope, otherwise it is parsed as a method call.
|
3482
|
+
|
3483
|
+
foo
|
3484
|
+
^^^
|
3485
|
+
- name: LocalVariableTargetNode
|
3486
|
+
fields:
|
3487
|
+
- name: name
|
3488
|
+
type: constant
|
3489
|
+
- name: depth
|
3490
|
+
type: uint32
|
3491
|
+
comment: |
|
3492
|
+
Represents writing to a local variable in a context that doesn't have an explicit value.
|
3493
|
+
|
3494
|
+
foo, bar = baz
|
3495
|
+
^^^ ^^^
|
3496
|
+
|
3497
|
+
foo => baz
|
3498
|
+
^^^
|
3499
|
+
- name: LocalVariableWriteNode
|
3500
|
+
fields:
|
3501
|
+
- name: name
|
3502
|
+
type: constant
|
3503
|
+
comment: |
|
3504
|
+
The name of the local variable, which is an [identifier](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#identifiers).
|
3505
|
+
|
3506
|
+
foo = :bar # name `:foo`
|
3507
|
+
|
3508
|
+
abc = 123 # name `:abc`
|
3509
|
+
- name: depth
|
3510
|
+
type: uint32
|
3511
|
+
comment: |
|
3512
|
+
The number of semantic scopes we have to traverse to find the declaration of this variable.
|
3513
|
+
|
3514
|
+
foo = 1 # depth 0
|
3515
|
+
|
3516
|
+
tap { foo = 1 } # depth 1
|
3517
|
+
|
3518
|
+
The specific rules for calculating the depth may differ from individual Ruby implementations, as they are not specified by the language. For more information, see [the Prism documentation](https://github.com/ruby/prism/blob/main/docs/local_variable_depth.md).
|
3519
|
+
- name: name_loc
|
3520
|
+
type: location
|
3521
|
+
comment: |
|
3522
|
+
The location of the variable name.
|
3523
|
+
|
3524
|
+
foo = :bar
|
3525
|
+
^^^
|
3526
|
+
- name: value
|
3527
|
+
type: node
|
3528
|
+
kind: non-void expression
|
3529
|
+
comment: |
|
3530
|
+
The value to write to the local variable. It can be any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression).
|
3531
|
+
|
3532
|
+
foo = :bar
|
3533
|
+
^^^^
|
3534
|
+
|
3535
|
+
abc = 1234
|
3536
|
+
^^^^
|
3537
|
+
|
3538
|
+
Note that since the name of a local variable is known before the value is parsed, it is valid for a local variable to appear within the value of its own write.
|
3539
|
+
|
3540
|
+
foo = foo
|
3541
|
+
- name: operator_loc
|
3542
|
+
type: location
|
3543
|
+
comment: |
|
3544
|
+
The location of the `=` operator.
|
3545
|
+
|
3546
|
+
x = :y
|
3547
|
+
^
|
3548
|
+
comment: |
|
3549
|
+
Represents writing to a local variable.
|
3550
|
+
|
3551
|
+
foo = 1
|
3552
|
+
^^^^^^^
|
3553
|
+
- name: MatchLastLineNode
|
3554
|
+
flags: RegularExpressionFlags
|
3555
|
+
fields:
|
3556
|
+
- name: opening_loc
|
3557
|
+
type: location
|
3558
|
+
- name: content_loc
|
3559
|
+
type: location
|
3560
|
+
- name: closing_loc
|
3561
|
+
type: location
|
3562
|
+
- name: unescaped
|
3563
|
+
type: string
|
3564
|
+
comment: |
|
3565
|
+
Represents a regular expression literal used in the predicate of a conditional to implicitly match against the last line read by an IO object.
|
3566
|
+
|
3567
|
+
if /foo/i then end
|
3568
|
+
^^^^^^
|
3569
|
+
- name: MatchPredicateNode
|
3570
|
+
fields:
|
3571
|
+
- name: value
|
3572
|
+
type: node
|
3573
|
+
kind: non-void expression
|
3574
|
+
- name: pattern
|
3575
|
+
type: node
|
3576
|
+
kind: pattern expression
|
3577
|
+
- name: operator_loc
|
3578
|
+
type: location
|
3579
|
+
comment: |
|
3580
|
+
Represents the use of the modifier `in` operator.
|
3581
|
+
|
3582
|
+
foo in bar
|
3583
|
+
^^^^^^^^^^
|
3584
|
+
- name: MatchRequiredNode
|
3585
|
+
fields:
|
3586
|
+
- name: value
|
3587
|
+
type: node
|
3588
|
+
kind: non-void expression
|
3589
|
+
comment: |
|
3590
|
+
Represents the left-hand side of the operator.
|
3591
|
+
|
3592
|
+
foo => bar
|
3593
|
+
^^^
|
3594
|
+
- name: pattern
|
3595
|
+
type: node
|
3596
|
+
kind: pattern expression
|
3597
|
+
comment: |
|
3598
|
+
Represents the right-hand side of the operator. The type of the node depends on the expression.
|
3599
|
+
|
3600
|
+
Anything that looks like a local variable name (including `_`) will result in a `LocalVariableTargetNode`.
|
3601
|
+
|
3602
|
+
foo => a # This is equivalent to writing `a = foo`
|
3603
|
+
^
|
3604
|
+
|
3605
|
+
Using an explicit `Array` or combining expressions with `,` will result in a `ArrayPatternNode`. This can be preceded by a constant.
|
3606
|
+
|
3607
|
+
foo => [a]
|
3608
|
+
^^^
|
3609
|
+
|
3610
|
+
foo => a, b
|
3611
|
+
^^^^
|
3612
|
+
|
3613
|
+
foo => Bar[a, b]
|
3614
|
+
^^^^^^^^^
|
3615
|
+
|
3616
|
+
If the array pattern contains at least two wildcard matches, a `FindPatternNode` is created instead.
|
3617
|
+
|
3618
|
+
foo => *, 1, *a
|
3619
|
+
^^^^^
|
3620
|
+
|
3621
|
+
Using an explicit `Hash` or a constant with square brackets and hash keys in the square brackets will result in a `HashPatternNode`.
|
3622
|
+
|
3623
|
+
foo => { a: 1, b: }
|
3624
|
+
|
3625
|
+
foo => Bar[a: 1, b:]
|
3626
|
+
|
3627
|
+
foo => Bar[**]
|
3628
|
+
|
3629
|
+
To use any variable that needs run time evaluation, pinning is required. This results in a `PinnedVariableNode`
|
3630
|
+
|
3631
|
+
foo => ^a
|
3632
|
+
^^
|
3633
|
+
|
3634
|
+
Similar, any expression can be used with pinning. This results in a `PinnedExpressionNode`.
|
3635
|
+
|
3636
|
+
foo => ^(a + 1)
|
3637
|
+
|
3638
|
+
Anything else will result in the regular node for that expression, for example a `ConstantReadNode`.
|
3639
|
+
|
3640
|
+
foo => CONST
|
3641
|
+
- name: operator_loc
|
3642
|
+
type: location
|
3643
|
+
comment: |
|
3644
|
+
The location of the operator.
|
3645
|
+
|
3646
|
+
foo => bar
|
3647
|
+
^^
|
3648
|
+
comment: |
|
3649
|
+
Represents the use of the `=>` operator.
|
3650
|
+
|
3651
|
+
foo => bar
|
3652
|
+
^^^^^^^^^^
|
3653
|
+
- name: MatchWriteNode
|
3654
|
+
fields:
|
3655
|
+
- name: call
|
3656
|
+
type: node
|
3657
|
+
kind: CallNode
|
3658
|
+
- name: targets
|
3659
|
+
type: node[]
|
3660
|
+
kind: LocalVariableTargetNode
|
3661
|
+
comment: |
|
3662
|
+
Represents writing local variables using a regular expression match with named capture groups.
|
3663
|
+
|
3664
|
+
/(?<foo>bar)/ =~ baz
|
3665
|
+
^^^^^^^^^^^^^^^^^^^^
|
3666
|
+
- name: MissingNode
|
3667
|
+
comment: |
|
3668
|
+
Represents a node that is missing from the source and results in a syntax error.
|
3669
|
+
- name: ModuleNode
|
3670
|
+
fields:
|
3671
|
+
- name: locals
|
3672
|
+
type: constant[]
|
3673
|
+
- name: module_keyword_loc
|
3674
|
+
type: location
|
3675
|
+
- name: constant_path
|
3676
|
+
type: node
|
3677
|
+
kind:
|
3678
|
+
- ConstantReadNode
|
3679
|
+
- ConstantPathNode
|
3680
|
+
- on error: MissingNode # module Parent module end
|
3681
|
+
- name: body
|
3682
|
+
type: node?
|
3683
|
+
kind:
|
3684
|
+
- StatementsNode
|
3685
|
+
- BeginNode
|
3686
|
+
- name: end_keyword_loc
|
3687
|
+
type: location
|
3688
|
+
- name: name
|
3689
|
+
type: constant
|
3690
|
+
comment: |
|
3691
|
+
Represents a module declaration involving the `module` keyword.
|
3692
|
+
|
3693
|
+
module Foo end
|
3694
|
+
^^^^^^^^^^^^^^
|
3695
|
+
- name: MultiTargetNode
|
3696
|
+
fields:
|
3697
|
+
- name: lefts
|
3698
|
+
type: node[]
|
3699
|
+
kind:
|
3700
|
+
- LocalVariableTargetNode
|
3701
|
+
- InstanceVariableTargetNode
|
3702
|
+
- ClassVariableTargetNode
|
3703
|
+
- GlobalVariableTargetNode
|
3704
|
+
- ConstantTargetNode
|
3705
|
+
- ConstantPathTargetNode
|
3706
|
+
- CallTargetNode
|
3707
|
+
- IndexTargetNode
|
3708
|
+
- MultiTargetNode
|
3709
|
+
- RequiredParameterNode # def m((a,b)); end
|
3710
|
+
- on error: BackReferenceReadNode # a, (b, $&) = z
|
3711
|
+
- on error: NumberedReferenceReadNode # a, (b, $1) = z
|
3712
|
+
comment: |
|
3713
|
+
Represents the targets expressions before a splat node.
|
3714
|
+
|
3715
|
+
a, (b, c, *) = 1, 2, 3, 4, 5
|
3716
|
+
^^^^
|
3717
|
+
|
3718
|
+
The splat node can be absent, in that case all target expressions are in the left field.
|
3719
|
+
|
3720
|
+
a, (b, c) = 1, 2, 3, 4, 5
|
3721
|
+
^^^^
|
3722
|
+
- name: rest
|
3723
|
+
type: node?
|
3724
|
+
kind:
|
3725
|
+
- ImplicitRestNode
|
3726
|
+
- SplatNode
|
3727
|
+
comment: |
|
3728
|
+
Represents a splat node in the target expression.
|
3729
|
+
|
3730
|
+
a, (b, *c) = 1, 2, 3, 4
|
3731
|
+
^^
|
3732
|
+
|
3733
|
+
The variable can be empty, this results in a `SplatNode` with a `nil` expression field.
|
3734
|
+
|
3735
|
+
a, (b, *) = 1, 2, 3, 4
|
3736
|
+
^
|
3737
|
+
|
3738
|
+
If the `*` is omitted, this field will contain an `ImplicitRestNode`
|
3739
|
+
|
3740
|
+
a, (b,) = 1, 2, 3, 4
|
3741
|
+
^
|
3742
|
+
- name: rights
|
3743
|
+
type: node[]
|
3744
|
+
kind:
|
3745
|
+
- LocalVariableTargetNode
|
3746
|
+
- InstanceVariableTargetNode
|
3747
|
+
- ClassVariableTargetNode
|
3748
|
+
- GlobalVariableTargetNode
|
3749
|
+
- ConstantTargetNode
|
3750
|
+
- ConstantPathTargetNode
|
3751
|
+
- CallTargetNode
|
3752
|
+
- IndexTargetNode
|
3753
|
+
- MultiTargetNode
|
3754
|
+
- RequiredParameterNode # def m((*,b)); end
|
3755
|
+
- on error: BackReferenceReadNode # a, (*, $&) = z
|
3756
|
+
- on error: NumberedReferenceReadNode # a, (*, $1) = z
|
3757
|
+
comment: |
|
3758
|
+
Represents the targets expressions after a splat node.
|
3759
|
+
|
3760
|
+
a, (*, b, c) = 1, 2, 3, 4, 5
|
3761
|
+
^^^^
|
3762
|
+
- name: lparen_loc
|
3763
|
+
type: location?
|
3764
|
+
comment: |
|
3765
|
+
The location of the opening parenthesis.
|
3766
|
+
|
3767
|
+
a, (b, c) = 1, 2, 3
|
3768
|
+
^
|
3769
|
+
- name: rparen_loc
|
3770
|
+
type: location?
|
3771
|
+
comment: |
|
3772
|
+
The location of the closing parenthesis.
|
3773
|
+
|
3774
|
+
a, (b, c) = 1, 2, 3
|
3775
|
+
^
|
3776
|
+
comment: |
|
3777
|
+
Represents a multi-target expression.
|
3778
|
+
|
3779
|
+
a, (b, c) = 1, 2, 3
|
3780
|
+
^^^^^^
|
3781
|
+
|
3782
|
+
This can be a part of `MultiWriteNode` as above, or the target of a `for` loop
|
3783
|
+
|
3784
|
+
for a, b in [[1, 2], [3, 4]]
|
3785
|
+
^^^^
|
3786
|
+
- name: MultiWriteNode
|
3787
|
+
fields:
|
3788
|
+
- name: lefts
|
3789
|
+
type: node[]
|
3790
|
+
kind:
|
3791
|
+
- LocalVariableTargetNode
|
3792
|
+
- InstanceVariableTargetNode
|
3793
|
+
- ClassVariableTargetNode
|
3794
|
+
- GlobalVariableTargetNode
|
3795
|
+
- ConstantTargetNode
|
3796
|
+
- ConstantPathTargetNode
|
3797
|
+
- CallTargetNode
|
3798
|
+
- IndexTargetNode
|
3799
|
+
- MultiTargetNode
|
3800
|
+
- on error: BackReferenceReadNode # $&, = z
|
3801
|
+
- on error: NumberedReferenceReadNode # $1, = z
|
3802
|
+
comment: |
|
3803
|
+
Represents the targets expressions before a splat node.
|
3804
|
+
|
3805
|
+
a, b, * = 1, 2, 3, 4, 5
|
3806
|
+
^^^^
|
3807
|
+
|
3808
|
+
The splat node can be absent, in that case all target expressions are in the left field.
|
3809
|
+
|
3810
|
+
a, b, c = 1, 2, 3, 4, 5
|
3811
|
+
^^^^^^^
|
3812
|
+
- name: rest
|
3813
|
+
type: node?
|
3814
|
+
kind:
|
3815
|
+
- ImplicitRestNode
|
3816
|
+
- SplatNode
|
3817
|
+
comment: |
|
3818
|
+
Represents a splat node in the target expression.
|
3819
|
+
|
3820
|
+
a, b, *c = 1, 2, 3, 4
|
3821
|
+
^^
|
3822
|
+
|
3823
|
+
The variable can be empty, this results in a `SplatNode` with a `nil` expression field.
|
3824
|
+
|
3825
|
+
a, b, * = 1, 2, 3, 4
|
3826
|
+
^
|
3827
|
+
|
3828
|
+
If the `*` is omitted, this field will contain an `ImplicitRestNode`
|
3829
|
+
|
3830
|
+
a, b, = 1, 2, 3, 4
|
3831
|
+
^
|
3832
|
+
- name: rights
|
3833
|
+
type: node[]
|
3834
|
+
kind:
|
3835
|
+
- LocalVariableTargetNode
|
3836
|
+
- InstanceVariableTargetNode
|
3837
|
+
- ClassVariableTargetNode
|
3838
|
+
- GlobalVariableTargetNode
|
3839
|
+
- ConstantTargetNode
|
3840
|
+
- ConstantPathTargetNode
|
3841
|
+
- CallTargetNode
|
3842
|
+
- IndexTargetNode
|
3843
|
+
- MultiTargetNode
|
3844
|
+
- on error: BackReferenceReadNode # *, $& = z
|
3845
|
+
- on error: NumberedReferenceReadNode # *, $1 = z
|
3846
|
+
comment: |
|
3847
|
+
Represents the targets expressions after a splat node.
|
3848
|
+
|
3849
|
+
a, *, b, c = 1, 2, 3, 4, 5
|
3850
|
+
^^^^
|
3851
|
+
- name: lparen_loc
|
3852
|
+
type: location?
|
3853
|
+
comment: |
|
3854
|
+
The location of the opening parenthesis.
|
3855
|
+
|
3856
|
+
(a, b, c) = 1, 2, 3
|
3857
|
+
^
|
3858
|
+
- name: rparen_loc
|
3859
|
+
type: location?
|
3860
|
+
comment: |
|
3861
|
+
The location of the closing parenthesis.
|
3862
|
+
|
3863
|
+
(a, b, c) = 1, 2, 3
|
3864
|
+
^
|
3865
|
+
- name: operator_loc
|
3866
|
+
type: location
|
3867
|
+
comment: |
|
3868
|
+
The location of the operator.
|
3869
|
+
|
3870
|
+
a, b, c = 1, 2, 3
|
3871
|
+
^
|
3872
|
+
- name: value
|
3873
|
+
type: node
|
3874
|
+
kind: non-void expression
|
3875
|
+
comment: |
|
3876
|
+
The value to write to the targets. It can be any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression).
|
3877
|
+
|
3878
|
+
a, b, c = 1, 2, 3
|
3879
|
+
^^^^^^^
|
3880
|
+
comment: |
|
3881
|
+
Represents a write to a multi-target expression.
|
3882
|
+
|
3883
|
+
a, b, c = 1, 2, 3
|
3884
|
+
^^^^^^^^^^^^^^^^^
|
3885
|
+
- name: NextNode
|
3886
|
+
fields:
|
3887
|
+
- name: arguments
|
3888
|
+
type: node?
|
3889
|
+
kind: ArgumentsNode
|
3890
|
+
- name: keyword_loc
|
3891
|
+
type: location
|
3892
|
+
comment: |
|
3893
|
+
Represents the use of the `next` keyword.
|
3894
|
+
|
3895
|
+
next 1
|
3896
|
+
^^^^^^
|
3897
|
+
- name: NilNode
|
3898
|
+
comment: |
|
3899
|
+
Represents the use of the `nil` keyword.
|
3900
|
+
|
3901
|
+
nil
|
3902
|
+
^^^
|
3903
|
+
- name: NoKeywordsParameterNode
|
3904
|
+
fields:
|
3905
|
+
- name: operator_loc
|
3906
|
+
type: location
|
3907
|
+
- name: keyword_loc
|
3908
|
+
type: location
|
3909
|
+
comment: |
|
3910
|
+
Represents the use of `**nil` inside method arguments.
|
3911
|
+
|
3912
|
+
def a(**nil)
|
3913
|
+
^^^^^
|
3914
|
+
end
|
3915
|
+
- name: NumberedParametersNode
|
3916
|
+
fields:
|
3917
|
+
- name: maximum
|
3918
|
+
type: uint8
|
3919
|
+
comment: |
|
3920
|
+
Represents an implicit set of parameters through the use of numbered parameters within a block or lambda.
|
3921
|
+
|
3922
|
+
-> { _1 + _2 }
|
3923
|
+
^^^^^^^^^^^^^^
|
3924
|
+
- name: NumberedReferenceReadNode
|
3925
|
+
fields:
|
3926
|
+
- name: number
|
3927
|
+
type: uint32
|
3928
|
+
comment: |
|
3929
|
+
The (1-indexed, from the left) number of the capture group. Numbered references that are too large result in this value being `0`.
|
3930
|
+
|
3931
|
+
$1 # number `1`
|
3932
|
+
|
3933
|
+
$5432 # number `5432`
|
3934
|
+
|
3935
|
+
$4294967296 # number `0`
|
3936
|
+
comment: |
|
3937
|
+
Represents reading a numbered reference to a capture in the previous match.
|
3938
|
+
|
3939
|
+
$1
|
3940
|
+
^^
|
3941
|
+
- name: OptionalKeywordParameterNode
|
3942
|
+
flags: ParameterFlags
|
3943
|
+
fields:
|
3944
|
+
- name: name
|
3945
|
+
type: constant
|
3946
|
+
- name: name_loc
|
3947
|
+
type: location
|
3948
|
+
- name: value
|
3949
|
+
type: node
|
3950
|
+
kind: non-void expression
|
3951
|
+
comment: |
|
3952
|
+
Represents an optional keyword parameter to a method, block, or lambda definition.
|
3953
|
+
|
3954
|
+
def a(b: 1)
|
3955
|
+
^^^^
|
3956
|
+
end
|
3957
|
+
- name: OptionalParameterNode
|
3958
|
+
flags: ParameterFlags
|
3959
|
+
fields:
|
3960
|
+
- name: name
|
3961
|
+
type: constant
|
3962
|
+
- name: name_loc
|
3963
|
+
type: location
|
3964
|
+
- name: operator_loc
|
3965
|
+
type: location
|
3966
|
+
- name: value
|
3967
|
+
type: node
|
3968
|
+
kind: non-void expression
|
3969
|
+
comment: |
|
3970
|
+
Represents an optional parameter to a method, block, or lambda definition.
|
3971
|
+
|
3972
|
+
def a(b = 1)
|
3973
|
+
^^^^^
|
3974
|
+
end
|
3975
|
+
- name: OrNode
|
3976
|
+
fields:
|
3977
|
+
- name: left
|
3978
|
+
type: node
|
3979
|
+
kind: non-void expression
|
3980
|
+
comment: |
|
3981
|
+
Represents the left side of the expression. It can be any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression).
|
3982
|
+
|
3983
|
+
left or right
|
3984
|
+
^^^^
|
3985
|
+
|
3986
|
+
1 || 2
|
3987
|
+
^
|
3988
|
+
- name: right
|
3989
|
+
type: node
|
3990
|
+
kind: Node
|
3991
|
+
comment: |
|
3992
|
+
Represents the right side of the expression.
|
3993
|
+
|
3994
|
+
left || right
|
3995
|
+
^^^^^
|
3996
|
+
|
3997
|
+
1 or 2
|
3998
|
+
^
|
3999
|
+
- name: operator_loc
|
4000
|
+
type: location
|
4001
|
+
comment: |
|
4002
|
+
The location of the `or` keyword or the `||` operator.
|
4003
|
+
|
4004
|
+
left or right
|
4005
|
+
^^
|
4006
|
+
comment: |
|
4007
|
+
Represents the use of the `||` operator or the `or` keyword.
|
4008
|
+
|
4009
|
+
left or right
|
4010
|
+
^^^^^^^^^^^^^
|
4011
|
+
- name: ParametersNode
|
4012
|
+
fields:
|
4013
|
+
- name: requireds
|
4014
|
+
type: node[]
|
4015
|
+
kind:
|
4016
|
+
- RequiredParameterNode
|
4017
|
+
- MultiTargetNode
|
4018
|
+
- name: optionals
|
4019
|
+
type: node[]
|
4020
|
+
kind: OptionalParameterNode
|
4021
|
+
- name: rest
|
4022
|
+
type: node?
|
4023
|
+
kind:
|
4024
|
+
- RestParameterNode
|
4025
|
+
- ImplicitRestNode # Only in block parameters
|
4026
|
+
- name: posts
|
4027
|
+
type: node[]
|
4028
|
+
kind:
|
4029
|
+
- RequiredParameterNode
|
4030
|
+
- MultiTargetNode
|
4031
|
+
# On parsing error of `f(**kwargs, ...)` or `f(**nil, ...)`, the keyword_rest value is moved here:
|
4032
|
+
- on error: KeywordRestParameterNode
|
4033
|
+
- on error: NoKeywordsParameterNode
|
4034
|
+
# On parsing error of `f(..., ...)`, the first forwarding parameter is moved here:
|
4035
|
+
- on error: ForwardingParameterNode
|
4036
|
+
- name: keywords
|
4037
|
+
type: node[]
|
4038
|
+
kind:
|
4039
|
+
- RequiredKeywordParameterNode
|
4040
|
+
- OptionalKeywordParameterNode
|
4041
|
+
- name: keyword_rest
|
4042
|
+
type: node?
|
4043
|
+
kind:
|
4044
|
+
- KeywordRestParameterNode
|
4045
|
+
- ForwardingParameterNode
|
4046
|
+
- NoKeywordsParameterNode
|
4047
|
+
- name: block
|
4048
|
+
type: node?
|
4049
|
+
kind: BlockParameterNode
|
4050
|
+
comment: |
|
4051
|
+
Represents the list of parameters on a method, block, or lambda definition.
|
4052
|
+
|
4053
|
+
def a(b, c, d)
|
4054
|
+
^^^^^^^
|
4055
|
+
end
|
4056
|
+
- name: ParenthesesNode
|
4057
|
+
flags: ParenthesesNodeFlags
|
4058
|
+
fields:
|
4059
|
+
- name: body
|
4060
|
+
type: node?
|
4061
|
+
kind: non-void expression # Usually a StatementsNode but not always e.g. `1 in (..10)`
|
4062
|
+
- name: opening_loc
|
4063
|
+
type: location
|
4064
|
+
- name: closing_loc
|
4065
|
+
type: location
|
4066
|
+
newline: false
|
4067
|
+
comment: |
|
4068
|
+
Represents a parenthesized expression
|
4069
|
+
|
4070
|
+
(10 + 34)
|
4071
|
+
^^^^^^^^^
|
4072
|
+
- name: PinnedExpressionNode
|
4073
|
+
fields:
|
4074
|
+
- name: expression
|
4075
|
+
type: node
|
4076
|
+
kind: non-void expression
|
4077
|
+
comment: |
|
4078
|
+
The expression used in the pinned expression
|
4079
|
+
|
4080
|
+
foo in ^(bar)
|
4081
|
+
^^^
|
4082
|
+
- name: operator_loc
|
4083
|
+
type: location
|
4084
|
+
comment: |
|
4085
|
+
The location of the `^` operator
|
4086
|
+
|
4087
|
+
foo in ^(bar)
|
4088
|
+
^
|
4089
|
+
- name: lparen_loc
|
4090
|
+
type: location
|
4091
|
+
comment: |
|
4092
|
+
The location of the opening parenthesis.
|
4093
|
+
|
4094
|
+
foo in ^(bar)
|
4095
|
+
^
|
4096
|
+
- name: rparen_loc
|
4097
|
+
type: location
|
4098
|
+
comment: |
|
4099
|
+
The location of the closing parenthesis.
|
4100
|
+
|
4101
|
+
foo in ^(bar)
|
4102
|
+
^
|
4103
|
+
comment: |
|
4104
|
+
Represents the use of the `^` operator for pinning an expression in a pattern matching expression.
|
4105
|
+
|
4106
|
+
foo in ^(bar)
|
4107
|
+
^^^^^^
|
4108
|
+
- name: PinnedVariableNode
|
4109
|
+
fields:
|
4110
|
+
- name: variable
|
4111
|
+
type: node
|
4112
|
+
kind:
|
4113
|
+
- LocalVariableReadNode
|
4114
|
+
- InstanceVariableReadNode
|
4115
|
+
- ClassVariableReadNode
|
4116
|
+
- GlobalVariableReadNode # foo in ^$a
|
4117
|
+
- BackReferenceReadNode # foo in ^$&
|
4118
|
+
- NumberedReferenceReadNode # foo in ^$1
|
4119
|
+
- ItLocalVariableReadNode # proc { 1 in ^it }
|
4120
|
+
- on error: MissingNode # foo in ^Bar
|
4121
|
+
comment: |
|
4122
|
+
The variable used in the pinned expression
|
4123
|
+
|
4124
|
+
foo in ^bar
|
4125
|
+
^^^
|
4126
|
+
- name: operator_loc
|
4127
|
+
type: location
|
4128
|
+
comment: |
|
4129
|
+
The location of the `^` operator
|
4130
|
+
|
4131
|
+
foo in ^bar
|
4132
|
+
^
|
4133
|
+
comment: |
|
4134
|
+
Represents the use of the `^` operator for pinning a variable in a pattern matching expression.
|
4135
|
+
|
4136
|
+
foo in ^bar
|
4137
|
+
^^^^
|
4138
|
+
- name: PostExecutionNode
|
4139
|
+
fields:
|
4140
|
+
- name: statements
|
4141
|
+
type: node?
|
4142
|
+
kind: StatementsNode
|
4143
|
+
- name: keyword_loc
|
4144
|
+
type: location
|
4145
|
+
- name: opening_loc
|
4146
|
+
type: location
|
4147
|
+
- name: closing_loc
|
4148
|
+
type: location
|
4149
|
+
comment: |
|
4150
|
+
Represents the use of the `END` keyword.
|
4151
|
+
|
4152
|
+
END { foo }
|
4153
|
+
^^^^^^^^^^^
|
4154
|
+
- name: PreExecutionNode
|
4155
|
+
fields:
|
4156
|
+
- name: statements
|
4157
|
+
type: node?
|
4158
|
+
kind: StatementsNode
|
4159
|
+
- name: keyword_loc
|
4160
|
+
type: location
|
4161
|
+
- name: opening_loc
|
4162
|
+
type: location
|
4163
|
+
- name: closing_loc
|
4164
|
+
type: location
|
4165
|
+
comment: |
|
4166
|
+
Represents the use of the `BEGIN` keyword.
|
4167
|
+
|
4168
|
+
BEGIN { foo }
|
4169
|
+
^^^^^^^^^^^^^
|
4170
|
+
- name: ProgramNode
|
4171
|
+
fields:
|
4172
|
+
- name: locals
|
4173
|
+
type: constant[]
|
4174
|
+
- name: statements
|
4175
|
+
type: node
|
4176
|
+
kind: StatementsNode
|
4177
|
+
comment: The top level node of any parse tree.
|
4178
|
+
- name: RangeNode
|
4179
|
+
flags: RangeFlags
|
4180
|
+
fields:
|
4181
|
+
- name: left
|
4182
|
+
type: node?
|
4183
|
+
kind: non-void expression
|
4184
|
+
comment: |
|
4185
|
+
The left-hand side of the range, if present. It can be either `nil` or any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression).
|
4186
|
+
|
4187
|
+
1...
|
4188
|
+
^
|
4189
|
+
|
4190
|
+
hello...goodbye
|
4191
|
+
^^^^^
|
4192
|
+
- name: right
|
4193
|
+
type: node?
|
4194
|
+
kind: non-void expression
|
4195
|
+
comment: |
|
4196
|
+
The right-hand side of the range, if present. It can be either `nil` or any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression).
|
4197
|
+
|
4198
|
+
..5
|
4199
|
+
^
|
4200
|
+
|
4201
|
+
1...foo
|
4202
|
+
^^^
|
4203
|
+
If neither right-hand or left-hand side was included, this will be a MissingNode.
|
4204
|
+
- name: operator_loc
|
4205
|
+
type: location
|
4206
|
+
comment: |
|
4207
|
+
The location of the `..` or `...` operator.
|
4208
|
+
comment: |
|
4209
|
+
Represents the use of the `..` or `...` operators.
|
4210
|
+
|
4211
|
+
1..2
|
4212
|
+
^^^^
|
4213
|
+
|
4214
|
+
c if a =~ /left/ ... b =~ /right/
|
4215
|
+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
4216
|
+
- name: RationalNode
|
4217
|
+
flags: IntegerBaseFlags
|
4218
|
+
fields:
|
4219
|
+
- name: numerator
|
4220
|
+
type: integer
|
4221
|
+
comment: |
|
4222
|
+
The numerator of the rational number.
|
4223
|
+
|
4224
|
+
1.5r # numerator 3
|
4225
|
+
- name: denominator
|
4226
|
+
type: integer
|
4227
|
+
comment: |
|
4228
|
+
The denominator of the rational number.
|
4229
|
+
|
4230
|
+
1.5r # denominator 2
|
4231
|
+
comment: |
|
4232
|
+
Represents a rational number literal.
|
4233
|
+
|
4234
|
+
1.0r
|
4235
|
+
^^^^
|
4236
|
+
- name: RedoNode
|
4237
|
+
comment: |
|
4238
|
+
Represents the use of the `redo` keyword.
|
4239
|
+
|
4240
|
+
redo
|
4241
|
+
^^^^
|
4242
|
+
- name: RegularExpressionNode
|
4243
|
+
flags: RegularExpressionFlags
|
4244
|
+
fields:
|
4245
|
+
- name: opening_loc
|
4246
|
+
type: location
|
4247
|
+
- name: content_loc
|
4248
|
+
type: location
|
4249
|
+
- name: closing_loc
|
4250
|
+
type: location
|
4251
|
+
- name: unescaped
|
4252
|
+
type: string
|
4253
|
+
comment: |
|
4254
|
+
Represents a regular expression literal with no interpolation.
|
4255
|
+
|
4256
|
+
/foo/i
|
4257
|
+
^^^^^^
|
4258
|
+
- name: RequiredKeywordParameterNode
|
4259
|
+
flags: ParameterFlags
|
4260
|
+
fields:
|
4261
|
+
- name: name
|
4262
|
+
type: constant
|
4263
|
+
- name: name_loc
|
4264
|
+
type: location
|
4265
|
+
comment: |
|
4266
|
+
Represents a required keyword parameter to a method, block, or lambda definition.
|
4267
|
+
|
4268
|
+
def a(b: )
|
4269
|
+
^^
|
4270
|
+
end
|
4271
|
+
- name: RequiredParameterNode
|
4272
|
+
flags: ParameterFlags
|
4273
|
+
fields:
|
4274
|
+
- name: name
|
4275
|
+
type: constant
|
4276
|
+
comment: |
|
4277
|
+
Represents a required parameter to a method, block, or lambda definition.
|
4278
|
+
|
4279
|
+
def a(b)
|
4280
|
+
^
|
4281
|
+
end
|
4282
|
+
- name: RescueModifierNode
|
4283
|
+
fields:
|
4284
|
+
- name: expression
|
4285
|
+
type: node
|
4286
|
+
kind: Node
|
4287
|
+
- name: keyword_loc
|
4288
|
+
type: location
|
4289
|
+
- name: rescue_expression
|
4290
|
+
type: node
|
4291
|
+
kind: Node
|
4292
|
+
newline: expression
|
4293
|
+
comment: |
|
4294
|
+
Represents an expression modified with a rescue.
|
4295
|
+
|
4296
|
+
foo rescue nil
|
4297
|
+
^^^^^^^^^^^^^^
|
4298
|
+
- name: RescueNode
|
4299
|
+
fields:
|
4300
|
+
- name: keyword_loc
|
4301
|
+
type: location
|
4302
|
+
- name: exceptions
|
4303
|
+
type: node[]
|
4304
|
+
kind: non-void expression
|
4305
|
+
- name: operator_loc
|
4306
|
+
type: location?
|
4307
|
+
- name: reference
|
4308
|
+
type: node?
|
4309
|
+
kind:
|
4310
|
+
- LocalVariableTargetNode
|
4311
|
+
- InstanceVariableTargetNode
|
4312
|
+
- ClassVariableTargetNode
|
4313
|
+
- GlobalVariableTargetNode
|
4314
|
+
- ConstantTargetNode
|
4315
|
+
- ConstantPathTargetNode
|
4316
|
+
- CallTargetNode
|
4317
|
+
- IndexTargetNode
|
4318
|
+
- on error: BackReferenceReadNode # => begin; rescue => $&; end
|
4319
|
+
- on error: NumberedReferenceReadNode # => begin; rescue => $1; end
|
4320
|
+
- on error: MissingNode # begin; rescue =>; end
|
4321
|
+
- name: then_keyword_loc
|
4322
|
+
type: location?
|
4323
|
+
- name: statements
|
4324
|
+
type: node?
|
4325
|
+
kind: StatementsNode
|
4326
|
+
- name: subsequent
|
4327
|
+
type: node?
|
4328
|
+
kind: RescueNode
|
4329
|
+
comment: |
|
4330
|
+
Represents a rescue statement.
|
4331
|
+
|
4332
|
+
begin
|
4333
|
+
rescue Foo, *splat, Bar => ex
|
4334
|
+
foo
|
4335
|
+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
4336
|
+
end
|
4337
|
+
|
4338
|
+
`Foo, *splat, Bar` are in the `exceptions` field. `ex` is in the `reference` field.
|
4339
|
+
- name: RestParameterNode
|
4340
|
+
flags: ParameterFlags
|
4341
|
+
fields:
|
4342
|
+
- name: name
|
4343
|
+
type: constant?
|
4344
|
+
- name: name_loc
|
4345
|
+
type: location?
|
4346
|
+
- name: operator_loc
|
4347
|
+
type: location
|
4348
|
+
comment: |
|
4349
|
+
Represents a rest parameter to a method, block, or lambda definition.
|
4350
|
+
|
4351
|
+
def a(*b)
|
4352
|
+
^^
|
4353
|
+
end
|
4354
|
+
- name: RetryNode
|
4355
|
+
comment: |
|
4356
|
+
Represents the use of the `retry` keyword.
|
4357
|
+
|
4358
|
+
retry
|
4359
|
+
^^^^^
|
4360
|
+
- name: ReturnNode
|
4361
|
+
fields:
|
4362
|
+
- name: keyword_loc
|
4363
|
+
type: location
|
4364
|
+
- name: arguments
|
4365
|
+
type: node?
|
4366
|
+
kind: ArgumentsNode
|
4367
|
+
comment: |
|
4368
|
+
Represents the use of the `return` keyword.
|
4369
|
+
|
4370
|
+
return 1
|
4371
|
+
^^^^^^^^
|
4372
|
+
- name: SelfNode
|
4373
|
+
comment: |
|
4374
|
+
Represents the `self` keyword.
|
4375
|
+
|
4376
|
+
self
|
4377
|
+
^^^^
|
4378
|
+
- name: ShareableConstantNode
|
4379
|
+
flags: ShareableConstantNodeFlags
|
4380
|
+
fields:
|
4381
|
+
- name: write
|
4382
|
+
type: node
|
4383
|
+
kind:
|
4384
|
+
- ConstantWriteNode
|
4385
|
+
- ConstantAndWriteNode
|
4386
|
+
- ConstantOrWriteNode
|
4387
|
+
- ConstantOperatorWriteNode
|
4388
|
+
- ConstantPathWriteNode
|
4389
|
+
- ConstantPathAndWriteNode
|
4390
|
+
- ConstantPathOrWriteNode
|
4391
|
+
- ConstantPathOperatorWriteNode
|
4392
|
+
comment: The constant write that should be modified with the shareability state.
|
4393
|
+
comment: |
|
4394
|
+
This node wraps a constant write to indicate that when the value is written, it should have its shareability state modified.
|
4395
|
+
|
4396
|
+
# shareable_constant_value: literal
|
4397
|
+
C = { a: 1 }
|
4398
|
+
^^^^^^^^^^^^
|
4399
|
+
- name: SingletonClassNode
|
4400
|
+
fields:
|
4401
|
+
- name: locals
|
4402
|
+
type: constant[]
|
4403
|
+
- name: class_keyword_loc
|
4404
|
+
type: location
|
4405
|
+
- name: operator_loc
|
4406
|
+
type: location
|
4407
|
+
- name: expression
|
4408
|
+
type: node
|
4409
|
+
kind: non-void expression
|
4410
|
+
- name: body
|
4411
|
+
type: node?
|
4412
|
+
kind:
|
4413
|
+
- StatementsNode
|
4414
|
+
- BeginNode
|
4415
|
+
- name: end_keyword_loc
|
4416
|
+
type: location
|
4417
|
+
comment: |
|
4418
|
+
Represents a singleton class declaration involving the `class` keyword.
|
4419
|
+
|
4420
|
+
class << self end
|
4421
|
+
^^^^^^^^^^^^^^^^^
|
4422
|
+
- name: SourceEncodingNode
|
4423
|
+
comment: |
|
4424
|
+
Represents the use of the `__ENCODING__` keyword.
|
4425
|
+
|
4426
|
+
__ENCODING__
|
4427
|
+
^^^^^^^^^^^^
|
4428
|
+
- name: SourceFileNode
|
4429
|
+
flags: StringFlags
|
4430
|
+
fields:
|
4431
|
+
- name: filepath
|
4432
|
+
type: string
|
4433
|
+
comment: Represents the file path being parsed. This corresponds directly to the `filepath` option given to the various `Prism::parse*` APIs.
|
4434
|
+
comment: |
|
4435
|
+
Represents the use of the `__FILE__` keyword.
|
4436
|
+
|
4437
|
+
__FILE__
|
4438
|
+
^^^^^^^^
|
4439
|
+
- name: SourceLineNode
|
4440
|
+
comment: |
|
4441
|
+
Represents the use of the `__LINE__` keyword.
|
4442
|
+
|
4443
|
+
__LINE__
|
4444
|
+
^^^^^^^^
|
4445
|
+
- name: SplatNode
|
4446
|
+
fields:
|
4447
|
+
- name: operator_loc
|
4448
|
+
type: location
|
4449
|
+
- name: expression
|
4450
|
+
type: node?
|
4451
|
+
kind: non-void expression
|
4452
|
+
comment: |
|
4453
|
+
Represents the use of the splat operator.
|
4454
|
+
|
4455
|
+
[*a]
|
4456
|
+
^^
|
4457
|
+
- name: StatementsNode
|
4458
|
+
fields:
|
4459
|
+
- name: body
|
4460
|
+
type: node[]
|
4461
|
+
kind: Node
|
4462
|
+
comment: |
|
4463
|
+
Represents a set of statements contained within some scope.
|
4464
|
+
|
4465
|
+
foo; bar; baz
|
4466
|
+
^^^^^^^^^^^^^
|
4467
|
+
- name: StringNode
|
4468
|
+
flags: StringFlags
|
4469
|
+
fields:
|
4470
|
+
- name: opening_loc
|
4471
|
+
type: location?
|
4472
|
+
- name: content_loc
|
4473
|
+
type: location
|
4474
|
+
- name: closing_loc
|
4475
|
+
type: location?
|
4476
|
+
- name: unescaped
|
4477
|
+
type: string
|
4478
|
+
comment: |
|
4479
|
+
Represents a string literal, a string contained within a `%w` list, or plain string content within an interpolated string.
|
4480
|
+
|
4481
|
+
"foo"
|
4482
|
+
^^^^^
|
4483
|
+
|
4484
|
+
%w[foo]
|
4485
|
+
^^^
|
4486
|
+
|
4487
|
+
"foo #{bar} baz"
|
4488
|
+
^^^^ ^^^^
|
4489
|
+
- name: SuperNode
|
4490
|
+
fields:
|
4491
|
+
- name: keyword_loc
|
4492
|
+
type: location
|
4493
|
+
- name: lparen_loc
|
4494
|
+
type: location?
|
4495
|
+
- name: arguments
|
4496
|
+
type: node?
|
4497
|
+
kind: ArgumentsNode
|
4498
|
+
- name: rparen_loc
|
4499
|
+
type: location?
|
4500
|
+
- name: block
|
4501
|
+
type: node?
|
4502
|
+
kind:
|
4503
|
+
- BlockNode
|
4504
|
+
- BlockArgumentNode
|
4505
|
+
comment: |
|
4506
|
+
Represents the use of the `super` keyword with parentheses or arguments.
|
4507
|
+
|
4508
|
+
super()
|
4509
|
+
^^^^^^^
|
4510
|
+
|
4511
|
+
super foo, bar
|
4512
|
+
^^^^^^^^^^^^^^
|
4513
|
+
- name: SymbolNode
|
4514
|
+
flags: SymbolFlags
|
4515
|
+
fields:
|
4516
|
+
- name: opening_loc
|
4517
|
+
type: location?
|
4518
|
+
- name: value_loc
|
4519
|
+
type: location?
|
4520
|
+
- name: closing_loc
|
4521
|
+
type: location?
|
4522
|
+
- name: unescaped
|
4523
|
+
type: string
|
4524
|
+
comment: |
|
4525
|
+
Represents a symbol literal or a symbol contained within a `%i` list.
|
4526
|
+
|
4527
|
+
:foo
|
4528
|
+
^^^^
|
4529
|
+
|
4530
|
+
%i[foo]
|
4531
|
+
^^^
|
4532
|
+
- name: TrueNode
|
4533
|
+
comment: |
|
4534
|
+
Represents the use of the literal `true` keyword.
|
4535
|
+
|
4536
|
+
true
|
4537
|
+
^^^^
|
4538
|
+
- name: UndefNode
|
4539
|
+
fields:
|
4540
|
+
- name: names
|
4541
|
+
type: node[]
|
4542
|
+
kind:
|
4543
|
+
- SymbolNode
|
4544
|
+
- InterpolatedSymbolNode
|
4545
|
+
- name: keyword_loc
|
4546
|
+
type: location
|
4547
|
+
comment: |
|
4548
|
+
Represents the use of the `undef` keyword.
|
4549
|
+
|
4550
|
+
undef :foo, :bar, :baz
|
4551
|
+
^^^^^^^^^^^^^^^^^^^^^^
|
4552
|
+
- name: UnlessNode
|
4553
|
+
fields:
|
4554
|
+
- name: keyword_loc
|
4555
|
+
type: location
|
4556
|
+
comment: |
|
4557
|
+
The location of the `unless` keyword.
|
4558
|
+
|
4559
|
+
unless cond then bar end
|
4560
|
+
^^^^^^
|
4561
|
+
|
4562
|
+
bar unless cond
|
4563
|
+
^^^^^^
|
4564
|
+
- name: predicate
|
4565
|
+
type: node
|
4566
|
+
kind: non-void expression
|
4567
|
+
comment: |
|
4568
|
+
The condition to be evaluated for the unless expression. It can be any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression).
|
4569
|
+
|
4570
|
+
unless cond then bar end
|
4571
|
+
^^^^
|
4572
|
+
|
4573
|
+
bar unless cond
|
4574
|
+
^^^^
|
4575
|
+
- name: then_keyword_loc
|
4576
|
+
type: location?
|
4577
|
+
comment: |
|
4578
|
+
The location of the `then` keyword, if present.
|
4579
|
+
|
4580
|
+
unless cond then bar end
|
4581
|
+
^^^^
|
4582
|
+
- name: statements
|
4583
|
+
type: node?
|
4584
|
+
kind: StatementsNode
|
4585
|
+
comment: |
|
4586
|
+
The body of statements that will executed if the unless condition is
|
4587
|
+
falsey. Will be `nil` if no body is provided.
|
4588
|
+
|
4589
|
+
unless cond then bar end
|
4590
|
+
^^^
|
4591
|
+
- name: else_clause
|
4592
|
+
type: node?
|
4593
|
+
kind: ElseNode
|
4594
|
+
comment: |
|
4595
|
+
The else clause of the unless expression, if present.
|
4596
|
+
|
4597
|
+
unless cond then bar else baz end
|
4598
|
+
^^^^^^^^
|
4599
|
+
- name: end_keyword_loc
|
4600
|
+
type: location?
|
4601
|
+
comment: |
|
4602
|
+
The location of the `end` keyword, if present.
|
4603
|
+
|
4604
|
+
unless cond then bar end
|
4605
|
+
^^^
|
4606
|
+
newline: predicate
|
4607
|
+
comment: |
|
4608
|
+
Represents the use of the `unless` keyword, either in the block form or the modifier form.
|
4609
|
+
|
4610
|
+
bar unless foo
|
4611
|
+
^^^^^^^^^^^^^^
|
4612
|
+
|
4613
|
+
unless foo then bar end
|
4614
|
+
^^^^^^^^^^^^^^^^^^^^^^^
|
4615
|
+
- name: UntilNode
|
4616
|
+
flags: LoopFlags
|
4617
|
+
fields:
|
4618
|
+
- name: keyword_loc
|
4619
|
+
type: location
|
4620
|
+
- name: do_keyword_loc
|
4621
|
+
type: location?
|
4622
|
+
- name: closing_loc
|
4623
|
+
type: location?
|
4624
|
+
- name: predicate
|
4625
|
+
type: node
|
4626
|
+
kind: non-void expression
|
4627
|
+
- name: statements
|
4628
|
+
type: node?
|
4629
|
+
kind: StatementsNode
|
4630
|
+
newline: predicate
|
4631
|
+
comment: |
|
4632
|
+
Represents the use of the `until` keyword, either in the block form or the modifier form.
|
4633
|
+
|
4634
|
+
bar until foo
|
4635
|
+
^^^^^^^^^^^^^
|
4636
|
+
|
4637
|
+
until foo do bar end
|
4638
|
+
^^^^^^^^^^^^^^^^^^^^
|
4639
|
+
- name: WhenNode
|
4640
|
+
fields:
|
4641
|
+
- name: keyword_loc
|
4642
|
+
type: location
|
4643
|
+
- name: conditions
|
4644
|
+
type: node[]
|
4645
|
+
kind: non-void expression
|
4646
|
+
- name: then_keyword_loc
|
4647
|
+
type: location?
|
4648
|
+
- name: statements
|
4649
|
+
type: node?
|
4650
|
+
kind: StatementsNode
|
4651
|
+
comment: |
|
4652
|
+
Represents the use of the `when` keyword within a case statement.
|
4653
|
+
|
4654
|
+
case true
|
4655
|
+
when true
|
4656
|
+
^^^^^^^^^
|
4657
|
+
end
|
4658
|
+
- name: WhileNode
|
4659
|
+
flags: LoopFlags
|
4660
|
+
fields:
|
4661
|
+
- name: keyword_loc
|
4662
|
+
type: location
|
4663
|
+
- name: do_keyword_loc
|
4664
|
+
type: location?
|
4665
|
+
- name: closing_loc
|
4666
|
+
type: location?
|
4667
|
+
- name: predicate
|
4668
|
+
type: node
|
4669
|
+
kind: non-void expression
|
4670
|
+
- name: statements
|
4671
|
+
type: node?
|
4672
|
+
kind: StatementsNode
|
4673
|
+
newline: predicate
|
4674
|
+
comment: |
|
4675
|
+
Represents the use of the `while` keyword, either in the block form or the modifier form.
|
4676
|
+
|
4677
|
+
bar while foo
|
4678
|
+
^^^^^^^^^^^^^
|
4679
|
+
|
4680
|
+
while foo do bar end
|
4681
|
+
^^^^^^^^^^^^^^^^^^^^
|
4682
|
+
- name: XStringNode
|
4683
|
+
flags: EncodingFlags
|
4684
|
+
fields:
|
4685
|
+
- name: opening_loc
|
4686
|
+
type: location
|
4687
|
+
- name: content_loc
|
4688
|
+
type: location
|
4689
|
+
- name: closing_loc
|
4690
|
+
type: location
|
4691
|
+
- name: unescaped
|
4692
|
+
type: string
|
4693
|
+
comment: |
|
4694
|
+
Represents an xstring literal with no interpolation.
|
4695
|
+
|
4696
|
+
`foo`
|
4697
|
+
^^^^^
|
4698
|
+
- name: YieldNode
|
4699
|
+
fields:
|
4700
|
+
- name: keyword_loc
|
4701
|
+
type: location
|
4702
|
+
- name: lparen_loc
|
4703
|
+
type: location?
|
4704
|
+
- name: arguments
|
4705
|
+
type: node?
|
4706
|
+
kind: ArgumentsNode
|
4707
|
+
- name: rparen_loc
|
4708
|
+
type: location?
|
4709
|
+
comment: |
|
4710
|
+
Represents the use of the `yield` keyword.
|
4711
|
+
|
4712
|
+
yield 1
|
4713
|
+
^^^^^^^
|