mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
parser: fix struct attribute for array struct field
This commit is contained in:
parent
fec7f0f0b9
commit
13b11a4155
@ -20,7 +20,11 @@ pub fn (mut p Parser) parse_array_type() table.Type {
|
||||
p.check(.rsbr)
|
||||
elem_type := p.parse_type()
|
||||
mut nr_dims := 1
|
||||
for p.tok.kind == .lsbr {
|
||||
|
||||
// detect attr
|
||||
not_attr := p.peek_tok.kind != .name && p.peek_tok2.kind !in [.semicolon, .rsbr]
|
||||
|
||||
for p.tok.kind == .lsbr && not_attr {
|
||||
p.next()
|
||||
p.check(.rsbr)
|
||||
nr_dims++
|
||||
|
@ -17,6 +17,12 @@ mut:
|
||||
num int
|
||||
}
|
||||
|
||||
struct Lol {
|
||||
b []string [json:lol]
|
||||
c string [json:cc]
|
||||
d int
|
||||
}
|
||||
|
||||
struct User {
|
||||
name string
|
||||
age int
|
||||
|
Loading…
Reference in New Issue
Block a user