Enum sqparse::ParseErrorType
source · pub enum ParseErrorType {
Show 18 variants
Internal(InternalErrorType),
ExpectedTerminal(TerminalToken),
ExpectedCompound2(TerminalToken, TerminalToken),
ExpectedCompound3(TerminalToken, TerminalToken, TerminalToken),
ExpectedIdentifier,
ExpectedLiteral,
ExpectedExpression,
ExpectedOperator,
ExpectedPrefixOperator,
ExpectedPostfixOperator,
ExpectedBinaryOperator,
ExpectedType,
ExpectedTypeModifier,
ExpectedTableSlot,
ExpectedClassMember,
ExpectedStatement,
ExpectedGlobalDeclaration,
IllegalLineBreak,
}Expand description
Type of ParseError.
Implements std::fmt::Display to write a useful error message.
Variants§
Internal(InternalErrorType)
An internal unexpected error occurred. This is a bug.
ExpectedTerminal(TerminalToken)
ExpectedCompound2(TerminalToken, TerminalToken)
Expected a specific compound terminal but got something else.
ExpectedCompound3(TerminalToken, TerminalToken, TerminalToken)
Expected a specific compound terminal but got something else.
ExpectedIdentifier
ExpectedLiteral
Expected a literal but got something else.
ExpectedExpression
Expected a token that starts an expression but got something else.
Example
int What = globalize_all_functions
^ error
ExpectedOperator
Expected an operator but got something else.
ExpectedPrefixOperator
Expected a prefix operator but got something else.
ExpectedPostfixOperator
Expected a postfix operator but got something else.
ExpectedBinaryOperator
Expected a binary operator but got something else.
ExpectedType
ExpectedTypeModifier
ExpectedTableSlot
Expected a token that starts a table slot but got something else.
Example
my_table = {
class MyTableClass {}
^ error
}
ExpectedClassMember
Expected a token that starts a class member but got something else.
Example
class MyClass {
globalize_all_functions
^ error
}
ExpectedStatement
ExpectedGlobalDeclaration
Expected a token that starts a global declaration but got something else.
Example
global if ()
^ error
IllegalLineBreak
Found a linebreak in a place where one is not allowed.
Trait Implementations§
source§impl Clone for ParseErrorType
impl Clone for ParseErrorType
source§fn clone(&self) -> ParseErrorType
fn clone(&self) -> ParseErrorType
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl Debug for ParseErrorType
impl Debug for ParseErrorType
source§impl Display for ParseErrorType
impl Display for ParseErrorType
source§impl PartialEq<ParseErrorType> for ParseErrorType
impl PartialEq<ParseErrorType> for ParseErrorType
source§fn eq(&self, other: &ParseErrorType) -> bool
fn eq(&self, other: &ParseErrorType) -> bool
self and other values to be equal, and is used
by ==.