mkdoc.py: handle conversion operators and template arguments in function names

This commit is contained in:
Wenzel Jakob 2016-05-01 22:36:09 +02:00
parent 6d2529613a
commit 65f0c2aeb7

View File

@ -32,6 +32,7 @@ PRINT_LIST = [
CursorKind.CLASS_TEMPLATE,
CursorKind.FUNCTION_DECL,
CursorKind.FUNCTION_TEMPLATE,
CursorKind.CONVERSION_FUNCTION,
CursorKind.CXX_METHOD,
CursorKind.CONSTRUCTOR,
CursorKind.FIELD_DECL
@ -62,6 +63,7 @@ def d(s):
def sanitize_name(name):
global registered_names
name = re.sub(r'type-parameter-0-([0-9]+)', r'T\1', name)
for k, v in CPP_OPERATORS.items():
name = name.replace('operator%s' % k, 'operator_%s' % v)
name = re.sub('<.*>', '', name)
@ -150,7 +152,7 @@ def process_comment(comment):
else:
result += wrapped + '\n\n'
wrapper.initial_indent = wrapper.subsequent_indent = ''
return result.rstrip()
return result.rstrip().lstrip('\n')
def extract(filename, node, prefix, output):