The second answer in this link provides a way to load enums from C++ to python:
Can python load definitions from a C header file?
The code works with the given example:
sample = """
stuff before
enum hello {
Zero,
One,
Two,
Three,
Five=5,
Six,
Ten=10
};
in the middle
enum blah
{
alpha,
beta,
gamma = 10 ,
zeta = 50
};
at the end
"""
However, it does not work for the following, due to the comments inside the enum:
sample = """
stuff before
enum hello {
Zero, //zero
One, //one
Two, //two
Three, //three
Five=5,
Six,
Ten=10
};
in the middle
enum blah
{
alpha,
beta, //beta
gamma = 10 ,
zeta = 50
};
at the end
"""
Is there a simple way to suppress these comments in line with the code provided in the link above? I cannot comment on the answer as I lack the reputation.