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.3
Fields of FractionAfterNumeric
Emitted for code like
foo.2
Fields of NoDigitsAfterDot
Emitted for code like
%k[foo]
Fields of UnknownTypeOfPercentString
Emitted for code like
0b
Fields of NumericLiteralWithoutDigits
Emitted for code like
%w[foo bar
Fields of UnterminatedList
Emitted for code like
/foo
Fields of UnterminatedRegexp
Emitted for code like
"foo
Fields 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
<<-HERE
Fields of UnterminatedHeredoc
heredoc_id: String
Heredoc identifier
Emitted for code like
<<-"HERE
Fields of UnterminatedHeredocId
Emitted for code like
eval("foo \r = 42")
Fields of SlashRAtMiddleOfLine
Emitted for code like (only in $VERBOSE mode)
foo **arg
Fields of DStarInterpretedAsArgPrefix
Emitted for code like (only in $VERBOSE mode)
foo *arg
Fields of StarInterpretedAsArgPrefix
Emitted for code like (only in $VERBOSE mode)
foo &arg
Fields of AmpersandInterpretedAsArgPrefix
Emitted for code like
range = 1...
Fields of TripleDotAtEol
Emitted for code like (only in $VERBOSE mode)
def m (a, b, c); end
Fields of ParenthesesIterpretedAsArglist
Emitted for code like (only in $VERBOSE mode)
m +foo
Fields of AmbiguousFirstArgument
operator: u8
Operator that is ambiguous
Emitted for code like (only in $VERBOSE mode)
1 *2
Fields of AmbiguousOperator
Emitted for code like
"\M- "
Fields of InvalidCharacterSyntax
suggestion: String
Valid syntax sugestions
Emitted for code like
09
Fields of InvalidOctalDigit
Emitted for code like
0_a
Fields of TrailingCharInNumber
c: u8
Invalid trailing char
Emitted for code like
=begin
Fields of EmbeddedDocumentMeetsEof
Emitted for code like
eval("\x01foo")
Fields of InvalidChar
c: u8
char
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: u8
char after $
Emitted for code like
@
Fields of IvarWithoutId
Emitted for code like
@1
Fields of InvalidIvarName
c: u8
char after @
Emitted for code like
@@
Fields of CvarWithoutId
Emitted for code like
@@1
Fields of InvalidCvarName
c: u8
char after @@
Emitted for code like
/re/foo
Fields of UnknownRegexOptions
options: String
Concatenated unknown options
Emitted for code like
"\u{1234"
Fields of UnterminatedUnicodeEscape
Emitted for code like
Fields of EncodingError
error: String
Error from decoder
Emitter for code like
eval("\xFF = 42")
Fields of InvalidMultibyteChar
Emitted for code like
a ?AA : 2
Fields of AmbiguousTernaryOperator
condition: String
Source of the condition expression
Emitted for code like
m /foo/
Fields of AmbiguousRegexp
Emitted for code like
begin; else; end
Fields of ElseWithoutRescue
Emitted for code like
def f; BEGIN{}; end
Fields of BeginNotAtTopLevel
Emitted for code like
alias $a $1
Fields of AliasNthRef
Emitted for code like
*a&.x = 0
Fields of CsendInsideMasgn
Emitted for code like
module foo; end
Fields of ClassOrModuleNameMustBeConstant
Emitted for code like
def foo=() = 42
Fields of EndlessSetterDefinition
Emitted for any code that produces invalid sequence of tokens
Fields of UnexpectedToken
token_name: String
Name of the token
Emitted for code like
def a; class Foo; end; end
Fields of ClassDefinitionInMethodBody
Emitted for code like
def a; module Foo; end; end
Fields of ModuleDefinitionInMethodBody
Emitted for code like
class A; return; end
Fields of InvalidReturnInClassOrModuleBody
Emitted for code like
def foo(Abc); end
Fields of ConstArgument
Emitted for code like
def foo(@abc); end
Fields of IvarArgument
Emitted for code like
def foo($abc); end
Fields of GvarArgument
Emitted for code like
def foo(@@abc); end
Fields of CvarArgument
Emitted for code like
case 0; in ^a; true; end
Fields of NoSuchLocalVariable
var_name: String
Variable 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
end
Fields of TokAtEolWithoutExpression
token_name: String
Name of the token
Emitted for code like
def m; END {}; end
Fields of EndInMethod
Emitted for code like (only in $VERBOSE mode)
a < b < c
Fields of ComparisonAfterComparison
comparison: String
Source of the first comparison
Emitted for code like
def m(foo = foo) end
Fields of CircularArgumentReference
arg_name: String
Name of the argument
Emitted for code like
def m; FOO = 1; end
Fields of DynamicConstantAssignment
Emitted for code like
self = foo
Fields of CantAssignToSelf
Emitted for code like
nil = foo
Fields of CantAssignToNil
Emitted for code like
true = foo
Fields of CantAssignToTrue
Emitted for code like
false = foo
Fields of CantAssignToFalse
Emitted for code like
__FILE__ = foo
Fields of CantAssignToFile
Emitted for code like
__LINE__ = foo
Fields of CantAssignToLine
Emitted for code like
__ENCODING__ = foo
Fields of CantAssignToEncoding
Emitted for code like
proc {_1; _1 = nil}
Fields of CantAssignToNumparam
numparam: String
Source of the numbered parameter
Emitted for code like
$1 = foo
Fields of CantSetVariable
var_name: String
Source of the read-only variable that is assigned
Emitted for code like
yield(&foo)
Fields of BlockGivenToYield
Emitted for code like
fun(&bar) do end
Fields of BlockAndBlockArgGiven
Emitted for code like
case a; in "#{a}": 1; end
Fields of SymbolLiteralWithInterpolation
Emitted for code like
_1 = 1
Fields of ReservedForNumparam
numparam: String
Numbered parameter that is treated as a local variable
Emitted for code like
case a; in a?:; end
Fields of KeyMustBeValidAsLocalVariable
Emitted for code like
case 0; in a, a; end
Fields of DuplicateVariableName
Emitted for code like
case 0; in a: 1, a: 2; end
Fields of DuplicateKeyName
Emitted for code like
def (1).foo; end
Fields of SingletonLiteral
Emitted for code like (only in $VERBOSE mode)
$100
Fields of NthRefIsTooBig
nth_ref: String
Source of the nth_ref that is techincally a regular global variable
Emitted for code like
def foo(aa, aa); end
Fields of DuplicatedArgumentName
Emitted for code like
/[/
Fields of RegexError
error: String
Error from Onigurama engine
Emitted for code like
%I"x .\xc3."
Fields of InvalidSymbol
symbol: String
Source of the symbol
Emitted for code like
a = return
Fields 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