Skip to content

(Closes #3446) Update to fix issues with codeblocks and routine names when comments exist.#3456

Open
LonelyCat124 wants to merge 4 commits into
masterfrom
3446_fix_routine_update_symtab
Open

(Closes #3446) Update to fix issues with codeblocks and routine names when comments exist.#3456
LonelyCat124 wants to merge 4 commits into
masterfrom
3446_fix_routine_update_symtab

Conversation

@LonelyCat124

Copy link
Copy Markdown
Collaborator

I tested this with the original file @schreiberx gave me also and it works now.
The change is just to use walk(...) instead of relying on the fparser structure.

@codecov

codecov Bot commented Jun 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (2d08da6) to head (a4aed8b).

Additional details and impacted files
@@            Coverage Diff            @@
##            master     #3456   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          395       395           
  Lines        55199     55200    +1     
=========================================
+ Hits         55199     55200    +1     

☔ 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

Copy link
Copy Markdown
Collaborator Author

@sergisiso @arporter This is ready for a first look.

@arporter arporter left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks @LonelyCat124. I think we just need to allow for Functions too and then this is probably good to go (I'll do the ITs next time around).

Comment thread src/psyclone/psyir/nodes/routine.py Outdated
# Have to walk to find the subroutine_stmt as
# comments can appear before the subroutine stmt.
subroutine_stmt = walk(routine,
Fortran2003.Subroutine_Stmt)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I see routines can contain subroutines or functions. Does this walk also need to be extended to allow for functions?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Ah yeah, my mistake, will fix.


contains

! This routine will be a codeblock.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please could you extend this test/add a new one that also checks when we have a Function.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Repeated the test with a function.

@LonelyCat124

Copy link
Copy Markdown
Collaborator Author

@arporter Ready for another look.

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