feat: Update cyclic functions to be aware of being in a cycle.

Finish the creation of cyclic functions
The last part is to update vars that call into a function in the cycle
This commit is contained in:
microproofs
2023-09-21 17:40:36 -04:00
committed by Kasey
parent 794fc93084
commit ae3053522e
5 changed files with 134 additions and 32 deletions

View File

@@ -52,7 +52,7 @@ pub enum HoistableFunction {
deps: Vec<(FunctionAccessKey, Variant)>,
},
Link((FunctionAccessKey, Variant)),
CyclicLink((FunctionAccessKey, Variant)),
CyclicLink(FunctionAccessKey),
}
#[derive(Clone, Debug, Eq, PartialEq, Hash)]

View File

@@ -21,6 +21,10 @@ impl TreePath {
TreePath { path: vec![] }
}
pub fn is_empty(&self) -> bool {
self.path.is_empty()
}
pub fn push(&mut self, depth: usize, index: usize) {
self.path.push((depth, index));
}