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

Function markoutercomma

numpy/f2py/crackfortran.py:877–894  ·  view source on GitHub ↗
(line, comma=',')

Source from the content-addressed store, hash-verified

875
876
877def markoutercomma(line, comma=','):
878 l = ''
879 f = 0
880 before, after = split_by_unquoted(line, comma + '()')
881 l += before
882 while after:
883 if (after[0] == comma) and (f == 0):
884 l += '@' + comma + '@'
885 else:
886 l += after[0]
887 if after[0] == '(':
888 f += 1
889 elif after[0] == ')':
890 f -= 1
891 before, after = split_by_unquoted(after[1:], comma + '()')
892 l += before
893 assert not f, repr((f, line, l))
894 return l
895
896def unmarkouterparen(line):
897 r = line.replace('@(@', '(').replace('@)@', ')')

Callers 9

getinitFunction · 0.85
sign2mapFunction · 0.85
_simplifyargsFunction · 0.85
analyzelineFunction · 0.85
updatevarsFunction · 0.85
cracktypespecFunction · 0.85
analyzecommonFunction · 0.85
analyzevarsFunction · 0.85
determineexprtypeFunction · 0.85

Calls 1

split_by_unquotedFunction · 0.85

Tested by

no test coverage detected