Closed arporter closed 5 years ago
I tried your statement with my implementation of IfBlock on PR #347 and I get:
If[was_elseif:False]
Reference[name:'ln_ctl']
CodeBlock[[<class 'fparser.two.Fortran2003.Call_Stmt'>]]
It is what I am expecting (besides that I am still not sure if a single statement body should have an Schedule with just one child or not). I think the problem is that it is not documented what IfBlock contains and I didn't look properly how you were using them on Nemo.
I will document all that on the PR: the first child is the condition, second the body (and these could be easily accessible with the properties self.condition and self.ifbody). Would that be good for the nemo API?
Yes, that looks good to me.
When constructing the PSyIR for the following Fortran:
the resulting representation doesn't look correct:
I would expect the
BinaryOperation
part to be contained within theIf[]
, not a child of it. I suspect this is my fault as when I first put in support for If conditions I was thinking only about if-then-else blocks.