Enum lib_ruby_parser::DiagnosticMessage [−][src]
#[repr(C)]
pub enum DiagnosticMessage {
Show 90 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,
},
InvalidIdToGet {
identifier: String,
},
ForwardArgAfterRestarg {},
NoAnonymousBlockarg {},
EndInMethod {},
ComparisonAfterComparison {
comparison: String,
},
DuplicateHashKey {},
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
Fields
Emitted for code
1.2.3NoDigitsAfterDot
Fields
Emitted for code like
foo.2UnknownTypeOfPercentString
Fields
Emitted for code like
%k[foo]NumericLiteralWithoutDigits
Fields
Emitted for code like
0bUnterminatedList
Fields
Emitted for code like
%w[foo barUnterminatedRegexp
Fields
Emitted for code like
/fooUnterminatedString
Fields
Emitted for code like
"fooUnterminatedQuotedString
Fields
Emitted for code like
%s
// ^ EOF, not "
InvalidUnicodeEscape
Fields
Emitted for code like
"\ufoo"TooLargeUnicodeCodepoint
Fields
Emitted for code like
"\u{999999}"InvalidUnicodeCodepoint
Fields
Emitted for code like
"\u{d800}"MultipleCodepointAtSingleChar
Fields
Emitted for code like
?\u{41 42}InvalidEscapeCharacter
Fields
Emitted for code like
"\M-"InvalidHexEscape
Fields
Emitted for code like
"\xZZ"UnterminatedHeredoc
Fields
heredoc_id: StringHeredoc identifier
Emitted for code like
<<-HEREUnterminatedHeredocId
Fields
Emitted for code like
<<-"HERESlashRAtMiddleOfLine
Fields
Emitted for code like
eval("foo \r = 42")DStarInterpretedAsArgPrefix
Fields
Emitted for code like (only in $VERBOSE mode)
foo **argStarInterpretedAsArgPrefix
Fields
Emitted for code like (only in $VERBOSE mode)
foo *argAmpersandInterpretedAsArgPrefix
Fields
Emitted for code like (only in $VERBOSE mode)
foo &argTripleDotAtEol
Fields
Emitted for code like
range = 1...ParenthesesIterpretedAsArglist
Fields
Emitted for code like (only in $VERBOSE mode)
def m (a, b, c); endAmbiguousFirstArgument
Fields
operator: u8Operator that is ambiguous
Emitted for code like (only in $VERBOSE mode)
m +fooAmbiguousOperator
Fields
operator: StringOperator that is ambiguous
interpreted_as: StringInterpretation of this operator
Emitted for code like (only in $VERBOSE mode)
1 *2InvalidCharacterSyntax
Fields
suggestion: StringValid syntax sugestions
Emitted for code like
"\M- "InvalidOctalDigit
Fields
Emitted for code like
09TrailingCharInNumber
Fields
c: u8Invalid trailing char
Emitted for code like
0_aEmbeddedDocumentMeetsEof
Fields
Emitted for code like
=beginInvalidChar
Fields
c: u8char
Emitted for code like
eval("\x01foo")IncompleteCharacterSyntax
Fields
It is unknown how to trigger this error. Code that triggers it in MRI can be dead.
GvarWithoutId
Fields
Emitted for code like
$InvalidGvarName
Fields
c: u8char after $
Emitted for code like
$@IvarWithoutId
Fields
Emitted for code like
@InvalidIvarName
Fields
c: u8char after @
Emitted for code like
@1CvarWithoutId
Fields
Emitted for code like
@@InvalidCvarName
Fields
c: u8char after @@
Emitted for code like
@@1UnknownRegexOptions
Fields
options: StringConcatenated unknown options
Emitted for code like
/re/fooUnterminatedUnicodeEscape
Fields
Emitted for code like
"\u{1234"EncodingError
Fields
error: StringError from decoder
Emitted for code like
InvalidMultibyteChar
Fields
Emitter for code like
eval("\xFF = 42")AmbiguousTernaryOperator
Fields
condition: StringSource of the condition expression
Emitted for code like
a ?AA : 2AmbiguousRegexp
Fields
Emitted for code like
m /foo/ElseWithoutRescue
Fields
Emitted for code like
begin; else; endBeginNotAtTopLevel
Fields
Emitted for code like
def f; BEGIN{}; endAliasNthRef
Fields
Emitted for code like
alias $a $1CsendInsideMasgn
Fields
Emitted for code like
*a&.x = 0ClassOrModuleNameMustBeConstant
Fields
Emitted for code like
module foo; endEndlessSetterDefinition
Fields
Emitted for code like
def foo=() = 42UnexpectedToken
Fields
token_name: StringName of the token
Emitted for any code that produces invalid sequence of tokens
ClassDefinitionInMethodBody
Fields
Emitted for code like
def a; class Foo; end; endModuleDefinitionInMethodBody
Fields
Emitted for code like
def a; module Foo; end; endInvalidReturnInClassOrModuleBody
Fields
Emitted for code like
class A; return; endConstArgument
Fields
Emitted for code like
def foo(Abc); endIvarArgument
Fields
Emitted for code like
def foo(@abc); endGvarArgument
Fields
Emitted for code like
def foo($abc); endCvarArgument
Fields
Emitted for code like
def foo(@@abc); endNoSuchLocalVariable
Fields
var_name: StringVariable name
Emitted for code like
case 0; in ^a; true; endOrdinaryParamDefined
Fields
Emitted for code like
m { |a| _1 }NumparamUsed
Fields
Emitted for code like
foo { _1; bar { _2 }; }TokAtEolWithoutExpression
Fields
token_name: StringName of the token
Emitted for code like (only in $VERBOSE mode)
if
42
endInvalidIdToGet
Fields
identifier: StringIdentifier
Emitted for code like
{ foo?: }
{ foo!: }ForwardArgAfterRestarg
Fields
Emitted for code like
def foo *rest, ...
endNoAnonymousBlockarg
Fields
Emitted for code like
def foo(); bar(&); endEndInMethod
Fields
Emitted for code like
def m; END {}; endComparisonAfterComparison
Fields
comparison: StringSource of the first comparison
Emitted for code like (only in $VERBOSE mode)
a < b < cDuplicateHashKey
Fields
Emitted for code like
{ 42 => value, 42 => another_value }CircularArgumentReference
Fields
arg_name: StringName of the argument
Emitted for code like
def m(foo = foo) endDynamicConstantAssignment
Fields
Emitted for code like
def m; FOO = 1; endCantAssignToSelf
Fields
Emitted for code like
self = fooCantAssignToNil
Fields
Emitted for code like
nil = fooCantAssignToTrue
Fields
Emitted for code like
true = fooCantAssignToFalse
Fields
Emitted for code like
false = fooCantAssignToFile
Fields
Emitted for code like
__FILE__ = fooCantAssignToLine
Fields
Emitted for code like
__LINE__ = fooCantAssignToEncoding
Fields
Emitted for code like
__ENCODING__ = fooCantAssignToNumparam
Fields
numparam: StringSource of the numbered parameter
Emitted for code like
proc {_1; _1 = nil}CantSetVariable
Fields
var_name: StringSource of the read-only variable that is assigned
Emitted for code like
$1 = fooBlockGivenToYield
Fields
Emitted for code like
yield(&foo)BlockAndBlockArgGiven
Fields
Emitted for code like
fun(&bar) do endSymbolLiteralWithInterpolation
Fields
Emitted for code like
case a; in "#{a}": 1; endReservedForNumparam
Fields
numparam: StringNumbered parameter that is treated as a local variable
Emitted for code like
_1 = 1KeyMustBeValidAsLocalVariable
Fields
Emitted for code like
case a; in a?:; endDuplicateVariableName
Fields
Emitted for code like
case 0; in a, a; endDuplicateKeyName
Fields
Emitted for code like
case 0; in a: 1, a: 2; endSingletonLiteral
Fields
Emitted for code like
def (1).foo; endNthRefIsTooBig
Fields
nth_ref: StringSource of the nth_ref that is techincally a regular global variable
Emitted for code like (only in $VERBOSE mode)
$100DuplicatedArgumentName
Fields
Emitted for code like
def foo(aa, aa); endRegexError
Fields
error: StringError from Onigurama engine
Emitted for code like
/[/InvalidSymbol
Fields
symbol: StringSource of the symbol
Emitted for code like
%I"x .\xc3."VoidValueExpression
Fields
Emitted for code like
a = returnImplementations
Trait Implementations
This method tests for self and other values to be equal, and is used
by ==. Read more
This method tests for !=.
Auto Trait Implementations
impl RefUnwindSafe for DiagnosticMessage
impl Send for DiagnosticMessage
impl Sync for DiagnosticMessage
impl Unpin for DiagnosticMessage
impl UnwindSafe for DiagnosticMessage
Blanket Implementations
Mutably borrows from an owned value. Read more
