pub enum EvalError {
Show 43 variants
Todo(String),
ListIndexOutOfBounds {
index: usize,
len: usize,
},
TypeMismatch {
id: Identifier,
expected: Type,
found: Type,
},
ArrayElementsDifferentTypes(TypeList),
SymbolNotFound(QualifiedName),
SymbolCannotBeCalled(QualifiedName),
AmbiguousSymbol(QualifiedName, QualifiedNames),
LocalNotFound(Identifier),
PropertyNotFound(Identifier),
NoPropertyId(QualifiedName),
ArgumentCountMismatch {
args: String,
expected: usize,
found: usize,
},
AssertionFailed(String),
ExpectedType {
expected: Type,
found: Type,
},
DiagError(DiagError),
LocalStackEmpty(Identifier),
WrongStackFrame(Identifier, &'static str),
ValueError(ValueError),
UnknownMethod(QualifiedName),
LowerError(LowerError),
UnexpectedNested(&'static str, Identifier),
MissingArguments(IdentifierList),
TooManyArguments(IdentifierList),
IdMatchButNotType(String),
BuiltinError(String),
MultiplicityNotAllowed(IdentifierList),
CannotMixGeometry,
IfConditionIsNotBool {
condition: String,
src_ref: SrcRef,
},
NoInitializationFound {
src_ref: SrcRef,
name: Identifier,
actual_params: String,
possible_params: Vec<String>,
},
AmbiguousInitialization {
src_ref: SrcRef,
name: Identifier,
actual_params: String,
ambiguous_params: Vec<String>,
},
BuildingPlanIncomplete(IdentifierList),
EmptyModelExpression,
WorkbenchInvalidOutput {
kind: WorkbenchKind,
produced: OutputType,
expected: OutputType,
},
ResolveError(ResolveError),
CannotCallOperationWithoutWorkpiece,
NoModelInWorkbench,
ValueAlreadyDefined {
location: SrcRef,
name: Identifier,
value: String,
previous_location: SrcRef,
},
NotAnLValue(Identifier),
SymbolIsPrivate {
what: QualifiedName,
within: QualifiedName,
},
UnusedGlobalSymbol(String),
UnusedLocal(Identifier),
ResolveFailed,
BadRange(i64, i64),
AmbiguousType {
ty: Type,
src_ref: SrcRef,
},
}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.
SymbolCannotBeCalled(QualifiedName)
The symbol cannot be called, e.g. when it is a source file or a module.
AmbiguousSymbol(QualifiedName, QualifiedNames)
Found ambiguous symbols.
LocalNotFound(Identifier)
Local Symbol not found.
PropertyNotFound(Identifier)
A property of a value was not found.
NoPropertyId(QualifiedName)
A property of a value was not found.
ArgumentCountMismatch
Argument count mismatch.
Fields
AssertionFailed(String)
Assertion failed.
ExpectedType
Different type expected.
DiagError(DiagError)
Diagnostic error
LocalStackEmpty(Identifier)
No locals available on stack.
WrongStackFrame(Identifier, &'static str)
Unexpected stack frame type
ValueError(ValueError)
Value Error.
UnknownMethod(QualifiedName)
Unknown method.
LowerError(LowerError)
Parser Error
UnexpectedNested(&'static str, Identifier)
Unexpected element within expression.
MissingArguments(IdentifierList)
Missing arguments
TooManyArguments(IdentifierList)
Missing arguments
IdMatchButNotType(String)
Arguments match by identifier but have incompatible types
BuiltinError(String)
Builtin error
MultiplicityNotAllowed(IdentifierList)
Trying to use multiplicity where it is not allowed
CannotMixGeometry
An error if you try to mix 2d and 3d geometries.
IfConditionIsNotBool
A condition of an if statement is not a boolean
NoInitializationFound
Workbench didn’t find a initialization routine matching the given arguments
AmbiguousInitialization
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
This error happens if the workbench produced a different output type.
ResolveError(ResolveError)
Resolve Error
CannotCallOperationWithoutWorkpiece
Cannot call operation without workpiece, e.g. op().
NoModelInWorkbench
There is no model in this workbench
ValueAlreadyDefined
Assignment failed because value already has been defined before.
Fields
name: IdentifierName of the value
NotAnLValue(Identifier)
Assignment failed because left side is not an l-value
SymbolIsPrivate
Found symbol but it’s not visible to user
UnusedGlobalSymbol(String)
Found unused global symbols.
UnusedLocal(Identifier)
Unused local.
ResolveFailed
Evaluation aborted because of prior resolve errors
BadRange(i64, i64)
Bad range (first > last)
AmbiguousType
Ambiguous types in tuple
Trait Implementations§
Source§impl Diagnostic for EvalError
impl Diagnostic for EvalError
Source§fn code(&self) -> Option<Box<dyn Display + '_>>
fn code(&self) -> Option<Box<dyn Display + '_>>
Diagnostic. Ideally also globally unique, and documented
in the toplevel crate’s documentation for easy searching. Rust path
format (foo::bar::baz) is recommended, but more classic codes like
E0123 or enums will work just fine.Source§fn help(&self) -> Option<Box<dyn Display + '_>>
fn help(&self) -> Option<Box<dyn Display + '_>>
Diagnostic. Do you have any
advice for the poor soul who’s just run into this issue?Source§fn severity(&self) -> Option<Severity>
fn severity(&self) -> Option<Severity>
ReportHandlers to change the display format
of this diagnostic. Read moreSource§fn labels(&self) -> Option<Box<dyn Iterator<Item = LabeledSpan> + '_>>
fn labels(&self) -> Option<Box<dyn Iterator<Item = LabeledSpan> + '_>>
Diagnostic’s Diagnostic::source_codeSource§fn source_code(&self) -> Option<&dyn SourceCode>
fn source_code(&self) -> Option<&dyn SourceCode>
Diagnostic’s Diagnostic::labels to.Diagnostics.Source§fn url(&self) -> Option<Box<dyn Display + '_>>
fn url(&self) -> Option<Box<dyn Display + '_>>
Diagnostic.Source§fn diagnostic_source(&self) -> Option<&dyn Diagnostic>
fn diagnostic_source(&self) -> Option<&dyn Diagnostic>
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
use the Display impl or to_string()
Source§impl From<LowerError> for EvalError
impl From<LowerError> for EvalError
Source§fn from(source: LowerError) -> Self
fn from(source: LowerError) -> Self
Source§impl From<ResolveError> for Box<EvalError>
impl From<ResolveError> for Box<EvalError>
Source§fn from(value: ResolveError) -> Self
fn from(value: ResolveError) -> Self
Source§impl From<ResolveError> for EvalError
impl From<ResolveError> for EvalError
Source§fn from(err: ResolveError) -> Self
fn from(err: ResolveError) -> Self
Source§impl From<ValueError> for Box<EvalError>
impl From<ValueError> for Box<EvalError>
Source§fn from(value: ValueError) -> Self
fn from(value: ValueError) -> 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 UnsafeUnpin 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<'a, T> CodeDisplay<'a> for Twhere
T: Display,
impl<'a, T> CodeDisplay<'a> for Twhere
T: Display,
Source§fn code_display(&self, ctx: &mut CodeFormatContext<'_>) -> Result<(), Error>
fn code_display(&self, ctx: &mut CodeFormatContext<'_>) -> Result<(), Error>
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<D> OwoColorize for D
impl<D> OwoColorize for D
Source§fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
Source§fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
Source§fn black(&self) -> FgColorDisplay<'_, Black, Self>
fn black(&self) -> FgColorDisplay<'_, Black, Self>
Source§fn on_black(&self) -> BgColorDisplay<'_, Black, Self>
fn on_black(&self) -> BgColorDisplay<'_, Black, Self>
Source§fn red(&self) -> FgColorDisplay<'_, Red, Self>
fn red(&self) -> FgColorDisplay<'_, Red, Self>
Source§fn on_red(&self) -> BgColorDisplay<'_, Red, Self>
fn on_red(&self) -> BgColorDisplay<'_, Red, Self>
Source§fn green(&self) -> FgColorDisplay<'_, Green, Self>
fn green(&self) -> FgColorDisplay<'_, Green, Self>
Source§fn on_green(&self) -> BgColorDisplay<'_, Green, Self>
fn on_green(&self) -> BgColorDisplay<'_, Green, Self>
Source§fn yellow(&self) -> FgColorDisplay<'_, Yellow, Self>
fn yellow(&self) -> FgColorDisplay<'_, Yellow, Self>
Source§fn on_yellow(&self) -> BgColorDisplay<'_, Yellow, Self>
fn on_yellow(&self) -> BgColorDisplay<'_, Yellow, Self>
Source§fn blue(&self) -> FgColorDisplay<'_, Blue, Self>
fn blue(&self) -> FgColorDisplay<'_, Blue, Self>
Source§fn on_blue(&self) -> BgColorDisplay<'_, Blue, Self>
fn on_blue(&self) -> BgColorDisplay<'_, Blue, Self>
Source§fn magenta(&self) -> FgColorDisplay<'_, Magenta, Self>
fn magenta(&self) -> FgColorDisplay<'_, Magenta, Self>
Source§fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
Source§fn purple(&self) -> FgColorDisplay<'_, Magenta, Self>
fn purple(&self) -> FgColorDisplay<'_, Magenta, Self>
Source§fn on_purple(&self) -> BgColorDisplay<'_, Magenta, Self>
fn on_purple(&self) -> BgColorDisplay<'_, Magenta, Self>
Source§fn cyan(&self) -> FgColorDisplay<'_, Cyan, Self>
fn cyan(&self) -> FgColorDisplay<'_, Cyan, Self>
Source§fn on_cyan(&self) -> BgColorDisplay<'_, Cyan, Self>
fn on_cyan(&self) -> BgColorDisplay<'_, Cyan, Self>
Source§fn white(&self) -> FgColorDisplay<'_, White, Self>
fn white(&self) -> FgColorDisplay<'_, White, Self>
Source§fn on_white(&self) -> BgColorDisplay<'_, White, Self>
fn on_white(&self) -> BgColorDisplay<'_, White, Self>
Source§fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
Source§fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
Source§fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
Source§fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
Source§fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
Source§fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
Source§fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
Source§fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
Source§fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
Source§fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
Source§fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
Source§fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
Source§fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
Source§fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
Source§fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
Source§fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
Source§fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
Source§fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
Source§fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
Source§fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
Source§fn bold(&self) -> BoldDisplay<'_, Self>
fn bold(&self) -> BoldDisplay<'_, Self>
Source§fn dimmed(&self) -> DimDisplay<'_, Self>
fn dimmed(&self) -> DimDisplay<'_, Self>
Source§fn italic(&self) -> ItalicDisplay<'_, Self>
fn italic(&self) -> ItalicDisplay<'_, Self>
Source§fn underline(&self) -> UnderlineDisplay<'_, Self>
fn underline(&self) -> UnderlineDisplay<'_, Self>
Source§fn blink(&self) -> BlinkDisplay<'_, Self>
fn blink(&self) -> BlinkDisplay<'_, Self>
Source§fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
Source§fn reversed(&self) -> ReversedDisplay<'_, Self>
fn reversed(&self) -> ReversedDisplay<'_, Self>
Source§fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
Source§fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::fg or
a color-specific method, such as OwoColorize::green, Read moreSource§fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::bg or
a color-specific method, such as OwoColorize::on_yellow, Read moreSource§fn fg_rgb<const R: u8, const G: u8, const B: u8>(
&self,
) -> FgColorDisplay<'_, CustomColor<R, G, B>, Self>
fn fg_rgb<const R: u8, const G: u8, const B: u8>( &self, ) -> FgColorDisplay<'_, CustomColor<R, G, B>, Self>
Source§fn bg_rgb<const R: u8, const G: u8, const B: u8>(
&self,
) -> BgColorDisplay<'_, CustomColor<R, G, B>, Self>
fn bg_rgb<const R: u8, const G: u8, const B: u8>( &self, ) -> BgColorDisplay<'_, CustomColor<R, G, B>, Self>
Source§fn truecolor(&self, r: u8, g: u8, b: u8) -> FgDynColorDisplay<'_, Rgb, Self>
fn truecolor(&self, r: u8, g: u8, b: u8) -> FgDynColorDisplay<'_, Rgb, Self>
Source§fn on_truecolor(&self, r: u8, g: u8, b: u8) -> BgDynColorDisplay<'_, Rgb, Self>
fn on_truecolor(&self, r: u8, g: u8, b: u8) -> BgDynColorDisplay<'_, Rgb, Self>
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T, S> SpanWrap<S> for Twhere
S: WrappingSpan<T>,
impl<T, S> SpanWrap<S> for Twhere
S: WrappingSpan<T>,
Source§fn with_span(self, span: S) -> <S as WrappingSpan<Self>>::Spanned
fn with_span(self, span: S) -> <S as WrappingSpan<Self>>::Spanned
WrappingSpan::make_wrapped to wrap an AST node in a span.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