Skip to content

Commit

Permalink
parser: minor cleanup in struct_decl (#19622)
Browse files Browse the repository at this point in the history
  • Loading branch information
shove70 committed Oct 22, 2023
1 parent af7a213 commit 9ece982
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions vlib/v/parser/struct.v
Expand Up @@ -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()
Expand Down

0 comments on commit 9ece982

Please sign in to comment.