Enum conch_parser::parse::ParseError
[−]
[src]
pub enum ParseError<T> { BadFd(SourcePos, SourcePos), BadIdent(String, SourcePos), BadSubst(Token, SourcePos), Unmatched(Token, SourcePos), IncompleteCmd(&'static str, SourcePos, &'static str, SourcePos), Unexpected(Token, SourcePos), UnexpectedEOF, Custom(T), }
The error type which is returned from parsing shell commands.
Variants
BadFd(SourcePos, SourcePos)
Encountered a word that could not be interpreted as a valid file descriptor. Stores the start and end position of the invalid word.
BadIdent(String, SourcePos)
Encountered a Token::Literal
where expecting a Token::Name
.
BadSubst(Token, SourcePos)
Encountered a bad token inside of ${...}
.
Unmatched(Token, SourcePos)
Encountered EOF while looking for a match for the specified token. Stores position of opening token.
IncompleteCmd(&'static str, SourcePos, &'static str, SourcePos)
Did not find a reserved keyword within a command. The first String is the command being parsed, followed by the position of where it starts. Next is the missing keyword followed by the position of where the parse expected to have encountered it.
Unexpected(Token, SourcePos)
Encountered a token not appropriate for the current context.
UnexpectedEOF
Encountered the end of input while expecting additional tokens.
Custom(T)
A custom error returned by the AST builder.
Trait Implementations
impl<T: Debug> Debug for ParseError<T>
[src]
impl<T: Clone> Clone for ParseError<T>
[src]
fn clone(&self) -> ParseError<T>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl<T: PartialEq> PartialEq for ParseError<T>
[src]
fn eq(&self, __arg_0: &ParseError<T>) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &ParseError<T>) -> bool
This method tests for !=
.
impl<T: Eq> Eq for ParseError<T>
[src]
impl<T: Error> Error for ParseError<T>
[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<T: Display> Display for ParseError<T>
[src]
impl<T> From<T> for ParseError<T>
[src]
fn from(err: T) -> Self
Performs the conversion.