Enum atoms::ParseError
[−]
[src]
pub enum ParseError { EndOfFile(usize, usize), TrailingGarbage(usize, usize), ClosingParen(usize, usize), NoExtensions(usize, usize), ConsWithoutRight(usize, usize), ConsWithoutClose(usize, usize), StringLiteral(usize, usize), EmptySymbol(usize, usize), SymbolEncode(usize, usize), BufferError(usize, usize, Error), }
Error that occurs when parsing s-expression.
All forms of this error have the line and column the error occured on stored in the first two members respectively.
Variants
EndOfFile(usize, usize)
Unexpected end of file or stream
This occurs when no more characters can be read from the input stream.
TrailingGarbage(usize, usize)
Trailing characters after end of expression
This error is raised when trying to parseinput as a single expression and more characters are available after a full expression has been parsed. Comments after the expression do not cause this error.
ClosingParen(usize, usize)
Unexpected closing paren
A closing paren was found as the first character of an expression.
NoExtensions(usize, usize)
Extensions not in use
An extension expression was used where an extension type has not been provided.
ConsWithoutRight(usize, usize)
Cons pair without right element
A cons pair was closed before a right side was declared,
for example (a . )
.
ConsWithoutClose(usize, usize)
Cons pair not closed after right expression
A cons pair was not closed after the right side was declared,
for example (a . b c)
.
StringLiteral(usize, usize)
An error occured when trying to parse a string literal.
This is caused when the parser is unable to properly unescape a string literal.
EmptySymbol(usize, usize)
A symbol without any length was used.
This probably caused by a quote not being attached to an expression,
for example ( ` , or ' )
SymbolEncode(usize, usize)
Symbol could not be encoded
This error is produced when a the type the represents symbols is unable to encode the given symbol.
BufferError(usize, usize, Error)
Error occured when trying to buffer text from input.
Methods
impl ParseError
[src]
fn position(&self) -> (usize, usize)
Get the location that an error occured on
Gets the location in the form of (line, column)
.
fn line(&self) -> usize
Get the line of input that the error occured on.
fn column(&self) -> usize
Get the column on the line of input that the error occured on.
Trait Implementations
impl Error for ParseError
[src]
fn description(&self) -> &str
A short description of the error. Read more
fn cause(&self) -> Option<&Error>
The lower-level cause of this error, if any. Read more
impl Display for ParseError
[src]
fn fmt(&self, f: &mut Formatter) -> Result<(), Error>
Formats the value using the given formatter. Read more