mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
fmt: fix struct decl gen with c structs
This commit is contained in:
parent
13c68eb81e
commit
9fcb8536e8
@ -439,8 +439,10 @@ pub fn (mut f Fmt) struct_decl(node ast.StructDecl) {
|
||||
if node.is_pub {
|
||||
f.write('pub ')
|
||||
}
|
||||
f.write('struct ')
|
||||
f.write_language_prefix(node.language)
|
||||
name := node.name.after('.')
|
||||
f.writeln('struct $name {')
|
||||
f.writeln('$name {')
|
||||
mut max := 0
|
||||
for field in node.fields {
|
||||
if field.name.len > max {
|
||||
|
Loading…
Reference in New Issue
Block a user