diff options
author | Kjell Ahlstedt <kjell.ahlstedt@bredband.net> | 2015-06-04 16:03:45 +0200 |
---|---|---|
committer | Kjell Ahlstedt <kjell.ahlstedt@bredband.net> | 2015-06-04 16:03:45 +0200 |
commit | 7f6feb8bbbe2b233248b6916253473a62ee6eed4 (patch) | |
tree | 5efa7969012bdb1edad80be4ae05c48df92cc82d | |
parent | ffd766254a22aaeae364c011f85fb6ee90900e17 (diff) | |
download | glibmm-7f6feb8bbbe2b233248b6916253473a62ee6eed4.tar.gz |
docextract_to_xml.py: Minor fix in internal data
* tools/defs_gen/docextract.py:
* tools/defs_gen/docextract_to_xml.py: Keep 'SECTION:' in section names when
data is stored in a dictionary (map, hash table). As before, don't write it
to the 'section' elements in the generated xml file.
-rw-r--r-- | tools/defs_gen/docextract.py | 2 | ||||
-rwxr-xr-x | tools/defs_gen/docextract_to_xml.py | 13 |
2 files changed, 12 insertions, 3 deletions
diff --git a/tools/defs_gen/docextract.py b/tools/defs_gen/docextract.py index 7ee2ef5b..1b18f56c 100644 --- a/tools/defs_gen/docextract.py +++ b/tools/defs_gen/docextract.py @@ -70,7 +70,7 @@ function_name_pattern = re.compile(r'^([a-z]\w*)\s*:?(\s*\(.*\)\s*){0,2}\s*$') signal_name_pattern = re.compile(r'^([A-Z]\w+::[a-z0-9-]+)\s*:?(\s*\(.*\)\s*){0,2}\s*$') property_name_pattern = re.compile(r'^([A-Z]\w+:[a-z0-9-]+)\s*:?(\s*\(.*\)\s*){0,2}\s*$') enum_name_pattern = re.compile(r'^([A-Z]\w+)\s*:?(\s*\(.*\)\s*){0,2}\s*$') -section_name_pattern = re.compile(r'^SECTION:([a-z0-9_-]+)\s*:?(\s*\(.*\)\s*){0,2}\s*$') +section_name_pattern = re.compile(r'^(SECTION:[a-z0-9_-]+)\s*:?(\s*\(.*\)\s*){0,2}\s*$') return_pattern = re.compile(r'^@?(returns:|return\s+value:)(.*\n?)$', re.IGNORECASE) deprecated_pattern = re.compile(r'^(deprecated\s*:\s*.*\n?)$', re.IGNORECASE) rename_to_pattern = re.compile(r'^(rename\s+to)\s*:\s*(.*\n?)$', re.IGNORECASE) diff --git a/tools/defs_gen/docextract_to_xml.py b/tools/defs_gen/docextract_to_xml.py index 3bf75c64..a3221350 100755 --- a/tools/defs_gen/docextract_to_xml.py +++ b/tools/defs_gen/docextract_to_xml.py @@ -116,8 +116,17 @@ if __name__ == '__main__': elif block_type == 'property' and not with_properties: continue # Likewise for sections. - elif block_type == 'section' and not with_sections: - continue + elif block_type == 'section': + if not with_sections: + continue + # Delete 'SECTION:' from the name. + # (It could easily be deleted by docextract.extract(), but then + # there would be a theoretical risk that a section name would + # be identical to a function name, when all kinds of elements + # are stored in the docs dictionary with their names as key.) + last_colon_pos = name.rfind(':') + if last_colon_pos >= 0: + name = name[last_colon_pos+1:] # Likewise for enums. elif block_type == 'enum' and not with_enums: continue |