Skip to content

BUG: Fix crackfortran parsing error when a division occurs within a common block #28633

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 2, 2025

Conversation

charris
Copy link
Member

@charris charris commented Apr 2, 2025

Backport of #28396.

The analyzeline function currently passes over all / characters, presumably assuming they only indicate the name of the common block. However, this means division operations after the common block name are also passed over.
For instance
common /mortmp/ ctmp((lub*(lub+1)*(lub+1))/lpmin+1)
fails to parse correctly.

This pull request attempts to rectify this by counting the number of slashes encountered in the line and only passing over the first two.

  • BUG: Fix crackpython parsing error when a division occurs within a common block

  • Add test for more complicated array sizing expression

  • fix typos

  • Simplify tests to currently supported syntax

  • Use regular expression to find common block name

  • Revert from broken regular expression version to prior version, add comment

  • Add space before inline comment

  • Use regular expression to split line

  • Add missing white space to appease linter

  • More linting fixes

  • Pass maxsplit as a keyword argument

…ommon block (numpy#28396)

* BUG: Fix crackpython parsing error when a division occurs within a common block

* Add test for more complicated array sizing expression

* fix typos

* Simplify tests to currently supported syntax

* Use regular expression to find common block name

* Revert from broken regular expression version to prior version, add comment

* Add space before inline comment

* Use regular expression to split line

* Add missing white space to appease linter

* More linting fixes

* Pass maxsplit as a keyword argument
@charris charris added this to the 2.2.5 release milestone Apr 2, 2025
@charris charris merged commit 9470412 into numpy:maintenance/2.2.x Apr 2, 2025
70 checks passed
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
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy