Skip to content

Commit 32cd134

Browse files
committed
Recalculate bound dependency upon instantiation
When instancing the CALL class, it will also add the params of the function as `required`, which will allow us, later, to update the LBound / UBound dependency.
1 parent 62f511f commit 32cd134

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

symbols/call.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,19 @@ class SymbolCALL(Symbol):
3333
lineno: source code line where this call was made
3434
"""
3535

36-
def __init__(self, entry, arglist, lineno):
36+
def __init__(self, entry: SymbolFUNCTION, arglist, lineno):
3737
super(SymbolCALL, self).__init__()
3838
assert isinstance(lineno, int)
3939
assert all(isinstance(x, SymbolARGUMENT) for x in arglist)
4040
self.entry = entry
4141
self.args = arglist # Func. call / array access
4242
self.lineno = lineno
4343

44+
if entry.token == 'FUNCTION':
45+
for arg, param in zip(arglist, entry.params): # Sets dependency graph for each argument -> parameter
46+
if arg.value is not None:
47+
arg.value.add_required_symbol(param)
48+
4449
@property
4550
def entry(self):
4651
return self.children[0]

0 commit comments

Comments
 (0)