crate::use_native_or_external!(StringPtr);
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: StringPtr, ) -> 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: StringPtr, interpreted_as: StringPtr, ) -> Self {
Self::AmbiguousOperator(AmbiguousOperator {operator, interpreted_as, })
}
pub fn new_invalid_character_syntax(suggestion: StringPtr, ) -> 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: StringPtr, ) -> Self {
Self::UnknownRegexOptions(UnknownRegexOptions {options, })
}
pub fn new_unterminated_unicode_escape() -> Self {
Self::UnterminatedUnicodeEscape(UnterminatedUnicodeEscape {})
}
pub fn new_encoding_error(error: StringPtr, ) -> Self {
Self::EncodingError(EncodingError {error, })
}
pub fn new_invalid_multibyte_char() -> Self {
Self::InvalidMultibyteChar(InvalidMultibyteChar {})
}
pub fn new_ambiguous_ternary_operator(condition: StringPtr, ) -> 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: StringPtr, ) -> 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: StringPtr, ) -> 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: StringPtr, ) -> Self {
Self::TokAtEolWithoutExpression(TokAtEolWithoutExpression {token_name, })
}
pub fn new_end_in_method() -> Self {
Self::EndInMethod(EndInMethod {})
}
pub fn new_comparison_after_comparison(comparison: StringPtr, ) -> Self {
Self::ComparisonAfterComparison(ComparisonAfterComparison {comparison, })
}
pub fn new_circular_argument_reference(arg_name: StringPtr, ) -> 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: StringPtr, ) -> Self {
Self::CantAssignToNumparam(CantAssignToNumparam {numparam, })
}
pub fn new_cant_set_variable(var_name: StringPtr, ) -> 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: StringPtr, ) -> 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: StringPtr, ) -> Self {
Self::NthRefIsTooBig(NthRefIsTooBig {nth_ref, })
}
pub fn new_duplicated_argument_name() -> Self {
Self::DuplicatedArgumentName(DuplicatedArgumentName {})
}
pub fn new_regex_error(error: StringPtr, ) -> Self {
Self::RegexError(RegexError {error, })
}
pub fn new_invalid_symbol(symbol: StringPtr, ) -> Self {
Self::InvalidSymbol(InvalidSymbol {symbol, })
}
pub fn new_void_value_expression() -> Self {
Self::VoidValueExpression(VoidValueExpression {})
}
}