(line, comma=',')
| 875 | |
| 876 | |
| 877 | def 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 | |
| 896 | def unmarkouterparen(line): |
| 897 | r = line.replace('@(@', '(').replace('@)@', ')') |
no test coverage detected