summaryrefslogtreecommitdiff
path: root/numpy/f2py
diff options
context:
space:
mode:
authorCharles Harris <charlesr.harris@gmail.com>2014-10-09 15:03:25 -0600
committerCharles Harris <charlesr.harris@gmail.com>2014-10-09 19:39:07 -0600
commit1d6ef527cc9e63272cf20bdfab0accb40cb12635 (patch)
tree751629936c2e2e98026cdccf0ca60f19897bcd29 /numpy/f2py
parentbbb7c3fbcdc2ddfcf79317661be2b99b1f6617e3 (diff)
downloadnumpy-1d6ef527cc9e63272cf20bdfab0accb40cb12635.tar.gz
BUG: Make f2py work with intent(in out).
Note that Fortran ignores spaces in this case, so that 'in out' is treated as 'inout'. Closes #479.
Diffstat (limited to 'numpy/f2py')
-rwxr-xr-xnumpy/f2py/crackfortran.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/numpy/f2py/crackfortran.py b/numpy/f2py/crackfortran.py
index 893081126..0fde37bcf 100755
--- a/numpy/f2py/crackfortran.py
+++ b/numpy/f2py/crackfortran.py
@@ -1274,7 +1274,7 @@ def markinnerspaces(line):
cb=''
for c in line:
if cb=='\\' and c in ['\\', '\'', '"']:
- l=l+c;
+ l=l+c
cb=c
continue
if f==0 and c in ['\'', '"']: cc=c; cc1={'\'':'"','"':'\''}[c]
@@ -2198,8 +2198,10 @@ def analyzevars(block):
if 'intent' not in vars[n]:
vars[n]['intent']=[]
for c in [x.strip() for x in markoutercomma(intent).split('@,@')]:
- if not c in vars[n]['intent']:
- vars[n]['intent'].append(c)
+ # Remove spaces so that 'in out' becomes 'inout'
+ tmp = c.replace(' ', '')
+ if tmp not in vars[n]['intent']:
+ vars[n]['intent'].append(tmp)
intent=None
if note:
note=note.replace('\\n\\n', '\n\n')
@@ -2220,7 +2222,7 @@ def analyzevars(block):
if 'check' not in vars[n]:
vars[n]['check']=[]
for c in [x.strip() for x in markoutercomma(check).split('@,@')]:
- if not c in vars[n]['check']:
+ if c not in vars[n]['check']:
vars[n]['check'].append(c)
check=None
if dim and 'dimension' not in vars[n]: