minor mkdoc name sanitation fix

This commit is contained in:
Wenzel Jakob 2016-04-26 00:12:22 +02:00
parent 19dfc50d10
commit d361a57863
1 changed files with 4 additions and 1 deletions

View File

@ -157,7 +157,10 @@ def extract(filename, node, prefix, output):
if node.kind in PRINT_LIST:
comment = d(node.raw_comment) if node.raw_comment is not None else ''
comment = process_comment(comment)
name = sanitize_name(prefix + '_' + d(node.spelling))
sub_prefix = prefix
if len(sub_prefix) > 0:
sub_prefix += '_'
name = sanitize_name(sub_prefix + d(node.spelling))
output.append('\nstatic const char *%s = %sR"doc(%s)doc";' % (name, '\n' if '\n' in comment else '', comment))
num_extracted += 1
return num_extracted