Skip to content

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

Draft
arporter wants to merge 8 commits intomasterfrom
2202_decln_ordering
Draft

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

Conversation

@arporter
Copy link
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

codecov bot commented Feb 23, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.95%. Comparing base (214ae5a) to head (72f247e).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3344      +/-   ##
==========================================
- Coverage   99.95%   99.95%   -0.01%     
==========================================
  Files         384      384              
  Lines       54214    54205       -9     
==========================================
- Hits        54192    54183       -9     
  Misses         22       22              

☔ 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
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
Member Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Blocked An issue/PR that is blocked by one or more issues/PRs. bug enhancement in progress

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant