pub enum LexErr {
DoesNotFitU16,
DoesNotFitI16,
InvalidHex,
InvalidNumeric,
InvalidHexEmpty,
InvalidDecEmpty,
UnknownIntErr,
UnclosedStrLit,
StrLitTooBig,
InvalidReg,
InvalidSymbol,
}Expand description
Any errors raised in attempting to tokenize an input stream.
Variants§
DoesNotFitU16
Numeric literal (unsigned dec, hex, and bin) cannot fit within the range of a u16
DoesNotFitI16
Numeric literal (signed dec) cannot fit within the range of a i16
InvalidHex
Hex literal (starting with x) has invalid hex digits
InvalidNumeric
Numeric literal could not be parsed as a decimal literal because it has invalid digits (i.e., not 0-9)
InvalidHexEmpty
Hex literal (starting with x) doesn’t have digits after it.
InvalidDecEmpty
Numeric literal could not be parsed as a decimal literal because there are no digits in it (it’s just # or #-)
UnknownIntErr
Int parsing failed but the reason why is unknown
UnclosedStrLit
String literal is missing an end quotation mark.
StrLitTooBig
String literal is missing an end quotation mark.
InvalidReg
Token had the format R\d, but \d isn’t 0-7.
InvalidSymbol
A symbol was used which is not allowed in LC3 assembly files
Trait Implementations§
source§impl Error for LexErr
impl Error for LexErr
1.30.0 · source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · source§fn description(&self) -> &str
fn description(&self) -> &str
impl Copy for LexErr
impl Eq for LexErr
impl StructuralPartialEq for LexErr
Auto Trait Implementations§
impl Freeze for LexErr
impl RefUnwindSafe for LexErr
impl Send for LexErr
impl Sync for LexErr
impl Unpin for LexErr
impl UnwindSafe for LexErr
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit)