Enum lib_ruby_parser::DiagnosticMessage[][src]

#[repr(C)]
pub enum DiagnosticMessage {
Show variants FractionAfterNumeric, NoDigitsAfterDot, UnknownTypeOfPercentString, NumericLiteralWithoutDigits, UnterminatedList, UnterminatedRegexp, UnterminatedString, UnterminatedQuotedString, InvalidUnicodeEscape, TooLargeUnicodeCodepoint, InvalidUnicodeCodepoint, MultipleCodepointAtSingleChar, InvalidEscapeCharacter, InvalidHexEscape, UnterminatedHeredoc { heredoc_id: String, }, UnterminatedHeredocId, SlashRAtMiddleOfLine, DStarInterpretedAsArgPrefix, StarInterpretedAsArgPrefix, AmpersandInterpretedAsArgPrefix, TripleDotAtEol, ParenthesesIterpretedAsArglist, AmbiguousFirstArgument { operator: u8, }, AmbiguousOperator { operator: String, interpreted_as: String, }, InvalidCharacterSyntax { suggestion: String, }, InvalidOctalDigit, TrailingCharInNumber { c: u8, }, EmbeddedDocumentMeetsEof, InvalidChar { c: u8, }, IncompleteCharacterSyntax, GvarWithoutId, InvalidGvarName { c: u8, }, IvarWithoutId, InvalidIvarName { c: u8, }, CvarWithoutId, InvalidCvarName { c: u8, }, UnknownRegexOptions { options: String, }, UnterminatedUnicodeEscape, EncodingError { error: String, }, InvalidMultibyteChar, AmbiguousTernaryOperator { condition: String, }, AmbiguousRegexp, ElseWithoutRescue, BeginNotAtTopLevel, AliasNthRef, CsendInsideMasgn, ClassOrModuleNameMustBeConstant, EndlessSetterDefinition, UnexpectedToken { token_name: String, }, ClassDefinitionInMethodBody, ModuleDefinitionInMethodBody, InvalidReturnInClassOrModuleBody, ConstArgument, IvarArgument, GvarArgument, CvarArgument, NoSuchLocalVariable { var_name: String, }, OrdinaryParamDefined, NumparamUsed, TokAtEolWithoutExpression { token_name: String, }, EndInMethod, ComparisonAfterComparison { comparison: String, }, CircularArgumentReference { arg_name: String, }, DynamicConstantAssignment, CantAssignToSelf, CantAssignToNil, CantAssignToTrue, CantAssignToFalse, CantAssignToFile, CantAssignToLine, CantAssignToEncoding, CantAssignToNumparam { numparam: String, }, CantSetVariable { var_name: String, }, BlockGivenToYield, BlockAndBlockArgGiven, SymbolLiteralWithInterpolation, ReservedForNumparam { numparam: String, }, KeyMustBeValidAsLocalVariable, DuplicateVariableName, DuplicateKeyName, SingletonLiteral, NthRefIsTooBig { nth_ref: String, }, DuplicatedArgumentName, RegexError { error: String, }, InvalidSymbol { symbol: String, }, VoidValueExpression,
}
Expand description

Enum of all possible diagnostic message (both warnings and errors)

Variants

FractionAfterNumeric

Emitted for code

1.2.3
NoDigitsAfterDot

Emitted for code like

foo.2
UnknownTypeOfPercentString

Emitted for code like

%k[foo]
NumericLiteralWithoutDigits

Emitted for code like

0b
UnterminatedList

Emitted for code like

%w[foo bar
UnterminatedRegexp

Emitted for code like

/foo
UnterminatedString

Emitted for code like

"foo
UnterminatedQuotedString

Emitted for code like

%s
//    ^ EOF, not \n
InvalidUnicodeEscape

Emitted for code like

"\ufoo"
TooLargeUnicodeCodepoint

Emitted for code like

"\u{999999}"
InvalidUnicodeCodepoint

Emitted for code like

"\u{d800}"
MultipleCodepointAtSingleChar

Emitted for code like

?\u{41 42}
InvalidEscapeCharacter

Emitted for code like

"\M-"
InvalidHexEscape

Emitted for code like

"\xZZ"
UnterminatedHeredoc

Emitted for code like

<<-HERE
Show fields

Fields of UnterminatedHeredoc

heredoc_id: String

Heredoc identifier

UnterminatedHeredocId

Emitted for code like

<<-"HERE
SlashRAtMiddleOfLine

Emitted for code like

eval("foo \r = 42")
DStarInterpretedAsArgPrefix

Emitted for code like (only in $VERBOSE mode)

foo **arg
StarInterpretedAsArgPrefix

Emitted for code like (only in $VERBOSE mode)

foo *arg
AmpersandInterpretedAsArgPrefix

Emitted for code like (only in $VERBOSE mode)

foo &arg
TripleDotAtEol

Emitted for code like

range = 1...
ParenthesesIterpretedAsArglist

Emitted for code like (only in $VERBOSE mode)

def m (a, b, c); end
AmbiguousFirstArgument

Emitted for code like (only in $VERBOSE mode)

m +foo
Show fields

Fields of AmbiguousFirstArgument

operator: u8

Operator that is ambiguous

AmbiguousOperator

Emitted for code like (only in $VERBOSE mode)

1 *2
Show fields

Fields of AmbiguousOperator

operator: String

Operator that is ambiguous

interpreted_as: String

Interpretation of this operator

InvalidCharacterSyntax

Emitted for code like

"\M- "
Show fields

Fields of InvalidCharacterSyntax

suggestion: String

Valid syntax sugestions

InvalidOctalDigit

Emitted for code like

09
TrailingCharInNumber

Emitted for code like

0_a
Show fields

Fields of TrailingCharInNumber

c: u8

Invalid trailing char

EmbeddedDocumentMeetsEof

Emitted for code like

=begin
InvalidChar

Emitted for code like

eval("\x01foo")
Show fields

Fields of InvalidChar

c: u8

char

IncompleteCharacterSyntax

It is unknown how to trigger this error. Code that triggers it in MRI can be dead.

GvarWithoutId

Emitted for code like

$
InvalidGvarName

Emitted for code like

$@
Show fields

Fields of InvalidGvarName

c: u8

char after $

IvarWithoutId

Emitted for code like

@
InvalidIvarName

Emitted for code like

@1
Show fields

Fields of InvalidIvarName

c: u8

char after @

CvarWithoutId

Emitted for code like

@@
InvalidCvarName

Emitted for code like

@@1
Show fields

Fields of InvalidCvarName

c: u8

char after @@

UnknownRegexOptions

Emitted for code like

/re/foo
Show fields

Fields of UnknownRegexOptions

options: String

Concatenated unknown options

UnterminatedUnicodeEscape

Emitted for code like

"\u{1234"
EncodingError

Emitted for code like

# encoding: foo
Show fields

Fields of EncodingError

error: String

Error from decoder

InvalidMultibyteChar

Emitter for code like

eval("\xFF = 42")
AmbiguousTernaryOperator

Emitted for code like

a ?AA : 2
Show fields

Fields of AmbiguousTernaryOperator

condition: String

Source of the condition expression

AmbiguousRegexp

Emitted for code like

m /foo/
ElseWithoutRescue

Emitted for code like

begin; else; end
BeginNotAtTopLevel

Emitted for code like

def f; BEGIN{}; end
AliasNthRef

Emitted for code like

alias $a $1
CsendInsideMasgn

Emitted for code like

*a&.x = 0
ClassOrModuleNameMustBeConstant

Emitted for code like

module foo; end
EndlessSetterDefinition

Emitted for code like

def foo=() = 42
UnexpectedToken

Emitted for any code that produces invalid sequence of tokens

Show fields

Fields of UnexpectedToken

token_name: String

Name of the token

ClassDefinitionInMethodBody

Emitted for code like

def a; class Foo; end; end
ModuleDefinitionInMethodBody

Emitted for code like

def a; module Foo; end; end
InvalidReturnInClassOrModuleBody

Emitted for code like

class A; return; end
ConstArgument

Emitted for code like

def foo(Abc); end
IvarArgument

Emitted for code like

def foo(@abc); end
GvarArgument

Emitted for code like

def foo($abc); end
CvarArgument

Emitted for code like

def foo(@@abc); end
NoSuchLocalVariable

Emitted for code like

case 0; in ^a; true; end
Show fields

Fields of NoSuchLocalVariable

var_name: String

Variable name

OrdinaryParamDefined

Emitted for code like

m { |a| _1 }
NumparamUsed

Emitted for code like

foo { _1; bar { _2 }; }
TokAtEolWithoutExpression

Emitted for code like (only in $VERBOSE mode)

if
42
end
Show fields

Fields of TokAtEolWithoutExpression

token_name: String

Name of the token

EndInMethod

Emitted for code like

def m; END {}; end
ComparisonAfterComparison

Emitted for code like (only in $VERBOSE mode)

a < b < c
Show fields

Fields of ComparisonAfterComparison

comparison: String

Source of the first comparison

CircularArgumentReference

Emitted for code like

def m(foo = foo) end
Show fields

Fields of CircularArgumentReference

arg_name: String

Name of the argument

DynamicConstantAssignment

Emitted for code like

def m; FOO = 1; end
CantAssignToSelf

Emitted for code like

self = foo
CantAssignToNil

Emitted for code like

nil = foo
CantAssignToTrue

Emitted for code like

true = foo
CantAssignToFalse

Emitted for code like

false = foo
CantAssignToFile

Emitted for code like

__FILE__ = foo
CantAssignToLine

Emitted for code like

__LINE__ = foo
CantAssignToEncoding

Emitted for code like

__ENCODING__ = foo
CantAssignToNumparam

Emitted for code like

proc {_1; _1 = nil}
Show fields

Fields of CantAssignToNumparam

numparam: String

Source of the numbered parameter

CantSetVariable

Emitted for code like

$1 = foo
Show fields

Fields of CantSetVariable

var_name: String

Source of the read-only variable that is assigned

BlockGivenToYield

Emitted for code like

yield(&foo)
BlockAndBlockArgGiven

Emitted for code like

fun(&bar) do end
SymbolLiteralWithInterpolation

Emitted for code like

case a; in "#{a}": 1; end
ReservedForNumparam

Emitted for code like

_1 = 1
Show fields

Fields of ReservedForNumparam

numparam: String

Numbered parameter that is treated as a local variable

KeyMustBeValidAsLocalVariable

Emitted for code like

case a; in a?:; end
DuplicateVariableName

Emitted for code like

case 0; in a, a; end
DuplicateKeyName

Emitted for code like

case 0; in a: 1, a: 2; end
SingletonLiteral

Emitted for code like

def (1).foo; end
NthRefIsTooBig

Emitted for code like (only in $VERBOSE mode)

$100
Show fields

Fields of NthRefIsTooBig

nth_ref: String

Source of the nth_ref that is techincally a regular global variable

DuplicatedArgumentName

Emitted for code like

def foo(aa, aa); end
RegexError

Emitted for code like

/[/
Show fields

Fields of RegexError

error: String

Error from Onigurama engine

InvalidSymbol

Emitted for code like

%I"x .\xc3."
Show fields

Fields of InvalidSymbol

symbol: String

Source of the symbol

VoidValueExpression

Emitted for code like

a = return

Implementations

Renders DiagnosticMessage by interpolating all dynamic values into a template

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.