pub enum Error {
LexicalError(Code, &'static str),
SyntacticalError(Code, &'static str),
IOError(Code, &'static str),
InitialisationError(Code, &'static str),
}Variants§
LexicalError(Code, &'static str)
A lexical error occurs when a lexer ( first step in compilation ) can not continue tokenizing this does not mean that the program is invalid, if that is the case an Error Token will be returned, instead this only occurs when the lexer absolutely can not continue tokenizing. This is usually due to an unhandeled character or something similar.
SyntacticalError(Code, &'static str)
A syntactical error occurs when a parser can’t continue parsing the program. This is usually due to an unexpected or missing token, but can also be due to anything that could later lead to a runtime error.
IOError(Code, &'static str)
An IO error occurs when there’s a problem with reading ( input ) or writing ( output ) to a source. This is usually due to the source not existing, being read or write protected, or being corrupted.
InitialisationError(Code, &'static str)
An initialisation error occurs when somethings fails to be initialised. This can have miscellaneous causes, but is usually due to a lack of memory or invalid arguments.