Closed arporter closed 3 years ago
I think the problem is that the various arguments are being grouped into a single CodeBlock whereas, in this case, we need separate CodeBlocks.
Aha, this seems the same error that I am getting in NemoLite2D with @rupertford PR #1228 :
call timer_start(itimer0, label = 'Time-stepping'num_repeats = nrepeat)
Oh yes, that's the one. I have a 'fix' - I add a new type of Structure to CodeBlock (ARGUMENT_LIST) and set this if the parent node in the frontend is a Call or a Reference to a RoutineSymbol. I think this will still fail though if we have a function call and haven't resolved the type of the Symbol representing the function (e.g. if it's imported via a wildcard USE).
A better alternative might be to change the frontend so that it doesn't merge CodeBlocks in this context.
If we have some code that results in a CodeBlock in the argument list, e.g.:
Then the PSyIR is:
But the generated code is:
i.e. we're missing the comma separator between the two arguments.