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

FractionAfterNumeric

Emitted for code

1.2.3

Fields of FractionAfterNumeric

NoDigitsAfterDot

Emitted for code like

foo.2

Fields of NoDigitsAfterDot

UnknownTypeOfPercentString

Emitted for code like

%k[foo]

Fields of UnknownTypeOfPercentString

NumericLiteralWithoutDigits

Emitted for code like

0b

Fields of NumericLiteralWithoutDigits

UnterminatedList

Emitted for code like

%w[foo bar

Fields of UnterminatedList

UnterminatedRegexp

Emitted for code like

/foo

Fields of UnterminatedRegexp

UnterminatedString

Emitted for code like

"foo

Fields of UnterminatedString

UnterminatedQuotedString

Emitted for code like

%s
//    ^ EOF, not "

Fields of UnterminatedQuotedString

InvalidUnicodeEscape

Emitted for code like

"\ufoo"

Fields of InvalidUnicodeEscape

TooLargeUnicodeCodepoint

Emitted for code like

"\u{999999}"

Fields of TooLargeUnicodeCodepoint

InvalidUnicodeCodepoint

Emitted for code like

"\u{d800}"

Fields of InvalidUnicodeCodepoint

MultipleCodepointAtSingleChar

Emitted for code like

?\u{41 42}

Fields of MultipleCodepointAtSingleChar

InvalidEscapeCharacter

Emitted for code like

"\M-"

Fields of InvalidEscapeCharacter

InvalidHexEscape

Emitted for code like

"\xZZ"

Fields of InvalidHexEscape

UnterminatedHeredoc

Emitted for code like

<<-HERE

Fields of UnterminatedHeredoc

heredoc_id: String

Heredoc identifier

UnterminatedHeredocId

Emitted for code like

<<-"HERE

Fields of UnterminatedHeredocId

SlashRAtMiddleOfLine

Emitted for code like

eval("foo \r = 42")

Fields of SlashRAtMiddleOfLine

DStarInterpretedAsArgPrefix

Emitted for code like (only in $VERBOSE mode)

foo **arg

Fields of DStarInterpretedAsArgPrefix

StarInterpretedAsArgPrefix

Emitted for code like (only in $VERBOSE mode)

foo *arg

Fields of StarInterpretedAsArgPrefix

AmpersandInterpretedAsArgPrefix

Emitted for code like (only in $VERBOSE mode)

foo &arg

Fields of AmpersandInterpretedAsArgPrefix

TripleDotAtEol

Emitted for code like

range = 1...

Fields of TripleDotAtEol

ParenthesesIterpretedAsArglist

Emitted for code like (only in $VERBOSE mode)

def m (a, b, c); end

Fields of ParenthesesIterpretedAsArglist

AmbiguousFirstArgument

Emitted for code like (only in $VERBOSE mode)

m +foo

Fields of AmbiguousFirstArgument

operator: u8

Operator that is ambiguous

AmbiguousOperator

Emitted for code like (only in $VERBOSE mode)

1 *2

Fields of AmbiguousOperator

operator: String

Operator that is ambiguous

interpreted_as: String

Interpretation of this operator

InvalidCharacterSyntax

Emitted for code like

"\M- "

Fields of InvalidCharacterSyntax

suggestion: String

Valid syntax sugestions

InvalidOctalDigit

Emitted for code like

09

Fields of InvalidOctalDigit

TrailingCharInNumber

Emitted for code like

0_a

Fields of TrailingCharInNumber

c: u8

Invalid trailing char

EmbeddedDocumentMeetsEof

Emitted for code like

=begin

Fields of EmbeddedDocumentMeetsEof

InvalidChar

Emitted for code like

eval("\x01foo")

Fields of InvalidChar

c: u8

char

IncompleteCharacterSyntax

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

Fields of IncompleteCharacterSyntax

GvarWithoutId

Emitted for code like

$

Fields of GvarWithoutId

InvalidGvarName

Emitted for code like

$@

Fields of InvalidGvarName

c: u8

char after $

IvarWithoutId

Emitted for code like

@

Fields of IvarWithoutId

InvalidIvarName

Emitted for code like

@1

Fields of InvalidIvarName

c: u8

char after @

CvarWithoutId

Emitted for code like

@@

Fields of CvarWithoutId

InvalidCvarName

Emitted for code like

@@1

Fields of InvalidCvarName

c: u8

char after @@

UnknownRegexOptions

Emitted for code like

/re/foo

Fields of UnknownRegexOptions

options: String

Concatenated unknown options

UnterminatedUnicodeEscape

Emitted for code like

"\u{1234"

Fields of UnterminatedUnicodeEscape

EncodingError

Emitted for code like

Fields of EncodingError

error: String

Error from decoder

InvalidMultibyteChar

Emitter for code like

eval("\xFF = 42")

Fields of InvalidMultibyteChar

AmbiguousTernaryOperator

Emitted for code like

a ?AA : 2

Fields of AmbiguousTernaryOperator

condition: String

Source of the condition expression

AmbiguousRegexp

Emitted for code like

m /foo/

Fields of AmbiguousRegexp

ElseWithoutRescue

Emitted for code like

begin; else; end

Fields of ElseWithoutRescue

BeginNotAtTopLevel

Emitted for code like

def f; BEGIN{}; end

Fields of BeginNotAtTopLevel

AliasNthRef

Emitted for code like

alias $a $1

Fields of AliasNthRef

CsendInsideMasgn

Emitted for code like

*a&.x = 0

Fields of CsendInsideMasgn

ClassOrModuleNameMustBeConstant

Emitted for code like

module foo; end

Fields of ClassOrModuleNameMustBeConstant

EndlessSetterDefinition

Emitted for code like

def foo=() = 42

Fields of EndlessSetterDefinition

UnexpectedToken

Emitted for any code that produces invalid sequence of tokens

Fields of UnexpectedToken

token_name: String

Name of the token

ClassDefinitionInMethodBody

Emitted for code like

def a; class Foo; end; end

Fields of ClassDefinitionInMethodBody

ModuleDefinitionInMethodBody

Emitted for code like

def a; module Foo; end; end

Fields of ModuleDefinitionInMethodBody

InvalidReturnInClassOrModuleBody

Emitted for code like

class A; return; end

Fields of InvalidReturnInClassOrModuleBody

ConstArgument

Emitted for code like

def foo(Abc); end

Fields of ConstArgument

IvarArgument

Emitted for code like

def foo(@abc); end

Fields of IvarArgument

GvarArgument

Emitted for code like

def foo($abc); end

Fields of GvarArgument

CvarArgument

Emitted for code like

def foo(@@abc); end

Fields of CvarArgument

NoSuchLocalVariable

Emitted for code like

case 0; in ^a; true; end

Fields of NoSuchLocalVariable

var_name: String

Variable name

OrdinaryParamDefined

Emitted for code like

m { |a| _1 }

Fields of OrdinaryParamDefined

NumparamUsed

Emitted for code like

foo { _1; bar { _2 }; }

Fields of NumparamUsed

TokAtEolWithoutExpression

Emitted for code like (only in $VERBOSE mode)

if
42
end

Fields of TokAtEolWithoutExpression

token_name: String

Name of the token

EndInMethod

Emitted for code like

def m; END {}; end

Fields of EndInMethod

ComparisonAfterComparison

Emitted for code like (only in $VERBOSE mode)

a < b < c

Fields of ComparisonAfterComparison

comparison: String

Source of the first comparison

CircularArgumentReference

Emitted for code like

def m(foo = foo) end

Fields of CircularArgumentReference

arg_name: String

Name of the argument

DynamicConstantAssignment

Emitted for code like

def m; FOO = 1; end

Fields of DynamicConstantAssignment

CantAssignToSelf

Emitted for code like

self = foo

Fields of CantAssignToSelf

CantAssignToNil

Emitted for code like

nil = foo

Fields of CantAssignToNil

CantAssignToTrue

Emitted for code like

true = foo

Fields of CantAssignToTrue

CantAssignToFalse

Emitted for code like

false = foo

Fields of CantAssignToFalse

CantAssignToFile

Emitted for code like

__FILE__ = foo

Fields of CantAssignToFile

CantAssignToLine

Emitted for code like

__LINE__ = foo

Fields of CantAssignToLine

CantAssignToEncoding

Emitted for code like

__ENCODING__ = foo

Fields of CantAssignToEncoding

CantAssignToNumparam

Emitted for code like

proc {_1; _1 = nil}

Fields of CantAssignToNumparam

numparam: String

Source of the numbered parameter

CantSetVariable

Emitted for code like

$1 = foo

Fields of CantSetVariable

var_name: String

Source of the read-only variable that is assigned

BlockGivenToYield

Emitted for code like

yield(&foo)

Fields of BlockGivenToYield

BlockAndBlockArgGiven

Emitted for code like

fun(&bar) do end

Fields of BlockAndBlockArgGiven

SymbolLiteralWithInterpolation

Emitted for code like

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

Fields of SymbolLiteralWithInterpolation

ReservedForNumparam

Emitted for code like

_1 = 1

Fields of ReservedForNumparam

numparam: String

Numbered parameter that is treated as a local variable

KeyMustBeValidAsLocalVariable

Emitted for code like

case a; in a?:; end

Fields of KeyMustBeValidAsLocalVariable

DuplicateVariableName

Emitted for code like

case 0; in a, a; end

Fields of DuplicateVariableName

DuplicateKeyName

Emitted for code like

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

Fields of DuplicateKeyName

SingletonLiteral

Emitted for code like

def (1).foo; end

Fields of SingletonLiteral

NthRefIsTooBig

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

DuplicatedArgumentName

Emitted for code like

def foo(aa, aa); end

Fields of DuplicatedArgumentName

RegexError

Emitted for code like

/[/

Fields of RegexError

error: String

Error from Onigurama engine

InvalidSymbol

Emitted for code like

%I"x .\xc3."

Fields of InvalidSymbol

symbol: String

Source of the symbol

VoidValueExpression

Emitted for code like

a = return

Fields of VoidValueExpression

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.