mirror of
https://github.com/pybind/pybind11.git
synced 2024-11-22 13:15:12 +00:00
Use a file-local constant for non-prefixing nodes.
This commit is contained in:
parent
2c8c5c4ed3
commit
e0b8bbbce9
6
tools/mkdoc.py
Normal file → Executable file
6
tools/mkdoc.py
Normal file → Executable file
@ -41,6 +41,10 @@ PRINT_LIST = [
|
||||
CursorKind.FIELD_DECL
|
||||
]
|
||||
|
||||
PREFIX_BLACKLIST = [
|
||||
CursorKind.TRANSLATION_UNIT
|
||||
]
|
||||
|
||||
CPP_OPERATORS = {
|
||||
'<=': 'le', '>=': 'ge', '==': 'eq', '!=': 'ne', '[]': 'array',
|
||||
'+=': 'iadd', '-=': 'isub', '*=': 'imul', '/=': 'idiv', '%=':
|
||||
@ -192,7 +196,7 @@ def extract(filename, node, prefix, output):
|
||||
return 0
|
||||
if node.kind in RECURSE_LIST:
|
||||
sub_prefix = prefix
|
||||
if node.kind != CursorKind.TRANSLATION_UNIT:
|
||||
if node.kind not in PREFIX_BLACKLIST:
|
||||
if len(sub_prefix) > 0:
|
||||
sub_prefix += '_'
|
||||
sub_prefix += d(node.spelling)
|
||||
|
Loading…
Reference in New Issue
Block a user