pub enum ParseErrorType {
Show 22 variants
ExpectedTerminal(TerminalToken),
ExpectedCompound2(TerminalToken, TerminalToken),
ExpectedCompound3(TerminalToken, TerminalToken, TerminalToken),
ExpectedIdentifier,
ExpectedLiteral,
ExpectedExpression,
ExpectedValue,
ExpectedOperator,
ExpectedPrefixOperator,
ExpectedPostfixOperator,
ExpectedBinaryOperator,
ExpectedType,
ExpectedTypeModifier,
ExpectedTableSlot,
ExpectedClassMember,
ExpectedStatement,
ExpectedEndOfStatement,
ExpectedGlobalDefinition,
IllegalLineBreak,
Precedence,
ExpectedSlot,
ExpectedStringLiteral,
}Expand description
Type of ParseError.
Implements std::fmt::Display to write a useful error message.
Variants§
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
^ errorExpectedValue
Expected a token that starts a value in an expression but got something else.
§Example
local sum = 1 + ?
^ errorExpectedOperator
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
ExpectedEndOfStatement
Expected a newline or semicolon to end a statement but got something else.
§Example
{ 1 } + 2
^ errorExpectedGlobalDefinition
Expected a token that starts a global definition but got something else.
§Example
global if ()
^ errorIllegalLineBreak
Found a linebreak in a place where one is not allowed.
Precedence
An expression was not allowed due to precedence rules.
ExpectedSlot
Expected a slot in a class or table.
ExpectedStringLiteral
Expected a string literal.
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 more