Enum ParseErrorType
#[non_exhaustive]pub enum ParseErrorType {
Show 38 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,
ForbiddenVariable(String),
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),
VariableExists(String),
VariableUndefined(String),
ModuleUndefined(String),
ExprTooDeep,
TooManyFunctions,
LiteralTooLarge(String, usize),
LoopBreak,
}
Expand description
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)
Error in the script text. Wrapped value is the lex error.
UnknownOperator(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)
Expecting a particular symbol but not finding one. Wrapped value is the description.
MalformedCallExpr(String)
An expression in function call arguments ()
has syntax error. Wrapped value is the error
description (if any).
§Deprecated
This error is no longer used and will be removed in the next major version.
MalformedIndexExpr(String)
An expression in indexing brackets []
has syntax error. Wrapped value is the error
description (if any).
MalformedInExpr(String)
An expression in an in
expression has syntax error. Wrapped value is the error description (if any).
§Deprecated
This error is no longer used and will be removed in the next major version.
MalformedCapture(String)
A capturing has syntax error. Wrapped value is the error description (if any).
DuplicatedProperty(String)
A map definition has duplicated property names. Wrapped value is the property name.
DuplicatedSwitchCase
A switch
case is duplicated.
§Deprecated
This error is no longer used and will be removed in the next major version.
DuplicatedVariable(String)
A variable name is duplicated. Wrapped value is the variable name.
WrongSwitchIntegerCase
A numeric case of a switch
statement is in an appropriate place.
WrongSwitchDefaultCase
The default case of a switch
statement is in an appropriate place.
WrongSwitchCaseCondition
The case condition of a switch
statement is not appropriate.
PropertyExpected
Missing a property name for custom types and maps.
VariableExpected
Missing a variable name after the let
, const
, for
or catch
keywords.
ForbiddenVariable(String)
Forbidden variable name. Wrapped value is the variable name.
Reserved(String)
An identifier is a reserved symbol.
MismatchedType(String, String)
An expression is of the wrong type. Wrapped values are the type requested and type of the actual result.
ExprExpected(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).
WrongFnDefinition
Defining a function fn
in an appropriate place (e.g. inside another function).
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.
FnMissingName
Missing a function name after the fn
keyword.
FnMissingParams(String)
A function definition is missing the parameters list. Wrapped value is the function name.
FnDuplicatedParam(String, String)
A function definition has duplicated parameters. Wrapped values are the function name and parameter name.
FnMissingBody(String)
A function definition is missing the body. Wrapped value is the function name.
WrongExport
Export statement not at global level.
AssignmentToConstant(String)
Assignment to an a constant variable. Wrapped value is the constant variable name.
AssignmentToInvalidLHS(String)
Assignment to an inappropriate LHS (left-hand-side) expression. Wrapped value is the error message (if any).
VariableExists(String)
A variable is already defined.
Only appears when variables shadowing is disabled.
VariableUndefined(String)
A variable is not found.
Only appears when strict variables mode is enabled.
ModuleUndefined(String)
An imported module is not found.
Only appears when strict variables mode is enabled.
ExprTooDeep
Expression exceeding the maximum levels of complexity.
TooManyFunctions
Number of scripted functions over maximum limit.
LiteralTooLarge(String, usize)
Literal exceeding the maximum size. Wrapped values are the data type name and the maximum size.
LoopBreak
Break statement not inside a loop.
Trait Implementations§
§impl Clone for ParseErrorType
impl Clone for ParseErrorType
§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§impl Debug for ParseErrorType
impl Debug for ParseErrorType
§impl Display for ParseErrorType
impl Display for ParseErrorType
§impl From<LexError> for ParseErrorType
impl From<LexError> for ParseErrorType
§fn from(err: LexError) -> ParseErrorType
fn from(err: LexError) -> ParseErrorType
§impl From<ParseErrorType> for EvalAltResult
impl From<ParseErrorType> for EvalAltResult
§fn from(err: ParseErrorType) -> EvalAltResult
fn from(err: ParseErrorType) -> EvalAltResult
§impl Hash for ParseErrorType
impl Hash for ParseErrorType
§impl PartialEq for ParseErrorType
impl PartialEq for ParseErrorType
impl Eq for ParseErrorType
impl StructuralPartialEq for ParseErrorType
Auto Trait Implementations§
impl Freeze for ParseErrorType
impl RefUnwindSafe for ParseErrorType
impl Send for ParseErrorType
impl Sync for ParseErrorType
impl Unpin for ParseErrorType
impl UnwindSafe for ParseErrorType
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.