ParseErrorType

Enum ParseErrorType 

Source
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)

Expected a specific terminal token but got something else.

§Example

function MyFunc { }
                ^ error
§

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

Expected an identifier but got something else.

§Example

global var !?!?! = "guh??"
           ^ error
§

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
§

ExpectedValue

Expected a token that starts a value in an expression but got something else.

§Example

local sum = 1 + ?
                ^ 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

Expected a type but got something else.

§Example

typedef Five 5
             ^ error
§

ExpectedTypeModifier

Expected a type modifier but got something else.

§Example

typedef help table&-
                   ^ error
§

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

Expected a token that starts a statement but got something else.

§Example

> hey
^ error
§

ExpectedEndOfStatement

Expected a newline or semicolon to end a statement but got something else.

§Example

{ 1 } + 2
      ^ error
§

ExpectedGlobalDefinition

Expected a token that starts a global definition but got something else.

§Example

global if ()
       ^ error
§

IllegalLineBreak

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

Source§

fn clone(&self) -> ParseErrorType

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ParseErrorType

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for ParseErrorType

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for ParseErrorType

Source§

fn eq(&self, other: &ParseErrorType) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for ParseErrorType

Source§

impl StructuralPartialEq for ParseErrorType

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.