1
0
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:
Ned Palacios 2020-06-02 13:41:02 +08:00 committed by GitHub
parent 13c68eb81e
commit 9fcb8536e8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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 {