mirror of
https://github.com/vlang/v.git
synced 2025-09-10 07:47:20 -04:00
cgen: fix missing line breaks in generated code with closure IIFE, when compiled with '-g' (fix #20306) (#20316)
This commit is contained in:
parent
969402461f
commit
cc250baf3c
@ -16,7 +16,7 @@ import sokol.gfx
|
|||||||
import sokol.sgl
|
import sokol.sgl
|
||||||
import sokol.sapp
|
import sokol.sapp
|
||||||
import stbi
|
import stbi
|
||||||
import szip
|
import compress.szip
|
||||||
import strings
|
import strings
|
||||||
|
|
||||||
// Help text
|
// Help text
|
||||||
@ -801,10 +801,10 @@ fn main() {
|
|||||||
|
|
||||||
// App init
|
// App init
|
||||||
mut app := &App{
|
mut app := &App{
|
||||||
gg: 0
|
gg: unsafe { nil }
|
||||||
// zip fields
|
// zip fields
|
||||||
zip: 0
|
zip: unsafe { nil }
|
||||||
item_list: 0
|
item_list: unsafe { nil }
|
||||||
}
|
}
|
||||||
|
|
||||||
app.state = .scanning
|
app.state = .scanning
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
* TODO:
|
* TODO:
|
||||||
**********************************************************************/
|
**********************************************************************/
|
||||||
import sokol.gfx
|
import sokol.gfx
|
||||||
import szip
|
import compress.szip
|
||||||
|
|
||||||
fn (mut il Item_list) scan_zip(path string, in_index int) ! {
|
fn (mut il Item_list) scan_zip(path string, in_index int) ! {
|
||||||
println('Scanning ZIP [${path}]')
|
println('Scanning ZIP [${path}]')
|
||||||
|
@ -701,6 +701,9 @@ fn (mut g Gen) call_expr(node ast.CallExpr) {
|
|||||||
g.expr(node.left)
|
g.expr(node.left)
|
||||||
g.writeln(';')
|
g.writeln(';')
|
||||||
g.write(line)
|
g.write(line)
|
||||||
|
if g.out.last_n(1) != '\n' {
|
||||||
|
g.writeln('')
|
||||||
|
}
|
||||||
g.write(tmp_var)
|
g.write(tmp_var)
|
||||||
} else if node.or_block.kind == .absent {
|
} else if node.or_block.kind == .absent {
|
||||||
g.expr(node.left)
|
g.expr(node.left)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user