@@ -115,17 +115,18 @@ def check_call_arguments(lineno, id_, args):
115115 if param .byref :
116116 from symbols .var import SymbolVAR
117117 if not isinstance (arg .value , SymbolVAR ):
118- syntax_error (lineno , "Expected a variable name, not an "
119- "expression (parameter By Reference)" )
118+ syntax_error (lineno , "Expected a variable name, not an expression (parameter By Reference)" )
120119 return False
121120
122121 if arg .class_ not in (CLASS .var , CLASS .array ):
123- syntax_error (lineno , "Expected a variable or array name "
124- "(parameter By Reference)" )
122+ syntax_error (lineno , "Expected a variable or array name (parameter By Reference)" )
125123 return False
126124
127125 arg .byref = True
128126
127+ if arg .value is not None :
128+ arg .value .add_required_symbol (param )
129+
129130 if entry .forwarded : # The function / sub was DECLARED but not implemented
130131 syntax_error (lineno , "%s '%s' declared but not implemented" % (CLASS .to_string (entry .class_ ), entry .name ))
131132 return False
@@ -139,7 +140,7 @@ def check_pending_calls():
139140 """
140141 result = True
141142
142- # Check for functions defined after calls (parametres , etc)
143+ # Check for functions defined after calls (parameters , etc)
143144 for id_ , params , lineno in global_ .FUNCTION_CALLS :
144145 result = result and check_call_arguments (lineno , id_ , params )
145146
0 commit comments