lib-ruby-parser 0.0.1.beta3-x86_64-darwin → 1.0.0-x86_64-darwin
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/lib/lib-ruby-parser/messages.rb +295 -280
- data/lib/lib-ruby-parser/native/lib_ruby_parser.bundle +0 -0
- data/lib/lib-ruby-parser/nodes.rb +1813 -2232
- data/lib/lib-ruby-parser/version.rb +2 -2
- metadata +5 -5
@@ -1,4 +1,4 @@
|
|
1
|
-
# This file is autogenerated by codegen/
|
1
|
+
# This file is autogenerated by codegen/messages.rb.liquid
|
2
2
|
|
3
3
|
# Root module
|
4
4
|
module LibRubyParser
|
@@ -6,271 +6,264 @@ module LibRubyParser
|
|
6
6
|
module Messages
|
7
7
|
# Emitted for code
|
8
8
|
#
|
9
|
-
#
|
10
|
-
#
|
11
|
-
#
|
9
|
+
# ```text
|
10
|
+
# 1.2.3
|
11
|
+
# ```
|
12
12
|
class FractionAfterNumeric < DiagnosticMessage
|
13
13
|
end
|
14
14
|
|
15
15
|
# Emitted for code like
|
16
16
|
#
|
17
|
-
#
|
18
|
-
#
|
19
|
-
#
|
17
|
+
# ```text
|
18
|
+
# foo.2
|
19
|
+
# ```
|
20
20
|
class NoDigitsAfterDot < DiagnosticMessage
|
21
21
|
end
|
22
22
|
|
23
23
|
# Emitted for code like
|
24
24
|
#
|
25
|
-
#
|
26
|
-
#
|
27
|
-
#
|
25
|
+
# ```text
|
26
|
+
# %k[foo]
|
27
|
+
# ```
|
28
28
|
class UnknownTypeOfPercentString < DiagnosticMessage
|
29
29
|
end
|
30
30
|
|
31
31
|
# Emitted for code like
|
32
32
|
#
|
33
|
-
#
|
34
|
-
#
|
35
|
-
#
|
33
|
+
# ```text
|
34
|
+
# 0b
|
35
|
+
# ```
|
36
36
|
class NumericLiteralWithoutDigits < DiagnosticMessage
|
37
37
|
end
|
38
38
|
|
39
39
|
# Emitted for code like
|
40
40
|
#
|
41
|
-
#
|
42
|
-
#
|
43
|
-
#
|
41
|
+
# ```text
|
42
|
+
# %w[foo bar
|
43
|
+
# ```
|
44
44
|
class UnterminatedList < DiagnosticMessage
|
45
45
|
end
|
46
46
|
|
47
47
|
# Emitted for code like
|
48
48
|
#
|
49
|
-
#
|
50
|
-
#
|
51
|
-
#
|
49
|
+
# ```text
|
50
|
+
# /foo
|
51
|
+
# ```
|
52
52
|
class UnterminatedRegexp < DiagnosticMessage
|
53
53
|
end
|
54
54
|
|
55
55
|
# Emitted for code like
|
56
56
|
#
|
57
|
-
#
|
58
|
-
#
|
59
|
-
#
|
57
|
+
# ```text
|
58
|
+
# "foo
|
59
|
+
# ```
|
60
60
|
class UnterminatedString < DiagnosticMessage
|
61
61
|
end
|
62
62
|
|
63
63
|
# Emitted for code like
|
64
64
|
#
|
65
|
-
#
|
66
|
-
#
|
67
|
-
#
|
68
|
-
#
|
65
|
+
# ```text
|
66
|
+
# %s
|
67
|
+
# // ^ EOF, not "
|
69
68
|
#
|
69
|
+
# ```
|
70
70
|
class UnterminatedQuotedString < DiagnosticMessage
|
71
71
|
end
|
72
72
|
|
73
73
|
# Emitted for code like
|
74
74
|
#
|
75
|
-
#
|
76
|
-
#
|
77
|
-
#
|
75
|
+
# ```text
|
76
|
+
# "\ufoo"
|
77
|
+
# ```
|
78
78
|
class InvalidUnicodeEscape < DiagnosticMessage
|
79
79
|
end
|
80
80
|
|
81
81
|
# Emitted for code like
|
82
82
|
#
|
83
|
-
#
|
84
|
-
#
|
85
|
-
#
|
83
|
+
# ```text
|
84
|
+
# "\u{999999}"
|
85
|
+
# ```
|
86
86
|
class TooLargeUnicodeCodepoint < DiagnosticMessage
|
87
87
|
end
|
88
88
|
|
89
89
|
# Emitted for code like
|
90
90
|
#
|
91
|
-
#
|
92
|
-
#
|
93
|
-
#
|
91
|
+
# ```text
|
92
|
+
# "\u{d800}"
|
93
|
+
# ```
|
94
94
|
class InvalidUnicodeCodepoint < DiagnosticMessage
|
95
95
|
end
|
96
96
|
|
97
97
|
# Emitted for code like
|
98
98
|
#
|
99
|
-
#
|
100
|
-
#
|
101
|
-
#
|
99
|
+
# ```text
|
100
|
+
# ?\u{41 42}
|
101
|
+
# ```
|
102
102
|
class MultipleCodepointAtSingleChar < DiagnosticMessage
|
103
103
|
end
|
104
104
|
|
105
105
|
# Emitted for code like
|
106
106
|
#
|
107
|
-
#
|
108
|
-
#
|
109
|
-
#
|
107
|
+
# ```text
|
108
|
+
# "\M-"
|
109
|
+
# ```
|
110
110
|
class InvalidEscapeCharacter < DiagnosticMessage
|
111
111
|
end
|
112
112
|
|
113
113
|
# Emitted for code like
|
114
114
|
#
|
115
|
-
#
|
116
|
-
#
|
117
|
-
#
|
115
|
+
# ```text
|
116
|
+
# "\xZZ"
|
117
|
+
# ```
|
118
118
|
class InvalidHexEscape < DiagnosticMessage
|
119
119
|
end
|
120
120
|
|
121
121
|
# Emitted for code like
|
122
122
|
#
|
123
|
-
#
|
124
|
-
#
|
125
|
-
#
|
123
|
+
# ```text
|
124
|
+
# <<-HERE
|
125
|
+
# ```
|
126
126
|
class UnterminatedHeredoc < DiagnosticMessage
|
127
127
|
# Heredoc identifier
|
128
128
|
#
|
129
129
|
# @return [String]
|
130
130
|
attr_reader :heredoc_id
|
131
|
-
|
132
131
|
end
|
133
132
|
|
134
133
|
# Emitted for code like
|
135
134
|
#
|
136
|
-
#
|
137
|
-
#
|
138
|
-
#
|
135
|
+
# ```text
|
136
|
+
# <<-"HERE
|
137
|
+
# ```
|
139
138
|
class UnterminatedHeredocId < DiagnosticMessage
|
140
139
|
end
|
141
140
|
|
142
141
|
# Emitted for code like
|
143
142
|
#
|
144
|
-
#
|
145
|
-
#
|
146
|
-
#
|
143
|
+
# ```text
|
144
|
+
# eval("foo \r = 42")
|
145
|
+
# ```
|
147
146
|
class SlashRAtMiddleOfLine < DiagnosticMessage
|
148
147
|
end
|
149
148
|
|
150
149
|
# Emitted for code like (only in $VERBOSE mode)
|
151
150
|
#
|
152
|
-
#
|
153
|
-
#
|
154
|
-
#
|
151
|
+
# ```text
|
152
|
+
# foo **arg
|
153
|
+
# ```
|
155
154
|
class DStarInterpretedAsArgPrefix < DiagnosticMessage
|
156
155
|
end
|
157
156
|
|
158
157
|
# Emitted for code like (only in $VERBOSE mode)
|
159
158
|
#
|
160
|
-
#
|
161
|
-
#
|
162
|
-
#
|
159
|
+
# ```text
|
160
|
+
# foo *arg
|
161
|
+
# ```
|
163
162
|
class StarInterpretedAsArgPrefix < DiagnosticMessage
|
164
163
|
end
|
165
164
|
|
166
165
|
# Emitted for code like (only in $VERBOSE mode)
|
167
166
|
#
|
168
|
-
#
|
169
|
-
#
|
170
|
-
#
|
167
|
+
# ```text
|
168
|
+
# foo &arg
|
169
|
+
# ```
|
171
170
|
class AmpersandInterpretedAsArgPrefix < DiagnosticMessage
|
172
171
|
end
|
173
172
|
|
174
173
|
# Emitted for code like
|
175
174
|
#
|
176
|
-
#
|
177
|
-
#
|
178
|
-
#
|
175
|
+
# ```text
|
176
|
+
# range = 1...
|
177
|
+
# ```
|
179
178
|
class TripleDotAtEol < DiagnosticMessage
|
180
179
|
end
|
181
180
|
|
182
181
|
# Emitted for code like (only in $VERBOSE mode)
|
183
182
|
#
|
184
|
-
#
|
185
|
-
#
|
186
|
-
#
|
183
|
+
# ```text
|
184
|
+
# def m (a, b, c); end
|
185
|
+
# ```
|
187
186
|
class ParenthesesIterpretedAsArglist < DiagnosticMessage
|
188
187
|
end
|
189
188
|
|
190
189
|
# Emitted for code like (only in $VERBOSE mode)
|
191
190
|
#
|
192
|
-
#
|
193
|
-
#
|
194
|
-
#
|
191
|
+
# ```text
|
192
|
+
# m +foo
|
193
|
+
# ```
|
195
194
|
class AmbiguousFirstArgument < DiagnosticMessage
|
196
195
|
# Operator that is ambiguous
|
197
196
|
#
|
198
197
|
# @return [Integer]
|
199
198
|
attr_reader :operator
|
200
|
-
|
201
199
|
end
|
202
200
|
|
203
201
|
# Emitted for code like (only in $VERBOSE mode)
|
204
202
|
#
|
205
|
-
#
|
206
|
-
#
|
207
|
-
#
|
203
|
+
# ```text
|
204
|
+
# 1 *2
|
205
|
+
# ```
|
208
206
|
class AmbiguousOperator < DiagnosticMessage
|
209
207
|
# Operator that is ambiguous
|
210
208
|
#
|
211
209
|
# @return [String]
|
212
210
|
attr_reader :operator
|
213
|
-
|
214
211
|
# Interpretation of this operator
|
215
212
|
#
|
216
213
|
# @return [String]
|
217
214
|
attr_reader :interpreted_as
|
218
|
-
|
219
215
|
end
|
220
216
|
|
221
217
|
# Emitted for code like
|
222
218
|
#
|
223
|
-
#
|
224
|
-
#
|
225
|
-
#
|
219
|
+
# ```text
|
220
|
+
# "\M- "
|
221
|
+
# ```
|
226
222
|
class InvalidCharacterSyntax < DiagnosticMessage
|
227
223
|
# Valid syntax sugestions
|
228
224
|
#
|
229
225
|
# @return [String]
|
230
226
|
attr_reader :suggestion
|
231
|
-
|
232
227
|
end
|
233
228
|
|
234
229
|
# Emitted for code like
|
235
230
|
#
|
236
|
-
#
|
237
|
-
#
|
238
|
-
#
|
231
|
+
# ```text
|
232
|
+
# 09
|
233
|
+
# ```
|
239
234
|
class InvalidOctalDigit < DiagnosticMessage
|
240
235
|
end
|
241
236
|
|
242
237
|
# Emitted for code like
|
243
238
|
#
|
244
|
-
#
|
245
|
-
#
|
246
|
-
#
|
239
|
+
# ```text
|
240
|
+
# 0_a
|
241
|
+
# ```
|
247
242
|
class TrailingCharInNumber < DiagnosticMessage
|
248
243
|
# Invalid trailing char
|
249
244
|
#
|
250
245
|
# @return [Integer]
|
251
246
|
attr_reader :c
|
252
|
-
|
253
247
|
end
|
254
248
|
|
255
249
|
# Emitted for code like
|
256
250
|
#
|
257
|
-
#
|
258
|
-
#
|
259
|
-
#
|
251
|
+
# ```text
|
252
|
+
# =begin
|
253
|
+
# ```
|
260
254
|
class EmbeddedDocumentMeetsEof < DiagnosticMessage
|
261
255
|
end
|
262
256
|
|
263
257
|
# Emitted for code like
|
264
258
|
#
|
265
|
-
#
|
266
|
-
#
|
267
|
-
#
|
259
|
+
# ```text
|
260
|
+
# eval("\x01foo")
|
261
|
+
# ```
|
268
262
|
class InvalidChar < DiagnosticMessage
|
269
263
|
# char
|
270
264
|
#
|
271
265
|
# @return [Integer]
|
272
266
|
attr_reader :c
|
273
|
-
|
274
267
|
end
|
275
268
|
|
276
269
|
# It is unknown how to trigger this error.
|
@@ -280,175 +273,169 @@ module LibRubyParser
|
|
280
273
|
|
281
274
|
# Emitted for code like
|
282
275
|
#
|
283
|
-
#
|
284
|
-
#
|
285
|
-
#
|
276
|
+
# ```text
|
277
|
+
# $
|
278
|
+
# ```
|
286
279
|
class GvarWithoutId < DiagnosticMessage
|
287
280
|
end
|
288
281
|
|
289
282
|
# Emitted for code like
|
290
283
|
#
|
291
|
-
#
|
292
|
-
#
|
293
|
-
#
|
284
|
+
# ```text
|
285
|
+
# $@
|
286
|
+
# ```
|
294
287
|
class InvalidGvarName < DiagnosticMessage
|
295
|
-
# char after
|
288
|
+
# char after `$`
|
296
289
|
#
|
297
290
|
# @return [Integer]
|
298
291
|
attr_reader :c
|
299
|
-
|
300
292
|
end
|
301
293
|
|
302
294
|
# Emitted for code like
|
303
295
|
#
|
304
|
-
#
|
305
|
-
#
|
306
|
-
#
|
296
|
+
# ```text
|
297
|
+
# @
|
298
|
+
# ```
|
307
299
|
class IvarWithoutId < DiagnosticMessage
|
308
300
|
end
|
309
301
|
|
310
302
|
# Emitted for code like
|
311
303
|
#
|
312
|
-
#
|
313
|
-
#
|
314
|
-
#
|
304
|
+
# ```text
|
305
|
+
# @1
|
306
|
+
# ```
|
315
307
|
class InvalidIvarName < DiagnosticMessage
|
316
|
-
# char after
|
308
|
+
# char after `@`
|
317
309
|
#
|
318
310
|
# @return [Integer]
|
319
311
|
attr_reader :c
|
320
|
-
|
321
312
|
end
|
322
313
|
|
323
314
|
# Emitted for code like
|
324
315
|
#
|
325
|
-
#
|
326
|
-
#
|
327
|
-
#
|
316
|
+
# ```text
|
317
|
+
# @@
|
318
|
+
# ```
|
328
319
|
class CvarWithoutId < DiagnosticMessage
|
329
320
|
end
|
330
321
|
|
331
322
|
# Emitted for code like
|
332
323
|
#
|
333
|
-
#
|
334
|
-
#
|
335
|
-
#
|
324
|
+
# ```text
|
325
|
+
# @@1
|
326
|
+
# ```
|
336
327
|
class InvalidCvarName < DiagnosticMessage
|
337
|
-
# char after
|
328
|
+
# char after `@@`
|
338
329
|
#
|
339
330
|
# @return [Integer]
|
340
331
|
attr_reader :c
|
341
|
-
|
342
332
|
end
|
343
333
|
|
344
334
|
# Emitted for code like
|
345
335
|
#
|
346
|
-
#
|
347
|
-
#
|
348
|
-
#
|
336
|
+
# ```text
|
337
|
+
# /re/foo
|
338
|
+
# ```
|
349
339
|
class UnknownRegexOptions < DiagnosticMessage
|
350
340
|
# Concatenated unknown options
|
351
341
|
#
|
352
342
|
# @return [String]
|
353
343
|
attr_reader :options
|
354
|
-
|
355
344
|
end
|
356
345
|
|
357
346
|
# Emitted for code like
|
358
347
|
#
|
359
|
-
#
|
360
|
-
#
|
361
|
-
#
|
348
|
+
# ```text
|
349
|
+
# "\u{1234"
|
350
|
+
# ```
|
362
351
|
class UnterminatedUnicodeEscape < DiagnosticMessage
|
363
352
|
end
|
364
353
|
|
365
354
|
# Emitted for code like
|
366
355
|
#
|
367
|
-
#
|
368
|
-
#
|
369
|
-
#
|
356
|
+
# ```text
|
357
|
+
# # encoding: foo
|
358
|
+
# ```
|
370
359
|
class EncodingError < DiagnosticMessage
|
371
360
|
# Error from decoder
|
372
361
|
#
|
373
362
|
# @return [String]
|
374
363
|
attr_reader :error
|
375
|
-
|
376
364
|
end
|
377
365
|
|
378
366
|
# Emitter for code like
|
379
367
|
#
|
380
|
-
#
|
381
|
-
#
|
382
|
-
#
|
368
|
+
# ```text
|
369
|
+
# eval("\xFF = 42")
|
370
|
+
# ```
|
383
371
|
class InvalidMultibyteChar < DiagnosticMessage
|
384
372
|
end
|
385
373
|
|
386
374
|
# Emitted for code like
|
387
375
|
#
|
388
|
-
#
|
389
|
-
#
|
390
|
-
#
|
376
|
+
# ```text
|
377
|
+
# a ?AA : 2
|
378
|
+
# ```
|
391
379
|
class AmbiguousTernaryOperator < DiagnosticMessage
|
392
380
|
# Source of the condition expression
|
393
381
|
#
|
394
382
|
# @return [String]
|
395
383
|
attr_reader :condition
|
396
|
-
|
397
384
|
end
|
398
385
|
|
399
386
|
# Emitted for code like
|
400
387
|
#
|
401
|
-
#
|
402
|
-
#
|
403
|
-
#
|
388
|
+
# ```text
|
389
|
+
# m /foo/
|
390
|
+
# ```
|
404
391
|
class AmbiguousRegexp < DiagnosticMessage
|
405
392
|
end
|
406
393
|
|
407
394
|
# Emitted for code like
|
408
395
|
#
|
409
|
-
#
|
410
|
-
#
|
411
|
-
#
|
396
|
+
# ```text
|
397
|
+
# begin; else; end
|
398
|
+
# ```
|
412
399
|
class ElseWithoutRescue < DiagnosticMessage
|
413
400
|
end
|
414
401
|
|
415
402
|
# Emitted for code like
|
416
403
|
#
|
417
|
-
#
|
418
|
-
#
|
419
|
-
#
|
404
|
+
# ```text
|
405
|
+
# def f; BEGIN{}; end
|
406
|
+
# ```
|
420
407
|
class BeginNotAtTopLevel < DiagnosticMessage
|
421
408
|
end
|
422
409
|
|
423
410
|
# Emitted for code like
|
424
411
|
#
|
425
|
-
#
|
426
|
-
#
|
427
|
-
#
|
412
|
+
# ```text
|
413
|
+
# alias $a $1
|
414
|
+
# ```
|
428
415
|
class AliasNthRef < DiagnosticMessage
|
429
416
|
end
|
430
417
|
|
431
418
|
# Emitted for code like
|
432
419
|
#
|
433
|
-
#
|
434
|
-
#
|
435
|
-
#
|
420
|
+
# ```text
|
421
|
+
# *a&.x = 0
|
422
|
+
# ```
|
436
423
|
class CsendInsideMasgn < DiagnosticMessage
|
437
424
|
end
|
438
425
|
|
439
426
|
# Emitted for code like
|
440
427
|
#
|
441
|
-
#
|
442
|
-
#
|
443
|
-
#
|
428
|
+
# ```text
|
429
|
+
# module foo; end
|
430
|
+
# ```
|
444
431
|
class ClassOrModuleNameMustBeConstant < DiagnosticMessage
|
445
432
|
end
|
446
433
|
|
447
434
|
# Emitted for code like
|
448
435
|
#
|
449
|
-
#
|
450
|
-
#
|
451
|
-
#
|
436
|
+
# ```text
|
437
|
+
# def foo=() = 42
|
438
|
+
# ```
|
452
439
|
class EndlessSetterDefinition < DiagnosticMessage
|
453
440
|
end
|
454
441
|
|
@@ -458,354 +445,382 @@ module LibRubyParser
|
|
458
445
|
#
|
459
446
|
# @return [String]
|
460
447
|
attr_reader :token_name
|
461
|
-
|
462
448
|
end
|
463
449
|
|
464
450
|
# Emitted for code like
|
465
451
|
#
|
466
|
-
#
|
467
|
-
#
|
468
|
-
#
|
452
|
+
# ```text
|
453
|
+
# def a; class Foo; end; end
|
454
|
+
# ```
|
469
455
|
class ClassDefinitionInMethodBody < DiagnosticMessage
|
470
456
|
end
|
471
457
|
|
472
458
|
# Emitted for code like
|
473
459
|
#
|
474
|
-
#
|
475
|
-
#
|
476
|
-
#
|
460
|
+
# ```text
|
461
|
+
# def a; module Foo; end; end
|
462
|
+
# ```
|
477
463
|
class ModuleDefinitionInMethodBody < DiagnosticMessage
|
478
464
|
end
|
479
465
|
|
480
466
|
# Emitted for code like
|
481
467
|
#
|
482
|
-
#
|
483
|
-
#
|
484
|
-
#
|
468
|
+
# ```text
|
469
|
+
# class A; return; end
|
470
|
+
# ```
|
485
471
|
class InvalidReturnInClassOrModuleBody < DiagnosticMessage
|
486
472
|
end
|
487
473
|
|
488
474
|
# Emitted for code like
|
489
475
|
#
|
490
|
-
#
|
491
|
-
#
|
492
|
-
#
|
476
|
+
# ```text
|
477
|
+
# def foo(Abc); end
|
478
|
+
# ```
|
493
479
|
class ConstArgument < DiagnosticMessage
|
494
480
|
end
|
495
481
|
|
496
482
|
# Emitted for code like
|
497
483
|
#
|
498
|
-
#
|
499
|
-
#
|
500
|
-
#
|
484
|
+
# ```text
|
485
|
+
# def foo(@abc); end
|
486
|
+
# ```
|
501
487
|
class IvarArgument < DiagnosticMessage
|
502
488
|
end
|
503
489
|
|
504
490
|
# Emitted for code like
|
505
491
|
#
|
506
|
-
#
|
507
|
-
#
|
508
|
-
#
|
492
|
+
# ```text
|
493
|
+
# def foo($abc); end
|
494
|
+
# ```
|
509
495
|
class GvarArgument < DiagnosticMessage
|
510
496
|
end
|
511
497
|
|
512
498
|
# Emitted for code like
|
513
499
|
#
|
514
|
-
#
|
515
|
-
#
|
516
|
-
#
|
500
|
+
# ```text
|
501
|
+
# def foo(@@abc); end
|
502
|
+
# ```
|
517
503
|
class CvarArgument < DiagnosticMessage
|
518
504
|
end
|
519
505
|
|
520
506
|
# Emitted for code like
|
521
507
|
#
|
522
|
-
#
|
523
|
-
#
|
524
|
-
#
|
508
|
+
# ```text
|
509
|
+
# case 0; in ^a; true; end
|
510
|
+
# ```
|
525
511
|
class NoSuchLocalVariable < DiagnosticMessage
|
526
512
|
# Variable name
|
527
513
|
#
|
528
514
|
# @return [String]
|
529
515
|
attr_reader :var_name
|
530
|
-
|
531
516
|
end
|
532
517
|
|
533
518
|
# Emitted for code like
|
534
519
|
#
|
535
|
-
#
|
536
|
-
#
|
537
|
-
#
|
520
|
+
# ```text
|
521
|
+
# m { |a| _1 }
|
522
|
+
# ```
|
538
523
|
class OrdinaryParamDefined < DiagnosticMessage
|
539
524
|
end
|
540
525
|
|
541
526
|
# Emitted for code like
|
542
527
|
#
|
543
|
-
#
|
544
|
-
#
|
545
|
-
#
|
528
|
+
# ```text
|
529
|
+
# foo { _1; bar { _2 }; }
|
530
|
+
# ```
|
546
531
|
class NumparamUsed < DiagnosticMessage
|
547
532
|
end
|
548
533
|
|
549
534
|
# Emitted for code like (only in $VERBOSE mode)
|
550
535
|
#
|
551
|
-
#
|
552
|
-
#
|
553
|
-
#
|
554
|
-
#
|
555
|
-
#
|
536
|
+
# ```text
|
537
|
+
# if
|
538
|
+
# 42
|
539
|
+
# end
|
540
|
+
# ```
|
556
541
|
class TokAtEolWithoutExpression < DiagnosticMessage
|
557
542
|
# Name of the token
|
558
543
|
#
|
559
544
|
# @return [String]
|
560
545
|
attr_reader :token_name
|
546
|
+
end
|
547
|
+
|
548
|
+
# Emitted for code like
|
549
|
+
#
|
550
|
+
# ```text
|
551
|
+
# { foo?: }
|
552
|
+
# # or
|
553
|
+
# { foo!: }
|
554
|
+
# ```
|
555
|
+
class InvalidIdToGet < DiagnosticMessage
|
556
|
+
# Identifier
|
557
|
+
#
|
558
|
+
# @return [String]
|
559
|
+
attr_reader :identifier
|
560
|
+
end
|
561
561
|
|
562
|
+
# Emitted for code like
|
563
|
+
#
|
564
|
+
# ```text
|
565
|
+
# def foo *rest, ...
|
566
|
+
# end
|
567
|
+
# ```
|
568
|
+
class ForwardArgAfterRestarg < DiagnosticMessage
|
562
569
|
end
|
563
570
|
|
564
571
|
# Emitted for code like
|
565
572
|
#
|
566
|
-
#
|
567
|
-
#
|
573
|
+
# ```text
|
574
|
+
# def foo(); bar(&); end
|
575
|
+
# ```
|
576
|
+
class NoAnonymousBlockarg < DiagnosticMessage
|
577
|
+
end
|
578
|
+
|
579
|
+
# Emitted for code like
|
568
580
|
#
|
581
|
+
# ```text
|
582
|
+
# def m; END {}; end
|
583
|
+
# ```
|
569
584
|
class EndInMethod < DiagnosticMessage
|
570
585
|
end
|
571
586
|
|
572
587
|
# Emitted for code like (only in $VERBOSE mode)
|
573
588
|
#
|
574
|
-
#
|
575
|
-
#
|
576
|
-
#
|
589
|
+
# ```text
|
590
|
+
# a < b < c
|
591
|
+
# ```
|
577
592
|
class ComparisonAfterComparison < DiagnosticMessage
|
578
593
|
# Source of the first comparison
|
579
594
|
#
|
580
595
|
# @return [String]
|
581
596
|
attr_reader :comparison
|
582
|
-
|
583
597
|
end
|
584
598
|
|
585
599
|
# Emitted for code like
|
586
600
|
#
|
587
|
-
#
|
588
|
-
#
|
601
|
+
# ```text
|
602
|
+
# { 42 => value, 42 => another_value }
|
603
|
+
# ```
|
604
|
+
class DuplicateHashKey < DiagnosticMessage
|
605
|
+
end
|
606
|
+
|
607
|
+
# Emitted for code like
|
589
608
|
#
|
609
|
+
# ```text
|
610
|
+
# def m(foo = foo) end
|
611
|
+
# ```
|
590
612
|
class CircularArgumentReference < DiagnosticMessage
|
591
613
|
# Name of the argument
|
592
614
|
#
|
593
615
|
# @return [String]
|
594
616
|
attr_reader :arg_name
|
595
|
-
|
596
617
|
end
|
597
618
|
|
598
619
|
# Emitted for code like
|
599
620
|
#
|
600
|
-
#
|
601
|
-
#
|
602
|
-
#
|
621
|
+
# ```text
|
622
|
+
# def m; FOO = 1; end
|
623
|
+
# ```
|
603
624
|
class DynamicConstantAssignment < DiagnosticMessage
|
604
625
|
end
|
605
626
|
|
606
627
|
# Emitted for code like
|
607
628
|
#
|
608
|
-
#
|
609
|
-
#
|
610
|
-
#
|
629
|
+
# ```text
|
630
|
+
# self = foo
|
631
|
+
# ```
|
611
632
|
class CantAssignToSelf < DiagnosticMessage
|
612
633
|
end
|
613
634
|
|
614
635
|
# Emitted for code like
|
615
636
|
#
|
616
|
-
#
|
617
|
-
#
|
618
|
-
#
|
637
|
+
# ```text
|
638
|
+
# nil = foo
|
639
|
+
# ```
|
619
640
|
class CantAssignToNil < DiagnosticMessage
|
620
641
|
end
|
621
642
|
|
622
643
|
# Emitted for code like
|
623
644
|
#
|
624
|
-
#
|
625
|
-
#
|
626
|
-
#
|
645
|
+
# ```text
|
646
|
+
# true = foo
|
647
|
+
# ```
|
627
648
|
class CantAssignToTrue < DiagnosticMessage
|
628
649
|
end
|
629
650
|
|
630
651
|
# Emitted for code like
|
631
652
|
#
|
632
|
-
#
|
633
|
-
#
|
634
|
-
#
|
653
|
+
# ```text
|
654
|
+
# false = foo
|
655
|
+
# ```
|
635
656
|
class CantAssignToFalse < DiagnosticMessage
|
636
657
|
end
|
637
658
|
|
638
659
|
# Emitted for code like
|
639
660
|
#
|
640
|
-
#
|
641
|
-
#
|
642
|
-
#
|
661
|
+
# ```text
|
662
|
+
# __FILE__ = foo
|
663
|
+
# ```
|
643
664
|
class CantAssignToFile < DiagnosticMessage
|
644
665
|
end
|
645
666
|
|
646
667
|
# Emitted for code like
|
647
668
|
#
|
648
|
-
#
|
649
|
-
#
|
650
|
-
#
|
669
|
+
# ```text
|
670
|
+
# __LINE__ = foo
|
671
|
+
# ```
|
651
672
|
class CantAssignToLine < DiagnosticMessage
|
652
673
|
end
|
653
674
|
|
654
675
|
# Emitted for code like
|
655
676
|
#
|
656
|
-
#
|
657
|
-
#
|
658
|
-
#
|
677
|
+
# ```text
|
678
|
+
# __ENCODING__ = foo
|
679
|
+
# ```
|
659
680
|
class CantAssignToEncoding < DiagnosticMessage
|
660
681
|
end
|
661
682
|
|
662
683
|
# Emitted for code like
|
663
684
|
#
|
664
|
-
#
|
665
|
-
#
|
666
|
-
#
|
685
|
+
# ```text
|
686
|
+
# proc {_1; _1 = nil}
|
687
|
+
# ```
|
667
688
|
class CantAssignToNumparam < DiagnosticMessage
|
668
689
|
# Source of the numbered parameter
|
669
690
|
#
|
670
691
|
# @return [String]
|
671
692
|
attr_reader :numparam
|
672
|
-
|
673
693
|
end
|
674
694
|
|
675
695
|
# Emitted for code like
|
676
696
|
#
|
677
|
-
#
|
678
|
-
#
|
679
|
-
#
|
697
|
+
# ```text
|
698
|
+
# $1 = foo
|
699
|
+
# ```
|
680
700
|
class CantSetVariable < DiagnosticMessage
|
681
701
|
# Source of the read-only variable that is assigned
|
682
702
|
#
|
683
703
|
# @return [String]
|
684
704
|
attr_reader :var_name
|
685
|
-
|
686
705
|
end
|
687
706
|
|
688
707
|
# Emitted for code like
|
689
708
|
#
|
690
|
-
#
|
691
|
-
#
|
692
|
-
#
|
709
|
+
# ```text
|
710
|
+
# yield(&foo)
|
711
|
+
# ```
|
693
712
|
class BlockGivenToYield < DiagnosticMessage
|
694
713
|
end
|
695
714
|
|
696
715
|
# Emitted for code like
|
697
716
|
#
|
698
|
-
#
|
699
|
-
#
|
700
|
-
#
|
717
|
+
# ```text
|
718
|
+
# fun(&bar) do end
|
719
|
+
# ```
|
701
720
|
class BlockAndBlockArgGiven < DiagnosticMessage
|
702
721
|
end
|
703
722
|
|
704
723
|
# Emitted for code like
|
705
724
|
#
|
706
|
-
#
|
707
|
-
#
|
708
|
-
#
|
725
|
+
# ```text
|
726
|
+
# case a; in "#{a}": 1; end
|
727
|
+
# ```
|
709
728
|
class SymbolLiteralWithInterpolation < DiagnosticMessage
|
710
729
|
end
|
711
730
|
|
712
731
|
# Emitted for code like
|
713
732
|
#
|
714
|
-
#
|
715
|
-
#
|
716
|
-
#
|
733
|
+
# ```text
|
734
|
+
# _1 = 1
|
735
|
+
# ```
|
717
736
|
class ReservedForNumparam < DiagnosticMessage
|
718
737
|
# Numbered parameter that is treated as a local variable
|
719
738
|
#
|
720
739
|
# @return [String]
|
721
740
|
attr_reader :numparam
|
722
|
-
|
723
741
|
end
|
724
742
|
|
725
743
|
# Emitted for code like
|
726
744
|
#
|
727
|
-
#
|
728
|
-
#
|
729
|
-
#
|
745
|
+
# ```text
|
746
|
+
# case a; in a?:; end
|
747
|
+
# ```
|
730
748
|
class KeyMustBeValidAsLocalVariable < DiagnosticMessage
|
731
749
|
end
|
732
750
|
|
733
751
|
# Emitted for code like
|
734
752
|
#
|
735
|
-
#
|
736
|
-
#
|
737
|
-
#
|
753
|
+
# ```text
|
754
|
+
# case 0; in a, a; end
|
755
|
+
# ```
|
738
756
|
class DuplicateVariableName < DiagnosticMessage
|
739
757
|
end
|
740
758
|
|
741
759
|
# Emitted for code like
|
742
760
|
#
|
743
|
-
#
|
744
|
-
#
|
745
|
-
#
|
761
|
+
# ```text
|
762
|
+
# case 0; in a: 1, a: 2; end
|
763
|
+
# ```
|
746
764
|
class DuplicateKeyName < DiagnosticMessage
|
747
765
|
end
|
748
766
|
|
749
767
|
# Emitted for code like
|
750
768
|
#
|
751
|
-
#
|
752
|
-
#
|
753
|
-
#
|
769
|
+
# ```text
|
770
|
+
# def (1).foo; end
|
771
|
+
# ```
|
754
772
|
class SingletonLiteral < DiagnosticMessage
|
755
773
|
end
|
756
774
|
|
757
775
|
# Emitted for code like (only in $VERBOSE mode)
|
758
776
|
#
|
759
|
-
#
|
760
|
-
#
|
761
|
-
#
|
777
|
+
# ```text
|
778
|
+
# $100
|
779
|
+
# ```
|
762
780
|
class NthRefIsTooBig < DiagnosticMessage
|
763
781
|
# Source of the nth_ref that is techincally a regular global variable
|
764
782
|
#
|
765
783
|
# @return [String]
|
766
784
|
attr_reader :nth_ref
|
767
|
-
|
768
785
|
end
|
769
786
|
|
770
787
|
# Emitted for code like
|
771
788
|
#
|
772
|
-
#
|
773
|
-
#
|
774
|
-
#
|
789
|
+
# ```text
|
790
|
+
# def foo(aa, aa); end
|
791
|
+
# ```
|
775
792
|
class DuplicatedArgumentName < DiagnosticMessage
|
776
793
|
end
|
777
794
|
|
778
795
|
# Emitted for code like
|
779
796
|
#
|
780
|
-
#
|
781
|
-
#
|
782
|
-
#
|
797
|
+
# ```text
|
798
|
+
# /[/
|
799
|
+
# ```
|
783
800
|
class RegexError < DiagnosticMessage
|
784
801
|
# Error from Onigurama engine
|
785
802
|
#
|
786
803
|
# @return [String]
|
787
804
|
attr_reader :error
|
788
|
-
|
789
805
|
end
|
790
806
|
|
791
807
|
# Emitted for code like
|
792
808
|
#
|
793
|
-
#
|
794
|
-
#
|
795
|
-
#
|
809
|
+
# ```text
|
810
|
+
# %I"x .\xc3."
|
811
|
+
# ```
|
796
812
|
class InvalidSymbol < DiagnosticMessage
|
797
813
|
# Source of the symbol
|
798
814
|
#
|
799
815
|
# @return [String]
|
800
816
|
attr_reader :symbol
|
801
|
-
|
802
817
|
end
|
803
818
|
|
804
819
|
# Emitted for code like
|
805
820
|
#
|
806
|
-
#
|
807
|
-
#
|
808
|
-
#
|
821
|
+
# ```text
|
822
|
+
# a = return
|
823
|
+
# ```
|
809
824
|
class VoidValueExpression < DiagnosticMessage
|
810
825
|
end
|
811
826
|
|