fmt: fix struct decl gen with c structs

pull/5165/head
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
1 changed files with 3 additions and 1 deletions

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 {