mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
parser: short struct syntax for all structs
This commit is contained in:
@ -925,9 +925,6 @@ fn (p mut Parser) factor() string {
|
||||
}
|
||||
peek2 := p.tokens[p.token_idx + 1]
|
||||
if p.peek() == .rcbr || (p.peek() == .name && peek2.tok == .colon) {
|
||||
if !p.expected_type.ends_with('Config') {
|
||||
p.error('short struct initialization syntax only works with structs that end with `Config`')
|
||||
}
|
||||
return p.struct_init(p.expected_type)
|
||||
}
|
||||
// { user | name :'new name' }
|
||||
|
Reference in New Issue
Block a user