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

Function removespaces

numpy/f2py/crackfortran.py:1639–1651  ·  view source on GitHub ↗
(expr)

Source from the content-addressed store, hash-verified

1637
1638
1639def removespaces(expr):
1640 expr = expr.strip()
1641 if len(expr) <= 1:
1642 return expr
1643 expr2 = expr[0]
1644 for i in range(1, len(expr) - 1):
1645 if (expr[i] == ' ' and
1646 ((expr[i + 1] in "()[]{}=+-/* ") or
1647 (expr[i - 1] in "()[]{}=+-/* "))):
1648 continue
1649 expr2 = expr2 + expr[i]
1650 expr2 = expr2 + expr[-1]
1651 return expr2
1652
1653
1654def markinnerspaces(line):

Callers 1

updatevarsFunction · 0.85

Calls 1

stripMethod · 0.80

Tested by

no test coverage detected