Skip to content

Commit aa8c274

Browse files
committed
HACK: revert to old-style Fortran array syntax
1 parent 8989db6 commit aa8c274

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

sphinxfortran/crackfortran.py

+7-4
Original file line numberDiff line numberDiff line change
@@ -651,10 +651,13 @@ def crackline(line, reset=0):
651651
global filepositiontext, currentfilename, neededmodule, expectbegin
652652
global skipblocksuntil, skipemptyends, previous_context, gotnextfile
653653

654-
line = line.replace('class', 'type') # DIRTY HACK
655-
line = line.replace('type is', 'xxx is') # (yet another) DIRTY HACK
656-
if line.strip() in ['interface', 'end interface']:
657-
line = '\n'
654+
if not line.strip().startswith('!'):
655+
line = line.replace('class', 'type') # DIRTY HACK
656+
line = line.replace('type is', 'xxx is') # (yet another) DIRTY HACK
657+
if line.strip() in ['interface', 'end interface']:
658+
line = '\n'
659+
line = line.replace('[', '(/')
660+
line = line.replace(']', '/)')
658661

659662
_, has_semicolon = split_by_unquoted(line, ";")
660663
if has_semicolon and not (f2pyenhancementspattern[0].match(line) or

0 commit comments

Comments
 (0)