Enum lib_ruby_parser::DiagnosticMessage[][src]

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

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

Fields of UnterminatedHeredoc

heredoc_id: StringPtr

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

Fields of AmbiguousFirstArgument

operator: u8

Operator that is ambiguous

AmbiguousOperator

Emitted for code like (only in $VERBOSE mode)

1 *2

Fields of AmbiguousOperator

operator: StringPtr

Operator that is ambiguous

interpreted_as: StringPtr

Interpretation of this operator

InvalidCharacterSyntax

Emitted for code like

"\M- "

Fields of InvalidCharacterSyntax

suggestion: StringPtr

Valid syntax sugestions

InvalidOctalDigit

Emitted for code like

09
TrailingCharInNumber

Emitted for code like

0_a

Fields of TrailingCharInNumber

c: u8

Invalid trailing char

EmbeddedDocumentMeetsEof

Emitted for code like

=begin
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.

GvarWithoutId

Emitted for code like

$
InvalidGvarName

Emitted for code like

$@

Fields of InvalidGvarName

c: u8

char after $

IvarWithoutId

Emitted for code like

@
InvalidIvarName

Emitted for code like

@1

Fields of InvalidIvarName

c: u8

char after @

CvarWithoutId

Emitted for code like

@@
InvalidCvarName

Emitted for code like

@@1

Fields of InvalidCvarName

c: u8

char after @@

UnknownRegexOptions

Emitted for code like

/re/foo

Fields of UnknownRegexOptions

options: StringPtr

Concatenated unknown options

UnterminatedUnicodeEscape

Emitted for code like

"\u{1234"
EncodingError

Emitted for code like

# encoding: foo

Fields of EncodingError

error: StringPtr

Error from decoder

InvalidMultibyteChar

Emitter for code like

eval("\xFF = 42")
AmbiguousTernaryOperator

Emitted for code like

a ?AA : 2

Fields of AmbiguousTernaryOperator

condition: StringPtr

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

Fields of UnexpectedToken

token_name: StringPtr

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

Fields of NoSuchLocalVariable

var_name: StringPtr

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

Fields of TokAtEolWithoutExpression

token_name: StringPtr

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

Fields of ComparisonAfterComparison

comparison: StringPtr

Source of the first comparison

CircularArgumentReference

Emitted for code like

def m(foo = foo) end

Fields of CircularArgumentReference

arg_name: StringPtr

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}

Fields of CantAssignToNumparam

numparam: StringPtr

Source of the numbered parameter

CantSetVariable

Emitted for code like

$1 = foo

Fields of CantSetVariable

var_name: StringPtr

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

Fields of ReservedForNumparam

numparam: StringPtr

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

Fields of NthRefIsTooBig

nth_ref: StringPtr

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

/[/

Fields of RegexError

error: StringPtr

Error from Onigurama engine

InvalidSymbol

Emitted for code like

%I"x .\xc3."

Fields of InvalidSymbol

symbol: StringPtr

Source of the symbol

VoidValueExpression

Emitted for code like

a = return

Implementations

impl DiagnosticMessage[src]

pub fn render(&self) -> String[src]

Renders DiagnosticMessage by interpolating all dynamic values into a template

Trait Implementations

impl Clone for DiagnosticMessage[src]

impl Debug for DiagnosticMessage[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.