pub struct ParsingError { /* private fields */ }
Expand description

An error which can be generated while parsing a Miden assembly source code into an AST.

Implementations§

source§

impl ParsingError

source

pub fn empty_source() -> Self

source

pub fn unexpected_eof(location: SourceLocation) -> Self

source

pub fn unexpected_token(token: &Token<'_>, expected: &str) -> Self

source

pub fn duplicate_const_name(token: &Token<'_>, label: &str) -> Self

source

pub fn invalid_const_name(token: &Token<'_>, err: LabelError) -> Self

source

pub fn invalid_const_value(token: &Token<'_>, value: &str, reason: &str) -> Self

source

pub fn const_invalid_scope(token: &Token<'_>) -> Self

source

pub fn const_not_found(token: &Token<'_>) -> Self

source

pub fn const_conversion_failed(token: &Token<'_>, type_name: &str) -> Self

source

pub fn const_division_by_zero(token: &Token<'_>) -> Self

source

pub fn invalid_op(token: &Token<'_>) -> Self

source

pub fn missing_param(token: &Token<'_>, expected_format: &str) -> Self

source

pub fn extra_param(token: &Token<'_>) -> Self

source

pub fn invalid_param(token: &Token<'_>, part_idx: usize) -> Self

source

pub fn invalid_param_with_reason( token: &Token<'_>, part_idx: usize, reason: &str ) -> Self

source

pub fn dangling_else(token: &Token<'_>) -> Self

source

pub fn unmatched_if(token: &Token<'_>) -> Self

source

pub fn unmatched_while(token: &Token<'_>) -> Self

source

pub fn unmatched_repeat(token: &Token<'_>) -> Self

source

pub fn unmatched_else(token: &Token<'_>) -> Self

source

pub fn unmatched_begin(token: &Token<'_>) -> Self

source

pub fn dangling_ops_after_program(token: &Token<'_>) -> Self

source

pub fn dangling_ops_after_module(token: &Token<'_>) -> Self

source

pub fn dangling_procedure_comment(location: SourceLocation) -> Self

source

pub fn not_a_library_module(token: &Token<'_>) -> Self

source

pub fn too_many_module_procs(num_procs: usize, max_procs: usize) -> Self

source

pub fn too_many_body_nodes(num_nodes: usize, max_nodes: usize) -> Self

source

pub fn module_docs_too_long(doc_len: usize, max_len: usize) -> Self

source

pub fn body_too_long( token: &Token<'_>, body_size: usize, max_body_size: usize ) -> Self

source

pub fn duplicate_proc_name(token: &Token<'_>, label: &str) -> Self

source

pub fn invalid_proc_name(token: &Token<'_>, err: LabelError) -> Self

source

pub fn invalid_reexported_procedure(token: &Token<'_>, label: &str) -> Self

source

pub fn proc_name_too_long(token: &Token<'_>, label: &str, max_len: u8) -> Self

source

pub fn invalid_proc_locals(token: &Token<'_>, locals: &str) -> Self

source

pub fn too_many_proc_locals( token: &Token<'_>, num_locals: u64, max_locals: u64 ) -> Self

source

pub fn unmatched_proc(token: &Token<'_>, proc_name: &str) -> Self

source

pub fn proc_export_not_allowed(token: &Token<'_>, label: &str) -> Self

source

pub fn proc_docs_too_long( token: &Token<'_>, doc_len: usize, max_len: usize ) -> Self

source

pub fn invalid_proc_root_invocation( token: &Token<'_>, label: &str, err: LabelError ) -> Self

source

pub fn invalid_proc_invocation(token: &Token<'_>, label: &str) -> Self

source

pub fn exec_with_mast_root(token: &Token<'_>) -> Self

source

pub fn syscall_with_module_name(token: &Token<'_>) -> Self

source

pub fn syscall_with_mast_root(token: &Token<'_>) -> Self

source

pub fn undefined_local_proc(token: &Token<'_>, label: &str) -> Self

source

pub fn procedure_module_not_imported( token: &Token<'_>, module_name: &str ) -> Self

source

pub fn too_many_imported_procs_invoked( token: &Token<'_>, num_procs: usize, max_procs: usize ) -> Self

source

pub fn duplicate_module_import(token: &Token<'_>, module: &str) -> Self

source

pub fn invalid_module_path(token: &Token<'_>, module_path: &str) -> Self

source

pub fn invalid_module_name(token: &Token<'_>, name: &str) -> Self

source

pub fn import_inside_body(token: &Token<'_>) -> Self

source

pub fn invalid_library_path(token: &Token<'_>, error: LibraryError) -> Self

source

pub fn too_many_imports(num_imports: usize, max_imports: usize) -> Self

source

pub fn message(&self) -> &String

source

pub fn operation(&self) -> &String

source

pub const fn location(&self) -> &SourceLocation

Trait Implementations§

source§

impl Clone for ParsingError

source§

fn clone(&self) -> ParsingError

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ParsingError

source§

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

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

impl Display for ParsingError

source§

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

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

impl Error for ParsingError

1.30.0 · source§

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

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<ParsingError> for AssemblyError

source§

fn from(err: ParsingError) -> Self

Converts to this type from the input type.
source§

impl From<ParsingError> for Error

source§

fn from(e: ParsingError) -> Self

Converts to this type from the input type.
source§

impl PartialEq for ParsingError

source§

fn eq(&self, other: &ParsingError) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Eq for ParsingError

source§

impl StructuralPartialEq for ParsingError

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

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

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

source§

default 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>,

§

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>,

§

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<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