use hashbrown::HashMap; use crate::representations::interpreted::ExprInst; use crate::interner::Token; #[derive(Clone)] pub struct Context<'a> { pub symbols: &'a HashMap>>, ExprInst>, pub gas: Option, } impl Context<'_> { pub fn is_stuck(&self, res: Option) -> bool { match (res, self.gas) { (Some(a), Some(b)) => a == b, (None, None) => false, (None, Some(_)) => panic!("gas not tracked despite limit"), (Some(_), None) => panic!("gas tracked without request"), } } } #[derive(Clone)] pub struct Return { pub state: ExprInst, pub gas: Option, pub inert: bool, }