diff --git a/src/pyft/statements.py b/src/pyft/statements.py index 312e629..f89fce3 100644 --- a/src/pyft/statements.py +++ b/src/pyft/statements.py @@ -719,7 +719,7 @@ def setPRESENTby(node, var, val): mainScope.addArrayParenthesesInNode(callStmt) # Add explcit bounds - self.addExplicitArrayBounds(node=callStmt, scope=mainScope) + mainScope.addExplicitArrayBounds(node=callStmt) # Detect if subroutine is called on arrays arrayRincallStmt = callStmt.findall('.//{*}array-R') diff --git a/src/pyft/variables.py b/src/pyft/variables.py index 9405fc6..e444c66 100644 --- a/src/pyft/variables.py +++ b/src/pyft/variables.py @@ -682,26 +682,15 @@ def removeUnusedLocalVar(self, excludeList=None, simplify=False): self.removeVarIfUnused(allVar, excludeDummy=True, excludeModule=True, simplify=simplify) @debugDecor - def addExplicitArrayBounds(self, node=None, scope=None): + def addExplicitArrayBounds(self, node=None): """ Replace ':' by explicit arrays bounds. :param node: xml node in which ':' must be replaced (None to replace everywhere) - :param scope: scope - If node is not None, scopePath can be None (and the scope path - will be guessed) or must correspond to the node. - If node is None, scopePath can be None to search everywhere or be defined - to restrain search to this scope or list of scopes. """ if node is None: - if scope is None: - nodes = [(sc, sc) for sc in self.getScopes(excludeContains=True)] - else: - nodes = [(sc, sc) for sc in scope.getScopes(excludeContains=True)] + nodes = [(scope, scope) for scope in self.getScopes(excludeContains=True)] else: - if scope is None: - nodes = [(self.getParentScopeNode(node), node)] - else: - nodes = [(scope, node)] + nodes = [(self, node)] for (scope, childNode) in nodes: for parent4 in [parent4 for parent4