#[derive(Debug, Copy, Clone, PartialEq)]
pub enum Exception {
Abort = -1,
AbortQuote = -2,
StackOverflow = -3,
StackUnderflow = -4,
ReturnStackOverflow = -5,
ReturnStackUnderflow = -6,
DoLoopNestedTooDeeply = -7,
DictionaryOverflow = -8,
InvalidMemoryAddress = -9,
DivisionByZero = -10,
ResultOutOfRange = -11,
ArgumentTypeMismatch = -12,
UndefinedWord = -13,
InterpretingACompileOnlyWord = -14,
InvalidForget = -15,
AttemptToUseZeroLengthString = -16,
PicturedNumericOutputStringOverflow = -17,
ParsedStringOverflow = -18,
DefinitionNameTooLong = -19,
WriteToAReadOnlyLocation = -20,
UnsupportedOperation = -21,
ControlStructureMismatch = -22,
AddressAlignmentException = -23,
InvalidNumericArgument = -24,
ReturnStackImbalance = -25,
LoopParametersUnavailable = -26,
InvalidRecursion = -27,
UserInterrupt = -28,
CompilerNesting = -29,
ObsolescentFeature = -30,
ToBodyUsedOnNonCreatedDefinition = -31,
InvalidNameArgument = -32,
BlockReadException = -33,
BlockWriteException = -34,
InvalidBlockNumber = -35,
InvalidFilePosition = -36,
FileIOException = -37,
NonExistentFile = -38,
UnexpectedEndOfFile = -39,
InvalidBaseForFloatingPointConversion = -40,
LossOfPrecision = -41,
FloatingPointDividedByZero = -42,
FloatingPointResultOutOfRange = -43,
FloatingPointStackOverflow = -44,
FloatingPointStackUnderflow = -45,
FloatingPointInvalidArgument = -46,
CompilationWordListDeleted = -47,
InvalidPostpone = -48,
SearchOrderOverflow = -49,
SearchOrderUnderflow = -50,
CompilationWordListChanged = -51,
ControlFlowStackOverflow = -52,
ExceptionStackOverflow = -53,
FloatingPointUnderflow = -54,
FloatingPointUnidentifiedFault = -55,
Quit = -56,
ExceptionInSendingOrReceivingACharacter = -57,
BracketIfElseOrThenException = -58,
}
impl Exception {
pub fn description(&self) -> &'static str {
match *self {
Exception::Abort => "Aborted",
Exception::AbortQuote => "Aborted",
Exception::StackOverflow => "Stack overflow",
Exception::StackUnderflow => "Stack underflow",
Exception::ReturnStackOverflow => "Return stack overflow",
Exception::ReturnStackUnderflow => "Return stack underflow",
Exception::DoLoopNestedTooDeeply => "Do-loop nested too deeply",
Exception::DictionaryOverflow => "Dictionary overflow",
Exception::InvalidMemoryAddress => "Invalid memory address",
Exception::DivisionByZero => "Division by zero",
Exception::ResultOutOfRange => "Result out of range",
Exception::ArgumentTypeMismatch => "Argument type mismatch",
Exception::UndefinedWord => "Undefined word",
Exception::InterpretingACompileOnlyWord => "Interpreting a compile only word",
Exception::InvalidForget => "Invalid FORGET",
Exception::AttemptToUseZeroLengthString => "Attempt to use zero length string",
Exception::PicturedNumericOutputStringOverflow => {
"Picture numeric output string overflow"
}
Exception::ParsedStringOverflow => "Parsed string overflow",
Exception::DefinitionNameTooLong => "Definition name too long",
Exception::WriteToAReadOnlyLocation => "Write to a read only location",
Exception::UnsupportedOperation => "Unsupported operation",
Exception::ControlStructureMismatch => "Control structure mismatch",
Exception::AddressAlignmentException => "Address alignment exception",
Exception::InvalidNumericArgument => "Invalid numeric argument",
Exception::ReturnStackImbalance => "Return stack imbalance",
Exception::LoopParametersUnavailable => "Loop parameters unavailable",
Exception::InvalidRecursion => "Invalid recursion",
Exception::UserInterrupt => "User interrupt",
Exception::CompilerNesting => "Compiler nesting",
Exception::ObsolescentFeature => "Obsolescent feature",
Exception::ToBodyUsedOnNonCreatedDefinition => ">BODY used on non-CREATEd definition",
Exception::InvalidNameArgument => "Invalid name argument",
Exception::BlockReadException => "Block read exception",
Exception::BlockWriteException => "Block write exception",
Exception::InvalidBlockNumber => "Invalid block number",
Exception::InvalidFilePosition => "Invalid file position",
Exception::FileIOException => "File I/O exception",
Exception::NonExistentFile => "Non-existent file",
Exception::UnexpectedEndOfFile => "Unexpected end of file",
Exception::InvalidBaseForFloatingPointConversion => {
"Invalid BASE for floating point conversion"
}
Exception::LossOfPrecision => "Loss of precision",
Exception::FloatingPointDividedByZero => "Floating point divided by zero",
Exception::FloatingPointResultOutOfRange => "Floating point result out of range",
Exception::FloatingPointStackOverflow => "Floating point stack overflow",
Exception::FloatingPointStackUnderflow => "Floating point stack underflow",
Exception::FloatingPointInvalidArgument => "Floating point invalid argument",
Exception::CompilationWordListDeleted => "Compilation word list deleted",
Exception::InvalidPostpone => "Invalid POSTPONE",
Exception::SearchOrderOverflow => "Search order overflow",
Exception::SearchOrderUnderflow => "Search order underflow",
Exception::CompilationWordListChanged => "Compilation word list changed",
Exception::ControlFlowStackOverflow => "Control flow stack overflow",
Exception::ExceptionStackOverflow => "Exception stack overflow",
Exception::FloatingPointUnderflow => "Floating point underflow",
Exception::FloatingPointUnidentifiedFault => "Floating point unidentified fault",
Exception::Quit => "QUIT",
Exception::ExceptionInSendingOrReceivingACharacter => {
"Exception in sending or receiving a character"
}
Exception::BracketIfElseOrThenException => "[IF],[ELSE],[THEN] exception",
}
}
}