Commit 65f0c2ae by Wenzel Jakob

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

parent 6d252961
...@@ -32,6 +32,7 @@ PRINT_LIST = [ ...@@ -32,6 +32,7 @@ PRINT_LIST = [
CursorKind.CLASS_TEMPLATE, CursorKind.CLASS_TEMPLATE,
CursorKind.FUNCTION_DECL, CursorKind.FUNCTION_DECL,
CursorKind.FUNCTION_TEMPLATE, CursorKind.FUNCTION_TEMPLATE,
CursorKind.CONVERSION_FUNCTION,
CursorKind.CXX_METHOD, CursorKind.CXX_METHOD,
CursorKind.CONSTRUCTOR, CursorKind.CONSTRUCTOR,
CursorKind.FIELD_DECL CursorKind.FIELD_DECL
...@@ -62,6 +63,7 @@ def d(s): ...@@ -62,6 +63,7 @@ def d(s):
def sanitize_name(name): def sanitize_name(name):
global registered_names global registered_names
name = re.sub(r'type-parameter-0-([0-9]+)', r'T\1', name)
for k, v in CPP_OPERATORS.items(): for k, v in CPP_OPERATORS.items():
name = name.replace('operator%s' % k, 'operator_%s' % v) name = name.replace('operator%s' % k, 'operator_%s' % v)
name = re.sub('<.*>', '', name) name = re.sub('<.*>', '', name)
...@@ -150,7 +152,7 @@ def process_comment(comment): ...@@ -150,7 +152,7 @@ def process_comment(comment):
else: else:
result += wrapped + '\n\n' result += wrapped + '\n\n'
wrapper.initial_indent = wrapper.subsequent_indent = '' wrapper.initial_indent = wrapper.subsequent_indent = ''
return result.rstrip() return result.rstrip().lstrip('\n')
def extract(filename, node, prefix, output): def extract(filename, node, prefix, output):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment