-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Inconsistent matching of inline calls and derived type member references #384
Comments
To add a further example to this, Daley has found that this behaviour (of matching a |
Fundamentally, until we can resolve the type of e.g. |
In the following code:
both of the OMP calls are parsed as |
I think that's allowed as long as all derived type components are allocatable or have default initialisers. |
Couldn't we simply avoid matching Structure_Constructors? We would still be wrong (as not returning what the standard says it is - now we do the same just the other way around) but the tools that use fparser would have them as Function Calls, which is a reasonable approximation as they behave like them, and we won't be missing actual functions. |
I created #449 to test this. Note that this does not attempt to solve the conflict with PartRef also mentioned in the original comment, only the Structure_Constructor. |
This would be good to have. I've just hit it again in PSyclone/#2769 where I've changed the Fortran backend to automatically add ".0" to reals. |
Yet another edge case, which is most likely not possible to resolve without having procedures in the symbol table. However, I felt it might be useful to document it:
Function calls in expressions and derived type member references are represented inconsistently. One distinction seems to be made based on whether named arguments are used or not.
A little example:
The four calls to
check
in theis_bad = ...
expression are represented as:check(this%val, thr=10)
:check(this%arr(1))
:check(val=this%arr(2))
:check(this%arr(3))
:What should, to my understanding, be a
Function_Reference
, is either represented asStructure_Constructor
(named argument present) orPart_Ref
(no named argument present).Additionally, the reference to
this%val
is represented as aProc_Component_Ref
in the first case, but (correctly?) identified as aData_Ref
in all others.The text was updated successfully, but these errors were encountered: