Skip to content
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

Use the upstream Fortran parser #3160

Merged
merged 3 commits into from May 13, 2022
Merged

Use the upstream Fortran parser #3160

merged 3 commits into from May 13, 2022

Conversation

techee
Copy link
Member

@techee techee commented Apr 12, 2022

To correctly rename anonymous tags the tag renaming function had to be updated for a special case in Fortran - see the commit for more details.

I also updated 2 unit tests which (I believe) contained invalid Fortran code the new parser didn't handle.

@techee
Copy link
Member Author

techee commented Apr 12, 2022

One more thing worth noting here is that previously there were 2 fortran parsers - F77 and FORTRAN. There's just a single after this PR which parses both dialects and TM_PARSER_F77 is set to some dummy value which can be replaced by some new parser (which could be for instance #3157).

@elextr
Copy link
Member

elextr commented Apr 14, 2022

The kind and len attributes in the tests are legal in newer Fortrans, eg 2003, see https://wg5-fortran.org/N1601-N1650/N1601.pdf section 4.5.2. [end language lawyering]

I guess someone had added them to allow newer Fortrans to be parsed. They will need to re-add them upstream.

[Edit: see here ]

@techee
Copy link
Member Author

techee commented Apr 14, 2022

@elextr Thanks for digging this out - I was aware of the commit which however didn't explain exactly what was going on but the specification clarifies it. I'll prepare a patch for the upstream version and update this PR afterwards.

@techee
Copy link
Member Author

techee commented Apr 25, 2022

Done, the change has been upstreamed so I updated the parser and the unit tests.

@techee
Copy link
Member Author

techee commented May 12, 2022

@elextr Anything left here here to be fixed or does it look OK to you?

@elextr
Copy link
Member

elextr commented May 12, 2022

LGB(quick)I, tests pass, some symbols show for random fortran from the interweb.

Update qualified_types.f90 and members.f90 to remove the "kind" and "len"
specifiers after integers. I haven't seen this usage documented anywhere
and the syntax, when used should include braces such as integer(len=5).
The previous Geany Fortran parser used to parse these but since I
don't think it's a valid syntax, I didn't submit the corresponding
patch upstream.

The rest of the tests is mostly added function arguments and different
names for anonymous tags.
@techee techee merged commit 2727068 into geany:master May 13, 2022
@b4n b4n added this to the 1.39/2.0 milestone Apr 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants