-
Notifications
You must be signed in to change notification settings - Fork 30
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
Incorrect parsing of an assignment into a Stmt_Function #171
Comments
I've verified this problem. The following cut down version also returns the assignment as a statement function
Notice, the |
Created branch |
To start off with I've added repr as an option to the fparser2.py script so that I can more easily see the types of objects generated by fparser2. I still need to update the documentation to reflect this addition. |
This issue is indicative of a larger problem, which is that some Fortran parse rules can not be resolved in isolation and need symbol table information. The plan is to turn fparser2 into a 2-phase parser which gets symbols in phase 1 and uses those for context, where required, in phase2. The problem in this issue will be fixed by this change. However, this does not help @sergisiso who is waiting on this fix. What I will do is create a temporary hack branch which removes the statement function match which will hopefully allow @sergisiso to make progress. |
Created branch sergi_sf_hack |
This branch removes the statement function match, adds a minimal example and updates the fparser2 script to output 'repr' for testing. To test ...
You can see that we now have an assignment statement in the execution part. |
For the time being I think it makes sense to move the "hack" onto master. The reason for this is that statement functions are not often used so support for them is unlikely to be missed. |
issue #171. Removal of statement function matching.
pr #200 is on master. Closing this issue. |
When parsing this function from nemolite2d:
The
output(ji,jj) = input(ji,jj)
is parsed as aStmt_Function_Stmt
inside the SpecificationPart, and I believe it should be an assignment on the ExecutionPart.The relevant Fortran rules are:
R1237 stmt-function-stmt is function-name ( [ dummy-arg-name-list ] ) = scalar-expr
C1264 (R1237) The function-name and each dummy-arg-name shall be specified, explicitly or implicitly, to be scalar.
And in this case function-name is specified to be an array.
The text was updated successfully, but these errors were encountered: