Skip to content

Commit 2db45c8

Browse files
committed
hdr_parser: ignore lines with 'CV__' macros
1 parent a84a5e8 commit 2db45c8

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

modules/python/src2/hdr_parser.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -769,7 +769,7 @@ def parse(self, hname, wmode=True):
769769

770770
for l0 in linelist:
771771
self.lineno += 1
772-
#print self.lineno
772+
#print(state, self.lineno, l0)
773773

774774
l = l0.strip()
775775

@@ -798,8 +798,13 @@ def parse(self, hname, wmode=True):
798798
l = l[pos+2:]
799799
state = SCAN
800800

801+
if l.startswith('CV__'): # just ignore this lines
802+
#print('IGNORE: ' + l)
803+
state = SCAN
804+
continue
805+
801806
if state != SCAN:
802-
print("Error at %d: invlid state = %d" % (self.lineno, state))
807+
print("Error at %d: invalid state = %d" % (self.lineno, state))
803808
sys.exit(-1)
804809

805810
while 1:
@@ -848,6 +853,7 @@ def parse(self, hname, wmode=True):
848853

849854
stmt = (block_head + " " + l[:pos]).strip()
850855
stmt = " ".join(stmt.split()) # normalize the statement
856+
#print(stmt)
851857
stack_top = self.block_stack[-1]
852858

853859
if stmt.startswith("@"):

0 commit comments

Comments
 (0)