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

fix Tetris example

This commit is contained in:
Alexander Medvednikov
2019-06-23 13:17:33 +02:00
parent f72de84e9c
commit c619243067
3 changed files with 13 additions and 4 deletions

View File

@ -2287,8 +2287,8 @@ fn (p mut Parser) array_init() string {
// println('GOT TYP after [] $typ')
}
// ! after array => no malloc and no copy
no_copy := p.tok == NOT
if no_copy {
no_alloc := p.tok == NOT
if no_alloc {
p.next()
}
// [1,2,3]!! => [3]int{1,2,3}
@ -2312,8 +2312,8 @@ fn (p mut Parser) array_init() string {
// typ += '_ptr"
// }
mut new_arr := 'new_array_from_c_array'
if no_copy {
new_arr += '_no_copy'
if no_alloc {
new_arr += '_no_alloc'
}
p.gen(' })')
// p.gen('$new_arr($vals.len, $vals.len, sizeof($typ), ($typ[]) $c_arr );')