'Given a column span underline, return a list of (begin, end) pairs.'

def parse_columns(self, line, offset):

    cols = []
    end = 0
    while 1:
        begin = line.find('-', end)
        end = line.find('    ', begin)
        if (begin < 0):
            break
        if (end < 0):
            end = len(line)
        cols.append((begin, end))
    if self.columns:
        if (cols[(-1)][1] != self.border_end):
            raise TableMarkupError(('Column    span    incomplete    at    line    offset    %s.' % offset))
        cols[(-1)] = (cols[(-1)][0], self.columns[(-1)][1])
    return cols
