Enum lc3_ensemble::parse::lex::LexErr
source · 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