1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

v fmt: fix extra space for anon struct (#16131)

This commit is contained in:
Makhnev Petr 2022-10-21 11:38:19 +04:00 committed by GitHub
parent c684dd8c9b
commit 2e8b9e3b92
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 8 additions and 7 deletions

View File

@ -16,9 +16,10 @@ pub fn (mut f Fmt) struct_decl(node ast.StructDecl, is_anon bool) {
} else {
f.write('struct')
}
f.write_language_prefix(node.language)
name := node.name.after('.') // strip prepended module
if !is_anon {
f.write(' ')
f.write_language_prefix(node.language)
f.write(name)
}
f.write_generic_types(node.generic_types)