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
use super::DiagnosticMessage;
use super::variants::*;
impl DiagnosticMessage {
pub fn new_fraction_after_numeric() -> Self {
Self::FractionAfterNumeric(FractionAfterNumeric { })
}
pub fn new_no_digits_after_dot() -> Self {
Self::NoDigitsAfterDot(NoDigitsAfterDot { })
}
pub fn new_unknown_type_of_percent_string() -> Self {
Self::UnknownTypeOfPercentString(UnknownTypeOfPercentString { })
}
pub fn new_numeric_literal_without_digits() -> Self {
Self::NumericLiteralWithoutDigits(NumericLiteralWithoutDigits { })
}
pub fn new_unterminated_list() -> Self {
Self::UnterminatedList(UnterminatedList { })
}
pub fn new_unterminated_regexp() -> Self {
Self::UnterminatedRegexp(UnterminatedRegexp { })
}
pub fn new_unterminated_string() -> Self {
Self::UnterminatedString(UnterminatedString { })
}
pub fn new_unterminated_quoted_string() -> Self {
Self::UnterminatedQuotedString(UnterminatedQuotedString { })
}
pub fn new_invalid_unicode_escape() -> Self {
Self::InvalidUnicodeEscape(InvalidUnicodeEscape { })
}
pub fn new_too_large_unicode_codepoint() -> Self {
Self::TooLargeUnicodeCodepoint(TooLargeUnicodeCodepoint { })
}
pub fn new_invalid_unicode_codepoint() -> Self {
Self::InvalidUnicodeCodepoint(InvalidUnicodeCodepoint { })
}
pub fn new_multiple_codepoint_at_single_char() -> Self {
Self::MultipleCodepointAtSingleChar(MultipleCodepointAtSingleChar { })
}
pub fn new_invalid_escape_character() -> Self {
Self::InvalidEscapeCharacter(InvalidEscapeCharacter { })
}
pub fn new_invalid_hex_escape() -> Self {
Self::InvalidHexEscape(InvalidHexEscape { })
}
pub fn new_unterminated_heredoc(heredoc_id: String) -> Self {
Self::UnterminatedHeredoc(UnterminatedHeredoc { heredoc_id })
}
pub fn new_unterminated_heredoc_id() -> Self {
Self::UnterminatedHeredocId(UnterminatedHeredocId { })
}
pub fn new_slash_r_at_middle_of_line() -> Self {
Self::SlashRAtMiddleOfLine(SlashRAtMiddleOfLine { })
}
pub fn new_d_star_interpreted_as_arg_prefix() -> Self {
Self::DStarInterpretedAsArgPrefix(DStarInterpretedAsArgPrefix { })
}
pub fn new_star_interpreted_as_arg_prefix() -> Self {
Self::StarInterpretedAsArgPrefix(StarInterpretedAsArgPrefix { })
}
pub fn new_ampersand_interpreted_as_arg_prefix() -> Self {
Self::AmpersandInterpretedAsArgPrefix(AmpersandInterpretedAsArgPrefix { })
}
pub fn new_triple_dot_at_eol() -> Self {
Self::TripleDotAtEol(TripleDotAtEol { })
}
pub fn new_parentheses_iterpreted_as_arglist() -> Self {
Self::ParenthesesIterpretedAsArglist(ParenthesesIterpretedAsArglist { })
}
pub fn new_ambiguous_first_argument(operator: u8) -> Self {
Self::AmbiguousFirstArgument(AmbiguousFirstArgument { operator })
}
pub fn new_ambiguous_operator(operator: String, interpreted_as: String) -> Self {
Self::AmbiguousOperator(AmbiguousOperator { operator, interpreted_as })
}
pub fn new_invalid_character_syntax(suggestion: String) -> Self {
Self::InvalidCharacterSyntax(InvalidCharacterSyntax { suggestion })
}
pub fn new_invalid_octal_digit() -> Self {
Self::InvalidOctalDigit(InvalidOctalDigit { })
}
pub fn new_trailing_char_in_number(c: u8) -> Self {
Self::TrailingCharInNumber(TrailingCharInNumber { c })
}
pub fn new_embedded_document_meets_eof() -> Self {
Self::EmbeddedDocumentMeetsEof(EmbeddedDocumentMeetsEof { })
}
pub fn new_invalid_char(c: u8) -> Self {
Self::InvalidChar(InvalidChar { c })
}
pub fn new_incomplete_character_syntax() -> Self {
Self::IncompleteCharacterSyntax(IncompleteCharacterSyntax { })
}
pub fn new_gvar_without_id() -> Self {
Self::GvarWithoutId(GvarWithoutId { })
}
pub fn new_invalid_gvar_name(c: u8) -> Self {
Self::InvalidGvarName(InvalidGvarName { c })
}
pub fn new_ivar_without_id() -> Self {
Self::IvarWithoutId(IvarWithoutId { })
}
pub fn new_invalid_ivar_name(c: u8) -> Self {
Self::InvalidIvarName(InvalidIvarName { c })
}
pub fn new_cvar_without_id() -> Self {
Self::CvarWithoutId(CvarWithoutId { })
}
pub fn new_invalid_cvar_name(c: u8) -> Self {
Self::InvalidCvarName(InvalidCvarName { c })
}
pub fn new_unknown_regex_options(options: String) -> Self {
Self::UnknownRegexOptions(UnknownRegexOptions { options })
}
pub fn new_unterminated_unicode_escape() -> Self {
Self::UnterminatedUnicodeEscape(UnterminatedUnicodeEscape { })
}
pub fn new_encoding_error(error: String) -> Self {
Self::EncodingError(EncodingError { error })
}
pub fn new_invalid_multibyte_char() -> Self {
Self::InvalidMultibyteChar(InvalidMultibyteChar { })
}
pub fn new_ambiguous_ternary_operator(condition: String) -> Self {
Self::AmbiguousTernaryOperator(AmbiguousTernaryOperator { condition })
}
pub fn new_ambiguous_regexp() -> Self {
Self::AmbiguousRegexp(AmbiguousRegexp { })
}
pub fn new_else_without_rescue() -> Self {
Self::ElseWithoutRescue(ElseWithoutRescue { })
}
pub fn new_begin_not_at_top_level() -> Self {
Self::BeginNotAtTopLevel(BeginNotAtTopLevel { })
}
pub fn new_alias_nth_ref() -> Self {
Self::AliasNthRef(AliasNthRef { })
}
pub fn new_csend_inside_masgn() -> Self {
Self::CsendInsideMasgn(CsendInsideMasgn { })
}
pub fn new_class_or_module_name_must_be_constant() -> Self {
Self::ClassOrModuleNameMustBeConstant(ClassOrModuleNameMustBeConstant { })
}
pub fn new_endless_setter_definition() -> Self {
Self::EndlessSetterDefinition(EndlessSetterDefinition { })
}
pub fn new_unexpected_token(token_name: String) -> Self {
Self::UnexpectedToken(UnexpectedToken { token_name })
}
pub fn new_class_definition_in_method_body() -> Self {
Self::ClassDefinitionInMethodBody(ClassDefinitionInMethodBody { })
}
pub fn new_module_definition_in_method_body() -> Self {
Self::ModuleDefinitionInMethodBody(ModuleDefinitionInMethodBody { })
}
pub fn new_invalid_return_in_class_or_module_body() -> Self {
Self::InvalidReturnInClassOrModuleBody(InvalidReturnInClassOrModuleBody { })
}
pub fn new_const_argument() -> Self {
Self::ConstArgument(ConstArgument { })
}
pub fn new_ivar_argument() -> Self {
Self::IvarArgument(IvarArgument { })
}
pub fn new_gvar_argument() -> Self {
Self::GvarArgument(GvarArgument { })
}
pub fn new_cvar_argument() -> Self {
Self::CvarArgument(CvarArgument { })
}
pub fn new_no_such_local_variable(var_name: String) -> Self {
Self::NoSuchLocalVariable(NoSuchLocalVariable { var_name })
}
pub fn new_ordinary_param_defined() -> Self {
Self::OrdinaryParamDefined(OrdinaryParamDefined { })
}
pub fn new_numparam_used() -> Self {
Self::NumparamUsed(NumparamUsed { })
}
pub fn new_tok_at_eol_without_expression(token_name: String) -> Self {
Self::TokAtEolWithoutExpression(TokAtEolWithoutExpression { token_name })
}
pub fn new_end_in_method() -> Self {
Self::EndInMethod(EndInMethod { })
}
pub fn new_comparison_after_comparison(comparison: String) -> Self {
Self::ComparisonAfterComparison(ComparisonAfterComparison { comparison })
}
pub fn new_circular_argument_reference(arg_name: String) -> Self {
Self::CircularArgumentReference(CircularArgumentReference { arg_name })
}
pub fn new_dynamic_constant_assignment() -> Self {
Self::DynamicConstantAssignment(DynamicConstantAssignment { })
}
pub fn new_cant_assign_to_self() -> Self {
Self::CantAssignToSelf(CantAssignToSelf { })
}
pub fn new_cant_assign_to_nil() -> Self {
Self::CantAssignToNil(CantAssignToNil { })
}
pub fn new_cant_assign_to_true() -> Self {
Self::CantAssignToTrue(CantAssignToTrue { })
}
pub fn new_cant_assign_to_false() -> Self {
Self::CantAssignToFalse(CantAssignToFalse { })
}
pub fn new_cant_assign_to_file() -> Self {
Self::CantAssignToFile(CantAssignToFile { })
}
pub fn new_cant_assign_to_line() -> Self {
Self::CantAssignToLine(CantAssignToLine { })
}
pub fn new_cant_assign_to_encoding() -> Self {
Self::CantAssignToEncoding(CantAssignToEncoding { })
}
pub fn new_cant_assign_to_numparam(numparam: String) -> Self {
Self::CantAssignToNumparam(CantAssignToNumparam { numparam })
}
pub fn new_cant_set_variable(var_name: String) -> Self {
Self::CantSetVariable(CantSetVariable { var_name })
}
pub fn new_block_given_to_yield() -> Self {
Self::BlockGivenToYield(BlockGivenToYield { })
}
pub fn new_block_and_block_arg_given() -> Self {
Self::BlockAndBlockArgGiven(BlockAndBlockArgGiven { })
}
pub fn new_symbol_literal_with_interpolation() -> Self {
Self::SymbolLiteralWithInterpolation(SymbolLiteralWithInterpolation { })
}
pub fn new_reserved_for_numparam(numparam: String) -> Self {
Self::ReservedForNumparam(ReservedForNumparam { numparam })
}
pub fn new_key_must_be_valid_as_local_variable() -> Self {
Self::KeyMustBeValidAsLocalVariable(KeyMustBeValidAsLocalVariable { })
}
pub fn new_duplicate_variable_name() -> Self {
Self::DuplicateVariableName(DuplicateVariableName { })
}
pub fn new_duplicate_key_name() -> Self {
Self::DuplicateKeyName(DuplicateKeyName { })
}
pub fn new_singleton_literal() -> Self {
Self::SingletonLiteral(SingletonLiteral { })
}
pub fn new_nth_ref_is_too_big(nth_ref: String) -> Self {
Self::NthRefIsTooBig(NthRefIsTooBig { nth_ref })
}
pub fn new_duplicated_argument_name() -> Self {
Self::DuplicatedArgumentName(DuplicatedArgumentName { })
}
pub fn new_regex_error(error: String) -> Self {
Self::RegexError(RegexError { error })
}
pub fn new_invalid_symbol(symbol: String) -> Self {
Self::InvalidSymbol(InvalidSymbol { symbol })
}
pub fn new_void_value_expression() -> Self {
Self::VoidValueExpression(VoidValueExpression { })
}
}