Enum LexerError

Source
pub enum LexerError<'i> {
Show 37 variants UnknownSegment(Rule), LibNoName(Src<'i>), LibNoId(Src<'i>), RoutineNoName(Src<'i>), RoutineUnrecognized(Src<'i>), StatementNoInstruction(Src<'i>), StatementNoFlag(Src<'i>), OperatorMiscomposition(Src<'i>), FlagWithoutValue(Src<'i>), RegisterNoType(Src<'i>), RegisterNoName(Src<'i>), RegisterNameNonDecimal(Src<'i>, ParseIntError), RegisterNoIndex(Src<'i>), RegisterIndexNonDecimal(Src<'i>, ParseIntError, &'i str), RegisterUnknown(Src<'i>), CallWithoutLibName(Src<'i>), CallWithoutRoutineName(Src<'i>), OperandUnknown(Src<'i>, &'i str), LiteralNoData(Src<'i>), LiteralWrongDec(Src<'i>, &'i str, ParseIntError), LiteralWrongHex(Src<'i>, &'i str, Error), LiteralWrongOct(Src<'i>, &'i str, ParseIntError), LiteralWrongBin(Src<'i>, &'i str, ParseIntError), FloatNoWhole(Src<'i>), FloatNoFraction(Src<'i>), FloatWholeNotNumber(Src<'i>, ParseIntError), FloatFractionNotNumber(Src<'i>, ParseIntError), FloatExponentialNotNumber(Src<'i>, ParseIntError), LiteralUnknown(Src<'i>, Rule), ConstNoName(Src<'i>), ConstNoValue(Src<'i>), VarNoName(Src<'i>), VarNoType(Src<'i>), VarNoDescription(Src<'i>), VarWrongDescription(Src<'i>), VarTypeUnknown(String, Src<'i>), ProgramAbsent,
}

Variants§

§

UnknownSegment(Rule)

unknown program segment {0:?}

§

LibNoName(Src<'i>)

library statement {0:#} has no detectable name {0}

§

LibNoId(Src<'i>)

library statement {0:#} has no detectable lib id {0}

§

RoutineNoName(Src<'i>)

routine {0:#} has no detectable name {0}

§

RoutineUnrecognized(Src<'i>)

routine {0:#} does not start with neither .MAIN or .ROUTINE {0}

§

StatementNoInstruction(Src<'i>)

label in {0:#} is not followed by an instruction {0}

§

StatementNoFlag(Src<'i>)

mnemonic is followed by non-flag rules {0}

§

OperatorMiscomposition(Src<'i>)

operator {0:#} is not composed of mnemonic and flags {0}

§

FlagWithoutValue(Src<'i>)

flag without flag value {0}

§

RegisterNoType(Src<'i>)

register operand contains no register type {0}

§

RegisterNoName(Src<'i>)

register operand does not specify register name {0}

§

RegisterNameNonDecimal(Src<'i>, ParseIntError)

register name must be encoded as a decimal number {0} details: {1}

§

RegisterNoIndex(Src<'i>)

register operand does not specify register index {0}

§

RegisterIndexNonDecimal(Src<'i>, ParseIntError, &'i str)

register index {2} is not a decimal number {0} details: {1}

§

RegisterUnknown(Src<'i>)

unknown register type {0}

§

CallWithoutLibName(Src<'i>)

call statement without library name {0}

§

CallWithoutRoutineName(Src<'i>)

call statement without routine name {0}

§

OperandUnknown(Src<'i>, &'i str)

unknown operand format {1} inside the statement {0:#} {0}

§

LiteralNoData(Src<'i>)

literal contains no data {0}

§

LiteralWrongDec(Src<'i>, &'i str, ParseIntError)

incorrect decimal literal {1} {0} details: {2}

§

LiteralWrongHex(Src<'i>, &'i str, Error)

incorrect hex literal {1} {0} details: {2}

§

LiteralWrongOct(Src<'i>, &'i str, ParseIntError)

incorrect oct literal {1} {0} details: {2}

§

LiteralWrongBin(Src<'i>, &'i str, ParseIntError)

incorrect bin literal {1} {0} details: {2}

§

FloatNoWhole(Src<'i>)

float literal contains no whole mantissa part {0}

§

FloatNoFraction(Src<'i>)

float literal contains no fractional mantissa part {0}

§

FloatWholeNotNumber(Src<'i>, ParseIntError)

float literal mantissa whole part is not an integer {0} details: {1}

§

FloatFractionNotNumber(Src<'i>, ParseIntError)

float literal mantissa fraction part is not an integer {0} details: {1}

§

FloatExponentialNotNumber(Src<'i>, ParseIntError)

float literal exponential part is not an integer {0} details: {1}

§

LiteralUnknown(Src<'i>, Rule)

unknown type of literal {1:?} {0}

§

ConstNoName(Src<'i>)

constant statement has no name {0}

§

ConstNoValue(Src<'i>)

constant statement has no value {0}

§

VarNoName(Src<'i>)

input variable has no name {0}

§

VarNoType(Src<'i>)

input variable has no type {0}

§

VarNoDescription(Src<'i>)

input variable has no description {0}

§

VarWrongDescription(Src<'i>)

input variable description is not a string literal {0}

§

VarTypeUnknown(String, Src<'i>)

unknown variable type {0} {1}

§

ProgramAbsent

unable to detect program code

Implementations§

Source§

impl<'i> LexerError<'i>

Source

pub fn errno(&self) -> u16

Trait Implementations§

Source§

impl<'i> Clone for LexerError<'i>

Source§

fn clone(&self) -> LexerError<'i>

Returns a duplicate 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<'i> Debug for LexerError<'i>

Source§

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

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

impl<'i> Display for LexerError<'i>

Source§

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

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

impl<'i> Error for LexerError<'i>

1.30.0 · 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<'i> From<LexerError<'i>> for MainError

Source§

fn from(err: LexerError<'i>) -> Self

Converts to this type from the input type.
Source§

impl<'i> From<LexerError<'i>> for String

Source§

fn from(err: LexerError<'i>) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl<'i> Freeze for LexerError<'i>

§

impl<'i> RefUnwindSafe for LexerError<'i>

§

impl<'i> Send for LexerError<'i>

§

impl<'i> Sync for LexerError<'i>

§

impl<'i> Unpin for LexerError<'i>

§

impl<'i> UnwindSafe for LexerError<'i>

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

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

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§

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.