Open
Description
ast = pycparserext.ext_c_parser.GnuCParser().parse("""
struct a {
int m;
};
struct a test() {
int x = 1;
return ({
(struct a){x};
});
}""")
print(pycparserext.ext_c_generator.GnuCGenerator().visit(ast))
output:
{
int m;
};
struct a test()
{
int x = 1;
return {
(struct a){x}
}
;
}
Compare with:
ast = pycparserext.ext_c_parser.GnuCParser().parse("""
struct a {
int m;
};
struct a test() {
int x = 1;
return ({
x;
});
}""")
output:
struct a
{
int m;
};
struct a test()
{
int x = 1;
return {
x;
}
;
}
Metadata
Metadata
Assignees
Labels
No labels