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

cgen: autofree: first step

This commit is contained in:
Alexander Medvednikov
2020-03-21 19:52:19 +01:00
parent efbf114a2f
commit e5f6a0949f
7 changed files with 127 additions and 37 deletions

View File

@ -2809,6 +2809,13 @@ fn (p mut Parser) array_init() string {
p.gen_array_init(real, no_alloc, new_arr_ph, i)
typ = 'array_${stringify_pointer(typ)}'
p.register_array(typ)
if p.tok == .lcbr && i == 0 && p.peek() == .name {
// []string{len:10} (V2)
for p.tok != .rcbr {
p.next()
}
p.check(.rcbr)
}
return typ
}