IO(IOError),
IncompleteReduction(Location),
InfiniteFloat(Location),
- InvalidSingleQuotedCharacter(char),
+ InvalidSingleQuotedCharacter(char, Location),
LexicalError(lexical::Error),
MissingQuote(Location),
NonPrologChar(Location),
pub fn location(&self) -> Option<Location> {
match self {
ParserError::BackQuotedString(location)
+ | ParserError::InvalidSingleQuotedCharacter(_, location)
| ParserError::IncompleteReduction(location)
| ParserError::InfiniteFloat(location)
| ParserError::MissingQuote(location)
| ParserError::ParseBigInt(location)
| ParserError::UnexpectedChar(_, location) => Some(location.clone()),
ParserError::Utf8Error(location) => location.as_ref().cloned(),
- ParserError::IO(_)
- | ParserError::LexicalError(_)
- | ParserError::InvalidSingleQuotedCharacter(_) => None,
+ ParserError::IO(_) | ParserError::LexicalError(_) => None,
}
}
}
}
} else {
- return Err(ParserError::InvalidSingleQuotedCharacter(c));
+ return Err(ParserError::InvalidSingleQuotedCharacter(
+ c,
+ self.location.clone(),
+ ));
}
} else {
match self.get_back_quoted_string() {