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),
}
Expand description
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§
Source§impl<T: Clone> Clone for ParseError<T>
impl<T: Clone> Clone for ParseError<T>
Source§fn clone(&self) -> ParseError<T>
fn clone(&self) -> ParseError<T>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more