mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
cgen: insert a newline every 8 elements in array init (#10034)
This commit is contained in:
parent
262ef7598d
commit
82a9add25b
@ -113,9 +113,14 @@ fn (mut g Gen) array_init(node ast.ArrayInit) {
|
|||||||
for i, expr in node.exprs {
|
for i, expr in node.exprs {
|
||||||
g.expr_with_cast(expr, node.expr_types[i], node.elem_type)
|
g.expr_with_cast(expr, node.expr_types[i], node.elem_type)
|
||||||
if i != len - 1 {
|
if i != len - 1 {
|
||||||
|
if i > 0 && i & 7 == 0 { // i > 0 && i % 8 == 0
|
||||||
|
g.writeln(',')
|
||||||
|
g.write('\t\t')
|
||||||
|
} else {
|
||||||
g.write(', ')
|
g.write(', ')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
g.write('}))')
|
g.write('}))')
|
||||||
if g.is_shared {
|
if g.is_shared {
|
||||||
g.write('}, sizeof($shared_styp))')
|
g.write('}, sizeof($shared_styp))')
|
||||||
|
Loading…
Reference in New Issue
Block a user