'Extract table-level comments and keywords for IPAC table.  See:
http://irsa.ipac.caltech.edu/applications/DDGEN/Doc/ipac_tbl.html#kw'

def update_meta(self, lines, meta):

    def process_keyword_value(val):
        '\n                                                Take    a    string    value    and    convert    to    float,    int    or    str,    and    strip    quotes\n                                                as    needed.\n                                                '
        val = val.strip()
        try:
            val = int(val)
        except Exception:
            try:
                val = float(val)
            except Exception:
                for quote in ('"', "'"):
                    if (val.startswith(quote) and val.endswith(quote)):
                        val = val[1:(-1)]
                        break
        return val
    table_meta = meta['table']
    table_meta['comments'] = []
    table_meta['keywords'] = OrderedDict()
    keywords = table_meta['keywords']
    re_keyword = re.compile('\\\\(?P<name>    \\w+)\\s*    =    (?P<value>    .+)    $', re.VERBOSE)
    for line in lines:
        if (not line.startswith('\\')):
            break
        m = re_keyword.match(line)
        if m:
            name = m.group('name')
            val = process_keyword_value(m.group('value'))
            if ((name in keywords) and isinstance(val, six.string_types)):
                prev_val = keywords[name]['value']
                if isinstance(prev_val, six.string_types):
                    val = (prev_val + val)
            keywords[name] = {'value': val}
        elif line.startswith('\\    '):
            val = line[2:].strip()
            if val:
                table_meta['comments'].append(val)
