MCPcopy Create free account
hub / github.com/numpy/numpy / postcrack2

Function postcrack2

numpy/f2py/crackfortran.py:2032–2061  ·  view source on GitHub ↗
(block, tab='', param_map=None)

Source from the content-addressed store, hash-verified

2030
2031
2032def postcrack2(block, tab='', param_map=None):
2033 global f90modulevars
2034
2035 if not f90modulevars:
2036 return block
2037 if isinstance(block, list):
2038 ret = [postcrack2(g, tab=tab + '\t', param_map=param_map)
2039 for g in block]
2040 return ret
2041 setmesstext(block)
2042 outmess('%sBlock: %s\n' % (tab, block['name']), 0)
2043
2044 if param_map is None:
2045 param_map = get_useparameters(block)
2046
2047 if param_map is not None and 'vars' in block:
2048 vars = block['vars']
2049 for n in list(vars.keys()):
2050 var = vars[n]
2051 if 'kindselector' in var:
2052 kind = var['kindselector']
2053 if 'kind' in kind:
2054 val = kind['kind']
2055 if val in param_map:
2056 kind['kind'] = param_map[val]
2057 new_body = [postcrack2(b, tab=tab + '\t', param_map=param_map)
2058 for b in block['body']]
2059 block['body'] = new_body
2060
2061 return block
2062
2063
2064def postcrack(block, args=None, tab=''):

Callers 1

crackfortranFunction · 0.85

Calls 4

setmesstextFunction · 0.85
get_useparametersFunction · 0.85
keysMethod · 0.80
outmessFunction · 0.70

Tested by

no test coverage detected