Enum lib_ruby_parser::DiagnosticMessage [−][src]
#[repr(C)]
pub enum DiagnosticMessage {
Show 86 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
Emitted for code
1.2.3Fields of FractionAfterNumeric
Emitted for code like
foo.2Fields of NoDigitsAfterDot
Emitted for code like
%k[foo]Fields of UnknownTypeOfPercentString
Emitted for code like
0bFields of NumericLiteralWithoutDigits
Emitted for code like
%w[foo barFields of UnterminatedList
Emitted for code like
/fooFields of UnterminatedRegexp
Emitted for code like
"fooFields of UnterminatedString
Emitted for code like
%s
// ^ EOF, not "
Fields of UnterminatedQuotedString
Emitted for code like
"\ufoo"Fields of InvalidUnicodeEscape
Emitted for code like
"\u{999999}"Fields of TooLargeUnicodeCodepoint
Emitted for code like
"\u{d800}"Fields of InvalidUnicodeCodepoint
Emitted for code like
?\u{41 42}Fields of MultipleCodepointAtSingleChar
Emitted for code like
"\M-"Fields of InvalidEscapeCharacter
Emitted for code like
"\xZZ"Fields of InvalidHexEscape
Emitted for code like
<<-HEREFields of UnterminatedHeredoc
heredoc_id: StringHeredoc identifier
Emitted for code like
<<-"HEREFields of UnterminatedHeredocId
Emitted for code like
eval("foo \r = 42")Fields of SlashRAtMiddleOfLine
Emitted for code like (only in $VERBOSE mode)
foo **argFields of DStarInterpretedAsArgPrefix
Emitted for code like (only in $VERBOSE mode)
foo *argFields of StarInterpretedAsArgPrefix
Emitted for code like (only in $VERBOSE mode)
foo &argFields of AmpersandInterpretedAsArgPrefix
Emitted for code like
range = 1...Fields of TripleDotAtEol
Emitted for code like (only in $VERBOSE mode)
def m (a, b, c); endFields of ParenthesesIterpretedAsArglist
Emitted for code like (only in $VERBOSE mode)
m +fooFields of AmbiguousFirstArgument
operator: u8Operator that is ambiguous
Emitted for code like (only in $VERBOSE mode)
1 *2Fields of AmbiguousOperator
Emitted for code like
"\M- "Fields of InvalidCharacterSyntax
suggestion: StringValid syntax sugestions
Emitted for code like
09Fields of InvalidOctalDigit
Emitted for code like
0_aFields of TrailingCharInNumber
c: u8Invalid trailing char
Emitted for code like
=beginFields of EmbeddedDocumentMeetsEof
Emitted for code like
eval("\x01foo")Fields of InvalidChar
c: u8char
It is unknown how to trigger this error. Code that triggers it in MRI can be dead.
Fields of IncompleteCharacterSyntax
Emitted for code like
$Fields of GvarWithoutId
Emitted for code like
$@Fields of InvalidGvarName
c: u8char after $
Emitted for code like
@Fields of IvarWithoutId
Emitted for code like
@1Fields of InvalidIvarName
c: u8char after @
Emitted for code like
@@Fields of CvarWithoutId
Emitted for code like
@@1Fields of InvalidCvarName
c: u8char after @@
Emitted for code like
/re/fooFields of UnknownRegexOptions
options: StringConcatenated unknown options
Emitted for code like
"\u{1234"Fields of UnterminatedUnicodeEscape
Emitted for code like
Fields of EncodingError
error: StringError from decoder
Emitter for code like
eval("\xFF = 42")Fields of InvalidMultibyteChar
Emitted for code like
a ?AA : 2Fields of AmbiguousTernaryOperator
condition: StringSource of the condition expression
Emitted for code like
m /foo/Fields of AmbiguousRegexp
Emitted for code like
begin; else; endFields of ElseWithoutRescue
Emitted for code like
def f; BEGIN{}; endFields of BeginNotAtTopLevel
Emitted for code like
alias $a $1Fields of AliasNthRef
Emitted for code like
*a&.x = 0Fields of CsendInsideMasgn
Emitted for code like
module foo; endFields of ClassOrModuleNameMustBeConstant
Emitted for code like
def foo=() = 42Fields of EndlessSetterDefinition
Emitted for any code that produces invalid sequence of tokens
Fields of UnexpectedToken
token_name: StringName of the token
Emitted for code like
def a; class Foo; end; endFields of ClassDefinitionInMethodBody
Emitted for code like
def a; module Foo; end; endFields of ModuleDefinitionInMethodBody
Emitted for code like
class A; return; endFields of InvalidReturnInClassOrModuleBody
Emitted for code like
def foo(Abc); endFields of ConstArgument
Emitted for code like
def foo(@abc); endFields of IvarArgument
Emitted for code like
def foo($abc); endFields of GvarArgument
Emitted for code like
def foo(@@abc); endFields of CvarArgument
Emitted for code like
case 0; in ^a; true; endFields of NoSuchLocalVariable
var_name: StringVariable name
Emitted for code like
m { |a| _1 }Fields of OrdinaryParamDefined
Emitted for code like
foo { _1; bar { _2 }; }Fields of NumparamUsed
Emitted for code like (only in $VERBOSE mode)
if
42
endFields of TokAtEolWithoutExpression
token_name: StringName of the token
Emitted for code like
def m; END {}; endFields of EndInMethod
Emitted for code like (only in $VERBOSE mode)
a < b < cFields of ComparisonAfterComparison
comparison: StringSource of the first comparison
Emitted for code like
def m(foo = foo) endFields of CircularArgumentReference
arg_name: StringName of the argument
Emitted for code like
def m; FOO = 1; endFields of DynamicConstantAssignment
Emitted for code like
self = fooFields of CantAssignToSelf
Emitted for code like
nil = fooFields of CantAssignToNil
Emitted for code like
true = fooFields of CantAssignToTrue
Emitted for code like
false = fooFields of CantAssignToFalse
Emitted for code like
__FILE__ = fooFields of CantAssignToFile
Emitted for code like
__LINE__ = fooFields of CantAssignToLine
Emitted for code like
__ENCODING__ = fooFields of CantAssignToEncoding
Emitted for code like
proc {_1; _1 = nil}Fields of CantAssignToNumparam
numparam: StringSource of the numbered parameter
Emitted for code like
$1 = fooFields of CantSetVariable
var_name: StringSource of the read-only variable that is assigned
Emitted for code like
yield(&foo)Fields of BlockGivenToYield
Emitted for code like
fun(&bar) do endFields of BlockAndBlockArgGiven
Emitted for code like
case a; in "#{a}": 1; endFields of SymbolLiteralWithInterpolation
Emitted for code like
_1 = 1Fields of ReservedForNumparam
numparam: StringNumbered parameter that is treated as a local variable
Emitted for code like
case a; in a?:; endFields of KeyMustBeValidAsLocalVariable
Emitted for code like
case 0; in a, a; endFields of DuplicateVariableName
Emitted for code like
case 0; in a: 1, a: 2; endFields of DuplicateKeyName
Emitted for code like
def (1).foo; endFields of SingletonLiteral
Emitted for code like (only in $VERBOSE mode)
$100Fields of NthRefIsTooBig
nth_ref: StringSource of the nth_ref that is techincally a regular global variable
Emitted for code like
def foo(aa, aa); endFields of DuplicatedArgumentName
Emitted for code like
/[/Fields of RegexError
error: StringError from Onigurama engine
Emitted for code like
%I"x .\xc3."Fields of InvalidSymbol
symbol: StringSource of the symbol
Emitted for code like
a = returnFields of VoidValueExpression
Implementations
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