From 9ece982fedab784fad25beb61528137293393ef8 Mon Sep 17 00:00:00 2001 From: shove Date: Mon, 23 Oct 2023 04:48:00 +0800 Subject: [PATCH] parser: minor cleanup in struct_decl (#19622) --- vlib/v/parser/struct.v | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/vlib/v/parser/struct.v b/vlib/v/parser/struct.v index 1462a9393a63df..6776088f73b07b 100644 --- a/vlib/v/parser/struct.v +++ b/vlib/v/parser/struct.v @@ -246,11 +246,9 @@ fn (mut p Parser) struct_decl(is_anon bool) ast.StructDecl { p.inside_struct_field_decl = true if p.tok.kind == .key_struct { // Anon structs - if p.tok.kind == .key_struct { - p.anon_struct_decl = p.struct_decl(true) - // Find the registered anon struct type, it was registered above in `p.struct_decl()` - typ = p.table.find_type_idx(p.anon_struct_decl.name) - } + p.anon_struct_decl = p.struct_decl(true) + // Find the registered anon struct type, it was registered above in `p.struct_decl()` + typ = p.table.find_type_idx(p.anon_struct_decl.name) } else { start_type_pos := p.tok.pos() typ = p.parse_type()