Enum fastobo::error::SyntaxError
source · pub enum SyntaxError {
UnexpectedRule {
expected: Rule,
actual: Rule,
},
ParserError {
error: Box<PestError<Rule>>,
},
}
Expand description
A syntax error.
Variants§
UnexpectedRule
An unexpected rule was used in FromPair::from_pair
.
Example
let cache = Cache::new();
let pairs = Lexer::tokenize(Rule::UnquotedString, "hello, world!");
let pair = pairs.unwrap().next().unwrap();
QuotedString::from_pair(pair, &cache).unwrap_err();
ParserError
The underlying parser encountered an error.
Example
QuotedString::from_str("definitely not a quoted string").unwrap_err();
Trait Implementations§
source§impl Debug for SyntaxError
impl Debug for SyntaxError
source§impl Display for SyntaxError
impl Display for SyntaxError
source§impl Error for SyntaxError
impl Error for SyntaxError
source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more
1.0.0 · source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
source§impl From<SyntaxError> for Error
impl From<SyntaxError> for Error
source§fn from(source: SyntaxError) -> Self
fn from(source: SyntaxError) -> Self
Converts to this type from the input type.