lib-ruby-parser 3.0.11

Ruby parser
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
// This file is auto-generated by codegen/rust/messages/external/constructors.rs

use crate::containers::ExternalStringPtr as StringPtr;
use crate::blobs::{Blob, HasBlob};
use super::DiagnosticMessage;

extern "C" {
    fn lib_ruby_parser__external__diagnotic_messages__new_fraction_after_numeric() -> Blob<DiagnosticMessage>;
    fn lib_ruby_parser__external__diagnotic_messages__new_no_digits_after_dot() -> Blob<DiagnosticMessage>;
    fn lib_ruby_parser__external__diagnotic_messages__new_unknown_type_of_percent_string() -> Blob<DiagnosticMessage>;
    fn lib_ruby_parser__external__diagnotic_messages__new_numeric_literal_without_digits() -> Blob<DiagnosticMessage>;
    fn lib_ruby_parser__external__diagnotic_messages__new_unterminated_list() -> Blob<DiagnosticMessage>;
    fn lib_ruby_parser__external__diagnotic_messages__new_unterminated_regexp() -> Blob<DiagnosticMessage>;
    fn lib_ruby_parser__external__diagnotic_messages__new_unterminated_string() -> Blob<DiagnosticMessage>;
    fn lib_ruby_parser__external__diagnotic_messages__new_unterminated_quoted_string() -> Blob<DiagnosticMessage>;
    fn lib_ruby_parser__external__diagnotic_messages__new_invalid_unicode_escape() -> Blob<DiagnosticMessage>;
    fn lib_ruby_parser__external__diagnotic_messages__new_too_large_unicode_codepoint() -> Blob<DiagnosticMessage>;
    fn lib_ruby_parser__external__diagnotic_messages__new_invalid_unicode_codepoint() -> Blob<DiagnosticMessage>;
    fn lib_ruby_parser__external__diagnotic_messages__new_multiple_codepoint_at_single_char() -> Blob<DiagnosticMessage>;
    fn lib_ruby_parser__external__diagnotic_messages__new_invalid_escape_character() -> Blob<DiagnosticMessage>;
    fn lib_ruby_parser__external__diagnotic_messages__new_invalid_hex_escape() -> Blob<DiagnosticMessage>;
    fn lib_ruby_parser__external__diagnotic_messages__new_unterminated_heredoc(heredoc_id: Blob<StringPtr>,) -> Blob<DiagnosticMessage>;
    fn lib_ruby_parser__external__diagnotic_messages__new_unterminated_heredoc_id() -> Blob<DiagnosticMessage>;
    fn lib_ruby_parser__external__diagnotic_messages__new_slash_r_at_middle_of_line() -> Blob<DiagnosticMessage>;
    fn lib_ruby_parser__external__diagnotic_messages__new_d_star_interpreted_as_arg_prefix() -> Blob<DiagnosticMessage>;
    fn lib_ruby_parser__external__diagnotic_messages__new_star_interpreted_as_arg_prefix() -> Blob<DiagnosticMessage>;
    fn lib_ruby_parser__external__diagnotic_messages__new_ampersand_interpreted_as_arg_prefix() -> Blob<DiagnosticMessage>;
    fn lib_ruby_parser__external__diagnotic_messages__new_triple_dot_at_eol() -> Blob<DiagnosticMessage>;
    fn lib_ruby_parser__external__diagnotic_messages__new_parentheses_iterpreted_as_arglist() -> Blob<DiagnosticMessage>;
    fn lib_ruby_parser__external__diagnotic_messages__new_ambiguous_first_argument(operator: u8,) -> Blob<DiagnosticMessage>;
    fn lib_ruby_parser__external__diagnotic_messages__new_ambiguous_operator(operator: Blob<StringPtr>,interpreted_as: Blob<StringPtr>,) -> Blob<DiagnosticMessage>;
    fn lib_ruby_parser__external__diagnotic_messages__new_invalid_character_syntax(suggestion: Blob<StringPtr>,) -> Blob<DiagnosticMessage>;
    fn lib_ruby_parser__external__diagnotic_messages__new_invalid_octal_digit() -> Blob<DiagnosticMessage>;
    fn lib_ruby_parser__external__diagnotic_messages__new_trailing_char_in_number(c: u8,) -> Blob<DiagnosticMessage>;
    fn lib_ruby_parser__external__diagnotic_messages__new_embedded_document_meets_eof() -> Blob<DiagnosticMessage>;
    fn lib_ruby_parser__external__diagnotic_messages__new_invalid_char(c: u8,) -> Blob<DiagnosticMessage>;
    fn lib_ruby_parser__external__diagnotic_messages__new_incomplete_character_syntax() -> Blob<DiagnosticMessage>;
    fn lib_ruby_parser__external__diagnotic_messages__new_gvar_without_id() -> Blob<DiagnosticMessage>;
    fn lib_ruby_parser__external__diagnotic_messages__new_invalid_gvar_name(c: u8,) -> Blob<DiagnosticMessage>;
    fn lib_ruby_parser__external__diagnotic_messages__new_ivar_without_id() -> Blob<DiagnosticMessage>;
    fn lib_ruby_parser__external__diagnotic_messages__new_invalid_ivar_name(c: u8,) -> Blob<DiagnosticMessage>;
    fn lib_ruby_parser__external__diagnotic_messages__new_cvar_without_id() -> Blob<DiagnosticMessage>;
    fn lib_ruby_parser__external__diagnotic_messages__new_invalid_cvar_name(c: u8,) -> Blob<DiagnosticMessage>;
    fn lib_ruby_parser__external__diagnotic_messages__new_unknown_regex_options(options: Blob<StringPtr>,) -> Blob<DiagnosticMessage>;
    fn lib_ruby_parser__external__diagnotic_messages__new_unterminated_unicode_escape() -> Blob<DiagnosticMessage>;
    fn lib_ruby_parser__external__diagnotic_messages__new_encoding_error(error: Blob<StringPtr>,) -> Blob<DiagnosticMessage>;
    fn lib_ruby_parser__external__diagnotic_messages__new_invalid_multibyte_char() -> Blob<DiagnosticMessage>;
    fn lib_ruby_parser__external__diagnotic_messages__new_ambiguous_ternary_operator(condition: Blob<StringPtr>,) -> Blob<DiagnosticMessage>;
    fn lib_ruby_parser__external__diagnotic_messages__new_ambiguous_regexp() -> Blob<DiagnosticMessage>;
    fn lib_ruby_parser__external__diagnotic_messages__new_else_without_rescue() -> Blob<DiagnosticMessage>;
    fn lib_ruby_parser__external__diagnotic_messages__new_begin_not_at_top_level() -> Blob<DiagnosticMessage>;
    fn lib_ruby_parser__external__diagnotic_messages__new_alias_nth_ref() -> Blob<DiagnosticMessage>;
    fn lib_ruby_parser__external__diagnotic_messages__new_csend_inside_masgn() -> Blob<DiagnosticMessage>;
    fn lib_ruby_parser__external__diagnotic_messages__new_class_or_module_name_must_be_constant() -> Blob<DiagnosticMessage>;
    fn lib_ruby_parser__external__diagnotic_messages__new_endless_setter_definition() -> Blob<DiagnosticMessage>;
    fn lib_ruby_parser__external__diagnotic_messages__new_unexpected_token(token_name: Blob<StringPtr>,) -> Blob<DiagnosticMessage>;
    fn lib_ruby_parser__external__diagnotic_messages__new_class_definition_in_method_body() -> Blob<DiagnosticMessage>;
    fn lib_ruby_parser__external__diagnotic_messages__new_module_definition_in_method_body() -> Blob<DiagnosticMessage>;
    fn lib_ruby_parser__external__diagnotic_messages__new_invalid_return_in_class_or_module_body() -> Blob<DiagnosticMessage>;
    fn lib_ruby_parser__external__diagnotic_messages__new_const_argument() -> Blob<DiagnosticMessage>;
    fn lib_ruby_parser__external__diagnotic_messages__new_ivar_argument() -> Blob<DiagnosticMessage>;
    fn lib_ruby_parser__external__diagnotic_messages__new_gvar_argument() -> Blob<DiagnosticMessage>;
    fn lib_ruby_parser__external__diagnotic_messages__new_cvar_argument() -> Blob<DiagnosticMessage>;
    fn lib_ruby_parser__external__diagnotic_messages__new_no_such_local_variable(var_name: Blob<StringPtr>,) -> Blob<DiagnosticMessage>;
    fn lib_ruby_parser__external__diagnotic_messages__new_ordinary_param_defined() -> Blob<DiagnosticMessage>;
    fn lib_ruby_parser__external__diagnotic_messages__new_numparam_used() -> Blob<DiagnosticMessage>;
    fn lib_ruby_parser__external__diagnotic_messages__new_tok_at_eol_without_expression(token_name: Blob<StringPtr>,) -> Blob<DiagnosticMessage>;
    fn lib_ruby_parser__external__diagnotic_messages__new_end_in_method() -> Blob<DiagnosticMessage>;
    fn lib_ruby_parser__external__diagnotic_messages__new_comparison_after_comparison(comparison: Blob<StringPtr>,) -> Blob<DiagnosticMessage>;
    fn lib_ruby_parser__external__diagnotic_messages__new_circular_argument_reference(arg_name: Blob<StringPtr>,) -> Blob<DiagnosticMessage>;
    fn lib_ruby_parser__external__diagnotic_messages__new_dynamic_constant_assignment() -> Blob<DiagnosticMessage>;
    fn lib_ruby_parser__external__diagnotic_messages__new_cant_assign_to_self() -> Blob<DiagnosticMessage>;
    fn lib_ruby_parser__external__diagnotic_messages__new_cant_assign_to_nil() -> Blob<DiagnosticMessage>;
    fn lib_ruby_parser__external__diagnotic_messages__new_cant_assign_to_true() -> Blob<DiagnosticMessage>;
    fn lib_ruby_parser__external__diagnotic_messages__new_cant_assign_to_false() -> Blob<DiagnosticMessage>;
    fn lib_ruby_parser__external__diagnotic_messages__new_cant_assign_to_file() -> Blob<DiagnosticMessage>;
    fn lib_ruby_parser__external__diagnotic_messages__new_cant_assign_to_line() -> Blob<DiagnosticMessage>;
    fn lib_ruby_parser__external__diagnotic_messages__new_cant_assign_to_encoding() -> Blob<DiagnosticMessage>;
    fn lib_ruby_parser__external__diagnotic_messages__new_cant_assign_to_numparam(numparam: Blob<StringPtr>,) -> Blob<DiagnosticMessage>;
    fn lib_ruby_parser__external__diagnotic_messages__new_cant_set_variable(var_name: Blob<StringPtr>,) -> Blob<DiagnosticMessage>;
    fn lib_ruby_parser__external__diagnotic_messages__new_block_given_to_yield() -> Blob<DiagnosticMessage>;
    fn lib_ruby_parser__external__diagnotic_messages__new_block_and_block_arg_given() -> Blob<DiagnosticMessage>;
    fn lib_ruby_parser__external__diagnotic_messages__new_symbol_literal_with_interpolation() -> Blob<DiagnosticMessage>;
    fn lib_ruby_parser__external__diagnotic_messages__new_reserved_for_numparam(numparam: Blob<StringPtr>,) -> Blob<DiagnosticMessage>;
    fn lib_ruby_parser__external__diagnotic_messages__new_key_must_be_valid_as_local_variable() -> Blob<DiagnosticMessage>;
    fn lib_ruby_parser__external__diagnotic_messages__new_duplicate_variable_name() -> Blob<DiagnosticMessage>;
    fn lib_ruby_parser__external__diagnotic_messages__new_duplicate_key_name() -> Blob<DiagnosticMessage>;
    fn lib_ruby_parser__external__diagnotic_messages__new_singleton_literal() -> Blob<DiagnosticMessage>;
    fn lib_ruby_parser__external__diagnotic_messages__new_nth_ref_is_too_big(nth_ref: Blob<StringPtr>,) -> Blob<DiagnosticMessage>;
    fn lib_ruby_parser__external__diagnotic_messages__new_duplicated_argument_name() -> Blob<DiagnosticMessage>;
    fn lib_ruby_parser__external__diagnotic_messages__new_regex_error(error: Blob<StringPtr>,) -> Blob<DiagnosticMessage>;
    fn lib_ruby_parser__external__diagnotic_messages__new_invalid_symbol(symbol: Blob<StringPtr>,) -> Blob<DiagnosticMessage>;
    fn lib_ruby_parser__external__diagnotic_messages__new_void_value_expression() -> Blob<DiagnosticMessage>;
}

impl DiagnosticMessage {
    /// Constructs FractionAfterNumeric variant
    pub fn new_fraction_after_numeric() -> Self {
        let blob = unsafe { lib_ruby_parser__external__diagnotic_messages__new_fraction_after_numeric() };
        Self { blob }
    }
    /// Constructs NoDigitsAfterDot variant
    pub fn new_no_digits_after_dot() -> Self {
        let blob = unsafe { lib_ruby_parser__external__diagnotic_messages__new_no_digits_after_dot() };
        Self { blob }
    }
    /// Constructs UnknownTypeOfPercentString variant
    pub fn new_unknown_type_of_percent_string() -> Self {
        let blob = unsafe { lib_ruby_parser__external__diagnotic_messages__new_unknown_type_of_percent_string() };
        Self { blob }
    }
    /// Constructs NumericLiteralWithoutDigits variant
    pub fn new_numeric_literal_without_digits() -> Self {
        let blob = unsafe { lib_ruby_parser__external__diagnotic_messages__new_numeric_literal_without_digits() };
        Self { blob }
    }
    /// Constructs UnterminatedList variant
    pub fn new_unterminated_list() -> Self {
        let blob = unsafe { lib_ruby_parser__external__diagnotic_messages__new_unterminated_list() };
        Self { blob }
    }
    /// Constructs UnterminatedRegexp variant
    pub fn new_unterminated_regexp() -> Self {
        let blob = unsafe { lib_ruby_parser__external__diagnotic_messages__new_unterminated_regexp() };
        Self { blob }
    }
    /// Constructs UnterminatedString variant
    pub fn new_unterminated_string() -> Self {
        let blob = unsafe { lib_ruby_parser__external__diagnotic_messages__new_unterminated_string() };
        Self { blob }
    }
    /// Constructs UnterminatedQuotedString variant
    pub fn new_unterminated_quoted_string() -> Self {
        let blob = unsafe { lib_ruby_parser__external__diagnotic_messages__new_unterminated_quoted_string() };
        Self { blob }
    }
    /// Constructs InvalidUnicodeEscape variant
    pub fn new_invalid_unicode_escape() -> Self {
        let blob = unsafe { lib_ruby_parser__external__diagnotic_messages__new_invalid_unicode_escape() };
        Self { blob }
    }
    /// Constructs TooLargeUnicodeCodepoint variant
    pub fn new_too_large_unicode_codepoint() -> Self {
        let blob = unsafe { lib_ruby_parser__external__diagnotic_messages__new_too_large_unicode_codepoint() };
        Self { blob }
    }
    /// Constructs InvalidUnicodeCodepoint variant
    pub fn new_invalid_unicode_codepoint() -> Self {
        let blob = unsafe { lib_ruby_parser__external__diagnotic_messages__new_invalid_unicode_codepoint() };
        Self { blob }
    }
    /// Constructs MultipleCodepointAtSingleChar variant
    pub fn new_multiple_codepoint_at_single_char() -> Self {
        let blob = unsafe { lib_ruby_parser__external__diagnotic_messages__new_multiple_codepoint_at_single_char() };
        Self { blob }
    }
    /// Constructs InvalidEscapeCharacter variant
    pub fn new_invalid_escape_character() -> Self {
        let blob = unsafe { lib_ruby_parser__external__diagnotic_messages__new_invalid_escape_character() };
        Self { blob }
    }
    /// Constructs InvalidHexEscape variant
    pub fn new_invalid_hex_escape() -> Self {
        let blob = unsafe { lib_ruby_parser__external__diagnotic_messages__new_invalid_hex_escape() };
        Self { blob }
    }
    /// Constructs UnterminatedHeredoc variant
    pub fn new_unterminated_heredoc(heredoc_id: StringPtr,) -> Self {
        let blob = unsafe { lib_ruby_parser__external__diagnotic_messages__new_unterminated_heredoc(heredoc_id.into_blob(), ) };
        Self { blob }
    }
    /// Constructs UnterminatedHeredocId variant
    pub fn new_unterminated_heredoc_id() -> Self {
        let blob = unsafe { lib_ruby_parser__external__diagnotic_messages__new_unterminated_heredoc_id() };
        Self { blob }
    }
    /// Constructs SlashRAtMiddleOfLine variant
    pub fn new_slash_r_at_middle_of_line() -> Self {
        let blob = unsafe { lib_ruby_parser__external__diagnotic_messages__new_slash_r_at_middle_of_line() };
        Self { blob }
    }
    /// Constructs DStarInterpretedAsArgPrefix variant
    pub fn new_d_star_interpreted_as_arg_prefix() -> Self {
        let blob = unsafe { lib_ruby_parser__external__diagnotic_messages__new_d_star_interpreted_as_arg_prefix() };
        Self { blob }
    }
    /// Constructs StarInterpretedAsArgPrefix variant
    pub fn new_star_interpreted_as_arg_prefix() -> Self {
        let blob = unsafe { lib_ruby_parser__external__diagnotic_messages__new_star_interpreted_as_arg_prefix() };
        Self { blob }
    }
    /// Constructs AmpersandInterpretedAsArgPrefix variant
    pub fn new_ampersand_interpreted_as_arg_prefix() -> Self {
        let blob = unsafe { lib_ruby_parser__external__diagnotic_messages__new_ampersand_interpreted_as_arg_prefix() };
        Self { blob }
    }
    /// Constructs TripleDotAtEol variant
    pub fn new_triple_dot_at_eol() -> Self {
        let blob = unsafe { lib_ruby_parser__external__diagnotic_messages__new_triple_dot_at_eol() };
        Self { blob }
    }
    /// Constructs ParenthesesIterpretedAsArglist variant
    pub fn new_parentheses_iterpreted_as_arglist() -> Self {
        let blob = unsafe { lib_ruby_parser__external__diagnotic_messages__new_parentheses_iterpreted_as_arglist() };
        Self { blob }
    }
    /// Constructs AmbiguousFirstArgument variant
    pub fn new_ambiguous_first_argument(operator: u8,) -> Self {
        let blob = unsafe { lib_ruby_parser__external__diagnotic_messages__new_ambiguous_first_argument(operator.into_blob(), ) };
        Self { blob }
    }
    /// Constructs AmbiguousOperator variant
    pub fn new_ambiguous_operator(operator: StringPtr,interpreted_as: StringPtr,) -> Self {
        let blob = unsafe { lib_ruby_parser__external__diagnotic_messages__new_ambiguous_operator(operator.into_blob(), interpreted_as.into_blob(), ) };
        Self { blob }
    }
    /// Constructs InvalidCharacterSyntax variant
    pub fn new_invalid_character_syntax(suggestion: StringPtr,) -> Self {
        let blob = unsafe { lib_ruby_parser__external__diagnotic_messages__new_invalid_character_syntax(suggestion.into_blob(), ) };
        Self { blob }
    }
    /// Constructs InvalidOctalDigit variant
    pub fn new_invalid_octal_digit() -> Self {
        let blob = unsafe { lib_ruby_parser__external__diagnotic_messages__new_invalid_octal_digit() };
        Self { blob }
    }
    /// Constructs TrailingCharInNumber variant
    pub fn new_trailing_char_in_number(c: u8,) -> Self {
        let blob = unsafe { lib_ruby_parser__external__diagnotic_messages__new_trailing_char_in_number(c.into_blob(), ) };
        Self { blob }
    }
    /// Constructs EmbeddedDocumentMeetsEof variant
    pub fn new_embedded_document_meets_eof() -> Self {
        let blob = unsafe { lib_ruby_parser__external__diagnotic_messages__new_embedded_document_meets_eof() };
        Self { blob }
    }
    /// Constructs InvalidChar variant
    pub fn new_invalid_char(c: u8,) -> Self {
        let blob = unsafe { lib_ruby_parser__external__diagnotic_messages__new_invalid_char(c.into_blob(), ) };
        Self { blob }
    }
    /// Constructs IncompleteCharacterSyntax variant
    pub fn new_incomplete_character_syntax() -> Self {
        let blob = unsafe { lib_ruby_parser__external__diagnotic_messages__new_incomplete_character_syntax() };
        Self { blob }
    }
    /// Constructs GvarWithoutId variant
    pub fn new_gvar_without_id() -> Self {
        let blob = unsafe { lib_ruby_parser__external__diagnotic_messages__new_gvar_without_id() };
        Self { blob }
    }
    /// Constructs InvalidGvarName variant
    pub fn new_invalid_gvar_name(c: u8,) -> Self {
        let blob = unsafe { lib_ruby_parser__external__diagnotic_messages__new_invalid_gvar_name(c.into_blob(), ) };
        Self { blob }
    }
    /// Constructs IvarWithoutId variant
    pub fn new_ivar_without_id() -> Self {
        let blob = unsafe { lib_ruby_parser__external__diagnotic_messages__new_ivar_without_id() };
        Self { blob }
    }
    /// Constructs InvalidIvarName variant
    pub fn new_invalid_ivar_name(c: u8,) -> Self {
        let blob = unsafe { lib_ruby_parser__external__diagnotic_messages__new_invalid_ivar_name(c.into_blob(), ) };
        Self { blob }
    }
    /// Constructs CvarWithoutId variant
    pub fn new_cvar_without_id() -> Self {
        let blob = unsafe { lib_ruby_parser__external__diagnotic_messages__new_cvar_without_id() };
        Self { blob }
    }
    /// Constructs InvalidCvarName variant
    pub fn new_invalid_cvar_name(c: u8,) -> Self {
        let blob = unsafe { lib_ruby_parser__external__diagnotic_messages__new_invalid_cvar_name(c.into_blob(), ) };
        Self { blob }
    }
    /// Constructs UnknownRegexOptions variant
    pub fn new_unknown_regex_options(options: StringPtr,) -> Self {
        let blob = unsafe { lib_ruby_parser__external__diagnotic_messages__new_unknown_regex_options(options.into_blob(), ) };
        Self { blob }
    }
    /// Constructs UnterminatedUnicodeEscape variant
    pub fn new_unterminated_unicode_escape() -> Self {
        let blob = unsafe { lib_ruby_parser__external__diagnotic_messages__new_unterminated_unicode_escape() };
        Self { blob }
    }
    /// Constructs EncodingError variant
    pub fn new_encoding_error(error: StringPtr,) -> Self {
        let blob = unsafe { lib_ruby_parser__external__diagnotic_messages__new_encoding_error(error.into_blob(), ) };
        Self { blob }
    }
    /// Constructs InvalidMultibyteChar variant
    pub fn new_invalid_multibyte_char() -> Self {
        let blob = unsafe { lib_ruby_parser__external__diagnotic_messages__new_invalid_multibyte_char() };
        Self { blob }
    }
    /// Constructs AmbiguousTernaryOperator variant
    pub fn new_ambiguous_ternary_operator(condition: StringPtr,) -> Self {
        let blob = unsafe { lib_ruby_parser__external__diagnotic_messages__new_ambiguous_ternary_operator(condition.into_blob(), ) };
        Self { blob }
    }
    /// Constructs AmbiguousRegexp variant
    pub fn new_ambiguous_regexp() -> Self {
        let blob = unsafe { lib_ruby_parser__external__diagnotic_messages__new_ambiguous_regexp() };
        Self { blob }
    }
    /// Constructs ElseWithoutRescue variant
    pub fn new_else_without_rescue() -> Self {
        let blob = unsafe { lib_ruby_parser__external__diagnotic_messages__new_else_without_rescue() };
        Self { blob }
    }
    /// Constructs BeginNotAtTopLevel variant
    pub fn new_begin_not_at_top_level() -> Self {
        let blob = unsafe { lib_ruby_parser__external__diagnotic_messages__new_begin_not_at_top_level() };
        Self { blob }
    }
    /// Constructs AliasNthRef variant
    pub fn new_alias_nth_ref() -> Self {
        let blob = unsafe { lib_ruby_parser__external__diagnotic_messages__new_alias_nth_ref() };
        Self { blob }
    }
    /// Constructs CsendInsideMasgn variant
    pub fn new_csend_inside_masgn() -> Self {
        let blob = unsafe { lib_ruby_parser__external__diagnotic_messages__new_csend_inside_masgn() };
        Self { blob }
    }
    /// Constructs ClassOrModuleNameMustBeConstant variant
    pub fn new_class_or_module_name_must_be_constant() -> Self {
        let blob = unsafe { lib_ruby_parser__external__diagnotic_messages__new_class_or_module_name_must_be_constant() };
        Self { blob }
    }
    /// Constructs EndlessSetterDefinition variant
    pub fn new_endless_setter_definition() -> Self {
        let blob = unsafe { lib_ruby_parser__external__diagnotic_messages__new_endless_setter_definition() };
        Self { blob }
    }
    /// Constructs UnexpectedToken variant
    pub fn new_unexpected_token(token_name: StringPtr,) -> Self {
        let blob = unsafe { lib_ruby_parser__external__diagnotic_messages__new_unexpected_token(token_name.into_blob(), ) };
        Self { blob }
    }
    /// Constructs ClassDefinitionInMethodBody variant
    pub fn new_class_definition_in_method_body() -> Self {
        let blob = unsafe { lib_ruby_parser__external__diagnotic_messages__new_class_definition_in_method_body() };
        Self { blob }
    }
    /// Constructs ModuleDefinitionInMethodBody variant
    pub fn new_module_definition_in_method_body() -> Self {
        let blob = unsafe { lib_ruby_parser__external__diagnotic_messages__new_module_definition_in_method_body() };
        Self { blob }
    }
    /// Constructs InvalidReturnInClassOrModuleBody variant
    pub fn new_invalid_return_in_class_or_module_body() -> Self {
        let blob = unsafe { lib_ruby_parser__external__diagnotic_messages__new_invalid_return_in_class_or_module_body() };
        Self { blob }
    }
    /// Constructs ConstArgument variant
    pub fn new_const_argument() -> Self {
        let blob = unsafe { lib_ruby_parser__external__diagnotic_messages__new_const_argument() };
        Self { blob }
    }
    /// Constructs IvarArgument variant
    pub fn new_ivar_argument() -> Self {
        let blob = unsafe { lib_ruby_parser__external__diagnotic_messages__new_ivar_argument() };
        Self { blob }
    }
    /// Constructs GvarArgument variant
    pub fn new_gvar_argument() -> Self {
        let blob = unsafe { lib_ruby_parser__external__diagnotic_messages__new_gvar_argument() };
        Self { blob }
    }
    /// Constructs CvarArgument variant
    pub fn new_cvar_argument() -> Self {
        let blob = unsafe { lib_ruby_parser__external__diagnotic_messages__new_cvar_argument() };
        Self { blob }
    }
    /// Constructs NoSuchLocalVariable variant
    pub fn new_no_such_local_variable(var_name: StringPtr,) -> Self {
        let blob = unsafe { lib_ruby_parser__external__diagnotic_messages__new_no_such_local_variable(var_name.into_blob(), ) };
        Self { blob }
    }
    /// Constructs OrdinaryParamDefined variant
    pub fn new_ordinary_param_defined() -> Self {
        let blob = unsafe { lib_ruby_parser__external__diagnotic_messages__new_ordinary_param_defined() };
        Self { blob }
    }
    /// Constructs NumparamUsed variant
    pub fn new_numparam_used() -> Self {
        let blob = unsafe { lib_ruby_parser__external__diagnotic_messages__new_numparam_used() };
        Self { blob }
    }
    /// Constructs TokAtEolWithoutExpression variant
    pub fn new_tok_at_eol_without_expression(token_name: StringPtr,) -> Self {
        let blob = unsafe { lib_ruby_parser__external__diagnotic_messages__new_tok_at_eol_without_expression(token_name.into_blob(), ) };
        Self { blob }
    }
    /// Constructs EndInMethod variant
    pub fn new_end_in_method() -> Self {
        let blob = unsafe { lib_ruby_parser__external__diagnotic_messages__new_end_in_method() };
        Self { blob }
    }
    /// Constructs ComparisonAfterComparison variant
    pub fn new_comparison_after_comparison(comparison: StringPtr,) -> Self {
        let blob = unsafe { lib_ruby_parser__external__diagnotic_messages__new_comparison_after_comparison(comparison.into_blob(), ) };
        Self { blob }
    }
    /// Constructs CircularArgumentReference variant
    pub fn new_circular_argument_reference(arg_name: StringPtr,) -> Self {
        let blob = unsafe { lib_ruby_parser__external__diagnotic_messages__new_circular_argument_reference(arg_name.into_blob(), ) };
        Self { blob }
    }
    /// Constructs DynamicConstantAssignment variant
    pub fn new_dynamic_constant_assignment() -> Self {
        let blob = unsafe { lib_ruby_parser__external__diagnotic_messages__new_dynamic_constant_assignment() };
        Self { blob }
    }
    /// Constructs CantAssignToSelf variant
    pub fn new_cant_assign_to_self() -> Self {
        let blob = unsafe { lib_ruby_parser__external__diagnotic_messages__new_cant_assign_to_self() };
        Self { blob }
    }
    /// Constructs CantAssignToNil variant
    pub fn new_cant_assign_to_nil() -> Self {
        let blob = unsafe { lib_ruby_parser__external__diagnotic_messages__new_cant_assign_to_nil() };
        Self { blob }
    }
    /// Constructs CantAssignToTrue variant
    pub fn new_cant_assign_to_true() -> Self {
        let blob = unsafe { lib_ruby_parser__external__diagnotic_messages__new_cant_assign_to_true() };
        Self { blob }
    }
    /// Constructs CantAssignToFalse variant
    pub fn new_cant_assign_to_false() -> Self {
        let blob = unsafe { lib_ruby_parser__external__diagnotic_messages__new_cant_assign_to_false() };
        Self { blob }
    }
    /// Constructs CantAssignToFile variant
    pub fn new_cant_assign_to_file() -> Self {
        let blob = unsafe { lib_ruby_parser__external__diagnotic_messages__new_cant_assign_to_file() };
        Self { blob }
    }
    /// Constructs CantAssignToLine variant
    pub fn new_cant_assign_to_line() -> Self {
        let blob = unsafe { lib_ruby_parser__external__diagnotic_messages__new_cant_assign_to_line() };
        Self { blob }
    }
    /// Constructs CantAssignToEncoding variant
    pub fn new_cant_assign_to_encoding() -> Self {
        let blob = unsafe { lib_ruby_parser__external__diagnotic_messages__new_cant_assign_to_encoding() };
        Self { blob }
    }
    /// Constructs CantAssignToNumparam variant
    pub fn new_cant_assign_to_numparam(numparam: StringPtr,) -> Self {
        let blob = unsafe { lib_ruby_parser__external__diagnotic_messages__new_cant_assign_to_numparam(numparam.into_blob(), ) };
        Self { blob }
    }
    /// Constructs CantSetVariable variant
    pub fn new_cant_set_variable(var_name: StringPtr,) -> Self {
        let blob = unsafe { lib_ruby_parser__external__diagnotic_messages__new_cant_set_variable(var_name.into_blob(), ) };
        Self { blob }
    }
    /// Constructs BlockGivenToYield variant
    pub fn new_block_given_to_yield() -> Self {
        let blob = unsafe { lib_ruby_parser__external__diagnotic_messages__new_block_given_to_yield() };
        Self { blob }
    }
    /// Constructs BlockAndBlockArgGiven variant
    pub fn new_block_and_block_arg_given() -> Self {
        let blob = unsafe { lib_ruby_parser__external__diagnotic_messages__new_block_and_block_arg_given() };
        Self { blob }
    }
    /// Constructs SymbolLiteralWithInterpolation variant
    pub fn new_symbol_literal_with_interpolation() -> Self {
        let blob = unsafe { lib_ruby_parser__external__diagnotic_messages__new_symbol_literal_with_interpolation() };
        Self { blob }
    }
    /// Constructs ReservedForNumparam variant
    pub fn new_reserved_for_numparam(numparam: StringPtr,) -> Self {
        let blob = unsafe { lib_ruby_parser__external__diagnotic_messages__new_reserved_for_numparam(numparam.into_blob(), ) };
        Self { blob }
    }
    /// Constructs KeyMustBeValidAsLocalVariable variant
    pub fn new_key_must_be_valid_as_local_variable() -> Self {
        let blob = unsafe { lib_ruby_parser__external__diagnotic_messages__new_key_must_be_valid_as_local_variable() };
        Self { blob }
    }
    /// Constructs DuplicateVariableName variant
    pub fn new_duplicate_variable_name() -> Self {
        let blob = unsafe { lib_ruby_parser__external__diagnotic_messages__new_duplicate_variable_name() };
        Self { blob }
    }
    /// Constructs DuplicateKeyName variant
    pub fn new_duplicate_key_name() -> Self {
        let blob = unsafe { lib_ruby_parser__external__diagnotic_messages__new_duplicate_key_name() };
        Self { blob }
    }
    /// Constructs SingletonLiteral variant
    pub fn new_singleton_literal() -> Self {
        let blob = unsafe { lib_ruby_parser__external__diagnotic_messages__new_singleton_literal() };
        Self { blob }
    }
    /// Constructs NthRefIsTooBig variant
    pub fn new_nth_ref_is_too_big(nth_ref: StringPtr,) -> Self {
        let blob = unsafe { lib_ruby_parser__external__diagnotic_messages__new_nth_ref_is_too_big(nth_ref.into_blob(), ) };
        Self { blob }
    }
    /// Constructs DuplicatedArgumentName variant
    pub fn new_duplicated_argument_name() -> Self {
        let blob = unsafe { lib_ruby_parser__external__diagnotic_messages__new_duplicated_argument_name() };
        Self { blob }
    }
    /// Constructs RegexError variant
    pub fn new_regex_error(error: StringPtr,) -> Self {
        let blob = unsafe { lib_ruby_parser__external__diagnotic_messages__new_regex_error(error.into_blob(), ) };
        Self { blob }
    }
    /// Constructs InvalidSymbol variant
    pub fn new_invalid_symbol(symbol: StringPtr,) -> Self {
        let blob = unsafe { lib_ruby_parser__external__diagnotic_messages__new_invalid_symbol(symbol.into_blob(), ) };
        Self { blob }
    }
    /// Constructs VoidValueExpression variant
    pub fn new_void_value_expression() -> Self {
        let blob = unsafe { lib_ruby_parser__external__diagnotic_messages__new_void_value_expression() };
        Self { blob }
    }
}