mirror of
https://github.com/vlang/v.git
synced 2025-09-16 16:02:29 +03:00
cgen: autofree: first step
This commit is contained in:
parent
efbf114a2f
commit
e5f6a0949f
7 changed files with 127 additions and 37 deletions
|
@ -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
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue