mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
C, move info-fields from all objects to just function and macro
This commit is contained in:
parent
063dcfd9ec
commit
dd53cd2f8c
@ -3130,18 +3130,6 @@ class CObject(ObjectDescription[ASTDeclaration]):
|
||||
Description of a C language object.
|
||||
"""
|
||||
|
||||
doc_field_types = [
|
||||
TypedField('parameter', label=_('Parameters'),
|
||||
names=('param', 'parameter', 'arg', 'argument'),
|
||||
typerolename='expr', typenames=('type',)),
|
||||
GroupedField('retval', label=_('Return values'),
|
||||
names=('retvals', 'retval')),
|
||||
Field('returnvalue', label=_('Returns'), has_arg=False,
|
||||
names=('returns', 'return')),
|
||||
Field('returntype', label=_('Return type'), has_arg=False,
|
||||
names=('rtype',)),
|
||||
]
|
||||
|
||||
option_spec: OptionSpec = {
|
||||
'noindexentry': directives.flag,
|
||||
}
|
||||
@ -3344,13 +3332,30 @@ class CMemberObject(CObject):
|
||||
return self.objtype
|
||||
|
||||
|
||||
_function_doc_field_types = [
|
||||
TypedField('parameter', label=_('Parameters'),
|
||||
names=('param', 'parameter', 'arg', 'argument'),
|
||||
typerolename='expr', typenames=('type',)),
|
||||
GroupedField('retval', label=_('Return values'),
|
||||
names=('retvals', 'retval')),
|
||||
Field('returnvalue', label=_('Returns'), has_arg=False,
|
||||
names=('returns', 'return')),
|
||||
Field('returntype', label=_('Return type'), has_arg=False,
|
||||
names=('rtype',)),
|
||||
]
|
||||
|
||||
|
||||
class CFunctionObject(CObject):
|
||||
object_type = 'function'
|
||||
|
||||
doc_field_types = _function_doc_field_types.copy()
|
||||
|
||||
|
||||
class CMacroObject(CObject):
|
||||
object_type = 'macro'
|
||||
|
||||
doc_field_types = _function_doc_field_types.copy()
|
||||
|
||||
|
||||
class CStructObject(CObject):
|
||||
object_type = 'struct'
|
||||
|
Loading…
Reference in New Issue
Block a user