Commits

Anonymous committed e6293ba

Remove the opcode directive.

Comments (0)

Files changed (2)

doc/markup/desc.rst

 
    .. versionadded:: 0.4
    
-.. directive:: .. opcode:: name
-
-   Describes a Python bytecode instruction (this is not very useful for projects
-   other than Python itself).
-
 .. directive:: .. cmdoption:: name args, name args, ...
 
    Describes a command line option or switch.  Option argument names should be

sphinx/directives/desc.py

             return '%s (%s.%s attribute)' % (attrname, module, clsname)
         else:
             return '%s (%s attribute)' % (attrname, clsname)
-    elif desctype == 'opcode':
-        return '%s (opcode)' % name
     elif desctype == 'cfunction':
         return '%s (C function)' % name
     elif desctype == 'cmember':
     return name
 
 
-opcode_sig_re = re.compile(r'(\w+(?:\+\d)?)\s*\((.*)\)')
-
-def parse_opcode_signature(signode, sig):
-    """Transform an opcode signature into RST nodes."""
-    m = opcode_sig_re.match(sig)
-    if m is None:
-        raise ValueError
-    opname, arglist = m.groups()
-    signode += addnodes.desc_name(opname, opname)
-    paramlist = addnodes.desc_parameterlist()
-    signode += paramlist
-    paramlist += addnodes.desc_parameter(arglist, arglist)
-    return opname.strip()
-
-
 option_desc_re = re.compile(
     r'(/|-|--)([-_a-zA-Z0-9]+)(\s*.*?)(?=,\s+(?:/|-|--)|$)')
 
                 name, clsname = parse_py_signature(signode, sig, desctype, module, env)
             elif desctype in ('cfunction', 'cmember', 'cmacro', 'ctype', 'cvar'):
                 name = parse_c_signature(signode, sig, desctype)
-            elif desctype == 'opcode':
-                name = parse_opcode_signature(signode, sig)
             elif desctype == 'cmdoption':
                 optname = parse_option_desc(signode, sig)
                 if not noindex:
     'cmacro',
     'ctype',
     'cvar',
-    # the odd one
-    'opcode',
     # for command line options
     'cmdoption',
     # the generic one