@@ -54,7 +54,8 @@ def parseCmdArgs():
54
54
55
55
56
56
def skipLine (line ):
57
- if line .find ("};" ) != - 1 :
57
+ lineNoComment = line .split ("//" )[0 ]
58
+ if lineNoComment .find ("};" ) != - 1 :
58
59
return True
59
60
return False
60
61
@@ -126,8 +127,8 @@ def parseFile(fileName, insideIGCNameSpace):
126
127
found_struct = DeclHeader (line , words [1 ], [])
127
128
while line .find ("};" ) == - 1 :
128
129
line = next (file , None )
129
- line = line .split ("//" )[0 ]
130
130
if not skipLine (line ):
131
+ line = line .split ("//" )[0 ]
131
132
extractVars (line , found_struct )
132
133
structureNames .append (found_struct )
133
134
#
@@ -137,12 +138,12 @@ def parseFile(fileName, insideIGCNameSpace):
137
138
found_enum = DeclHeader (line , words [nameIdx ], [])
138
139
while line .find ("};" ) == - 1 :
139
140
line = next (file , None )
140
- line = line .split ("//" )[0 ]
141
141
if not skipLine (line ):
142
+ line = line .split ("//" )[0 ]
142
143
extractEnumVal (line , found_enum )
143
144
enumNames .append (found_enum )
144
145
#
145
- if line .find ( "#include" ) != - 1 :
146
+ if line .lstrip (). startswith ( "#include" ) == True :
146
147
words = line .split ()
147
148
parent_dir = os .path .dirname (fileName )
148
149
include_file = words [1 ][1 :- 1 ] # cut off the "" or <> surrounding the file name
0 commit comments