diff options
Diffstat (limited to 'numpy/f2py/crackfortran.py')
-rwxr-xr-x | numpy/f2py/crackfortran.py | 45 |
1 files changed, 40 insertions, 5 deletions
diff --git a/numpy/f2py/crackfortran.py b/numpy/f2py/crackfortran.py index d0d8aa8fa..893081126 100755 --- a/numpy/f2py/crackfortran.py +++ b/numpy/f2py/crackfortran.py @@ -166,12 +166,8 @@ skipemptyends=0 # for old F77 programs without 'program' statement ignorecontains=1 dolowercase=1 debug=[] -## do_analyze = 1 - -###### global variables - -## use reload(crackfortran) to reset these variables +# Global variables groupcounter=0 grouplist={groupcounter:[]} neededmodule=-1 @@ -188,6 +184,45 @@ onlyfuncs=[] include_paths=[] previous_context = None + +def reset_global_f2py_vars(): + global groupcounter, grouplist, neededmodule, expectbegin, \ + skipblocksuntil, usermodules, f90modulevars, gotnextfile, \ + filepositiontext, currentfilename, skipfunctions, skipfuncs, \ + onlyfuncs, include_paths, previous_context, \ + strictf77, sourcecodeform, quiet, verbose, tabchar, pyffilename, \ + f77modulename, skipemptyends, ignorecontains, dolowercase, debug + + # flags + strictf77 = 1 + sourcecodeform = 'fix' + quiet = 0 + verbose = 1 + tabchar = 4*' ' + pyffilename = '' + f77modulename = '' + skipemptyends = 0 + ignorecontains = 1 + dolowercase = 1 + debug = [] + # variables + groupcounter = 0 + grouplist = {groupcounter:[]} + neededmodule =-1 + expectbegin = 1 + skipblocksuntil = -1 + usermodules = [] + f90modulevars = {} + gotnextfile = 1 + filepositiontext = '' + currentfilename = '' + skipfunctions = [] + skipfuncs = [] + onlyfuncs = [] + include_paths = [] + previous_context = None + + ###### Some helper functions def show(o,f=0):pprint.pprint(o) errmess=sys.stderr.write |