[][src]Enum rhai::ParseErrorType

pub enum ParseErrorType {
    BadInput(String),
    UnexpectedEOF,
    UnknownOperator(String),
    MissingToken(StringString),
    MalformedCallExpr(String),
    MalformedIndexExpr(String),
    MalformedInExpr(String),
    DuplicatedProperty(String),
    ForbiddenConstantExpr(String),
    PropertyExpected,
    VariableExpected,
    ExprExpected(String),
    WrongFnDefinition,
    FnMissingName,
    FnMissingParams(String),
    FnDuplicatedParam(StringString),
    FnMissingBody(String),
    DuplicatedExport(String),
    WrongExport,
    AssignmentToCopy,
    AssignmentToConstant(String),
    ExprTooDeep,
    LoopBreak,
}

Type of error encountered when parsing a script.

Some errors never appear when certain features are turned on. They still exist so that the application can turn features on and off without going through massive code changes to remove/add back enum variants in match statements.

Variants

BadInput(String)

Error in the script text. Wrapped value is the error message.

UnexpectedEOF

The script ends prematurely.

UnknownOperator(String)

An unknown operator is encountered. Wrapped value is the operator.

MissingToken(StringString)

Expecting a particular token but not finding one. Wrapped values are the token and description.

MalformedCallExpr(String)

An expression in function call arguments () has syntax error. Wrapped value is the error description (if any).

MalformedIndexExpr(String)

An expression in indexing brackets [] has syntax error. Wrapped value is the error description (if any).

Never appears under the no_index feature.

MalformedInExpr(String)

An expression in an in expression has syntax error. Wrapped value is the error description (if any).

Never appears under the no_object and no_index features combination.

DuplicatedProperty(String)

A map definition has duplicated property names. Wrapped value is the property name.

Never appears under the no_object feature.

ForbiddenConstantExpr(String)

Invalid expression assigned to constant. Wrapped value is the name of the constant.

PropertyExpected

Missing a property name for custom types and maps.

Never appears under the no_object feature.

VariableExpected

Missing a variable name after the let, const or for keywords.

ExprExpected(String)

Missing an expression. Wrapped value is the expression type.

WrongFnDefinition

Defining a function fn in an appropriate place (e.g. inside another function).

Never appears under the no_function feature.

FnMissingName

Missing a function name after the fn keyword.

Never appears under the no_function feature.

FnMissingParams(String)

A function definition is missing the parameters list. Wrapped value is the function name.

Never appears under the no_function feature.

FnDuplicatedParam(StringString)

A function definition has duplicated parameters. Wrapped values are the function name and parameter name.

Never appears under the no_function feature.

FnMissingBody(String)

A function definition is missing the body. Wrapped value is the function name.

Never appears under the no_function feature.

DuplicatedExport(String)

An export statement has duplicated names.

Never appears under the no_module feature.

WrongExport

Export statement not at global level.

Never appears under the no_module feature.

AssignmentToCopy

Assignment to a copy of a value.

AssignmentToConstant(String)

Assignment to an a constant variable.

ExprTooDeep

Expression exceeding the maximum levels of complexity.

Never appears under the unchecked feature.

LoopBreak

Break statement not inside a loop.

Trait Implementations

impl Clone for ParseErrorType[src]

impl Debug for ParseErrorType[src]

impl Eq for ParseErrorType[src]

impl Hash for ParseErrorType[src]

impl PartialEq<ParseErrorType> for ParseErrorType[src]

impl StructuralEq for ParseErrorType[src]

impl StructuralPartialEq for ParseErrorType[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.