feat: SCC analysis (thunk capture WIP)
This commit is contained in:
@@ -14,7 +14,7 @@ use super::super::public as p;
|
||||
use super::Value;
|
||||
|
||||
#[repr(transparent)]
|
||||
#[derive(Constructor, Clone, PartialEq)]
|
||||
#[derive(Constructor, Clone, PartialEq, Debug)]
|
||||
pub struct AttrSet {
|
||||
data: HashMap<EcoString, Value>,
|
||||
}
|
||||
@@ -61,7 +61,7 @@ impl AttrSet {
|
||||
let item = item?;
|
||||
let Some(Value::AttrSet(attrs)) = data.get(&item) else {
|
||||
return Err(Error::EvalError(format!(
|
||||
"{} not found",
|
||||
"attribute {} not found",
|
||||
Symbol::from(item)
|
||||
)));
|
||||
};
|
||||
@@ -73,7 +73,10 @@ impl AttrSet {
|
||||
.ok_or_else(|| Error::EvalError(format!("{} not found", Symbol::from(last))))
|
||||
}
|
||||
|
||||
pub fn has_attr(&self, mut path: impl DoubleEndedIterator<Item = Result<EcoString>>) -> Result<bool> {
|
||||
pub fn has_attr(
|
||||
&self,
|
||||
mut path: impl DoubleEndedIterator<Item = Result<EcoString>>,
|
||||
) -> Result<bool> {
|
||||
let mut data = &self.data;
|
||||
let last = path.nth_back(0).unwrap();
|
||||
for item in path {
|
||||
|
||||
Reference in New Issue
Block a user