c2v
c2v copied to clipboard
fix issue #172
fiix the bug of #172 [Can't translate compound struct and union; (https://github.com/vlang/c2v/issues/172)
testcase 1
- case struct ss{ union{int i;int j;}; int i1; };
- result struct Ss { ss0 i1 int } union ss0 { i int j int }
test case 2
- case struct ss{ int i1; union{int i;int j;}; };
- result struct Ss { ss0 i1 int } union ss0 { i int j int }
test case 3
- case struct ss{ union{int i1;int j1;}; int i1; union{int i;int j;}; };
- result struct Ss { ss0 ss1 i1 int } union ss0 { i1 int j1 int } union ss1 { i int j int }
Thanks! Can you vfmt the code please?
Also
tests/5.struct.v:103:13: error: `AnonStructTest0` lacks body
101 |
102 | age int
103 | foo struct AnonStructTest0 {
| ~~~~~~~~~~~~~~~
104 | bar int