From 4d46958c82c5bf102488775004e7960edca4b42e Mon Sep 17 00:00:00 2001 From: Vadim Levin Date: Fri, 25 Mar 2022 15:36:31 +0300 Subject: [PATCH] fix: inline namespace handling in header parser `inline namespace` should be skipped in header parser namespaces list. Example: ```cpp namespace cv { inline namespace inlined { namespace inner { // content } // namespace inner } // namespace inlined } // namespace cv ``` Before fix `inner` is registered as `cv..inner` After fix: `cv.inner` --- modules/python/src2/hdr_parser.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/python/src2/hdr_parser.py b/modules/python/src2/hdr_parser.py index 0c3360fcbc..ebe13f05c7 100755 --- a/modules/python/src2/hdr_parser.py +++ b/modules/python/src2/hdr_parser.py @@ -1002,7 +1002,7 @@ class CppHeaderParser(object): docstring = "" if stmt_type == "namespace": chunks = [block[1] for block in self.block_stack if block[0] == 'namespace'] + [name] - self.namespaces.add('.'.join(chunks)) + self.namespaces.add('.'.join(filter(lambda c: len(c)> 0, chunks))) else: stmt_type, name, parse_flag = "block", "", False