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

v2: fix fixed array parsing

This commit is contained in:
joe-conigliaro 2020-02-11 14:45:33 +11:00
parent 2d7c80bbc3
commit f7b80c3c62

View File

@ -11,9 +11,9 @@ pub fn (p mut Parser) parse_array_type(nr_muls int) table.Type {
// fixed array
if p.tok.kind == .number {
size := p.tok.lit.int()
elem_type := p.parse_type()
p.next()
p.check(.rsbr)
p.check_name()
elem_type := p.parse_type()
idx := p.table.find_or_register_array_fixed(elem_type, size, 1)
return table.new_type_ptr(idx, nr_muls)
}