use super::*;
use crate::reader::Offset;
use indexmap::IndexMap;
#[derive(Debug)]
pub(in crate::compiler) struct ImlParselet {
pub offset: Option<Offset>, pub consuming: bool, pub severity: u8, pub name: Option<String>, pub constants: IndexMap<String, ImlValue>, pub signature: IndexMap<String, ImlValue>, pub locals: usize, pub begin: ImlOp, pub end: ImlOp, pub body: ImlOp, }
impl ImlParselet {
pub fn id(&self) -> usize {
self as *const ImlParselet as usize
}
}
impl std::cmp::PartialEq for ImlParselet {
fn eq(&self, other: &Self) -> bool {
self.id() == other.id()
}
}
impl Eq for ImlParselet {}
impl std::hash::Hash for ImlParselet {
fn hash<H: std::hash::Hasher>(&self, state: &mut H) {
self.id().hash(state);
}
}
impl std::cmp::PartialOrd for ImlParselet {
fn partial_cmp(&self, other: &Self) -> Option<std::cmp::Ordering> {
self.id().partial_cmp(&other.id())
}
}