From 2db45c8a8592059a3bef8d61d01bc8dbdd352dc1 Mon Sep 17 00:00:00 2001 From: Alexander Alekhin Date: Thu, 29 Jun 2017 19:40:36 +0300 Subject: [PATCH] hdr_parser: ignore lines with 'CV__' macros --- modules/python/src2/hdr_parser.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/modules/python/src2/hdr_parser.py b/modules/python/src2/hdr_parser.py index cd50b520e8..0999a43996 100755 --- a/modules/python/src2/hdr_parser.py +++ b/modules/python/src2/hdr_parser.py @@ -769,7 +769,7 @@ class CppHeaderParser(object): for l0 in linelist: self.lineno += 1 - #print self.lineno + #print(state, self.lineno, l0) l = l0.strip() @@ -798,8 +798,13 @@ class CppHeaderParser(object): l = l[pos+2:] state = SCAN + if l.startswith('CV__'): # just ignore this lines + #print('IGNORE: ' + l) + state = SCAN + continue + if state != SCAN: - print("Error at %d: invlid state = %d" % (self.lineno, state)) + print("Error at %d: invalid state = %d" % (self.lineno, state)) sys.exit(-1) while 1: @@ -848,6 +853,7 @@ class CppHeaderParser(object): stmt = (block_head + " " + l[:pos]).strip() stmt = " ".join(stmt.split()) # normalize the statement + #print(stmt) stack_top = self.block_stack[-1] if stmt.startswith("@"):