We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
expected_scope_depth
1 parent 439e862 commit 441ab02Copy full SHA for 441ab02
src/utils.jl
@@ -639,6 +639,23 @@ function check_scope_depth(scope, depth)
639
end
640
641
642
+"""
643
+ $(TYPEDSIGNATURES)
644
+
645
+Return the expected depth of the given `SymScope` from the root system.
646
647
+function expected_scope_depth(scope)
648
+ if scope isa LocalScope
649
+ return 0
650
+ elseif scope isa ParentScope
651
+ return expected_scope_depth(scope.parent) + 1
652
+ elseif scope isa DelayParentScope
653
+ return expected_scope_depth(scope.parent) + scope.N + 1
654
+ elseif scope isa GlobalScope
655
+ return -1
656
+ end
657
+end
658
659
"""
660
Find all the symbolic constants of some equations or terms and return them as a vector.
661
0 commit comments