From: Vladimír Vondruš Date: Sun, 11 Feb 2018 17:46:33 +0000 (+0100) Subject: doxygen: count also all aliases to the search symbol count. X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~cjwatson/git?a=commitdiff_plain;h=52fd40ed52699c5bbc684c228a7b8337d742bfc8;p=blog.git doxygen: count also all aliases to the search symbol count. --- diff --git a/doxygen/dox2html5.py b/doxygen/dox2html5.py index b00dfc86..e7b47559 100755 --- a/doxygen/dox2html5.py +++ b/doxygen/dox2html5.py @@ -1782,6 +1782,7 @@ def build_search_data(state: State, merge_subtrees=True, add_lookahead_barriers= def strip_tags(text): return strip_tags_re.sub('', text) + symbol_count = 0 for result in state.search: # Decide on prefix joiner. Defines are among the :: ones as well, # because we need to add the function macros twice -- but they have no @@ -1854,7 +1855,10 @@ def build_search_data(state: State, merge_subtrees=True, add_lookahead_barriers= keyword_index = map.add(title, '', alias=index, suffix_length=suffix_length) trie.insert(search.lower(), keyword_index) - return serialize_search_data(trie, map, len(state.search), merge_subtrees=merge_subtrees, merge_prefixes=merge_prefixes) + # Add this symbol and all its aliases to total symbol count + symbol_count += len(result.keywords) + 1 + + return serialize_search_data(trie, map, symbol_count, merge_subtrees=merge_subtrees, merge_prefixes=merge_prefixes) def base85encode_search_data(data: bytearray) -> bytearray: return (b"/* Generated by http://mcss.mosra.cz/doxygen/. Do not edit. */\n" + diff --git a/doxygen/test/test_search.py b/doxygen/test/test_search.py index 6a8ee77d..d080814f 100755 --- a/doxygen/test/test_search.py +++ b/doxygen/test/test_search.py @@ -376,7 +376,7 @@ class Search(IntegrationTestCase): #print(search_data_pretty) self.assertEqual(len(serialized), 4572) self.assertEqual(search_data_pretty, """ -36 symbols +52 symbols deprecated_macro [0] || | ($ || | ) [1]