Skip to content

499 avoid exponential loop handling#500

Closed
hiker wants to merge 7 commits into
masterfrom
499_avoid_exponential_loop_handling
Closed

499 avoid exponential loop handling#500
hiker wants to merge 7 commits into
masterfrom
499_avoid_exponential_loop_handling

Conversation

@hiker
Copy link
Copy Markdown
Collaborator

@hiker hiker commented Apr 21, 2026

Fixes the exponential behaviour with number of non-blocked loops in one Fortran unit. This is done by detecting when searching for a blocked loop in e.g.:

      do 10 i=1, 10
 10     a(i) = i

That the statement with label 10 indicates that there is no matching 10 enddo (or continue) statement coming, and therefore abooting earlier.

It cuts down parse time for a socrates file that was not parsed in 40 minutes(!!) down to 7 seconds.

Problem: I don't know how to test this patch. During development, the existing tests have flagged some issues I had, so the code is definitely used, and would trigger a failed test if it is really broken. But I don't really know how to test if it triggers as expected (since the function itself would return None without this patch as well ... just later)

Suggestions welcome

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 21, 2026

Codecov Report

❌ Patch coverage is 92.00000% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 92.21%. Comparing base (a197a85) to head (269153c).

Files with missing lines Patch % Lines
src/fparser/two/C99Preprocessor.py 90.90% 1 Missing ⚠️
src/fparser/two/utils.py 92.85% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #500      +/-   ##
==========================================
- Coverage   92.21%   92.21%   -0.01%     
==========================================
  Files          87       87              
  Lines       13832    13856      +24     
==========================================
+ Hits        12755    12777      +22     
- Misses       1077     1079       +2     

☔ 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.

@hiker
Copy link
Copy Markdown
Collaborator Author

hiker commented Apr 21, 2026

Oops, this was not based on master. Making a new one.

@hiker hiker closed this Apr 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant