Returns a docco section for the given enum.

    :Parameters:
      enum
        Parsed IDL enum dict. Keys: 'comment', 'name', 'values'

def parse_enum(enum):
    """
    Returns a docco section for the given enum.

    :Parameters:
      enum
        Parsed IDL enum dict. Keys: 'comment', 'name', 'values'
    """
    docs = enum['comment']
    code = '<span class="k">enum</span> <span class="gs">%s</span> {\n' % enum['name']
    for v in enum["values"]:
        if v['comment']:
            for line in v['comment'].split("\n"):
                code += '    <span class="c1">// %s</span>\n' % line
        code += '    <span class="nv">%s</span>\n' % v['value']
    code += "}"

    return to_section(docs, code)