SpannedCompilerError

Struct SpannedCompilerError 

Source
pub struct SpannedCompilerError {
    pub error: CompilerError,
    pub span: Option<Range<usize>>,
}
Expand description

A compiler error that can be linked to a specific span in the source code

Fields§

§error: CompilerError§span: Option<Range<usize>>

Implementations§

Trait Implementations§

Source§

impl Debug for SpannedCompilerError

Source§

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

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

impl Display for SpannedCompilerError

Source§

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

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

impl ErrorCollector<SpannedCompilerError> for DetailedCompilerErrors

Source§

impl<'a> ExpressionVisitor<SpannedCompilerError> for Precompiler<'a>

Source§

fn handle_expression_error( &mut self, error: SpannedCompilerError, _expression: &DatexExpression, ) -> Result<VisitAction<DatexExpression>, SpannedCompilerError>

Handle expression errors by either recording them if collected_errors is Some, or aborting the traversal if collected_errors is None.

Source§

fn before_visit_datex_expression(&mut self, expr: &mut DatexExpression)

Source§

fn after_visit_datex_expression(&mut self, expr: &mut DatexExpression)

Source§

fn visit_remote_execution( &mut self, remote_execution: &mut RemoteExecution, _: &Range<usize>, ) -> ExpressionVisitResult<SpannedCompilerError>

Visit remote execution
Source§

fn visit_statements( &mut self, statements: &mut Statements, _: &Range<usize>, ) -> ExpressionVisitResult<SpannedCompilerError>

Visit statements
Source§

fn visit_type_declaration( &mut self, type_declaration: &mut TypeDeclaration, _: &Range<usize>, ) -> ExpressionVisitResult<SpannedCompilerError>

Visit type declaration
Source§

fn visit_binary_operation( &mut self, binary_operation: &mut BinaryOperation, span: &Range<usize>, ) -> ExpressionVisitResult<SpannedCompilerError>

Visit binary operation
Source§

fn visit_variable_declaration( &mut self, variable_declaration: &mut VariableDeclaration, span: &Range<usize>, ) -> ExpressionVisitResult<SpannedCompilerError>

Visit variable declaration
Source§

fn visit_variable_assignment( &mut self, variable_assignment: &mut VariableAssignment, span: &Range<usize>, ) -> ExpressionVisitResult<SpannedCompilerError>

Visit variable assignment
Source§

fn visit_identifier( &mut self, identifier: &mut String, span: &Range<usize>, ) -> ExpressionVisitResult<SpannedCompilerError>

Visit identifier
Source§

fn visit_datex_expression( &mut self, expr: &mut DatexExpression, ) -> Result<(), E>

Visit datex expression
Source§

fn visit_unary_operation( &mut self, unary_operation: &mut UnaryOperation, span: &Range<usize>, ) -> ExpressionVisitResult<E>

Visit unary operation
Source§

fn visit_variant_access( &mut self, variant_access: &mut VariantAccess, span: &Range<usize>, ) -> ExpressionVisitResult<E>

Visit variant access
Source§

fn visit_property_assignment( &mut self, property_assignment: &mut PropertyAssignment, span: &Range<usize>, ) -> ExpressionVisitResult<E>

Visit property assignment
Source§

fn visit_conditional( &mut self, conditional: &mut Conditional, span: &Range<usize>, ) -> ExpressionVisitResult<E>

Visit conditional expression
Source§

fn visit_comparison_operation( &mut self, comparison_operation: &mut ComparisonOperation, span: &Range<usize>, ) -> ExpressionVisitResult<E>

Visit comparison operation
Source§

fn visit_deref_assignment( &mut self, deref_assignment: &mut DerefAssignment, span: &Range<usize>, ) -> ExpressionVisitResult<E>

Visit dereference assignment
Source§

fn visit_apply( &mut self, apply: &mut Apply, span: &Range<usize>, ) -> ExpressionVisitResult<E>

Visit apply chain
Source§

fn visit_property_access( &mut self, property_access: &mut PropertyAccess, span: &Range<usize>, ) -> ExpressionVisitResult<E>

Visit property access
Source§

fn visit_generic_instantiation( &mut self, generic_instantiation: &mut GenericInstantiation, span: &Range<usize>, ) -> ExpressionVisitResult<E>

Visit generic instantiation
Source§

fn visit_callable_declaration( &mut self, function_declaration: &mut CallableDeclaration, span: &Range<usize>, ) -> ExpressionVisitResult<E>

Visit callable declaration
Source§

fn visit_slot_assignment( &mut self, slot_assignment: &mut SlotAssignment, span: &Range<usize>, ) -> ExpressionVisitResult<E>

Visit slot assignment
Source§

fn visit_variable_access( &mut self, var_access: &mut VariableAccess, span: &Range<usize>, ) -> ExpressionVisitResult<E>

Visit variable access
Source§

fn visit_create_ref( &mut self, create_ref: &mut CreateRef, span: &Range<usize>, ) -> ExpressionVisitResult<E>

Visit create reference expression
Source§

fn visit_create_mut( &mut self, datex_expression: &mut DatexExpression, span: &Range<usize>, ) -> ExpressionVisitResult<E>

Visit create mutable reference expression
Source§

fn visit_deref( &mut self, deref: &mut Deref, span: &Range<usize>, ) -> ExpressionVisitResult<E>

Visit dereference expression
Source§

fn visit_list( &mut self, list: &mut List, span: &Range<usize>, ) -> ExpressionVisitResult<E>

Visit list expression
Source§

fn visit_map( &mut self, map: &mut Map, span: &Range<usize>, ) -> ExpressionVisitResult<E>

Visit map expression
Source§

fn visit_integer( &mut self, integer: &mut Integer, span: &Range<usize>, ) -> ExpressionVisitResult<E>

Visit integer literal
Source§

fn visit_typed_integer( &mut self, typed_integer: &mut TypedInteger, span: &Range<usize>, ) -> ExpressionVisitResult<E>

Visit typed integer literal
Source§

fn visit_decimal( &mut self, decimal: &mut Decimal, span: &Range<usize>, ) -> ExpressionVisitResult<E>

Visit decimal literal
Source§

fn visit_typed_decimal( &mut self, typed_decimal: &mut TypedDecimal, span: &Range<usize>, ) -> ExpressionVisitResult<E>

Visit typed decimal literal
Source§

fn visit_placeholder(&mut self, span: &Range<usize>) -> ExpressionVisitResult<E>

Source§

fn visit_text( &mut self, text: &mut String, span: &Range<usize>, ) -> ExpressionVisitResult<E>

Visit text literal
Source§

fn visit_get_reference( &mut self, pointer_address: &mut PointerAddress, span: &Range<usize>, ) -> ExpressionVisitResult<E>

Visit get reference expression
Source§

fn visit_boolean( &mut self, boolean: &mut bool, span: &Range<usize>, ) -> ExpressionVisitResult<E>

Visit boolean literal
Source§

fn visit_endpoint( &mut self, endpoint: &mut Endpoint, span: &Range<usize>, ) -> ExpressionVisitResult<E>

Visit endpoint expression
Source§

fn visit_null(&mut self, span: &Range<usize>) -> ExpressionVisitResult<E>

Visit null literal
Source§

fn visit_pointer_address( &mut self, pointer_address: &PointerAddress, span: &Range<usize>, ) -> ExpressionVisitResult<E>

Visit pointer address expression
Source§

fn visit_slot( &mut self, slot: &Slot, span: &Range<usize>, ) -> ExpressionVisitResult<E>

Visit slot expression
Source§

impl From<CompilerError> for SpannedCompilerError

Source§

fn from(value: CompilerError) -> Self

Converts to this type from the input type.
Source§

impl From<SpannedCompilerError> for DeserializationError

Source§

fn from(e: SpannedCompilerError) -> Self

Converts to this type from the input type.
Source§

impl From<SpannedCompilerError> for ScriptExecutionError

Available on crate feature compiler only.
Source§

fn from(err: SpannedCompilerError) -> Self

Converts to this type from the input type.
Source§

impl From<SpannedCompilerError> for SimpleCompilerErrorOrDetailedCompilerErrorWithRichAst

Source§

fn from( value: SpannedCompilerError, ) -> SimpleCompilerErrorOrDetailedCompilerErrorWithRichAst

Converts to this type from the input type.
Source§

impl From<SpannedCompilerError> for SimpleOrDetailedCompilerError

Source§

fn from(value: SpannedCompilerError) -> Self

Converts to this type from the input type.
Source§

impl From<SpannedParserError> for SpannedCompilerError

Source§

fn from(value: SpannedParserError) -> Self

Converts to this type from the input type.
Source§

impl From<SpannedTypeError> for SpannedCompilerError

Source§

fn from(value: SpannedTypeError) -> Self

Converts to this type from the input type.
Source§

impl<'a> TypeExpressionVisitor<SpannedCompilerError> for Precompiler<'a>

Source§

fn visit_literal_type( &mut self, literal: &mut String, span: &Range<usize>, ) -> TypeExpressionVisitResult<SpannedCompilerError>

Visit literal type expression
Source§

fn visit_variant_access_type( &mut self, variant_access: &mut TypeVariantAccess, span: &Range<usize>, ) -> TypeExpressionVisitResult<SpannedCompilerError>

Visit variant access expression
Source§

fn handle_type_expression_error( &mut self, error: E, expression: &TypeExpression, ) -> Result<VisitAction<TypeExpression>, E>

Handle type expression error Can either propagate the error or return a VisitAction to recover Per default, it just propagates the error
Source§

fn before_visit_type_expression(&mut self, expression: &mut TypeExpression)

Source§

fn after_visit_type_expression(&mut self, expression: &mut TypeExpression)

Source§

fn visit_type_expression(&mut self, expr: &mut TypeExpression) -> Result<(), E>

Visit type expression
Source§

fn visit_structural_list_type( &mut self, structural_list: &mut StructuralList, span: &Range<usize>, ) -> TypeExpressionVisitResult<E>

Visit structural list type expression
Source§

fn visit_fixed_size_list_type( &mut self, fixed_size_list: &mut FixedSizeList, span: &Range<usize>, ) -> TypeExpressionVisitResult<E>

Visit fixed size list type expression
Source§

fn visit_slice_list_type( &mut self, slice_list: &mut SliceList, span: &Range<usize>, ) -> TypeExpressionVisitResult<E>

Visit slice list type expression
Source§

fn visit_intersection_type( &mut self, intersection: &mut Intersection, span: &Range<usize>, ) -> TypeExpressionVisitResult<E>

Visit intersection type expression
Source§

fn visit_union_type( &mut self, union: &mut Union, span: &Range<usize>, ) -> TypeExpressionVisitResult<E>

Visit union type expression
Source§

fn visit_generic_access_type( &mut self, generic_access: &mut GenericAccess, span: &Range<usize>, ) -> TypeExpressionVisitResult<E>

Visit generic access type expression
Source§

fn visit_callable_type( &mut self, callable_type_expression: &mut CallableTypeExpression, span: &Range<usize>, ) -> TypeExpressionVisitResult<E>

Visit function type expression
Source§

fn visit_structural_map_type( &mut self, structural_map: &mut StructuralMap, span: &Range<usize>, ) -> TypeExpressionVisitResult<E>

Visit structural map type expression
Source§

fn visit_ref_type( &mut self, type_ref: &mut TypeExpression, span: &Range<usize>, ) -> TypeExpressionVisitResult<E>

Visit type reference expression
Source§

fn visit_ref_mut_type( &mut self, type_ref_mut: &mut TypeExpression, span: &Range<usize>, ) -> TypeExpressionVisitResult<E>

Visit mutable type reference expression
Source§

fn visit_integer_type( &mut self, integer: &mut Integer, span: &Range<usize>, ) -> TypeExpressionVisitResult<E>

Visit integer literal
Source§

fn visit_typed_integer_type( &mut self, typed_integer: &mut TypedInteger, span: &Range<usize>, ) -> TypeExpressionVisitResult<E>

Visit typed integer literal
Source§

fn visit_decimal_type( &mut self, decimal: &mut Decimal, span: &Range<usize>, ) -> TypeExpressionVisitResult<E>

Visit decimal literal
Source§

fn visit_typed_decimal_type( &mut self, typed_decimal: &mut TypedDecimal, span: &Range<usize>, ) -> TypeExpressionVisitResult<E>

Visit typed decimal literal
Source§

fn visit_text_type( &mut self, text: &mut String, span: &Range<usize>, ) -> TypeExpressionVisitResult<E>

Visit text literal
Source§

fn visit_get_reference_type( &mut self, pointer_address: &mut PointerAddress, span: &Range<usize>, ) -> TypeExpressionVisitResult<E>

Visit get reference expression
Source§

fn visit_boolean_type( &mut self, boolean: &mut bool, span: &Range<usize>, ) -> TypeExpressionVisitResult<E>

Visit boolean literal
Source§

fn visit_endpoint_type( &mut self, endpoint: &mut Endpoint, span: &Range<usize>, ) -> TypeExpressionVisitResult<E>

Visit endpoint expression
Source§

fn visit_null_type( &mut self, span: &Range<usize>, ) -> TypeExpressionVisitResult<E>

Visit null literal
Source§

fn visit_unit_type( &mut self, span: &Range<usize>, ) -> TypeExpressionVisitResult<E>

Source§

fn visit_variable_access_type( &mut self, var_access: &mut VariableAccess, span: &Range<usize>, ) -> TypeExpressionVisitResult<E>

Visit variable access

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> Any for T
where T: Any,

Source§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

Source§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

Source§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

Source§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

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> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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<T> Same for T

Source§

type Output = T

Should always be Self
Source§

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

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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<A, B, T> HttpServerConnExec<A, B> for T
where B: Body,