New version to work with 'common' statements#3444
Conversation
… martin_common
Codecov Report❌ Patch coverage is ❌ Your project check has failed because you have indirect coverage changes. Learn more about Unexpected Coverage Changes and reasons for indirect coverage changes. Additional details and impacted files@@ Coverage Diff @@
## master #3444 +/- ##
==========================================
- Coverage 99.96% 99.94% -0.02%
==========================================
Files 391 392 +1
Lines 54689 54898 +209
==========================================
+ Hits 54670 54870 +200
- Misses 19 28 +9 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Thanks @schreiberx. Before looking very closely at this, I just want to discuss something: this PR adds the concept of a subroutine my_sub()
common /andy/ b, c
integer :: b, c
integer :: andy
end subroutine my_subcompiles fine. However, the question is whether @sergisiso, @AidanChalk or @hiker think that this sharing of the namespace actually matters? It will require some special handling when e.g. merging symbol tables (e.g. to ignore a clash if one of the symbols is a |
|
We avoided adding this Symbol type the first time for this same reason. And I still think it should not be a symbol, it matches better with the psyir Interface concept. For me: Should be treated similarly to:
|
|
oh, it already works like this: What problem are you trying to solve here @schreiberx ? |
|
Sorry I am catching up slowly, but I agree the solution is @arporter comment here: #3389 (review) |
|
I like the interface idea Sergi: it would then quite naturally work like module USE statements - we'd examine all Symbols and create COMMON declarations for all of the distinct COMMON blocks that they are associated with. |
The alternative approach (another PR) used regular expressions to search for this. It's simply to avoid this. |
|
Thanks @schreiberx as discussed in Teams I would prefer to continue the other branch rather than this one |


This is an alternative version to work with 'common' statements.
Here, common statements are directly supported in the symbol table rather than using workarounds.