pub enum EvalError {
Show 52 variants
Todo(String),
ListIndexOutOfBounds {
index: usize,
len: usize,
},
TypeMismatch {
id: Identifier,
expected: Type,
found: Type,
},
ArrayElementsDifferentTypes(TypeList),
SymbolNotFound(QualifiedName),
NoSymbolsToUse(QualifiedName),
SymbolFound(QualifiedName),
SymbolCannotBeCalled(QualifiedName, Box<SymbolDefinition>),
AmbiguousSymbol {
ambiguous: QualifiedName,
others: Symbols,
},
LocalNotFound(Identifier),
PropertyNotFound(Identifier),
ArgumentCountMismatch {
args: ArgumentValueList,
expected: usize,
found: usize,
},
AssertWrongSignature(ArgumentValueList),
InvalidArgumentType(Type),
UnexpectedArgument(Identifier, Type),
AssertionFailed(String),
ExpectedType {
expected: Type,
found: Type,
},
ErrorLimitReached(u32),
LocalStackEmpty(Identifier),
WrongStackFrame(Identifier, &'static str),
ValueError(ValueError),
UnknownMethod(QualifiedName),
ParseError(ParseError),
StatementNotSupported(&'static str),
UninitializedProperties(IdentifierList),
UnexpectedNested(&'static str, Identifier),
NoVariablesAllowedIn(&'static str),
AttributeError(AttributeError),
MissingArguments(IdentifierList),
TooManyArguments(IdentifierList),
BuiltinError(String),
ParameterByTypeNotFound(Type),
MultiplicityNotAllowed(IdentifierList),
CannotMixGeometry,
IfConditionIsNotBool(Value),
NoInitializationFound(Identifier),
BuildingPlanIncomplete(IdentifierList),
EmptyModelExpression,
WorkbenchInvalidOutput(WorkbenchKind, OutputType, OutputType),
WorkbenchNoOutput(WorkbenchKind, OutputType),
InvalidSelfReference(Identifier),
ResolveError(ResolveError),
NotAnOperation(QualifiedName),
OperationOnEmptyGeometry,
CannotCallOperationWithoutWorkpiece,
MissingReturn(QualifiedName),
NoModelInWorkbench,
AmbiguousProperty(QualifiedName, Identifier),
ValueAlreadyInitialized(Identifier, Value, SrcRef),
NotAnLValue(Identifier),
SymbolIsPrivate {
what: QualifiedName,
within: QualifiedName,
},
SymbolBehindAliasIsPrivate {
what: QualifiedName,
alias: QualifiedName,
within: QualifiedName,
},
}
Expand description
Evaluation error.
Variants§
Todo(String)
Can’t find a project file by it’s qualified name.
ListIndexOutOfBounds
List index out of bounds.
TypeMismatch
Parameter type mismatch.
ArrayElementsDifferentTypes(TypeList)
Array elements have different types.
SymbolNotFound(QualifiedName)
Symbol not found.
NoSymbolsToUse(QualifiedName)
Given symbol has not children which can be used.
SymbolFound(QualifiedName)
Symbol was not expected to be found (e.g. assert_invalid
).
SymbolCannotBeCalled(QualifiedName, Box<SymbolDefinition>)
The symbol cannot be called, e.g. when it is a source file or a module.
AmbiguousSymbol
Found ambiguous symbols.
LocalNotFound(Identifier)
Local Symbol not found.
PropertyNotFound(Identifier)
A property of a value was not found.
ArgumentCountMismatch
Argument count mismatch.
Fields
args: ArgumentValueList
Argument list including the error
AssertWrongSignature(ArgumentValueList)
Called assertion
InvalidArgumentType(Type)
Invalid argument type.
UnexpectedArgument(Identifier, Type)
Unexpected argument.
AssertionFailed(String)
Assertion failed.
ExpectedType
Different type expected.
ErrorLimitReached(u32)
Cannot continue evaluation after error limit has been reached.
LocalStackEmpty(Identifier)
No locals available on stack.
WrongStackFrame(Identifier, &'static str)
Unexpected stack frame type
ValueError(ValueError)
Value Error.
UnknownMethod(QualifiedName)
Unknown method.
ParseError(ParseError)
Parser Error
StatementNotSupported(&'static str)
Statement is not supported in this context.
UninitializedProperties(IdentifierList)
Properties are not initialized.
UnexpectedNested(&'static str, Identifier)
Unexpected element within expression.
NoVariablesAllowedIn(&'static str)
No variables allowed in definition
AttributeError(AttributeError)
Error when evaluating attributes.
MissingArguments(IdentifierList)
Missing arguments
TooManyArguments(IdentifierList)
Missing arguments
BuiltinError(String)
Builtin error
ParameterByTypeNotFound(Type)
Parameter not found by type in ParameterValueList
MultiplicityNotAllowed(IdentifierList)
Trying to use multiplicity where it is not allowed
CannotMixGeometry
An error if you try to mix 2d and 3d geometries.
IfConditionIsNotBool(Value)
A condition of an if statement is not a boolean
NoInitializationFound(Identifier)
Workbench didn’t find a initialization routine matching the given arguments
BuildingPlanIncomplete(IdentifierList)
Initializer missed to set a property from plan
EmptyModelExpression
This errors happens if the expression is supposed to produce models but did not.
WorkbenchInvalidOutput(WorkbenchKind, OutputType, OutputType)
This error happens if the workbench produced a different output type.
WorkbenchNoOutput(WorkbenchKind, OutputType)
This error happens if the workbench produced a different output type.
InvalidSelfReference(Identifier)
Unexpected source file in expression
ResolveError(ResolveError)
Resolve Error
NotAnOperation(QualifiedName)
Unexpected source file in expression
OperationOnEmptyGeometry
Calling an operation on an empty geometry, e.g.: {}.op()
.
CannotCallOperationWithoutWorkpiece
Cannot call operation without workpiece, e.g. op()
.
MissingReturn(QualifiedName)
Function missing return statement
NoModelInWorkbench
There is no model in this workbench
AmbiguousProperty(QualifiedName, Identifier)
Found a symbol and a property with that name
ValueAlreadyInitialized(Identifier, Value, SrcRef)
Assignment failed because value already has been initialized
NotAnLValue(Identifier)
Assignment failed because left side is not an l-value
SymbolIsPrivate
Found symbol but it’s not visible to user
SymbolBehindAliasIsPrivate
Found symbol but it’s not visible to user
Fields
what: QualifiedName
what was searched
alias: QualifiedName
the alias in between
within: QualifiedName
where it was searched
Trait Implementations§
Source§impl Error for EvalError
impl Error for EvalError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
Source§impl From<AttributeError> for EvalError
impl From<AttributeError> for EvalError
Source§fn from(source: AttributeError) -> Self
fn from(source: AttributeError) -> Self
Source§impl From<ParseError> for EvalError
impl From<ParseError> for EvalError
Source§fn from(source: ParseError) -> Self
fn from(source: ParseError) -> Self
Source§impl From<ResolveError> for EvalError
impl From<ResolveError> for EvalError
Source§fn from(source: ResolveError) -> Self
fn from(source: ResolveError) -> Self
Source§impl From<ValueError> for EvalError
impl From<ValueError> for EvalError
Source§fn from(source: ValueError) -> Self
fn from(source: ValueError) -> Self
Auto Trait Implementations§
impl Freeze for EvalError
impl !RefUnwindSafe for EvalError
impl !Send for EvalError
impl !Sync for EvalError
impl Unpin for EvalError
impl !UnwindSafe for EvalError
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
ToCompactString::to_compact_string()
Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
CompactString
. Read more