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

Function cracktypespec0

numpy/f2py/crackfortran.py:1600–1624  ·  view source on GitHub ↗
(typespec, ll)

Source from the content-addressed store, hash-verified

1598
1599
1600def cracktypespec0(typespec, ll):
1601 selector = None
1602 attr = None
1603 if re.match(r'double\s*complex', typespec, re.I):
1604 typespec = 'double complex'
1605 elif re.match(r'double\s*precision', typespec, re.I):
1606 typespec = 'double precision'
1607 else:
1608 typespec = typespec.strip().lower()
1609 m1 = selectpattern.match(markouterparen(ll))
1610 if not m1:
1611 outmess(
1612 'cracktypespec0: no kind/char_selector pattern found for line.\n')
1613 return
1614 d = m1.groupdict()
1615 for k in list(d.keys()):
1616 d[k] = unmarkouterparen(d[k])
1617 if typespec in ['complex', 'integer', 'logical', 'real', 'character', 'type']:
1618 selector = d['this']
1619 ll = d['after']
1620 i = ll.find('::')
1621 if i >= 0:
1622 attr = ll[:i].strip()
1623 ll = ll[i + 2:]
1624 return typespec, selector, attr, ll
1625#####
1626namepattern = re.compile(r'\s*(?P<name>\b\w+\b)\s*(?P<after>.*)\s*\Z', re.I)
1627kindselector = re.compile(

Callers 2

analyzelineFunction · 0.85
analyzevarsFunction · 0.85

Calls 7

markouterparenFunction · 0.85
unmarkouterparenFunction · 0.85
lowerMethod · 0.80
stripMethod · 0.80
keysMethod · 0.80
findMethod · 0.80
outmessFunction · 0.70

Tested by

no test coverage detected