pub enum Error {
Show 48 variants
InvalidToken {
token: Token,
},
UnexpectedProperties {
error_span: Span,
},
InvalidCharacter {
character: char,
error_span: Span,
},
NewLineInString {
error_span: Span,
},
NumberTooLarge {
error_span: Span,
},
SingleVariantExplicitIterator {
error_span: Span,
},
EndOfInput,
UndefinedRuleOperator {
operator: NamedIdent,
},
InconsistentIterators {
first_span: Span,
first_length: usize,
occurred_span: Span,
occurred_length: usize,
error_span: Span,
},
IteratorWithSameIdIterator {
error_span: Span,
parent_span: Span,
contained_span: Span,
},
InconsistentTypes {
expected: (Type, Box<Span>),
got: (Type, Box<Span>),
error_span: Box<Span>,
},
RedefinedVariable {
defined_at: Span,
error_span: Span,
variable_name: String,
},
UndefinedTypeVariable {
definition: Span,
},
UndefinedVariable {
error_span: Span,
variable_name: String,
suggested: Option<String>,
suggest_complex: bool,
},
UndefinedFunction {
error_span: Span,
function_name: String,
suggested: Option<&'static str>,
},
UndefinedMethod {
error_span: Span,
function_name: String,
suggested: Option<&'static str>,
on_type: Type,
},
FieldAccess {
error_span: Span,
},
FeatureNotSupported {
error_span: Span,
feature_name: &'static str,
},
InvalidArgumentCount {
error_span: Span,
expected: &'static [u8],
got: u8,
},
OverloadNotFound {
error_span: Span,
params: Vec<Type>,
function_name: String,
},
CannotUnpack {
error_span: Span,
ty: Type,
length: usize,
},
ImplicitConversionDoesNotExist {
error_span: Span,
from: Type,
to: Type,
},
InvalidOperandType {
error_span: Box<Span>,
got: (Type, Box<Span>),
op: String,
},
LetStatUnexpectedIterator {
var_span: Span,
error_span: Span,
},
LetStatMoreThanOneIterator {
error_span: Span,
first_span: Span,
second_span: Span,
},
NonPointInPointCollection {
error_span: Span,
received: (Span, Type),
},
FlagDoesNotExist {
flag_name: String,
flag_span: Span,
error_span: Span,
suggested: Option<&'static str>,
},
FlagSetExpected {
error_span: Span,
},
StringExpected {
error_span: Span,
},
StringOrIdentExpected {
error_span: Span,
},
NonRawStringOrIdentExpected {
error_span: Span,
},
BooleanExpected {
error_span: Span,
},
NumberExpected {
error_span: Span,
},
InvalidIdentMathString {
error_span: Span,
},
RedefinedFlag {
error_span: Span,
first_defined: Span,
flag_name: &'static str,
},
EnumInvalidValue {
error_span: Span,
available_values: &'static [&'static str],
received_value: String,
},
RequiredFlagNotSet {
flag_name: &'static str,
required_because: Span,
definition_span: Option<Span>,
available_values: &'static [&'static str],
},
ComparisonDoesNotExist {
error_span: Span,
ty: Type,
},
EmptyLabel {
error_span: Span,
},
UnclosedSpecial {
error_span: Span,
parsed_special: String,
},
SpecialNotRecognised {
error_span: Span,
code: String,
suggested: Option<String>,
},
UnclosedString {
error_span: Span,
},
LabelIndexInsideIndex {
error_span: Span,
},
UnexpectedDisplayOption {
error_span: Span,
option: String,
suggested: Option<&'static str>,
},
RepeatedDisplayOption {
error_span: Span,
first_span: Span,
option: String,
},
InvalidPC {
error_span: Span,
},
ZeroDenominator {
error_span: Span,
},
ExpectedFunction {
error_span: Span,
},
}
Expand description
A GeoScript
error
Variants§
InvalidToken
Invalid token in the figure script.
UnexpectedProperties
Properties exncountered where not expected
InvalidCharacter
Invalid (unsupported) character in the figure script.
Fields
NewLineInString
A newline character was found in a string
NumberTooLarge
The given number is too large to be parsed.
SingleVariantExplicitIterator
Found an explicit iterator with a single variant.
EndOfInput
Unexpected end of script.
UndefinedRuleOperator
Found an undefined rule oprator.
Fields
operator: NamedIdent
The operator
InconsistentIterators
Iterators with non-matching lengths
Fields
IteratorWithSameIdIterator
An iterator contains an iterator with the same id.
Fields
InconsistentTypes
Inconsistent types in a rule or a binary operation.
Fields
RedefinedVariable
A variable with the same name already exists
Fields
UndefinedTypeVariable
A variable of undefined type
UndefinedVariable
An undefined variable was referenced
Fields
UndefinedFunction
An undefined function was referenced.
Fields
UndefinedMethod
An undefined method was referenced.
Fields
FieldAccess
An attempt to access a field of a value has been made.
FeatureNotSupported
An attempt to use an unsupported language feature was made.
InvalidArgumentCount
Invalid argument count for a function
Fields
OverloadNotFound
An overload for a function was not found
Fields
CannotUnpack
Cannot unpack a type onto a point collection.
Fields
ImplicitConversionDoesNotExist
There’s no implicit conversion between two types.
Fields
InvalidOperandType
Invalid type of an operand of a binary operation
Fields
LetStatUnexpectedIterator
An unexpected iterator was found in a let statement.
LetStatMoreThanOneIterator
More than one iterator was found in a let statement.
Fields
NonPointInPointCollection
There’s a non-point value in a point collection
FlagDoesNotExist
An undefined flag was referenced
Fields
FlagSetExpected
A flag set expected as a flag value.
StringExpected
A string was expected
StringOrIdentExpected
A string or an identifier was expected.
NonRawStringOrIdentExpected
A non-raw string or an identifier was expected
BooleanExpected
A bool value was expected.
NumberExpected
A number value was expected
InvalidIdentMathString
The provided identifier cannot be converted into a math string.
RedefinedFlag
A flag’s value was set more than once
Fields
EnumInvalidValue
Invalid value for an enumeration
Fields
RequiredFlagNotSet
A flag that must be set was not set.
Fields
ComparisonDoesNotExist
A comparison between two values of a type does not exist
EmptyLabel
An empty lable was found
UnclosedSpecial
There’s an unclosed special character in a math string
SpecialNotRecognised
An undefined special character was referenced
Fields
UnclosedString
There’s an unclosed string
LabelIndexInsideIndex
An index was found inside another index, in a math string
UnexpectedDisplayOption
An unexpected property was found
Fields
RepeatedDisplayOption
A property was repeated
Fields
InvalidPC
An invalid Point collection
ZeroDenominator
A denominator of zero
ExpectedFunction
A function name was expected
Implementations§
Source§impl Error
impl Error
Sourcepub fn as_implicit_does_not_exist(&self) -> Option<(&Span, &Type, &Type)>
pub fn as_implicit_does_not_exist(&self) -> Option<(&Span, &Type, &Type)>
Match against ImplicitConversonDoesNotExist
Sourcepub fn diagnostic(self) -> DiagnosticData
pub fn diagnostic(self) -> DiagnosticData
Convert the error to a diagnostic
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Error
impl RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnwindSafe for Error
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> Convert for T
impl<T> Convert for T
Source§fn convert<U>(self, context: &CompileContext) -> Expr<U>where
U: ConvertFrom<T>,
fn convert<U>(self, context: &CompileContext) -> Expr<U>where
U: ConvertFrom<T>,
self
into a specific type. Read moreSource§fn can_convert<U>(&self) -> boolwhere
U: ConvertFrom<T>,
fn can_convert<U>(&self) -> boolwhere
U: ConvertFrom<T>,
self
can be converted into a specific type. Read more