Open ShadowLL opened 4 years ago
Definitely a bug. I don't really have an interest in fixing this myself (lots of stuff going on), but I can provide guidance for debugging/fixing this if you would like to fix it and make a PR.
In particular, I find that setting the environment variable CPPHEADERPARSER_DEBUG=1 is really useful for figuring out what the parser is doing.
I imagine that this isn't the only piece in the SDK that would cause problems. Might try just commenting out that enum and see what else breaks.
The following code has the same parsing error: evaluating '': unexpected '', expected ';' struct AudioPortCapability { enum AudioFormat* formats; /*< Supported audio formats. For details, see {@link AudioFormat}. / };
After I modified the following code, the program can run normally: def _parse_enum(self): ......
name = ""
if nametok.type == "NAME":
name = nametok.value
debug_print("enum name is '%s'", name)
tok = self.lex.token()
#MODIFED:
if tok.value == "*":
name = name + ' *'
tok = self.lex.token()
else:
debug_print("anonymous enum")
tok = nametok
@liuyongbao1982 That looks like a different parse error to me. If you open a PR though with your change and a test, we'd be happy to take your change, since that's also a bug.
This is detailed exception information: