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

Function analyzebody

numpy/f2py/crackfortran.py:2237–2279  ·  view source on GitHub ↗
(block, args, tab='')

Source from the content-addressed store, hash-verified

2235
2236
2237def analyzebody(block, args, tab=''):
2238 global usermodules, skipfuncs, onlyfuncs, f90modulevars
2239
2240 setmesstext(block)
2241
2242 maybe_private = {
2243 key: value
2244 for key, value in block['vars'].items()
2245 if 'attrspec' not in value or 'public' not in value['attrspec']
2246 }
2247
2248 body = []
2249 for b in block['body']:
2250 b['parent_block'] = block
2251 if b['block'] in ['function', 'subroutine']:
2252 if args is not None and b['name'] not in args:
2253 continue
2254 else:
2255 as_ = b['args']
2256 # Add private members to skipfuncs for gh-23879
2257 if b['name'] in maybe_private.keys():
2258 skipfuncs.append(b['name'])
2259 if b['name'] in skipfuncs:
2260 continue
2261 if onlyfuncs and b['name'] not in onlyfuncs:
2262 continue
2263 b['saved_interface'] = crack2fortrangen(
2264 b, '\n' + ' ' * 6, as_interface=True)
2265
2266 else:
2267 as_ = args
2268 b = postcrack(b, as_, tab=tab + '\t')
2269 if b['block'] in ['interface', 'abstract interface'] and \
2270 not b['body'] and not b.get('implementedby'):
2271 if 'f2pyenhancements' not in b:
2272 continue
2273 if b['block'].replace(' ', '') == 'pythonmodule':
2274 usermodules.append(b)
2275 else:
2276 if b['block'] == 'module':
2277 f90modulevars[b['name']] = b['vars']
2278 body.append(b)
2279 return body
2280
2281
2282def buildimplicitrules(block):

Callers 1

postcrackFunction · 0.85

Calls 6

setmesstextFunction · 0.85
crack2fortrangenFunction · 0.85
postcrackFunction · 0.85
keysMethod · 0.80
replaceMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected