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 larger than the maximum string size (u16::MAX - 1).
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§
impl Copy for LexErr
impl Eq for LexErr
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
use the Display impl or to_string()