[Numpy-svn] r3261 - trunk/numpy/f2py

numpy-svn at scipy.org numpy-svn at scipy.org
Thu Oct 5 11:59:20 CDT 2006


Author: pearu
Date: 2006-10-05 11:59:15 -0500 (Thu, 05 Oct 2006)
New Revision: 3261

Modified:
   trunk/numpy/f2py/crackfortran.py
Log:
Bug fix for DATA statement with components containing subexpressions.

Modified: trunk/numpy/f2py/crackfortran.py
===================================================================
--- trunk/numpy/f2py/crackfortran.py	2006-10-05 16:44:52 UTC (rev 3260)
+++ trunk/numpy/f2py/crackfortran.py	2006-10-05 16:59:15 UTC (rev 3261)
@@ -999,10 +999,13 @@
             groupcache[groupcounter]['implicit']=impl
     elif case=='data':
         ll=[]
-        dl='';il='';f=0;fc=1
+        dl='';il='';f=0;fc=1;inp=0
         for c in m.group('after'):
-            if c=="'": fc=not fc
-            if c=='/' and fc: f=f+1;continue
+            if not inp:
+                if c=="'": fc=not fc
+                if c=='/' and fc: f=f+1;continue
+            if c=='(': inp = inp + 1
+            elif c==')': inp = inp - 1
             if f==0: dl=dl+c
             elif f==1: il=il+c
             elif f==2:



More information about the Numpy-svn mailing list