Since we now only have a Function, we should only have FunctionCall. The idea is to unify the almost duplicate code that we currently have to have in almost all visitors regarding function/subroutine calls.
Also we will be adding generics/templates, so we want both functions and subroutines to be handled the same way.
The different between SubroutineCall and FunctionCall is that one is a statement and the other is not. How to unify?
One option is to just have FunctionCall, an expr. Then change SubroutineCall to just point to a FunctionCall:
Since we now only have a
Function
, we should only haveFunctionCall
. The idea is to unify the almost duplicate code that we currently have to have in almost all visitors regarding function/subroutine calls.Also we will be adding generics/templates, so we want both functions and subroutines to be handled the same way.
The different between
SubroutineCall
andFunctionCall
is that one is a statement and the other is not. How to unify?One option is to just have
FunctionCall
, anexpr
. Then changeSubroutineCall
to just point to aFunctionCall
:But the extra indirection is a bit unfortunate. Another option is: