Commit e0b8bbbc by Dan Committed by Wenzel Jakob

Use a file-local constant for non-prefixing nodes.

parent 2c8c5c4e
...@@ -41,6 +41,10 @@ PRINT_LIST = [ ...@@ -41,6 +41,10 @@ PRINT_LIST = [
CursorKind.FIELD_DECL CursorKind.FIELD_DECL
] ]
PREFIX_BLACKLIST = [
CursorKind.TRANSLATION_UNIT
]
CPP_OPERATORS = { CPP_OPERATORS = {
'<=': 'le', '>=': 'ge', '==': 'eq', '!=': 'ne', '[]': 'array', '<=': 'le', '>=': 'ge', '==': 'eq', '!=': 'ne', '[]': 'array',
'+=': 'iadd', '-=': 'isub', '*=': 'imul', '/=': 'idiv', '%=': '+=': 'iadd', '-=': 'isub', '*=': 'imul', '/=': 'idiv', '%=':
...@@ -192,7 +196,7 @@ def extract(filename, node, prefix, output): ...@@ -192,7 +196,7 @@ def extract(filename, node, prefix, output):
return 0 return 0
if node.kind in RECURSE_LIST: if node.kind in RECURSE_LIST:
sub_prefix = prefix sub_prefix = prefix
if node.kind != CursorKind.TRANSLATION_UNIT: if node.kind not in PREFIX_BLACKLIST:
if len(sub_prefix) > 0: if len(sub_prefix) > 0:
sub_prefix += '_' sub_prefix += '_'
sub_prefix += d(node.spelling) sub_prefix += d(node.spelling)
......
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