Skip to content

(Closes #2202) Update the generation of Fortran declarations to observe dependencies#3344

Draft
arporter wants to merge 14 commits intomasterfrom
2202_decln_ordering
Draft

(Closes #2202) Update the generation of Fortran declarations to observe dependencies#3344
arporter wants to merge 14 commits intomasterfrom
2202_decln_ordering

Conversation

@arporter
Copy link
Copy Markdown
Member

@arporter arporter commented Feb 23, 2026

This is a relatively simple PR - it takes the inter-dependence handling out of _gen_param_decls and puts it into gen_decls. This also then means we can delete _gen_param_decls. I've added tests for the various tricky cases described in the original Issue and they all pass now :-)

@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 23, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.96%. Comparing base (59b71f5) to head (1bd9004).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #3344   +/-   ##
=======================================
  Coverage   99.96%   99.96%           
=======================================
  Files         389      389           
  Lines       54598    54594    -4     
=======================================
- Hits        54579    54575    -4     
  Misses         19       19           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@arporter
Copy link
Copy Markdown
Member Author

The NEMO ITs failed because of character variables:

Symbol Table of Container 'test_mod':
-------------------------------------
DataSymbol:
  cdwmo: DataSymbol<UnsupportedFortranType('CHARACTER(LEN = ilenwmo), DIMENSION(:), POINTER, PUBLIC :: cdwmo'), Unknown>
  ilenwmo: DataSymbol<Scalar<INTEGER, UNDEFINED>, Static, initial_value=Literal[value:'58', Scalar<INTEGER, UNDEFINED>], constant=True>

(Pdb) cdwmo = table.lookup("cdwmo")
(Pdb) cdwmo.get_all_accessed_symbols()
set()
(Pdb) cdwmo.datatype.declaration
'CHARACTER(LEN = ilenwmo), DIMENSION(:), POINTER, PUBLIC :: cdwmo'

I was proceeding to try and do something with the parse tree in UnsupportedFortranType but actually, it would probably be better to work on populating the partial_datatype in this case.

@arporter arporter marked this pull request as draft February 24, 2026 09:05
@arporter arporter added the Blocked An issue/PR that is blocked by one or more issues/PRs. label Feb 25, 2026
@arporter
Copy link
Copy Markdown
Member Author

Marking this as blocked for the moment because I want to investigate adding support for a CharacterType with a length property.

@arporter arporter removed the Blocked An issue/PR that is blocked by one or more issues/PRs. label Apr 29, 2026
@arporter
Copy link
Copy Markdown
Member Author

Although things are now better, complex types are still a problem - I've added a (failing) test which demonstrates this.

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.

1 participant