Detect cyclic dependencies for calculations
MartijnR opened this issue · comments
Martijn van de Rijdt commented
E.g.:
- node a has calculation b + 1
- node b has calculation a + 1
Or:
- node a has calculation b + 1
- node b has calculation c + 1
- node c has calculation a + 1
Suggested implementation:
- iterate through all calculation expressions to build a map of all calculation nodes with the nodes they reference (using xform._extractNodeReferences).
- then, for each calculation, do a recursive check of all dependent nodes (and their dependencies etc)
- check if any of the dependencies in 2 is the node itself