(line, comma=',')
| 868 | |
| 869 | |
| 870 | def markoutercomma(line, comma=','): |
| 871 | l = '' |
| 872 | f = 0 |
| 873 | before, after = split_by_unquoted(line, comma + '()') |
| 874 | l += before |
| 875 | while after: |
| 876 | if (after[0] == comma) and (f == 0): |
| 877 | l += '@' + comma + '@' |
| 878 | else: |
| 879 | l += after[0] |
| 880 | if after[0] == '(': |
| 881 | f += 1 |
| 882 | elif after[0] == ')': |
| 883 | f -= 1 |
| 884 | before, after = split_by_unquoted(after[1:], comma + '()') |
| 885 | l += before |
| 886 | assert not f, repr((f, line, l)) |
| 887 | return l |
| 888 | |
| 889 | def unmarkouterparen(line): |
| 890 | r = line.replace('@(@', '(').replace('@)@', ')') |
no test coverage detected
searching dependent graphs…