mirror of
https://github.com/pybind/pybind11.git
synced 2025-02-20 15:40:45 +00:00
mkdoc.py: handle conversion operators and template arguments in function names
This commit is contained in:
parent
6d2529613a
commit
65f0c2aeb7
@ -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):
|
||||
|
Loading…
Reference in New Issue
Block a user