Enum quad_compat_rhai::ParseErrorType [−][src]
#[non_exhaustive]
pub enum ParseErrorType {
Show 35 variants
UnexpectedEOF,
BadInput(LexError),
UnknownOperator(String),
MissingToken(String, String),
MissingSymbol(String),
MalformedCallExpr(String),
MalformedIndexExpr(String),
MalformedInExpr(String),
MalformedCapture(String),
DuplicatedProperty(String),
DuplicatedSwitchCase,
DuplicatedVariable(String),
WrongSwitchIntegerCase,
WrongSwitchDefaultCase,
WrongSwitchCaseCondition,
PropertyExpected,
VariableExpected,
Reserved(String),
MismatchedType(String, String),
ExprExpected(String),
WrongDocComment,
WrongFnDefinition,
FnDuplicatedDefinition(String, usize),
FnMissingName,
FnMissingParams(String),
FnDuplicatedParam(String, String),
FnMissingBody(String),
WrongExport,
AssignmentToConstant(String),
AssignmentToInvalidLHS(String),
VariableUndefined(String),
ModuleUndefined(String),
ExprTooDeep,
LiteralTooLarge(String, usize),
LoopBreak,
}
Expand description
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 (Non-exhaustive)
This enum is marked as non-exhaustive
UnexpectedEOF
The script ends prematurely.
BadInput(LexError)
Tuple Fields
0: LexError
Error in the script text. Wrapped value is the lex error.
UnknownOperator(String)
Tuple Fields
0: String
An unknown operator is encountered. Wrapped value is the operator.
MissingToken(String, String)
Expecting a particular token but not finding one. Wrapped values are the token and description.
MissingSymbol(String)
Tuple Fields
0: String
Expecting a particular symbol but not finding one. Wrapped value is the description.
MalformedCallExpr(String)
Tuple Fields
0: String
An expression in function call arguments ()
has syntax error. Wrapped value is the error
description (if any).
MalformedIndexExpr(String)
Tuple Fields
0: 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)
Tuple Fields
0: 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.
MalformedCapture(String)
Tuple Fields
0: String
A capturing has syntax error. Wrapped value is the error description (if any).
Never appears under the no_closure
feature.
DuplicatedProperty(String)
Tuple Fields
0: String
A map definition has duplicated property names. Wrapped value is the property name.
Never appears under the no_object
feature.
DuplicatedSwitchCase
A switch
case is duplicated.
DuplicatedVariable(String)
Tuple Fields
0: String
A variable name is duplicated. Wrapped value is the variable name.
WrongSwitchIntegerCase
An integer case of a switch
statement is after a range case.
WrongSwitchDefaultCase
The default case of a switch
statement is not the last.
WrongSwitchCaseCondition
The case condition of a switch
statement is not appropriate.
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
, for
or catch
keywords.
Reserved(String)
Tuple Fields
0: String
An identifier is a reserved keyword.
MismatchedType(String, String)
An expression is of the wrong type. Wrapped values are the type requested and type of the actual result.
ExprExpected(String)
Tuple Fields
0: String
Missing an expression. Wrapped value is the expression type.
WrongDocComment
Defining a doc-comment in an appropriate place (e.g. not at global level).
Never appears under the no_function
feature.
WrongFnDefinition
Defining a function fn
in an appropriate place (e.g. inside another function).
Never appears under the no_function
feature.
FnDuplicatedDefinition(String, usize)
Defining a function with a name that conflicts with an existing function. Wrapped values are the function name and number of parameters.
Never appears under the no_object
feature.
FnMissingName
Missing a function name after the fn
keyword.
Never appears under the no_function
feature.
FnMissingParams(String)
Tuple Fields
0: String
A function definition is missing the parameters list. Wrapped value is the function name.
Never appears under the no_function
feature.
FnDuplicatedParam(String, String)
A function definition has duplicated parameters. Wrapped values are the function name and parameter name.
Never appears under the no_function
feature.
FnMissingBody(String)
Tuple Fields
0: String
A function definition is missing the body. Wrapped value is the function name.
Never appears under the no_function
feature.
WrongExport
Export statement not at global level.
Never appears under the no_module
feature.
AssignmentToConstant(String)
Tuple Fields
0: String
Assignment to an a constant variable. Wrapped value is the constant variable name.
AssignmentToInvalidLHS(String)
Tuple Fields
0: String
Assignment to an inappropriate LHS (left-hand-side) expression. Wrapped value is the error message (if any).
VariableUndefined(String)
Tuple Fields
0: String
A variable is not found.
Only appears when strict variables mode is enabled.
ModuleUndefined(String)
Tuple Fields
0: String
An imported module is not found.
Only appears when strict variables mode is enabled.
Never appears under the no_module
feature.
ExprTooDeep
Expression exceeding the maximum levels of complexity.
Never appears under the unchecked
feature.
LiteralTooLarge(String, usize)
Literal exceeding the maximum size. Wrapped values are the data type name and the maximum size.
Never appears under the unchecked
feature.
LoopBreak
Break statement not inside a loop.
Trait Implementations
Performs the conversion.
Performs the conversion.
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
Auto Trait Implementations
impl RefUnwindSafe for ParseErrorType
impl Send for ParseErrorType
impl Sync for ParseErrorType
impl Unpin for ParseErrorType
impl UnwindSafe for ParseErrorType
Blanket Implementations
Mutably borrows from an owned value. Read more