use machine-generated PartialEq instance for hashing Constant (#817)
This commit is contained in:
@@ -33,7 +33,7 @@ macro_rules! consume_chars_with {
|
||||
};
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq)]
|
||||
#[derive(Debug, Clone)]
|
||||
pub enum Token {
|
||||
Constant(Constant),
|
||||
Var(Rc<Atom>),
|
||||
@@ -49,6 +49,17 @@ pub enum Token {
|
||||
End,
|
||||
}
|
||||
|
||||
impl Token {
|
||||
#[inline]
|
||||
pub(super) fn is_end(&self) -> bool {
|
||||
if let Token::End = self {
|
||||
true
|
||||
} else {
|
||||
false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub struct Lexer<'a, R: Read> {
|
||||
pub(crate) atom_tbl: TabledData<Atom>,
|
||||
pub(crate) reader: &'a mut ParsingStream<R>,
|
||||
|
||||
Reference in New Issue
Block a user