BUG: Fix crackfortran parsing error when a division occurs within a common block by charris · Pull Request #28633 · numpy/numpy · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 2 additions & 19 deletions numpy/f2py/crackfortran.py
17 changes: 17 additions & 0 deletions numpy/f2py/tests/src/crackfortran/common_with_division.f
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
subroutine common_with_division
integer lmu,lb,lub,lpmin
parameter (lmu=1)
parameter (lb=20)
c crackfortran fails to parse this
c parameter (lub=(lb-1)*lmu+1)
c crackfortran can successfully parse this though
parameter (lub=lb*lmu-lmu+1)
parameter (lpmin=2)

c crackfortran fails to parse this correctly
c common /mortmp/ ctmp((lub*(lub+1)*(lub+1))/lpmin+1)

common /mortmp/ ctmp(lub/lpmin+1)

return
end
6 changes: 5 additions & 1 deletion numpy/f2py/tests/test_crackfortran.py