Skip to content

(closes #3392) Store commonblock name inside its interface - #3543

Open
sergisiso wants to merge 1 commit into
masterfrom
3392_store_common_block_name
Open

(closes #3392) Store commonblock name inside its interface#3543
sergisiso wants to merge 1 commit into
masterfrom
3392_store_common_block_name

Conversation

@sergisiso

Copy link
Copy Markdown
Collaborator

This felt as a very natural way to implement the CommonBlocks, I don't know why it wasn't done like this in the first place.

@sergisiso

Copy link
Copy Markdown
Collaborator Author

@arporter @LonelyCat124 This is ready for review, it is the ground work to then address #2554

@sergisiso sergisiso self-assigned this Aug 5, 2026
@codecov

codecov Bot commented Aug 5, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (a74dfdf) to head (2e917f9).
⚠️ Report is 81 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##            master     #3543   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          397       397           
  Lines        55577     55580    +3     
=========================================
+ Hits         55577     55580    +3     

☔ View full report in Codecov by Harness.
📢 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.

@LonelyCat124 LonelyCat124 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sergisiso This mostly makes sense and seems reasonable. I've asked for a couple of things, one is to just test behaviour regarding comments around/in common blocks declaration to check it doesn't also break since it uses hard coded indices.

# now have a common-block interface.
try:
# Loop over every COMMON block defined in this Common_Stmt
for cb_object in node.children[0]:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we've been having regular issues when comments appear on/before blocks we've not tested, can you have a go and see what happens if you have comemnts inline or immediately preceding a codeblock with --keep-comments? Am just increasingly wary of our hard coded node.children[0] code.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also applies to cb_object[0] - probably need to double check in fparser that its always [0].

@@ -2904,10 +2904,9 @@ def _process_data_statements(nodes, psyir_parent):

@staticmethod
def _process_common_blocks(nodes, psyir_parent):

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add type hinting to this since it's being modified.

'''Test we can create an CommonBlockInterface instance and check its
__str__ value
'''Test we can create an CommonBlockInterface instance and
__str__, __eq__, copy, and get its name.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"and tests str, eq, copy and can get its name"?

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.

2 participants