EvalError

Enum EvalError 

Source
pub enum EvalError {
Show 57 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), AmbiguousSymbol(QualifiedName, QualifiedNames), LocalNotFound(Identifier), PropertyNotFound(Identifier), NoPropertyId(QualifiedName), ArgumentCountMismatch { args: String, expected: usize, found: usize, }, InvalidArgumentType(Type), UnexpectedArgument(Identifier, Type), AssertionFailed(String), ExpectedType { expected: Type, found: Type, }, DiagError(DiagError), 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(String), NoInitializationFound { src_ref: SrcRef, name: Identifier, actual_params: String, possible_params: Vec<String>, }, BuildingPlanIncomplete(IdentifierList), EmptyModelExpression, WarnEmptyWorkbench(String, Identifier), WorkbenchInvalidOutput(WorkbenchKind, OutputType, OutputType), WorkbenchNoOutput(WorkbenchKind, OutputType), InvalidSelfReference(Identifier), ResolveError(ResolveError), NotAnOperation(QualifiedName), OperationOnEmptyGeometry, CannotCallOperationWithoutWorkpiece, MissingReturn(QualifiedName), NoModelInWorkbench, AmbiguousProperty(QualifiedName, Identifier), ValueAlreadyDefined { location: SrcRef, name: Identifier, value: String, previous_location: SrcRef, }, NotAnLValue(Identifier), SymbolIsPrivate { what: QualifiedName, within: QualifiedName, }, SymbolBehindAliasIsPrivate { what: QualifiedName, alias: QualifiedName, within: QualifiedName, }, UnusedGlobalSymbol(String), UnusedLocal(Identifier), ResolveFailed, BadRange(i64, i64),
}
Expand description

Evaluation error.

Variants§

§

Todo(String)

Can’t find a project file by it’s qualified name.

§

ListIndexOutOfBounds

List index out of bounds.

Fields

§index: usize

Wrong index

§len: usize

Length of list

§

TypeMismatch

Parameter type mismatch.

Fields

§id: Identifier

Parameter name

§expected: Type

Expected type

§found: Type

Found type

§

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)

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

§args: String

Argument list including the error

§expected: usize

Expected number of arguments

§found: usize

Found number of arguments

§

InvalidArgumentType(Type)

Invalid argument type.

§

UnexpectedArgument(Identifier, Type)

Unexpected argument.

§

AssertionFailed(String)

Assertion failed.

§

ExpectedType

Different type expected.

Fields

§expected: Type

Expected type.

§found: Type

Found type.

§

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.

§

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(String)

A condition of an if statement is not a boolean

§

NoInitializationFound

Workbench didn’t find a initialization routine matching the given arguments

Fields

§src_ref: SrcRef
§actual_params: String
§possible_params: Vec<String>
§

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.

§

WarnEmptyWorkbench(String, Identifier)

Workbench with empty body - suspicious!

§

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

§

ValueAlreadyDefined

Assignment failed because value already has been defined before.

Fields

§location: SrcRef

Location of the error

§name: Identifier

Name of the value

§value: String

Previous value

§previous_location: SrcRef

Previous definition

§

NotAnLValue(Identifier)

Assignment failed because left side is not an l-value

§

SymbolIsPrivate

Found symbol but it’s not visible to user

Fields

§what: QualifiedName

what was searched

§within: QualifiedName

where it was searched

§

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

§

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)

Trait Implementations§

Source§

impl Debug for EvalError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Diagnostic for EvalError

Source§

fn help(&self) -> Option<Box<dyn Display + '_>>

Additional help text related to this Diagnostic. Do you have any advice for the poor soul who’s just run into this issue?
Source§

fn labels(&self) -> Option<Box<dyn Iterator<Item = LabeledSpan> + '_>>

Labels to apply to this Diagnostic’s Diagnostic::source_code
Source§

fn code<'a>(&'a self) -> Option<Box<dyn Display + 'a>>

Unique diagnostic code that can be used to look up more information about this 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 severity(&self) -> Option<Severity>

Diagnostic severity. This may be used by ReportHandlers to change the display format of this diagnostic. Read more
Source§

fn url<'a>(&'a self) -> Option<Box<dyn Display + 'a>>

URL to visit for a more detailed explanation/help about this Diagnostic.
Source§

fn source_code(&self) -> Option<&dyn SourceCode>

Source code to apply this Diagnostic’s Diagnostic::labels to.
Source§

fn related<'a>( &'a self, ) -> Option<Box<dyn Iterator<Item = &'a dyn Diagnostic> + 'a>>

Additional related Diagnostics.
Source§

fn diagnostic_source(&self) -> Option<&dyn Diagnostic>

The cause of the error.
Source§

impl Display for EvalError

Source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Error for EvalError

Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<AttributeError> for EvalError

Source§

fn from(source: AttributeError) -> Self

Converts to this type from the input type.
Source§

impl From<DiagError> for EvalError

Source§

fn from(source: DiagError) -> Self

Converts to this type from the input type.
Source§

impl From<ParseError> for EvalError

Source§

fn from(source: ParseError) -> Self

Converts to this type from the input type.
Source§

impl From<ResolveError> for EvalError

Source§

fn from(err: ResolveError) -> Self

Converts to this type from the input type.
Source§

impl From<ValueError> for EvalError

Source§

fn from(source: ValueError) -> Self

Converts to this type from the input type.
Source§

impl Lookup<EvalError> for EvalContext

Source§

fn lookup( &self, name: &QualifiedName, target: LookupTarget, ) -> EvalResult<Symbol>

Search a symbol by it’s qualified name. Read more
Source§

fn ambiguity_error( ambiguous: QualifiedName, others: QualifiedNames, ) -> EvalError

Return an ambiguity error.
Source§

fn lookup_within( &self, name: &QualifiedName, within: &Symbol, target: LookupTarget, ) -> Result<Symbol, E>

Search a symbol by it’s qualified name and within the given symbol. Read more
Source§

fn lookup_within_opt( &self, name: &QualifiedName, within: &Option<Symbol>, target: LookupTarget, ) -> Result<Symbol, E>

Search a symbol by it’s qualified name and within a given symbol Read more
Source§

fn deny_super(&self, name: &QualifiedName) -> ResolveResult<()>

Returns an error if name starts with super::.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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 more
Source§

impl<D> OwoColorize for D

Source§

fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>
where C: Color,

Set the foreground color generically Read more
Source§

fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>
where C: Color,

Set the background color generically. Read more
Source§

fn black(&self) -> FgColorDisplay<'_, Black, Self>

Change the foreground color to black
Source§

fn on_black(&self) -> BgColorDisplay<'_, Black, Self>

Change the background color to black
Source§

fn red(&self) -> FgColorDisplay<'_, Red, Self>

Change the foreground color to red
Source§

fn on_red(&self) -> BgColorDisplay<'_, Red, Self>

Change the background color to red
Source§

fn green(&self) -> FgColorDisplay<'_, Green, Self>

Change the foreground color to green
Source§

fn on_green(&self) -> BgColorDisplay<'_, Green, Self>

Change the background color to green
Source§

fn yellow(&self) -> FgColorDisplay<'_, Yellow, Self>

Change the foreground color to yellow
Source§

fn on_yellow(&self) -> BgColorDisplay<'_, Yellow, Self>

Change the background color to yellow
Source§

fn blue(&self) -> FgColorDisplay<'_, Blue, Self>

Change the foreground color to blue
Source§

fn on_blue(&self) -> BgColorDisplay<'_, Blue, Self>

Change the background color to blue
Source§

fn magenta(&self) -> FgColorDisplay<'_, Magenta, Self>

Change the foreground color to magenta
Source§

fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>

Change the background color to magenta
Source§

fn purple(&self) -> FgColorDisplay<'_, Magenta, Self>

Change the foreground color to purple
Source§

fn on_purple(&self) -> BgColorDisplay<'_, Magenta, Self>

Change the background color to purple
Source§

fn cyan(&self) -> FgColorDisplay<'_, Cyan, Self>

Change the foreground color to cyan
Source§

fn on_cyan(&self) -> BgColorDisplay<'_, Cyan, Self>

Change the background color to cyan
Source§

fn white(&self) -> FgColorDisplay<'_, White, Self>

Change the foreground color to white
Source§

fn on_white(&self) -> BgColorDisplay<'_, White, Self>

Change the background color to white
Source§

fn default_color(&self) -> FgColorDisplay<'_, Default, Self>

Change the foreground color to the terminal default
Source§

fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>

Change the background color to the terminal default
Source§

fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>

Change the foreground color to bright black
Source§

fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>

Change the background color to bright black
Source§

fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>

Change the foreground color to bright red
Source§

fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>

Change the background color to bright red
Source§

fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>

Change the foreground color to bright green
Source§

fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>

Change the background color to bright green
Source§

fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>

Change the foreground color to bright yellow
Source§

fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>

Change the background color to bright yellow
Source§

fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>

Change the foreground color to bright blue
Source§

fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>

Change the background color to bright blue
Source§

fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>

Change the foreground color to bright magenta
Source§

fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>

Change the background color to bright magenta
Source§

fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>

Change the foreground color to bright purple
Source§

fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>

Change the background color to bright purple
Source§

fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>

Change the foreground color to bright cyan
Source§

fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>

Change the background color to bright cyan
Source§

fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>

Change the foreground color to bright white
Source§

fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>

Change the background color to bright white
Source§

fn bold(&self) -> BoldDisplay<'_, Self>

Make the text bold
Source§

fn dimmed(&self) -> DimDisplay<'_, Self>

Make the text dim
Source§

fn italic(&self) -> ItalicDisplay<'_, Self>

Make the text italicized
Source§

fn underline(&self) -> UnderlineDisplay<'_, Self>

Make the text underlined
Make the text blink
Make the text blink (but fast!)
Source§

fn reversed(&self) -> ReversedDisplay<'_, Self>

Swap the foreground and background colors
Source§

fn hidden(&self) -> HiddenDisplay<'_, Self>

Hide the text
Source§

fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>

Cross out the text
Source§

fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>
where Color: DynColor,

Set the foreground color at runtime. Only use if you do not know which color will be used at compile-time. If the color is constant, use either OwoColorize::fg or a color-specific method, such as OwoColorize::green, Read more
Source§

fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>
where Color: DynColor,

Set the background color at runtime. Only use if you do not know what color to use at compile-time. If the color is constant, use either OwoColorize::bg or a color-specific method, such as OwoColorize::on_yellow, Read more
Source§

fn fg_rgb<const R: u8, const G: u8, const B: u8>( &self, ) -> FgColorDisplay<'_, CustomColor<R, G, B>, Self>

Set the foreground color to a specific RGB value.
Source§

fn bg_rgb<const R: u8, const G: u8, const B: u8>( &self, ) -> BgColorDisplay<'_, CustomColor<R, G, B>, Self>

Set the background color to a specific RGB value.
Source§

fn truecolor(&self, r: u8, g: u8, b: u8) -> FgDynColorDisplay<'_, Rgb, Self>

Sets the foreground color to an RGB value.
Source§

fn on_truecolor(&self, r: u8, g: u8, b: u8) -> BgDynColorDisplay<'_, Rgb, Self>

Sets the background color to an RGB value.
Source§

fn style(&self, style: Style) -> Styled<&Self>

Apply a runtime-determined style
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> ToCompactString for T
where T: Display,

Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<G1, G2> Within<G2> for G1
where G2: Contains<G1>,

Source§

fn is_within(&self, b: &G2) -> bool