Parses the COBOL
     - converts the COBOL line into a dictionary containing the information
     - parses the pic information into type, length, precision
     - ~~handles redefines~~ -> our implementation does not do that anymore
       because we want to display item that was redefined.

def parse_cobol(lines):
    """
    Parses the COBOL
     - converts the COBOL line into a dictionary containing the information
     - parses the pic information into type, length, precision
     - ~~handles redefines~~ -> our implementation does not do that anymore
       because we want to display item that was redefined.
    """
    output = []

    intify = ["level", "occurs"]

    # All in 1 line now, let's parse
    for row in lines:
        match = CobolPatterns.row_pattern.match(row.strip())

        if not match:
            _logger().warning("Found unmatched row %s" % row.strip())
            continue

        match = match.groupdict()

        for i in intify:
            match[i] = int(match[i]) if match[i] is not None else None

        if match['pic'] is not None:
            match['pic_info'] = parse_pic_string(match['pic'])

        output.append(match)
    return output