mirror of
https://github.com/neovim/neovim.git
synced 2025-11-12 13:28:54 +00:00
gen_api_vimdoc.py: workaround: attributes of (void) functions
This commit is contained in:
@@ -38,6 +38,10 @@ import subprocess
|
|||||||
|
|
||||||
from xml.dom import minidom
|
from xml.dom import minidom
|
||||||
|
|
||||||
|
if sys.version_info[0] < 3:
|
||||||
|
print("use Python 3")
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
doc_filename = 'api.txt'
|
doc_filename = 'api.txt'
|
||||||
# String used to find the start of the generated part of the doc.
|
# String used to find the start of the generated part of the doc.
|
||||||
section_start_token = '*api-global*'
|
section_start_token = '*api-global*'
|
||||||
@@ -285,14 +289,19 @@ def parse_source_xml(filename):
|
|||||||
parts = return_type.strip('_').split('_')
|
parts = return_type.strip('_').split('_')
|
||||||
return_type = '%s(%s)' % (parts[0], ', '.join(parts[1:]))
|
return_type = '%s(%s)' % (parts[0], ', '.join(parts[1:]))
|
||||||
|
|
||||||
|
name = get_text(get_child(member, 'name'))
|
||||||
|
|
||||||
annotations = get_text(get_child(member, 'argsstring'))
|
annotations = get_text(get_child(member, 'argsstring'))
|
||||||
if annotations and ')' in annotations:
|
if annotations and ')' in annotations:
|
||||||
annotations = annotations.rsplit(')', 1)[-1].strip()
|
annotations = annotations.rsplit(')', 1)[-1].strip()
|
||||||
|
# XXX: (doxygen 1.8.11) 'argsstring' only includes FUNC_ATTR_*
|
||||||
|
# attributes if the function signature is non-void.
|
||||||
|
# Force attributes here for such functions.
|
||||||
|
if name == 'nvim_get_mode' and len(annotations) == 0:
|
||||||
|
annotations += 'FUNC_API_ASYNC'
|
||||||
annotations = filter(None, map(lambda x: annotation_map.get(x),
|
annotations = filter(None, map(lambda x: annotation_map.get(x),
|
||||||
annotations.split()))
|
annotations.split()))
|
||||||
|
|
||||||
name = get_text(get_child(member, 'name'))
|
|
||||||
|
|
||||||
vimtag = '*%s()*' % name
|
vimtag = '*%s()*' % name
|
||||||
args = []
|
args = []
|
||||||
type_length = 0
|
type_length = 0
|
||||||
|
|||||||
Reference in New Issue
Block a user