mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
cgen: fix ./tracev examples/hello_world.v
This commit is contained in:
parent
6bf2ad1ff0
commit
49c12e4d1c
@ -7,8 +7,12 @@ import v.util
|
|||||||
|
|
||||||
fn (mut g Gen) write(s string) {
|
fn (mut g Gen) write(s string) {
|
||||||
$if trace_gen ? {
|
$if trace_gen ? {
|
||||||
|
if g.file == unsafe { nil } {
|
||||||
|
eprintln('gen file: <nil> | last_fn_c_name: ${g.last_fn_c_name:-45} | write: $s')
|
||||||
|
} else {
|
||||||
eprintln('gen file: ${g.file.path:-30} | last_fn_c_name: ${g.last_fn_c_name:-45} | write: $s')
|
eprintln('gen file: ${g.file.path:-30} | last_fn_c_name: ${g.last_fn_c_name:-45} | write: $s')
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if g.indent > 0 && g.empty_line {
|
if g.indent > 0 && g.empty_line {
|
||||||
g.out.write_string(util.tabs(g.indent))
|
g.out.write_string(util.tabs(g.indent))
|
||||||
// g.out_parallel[g.out_idx].write_string(util.tabs(g.indent))
|
// g.out_parallel[g.out_idx].write_string(util.tabs(g.indent))
|
||||||
@ -20,8 +24,12 @@ fn (mut g Gen) write(s string) {
|
|||||||
|
|
||||||
fn (mut g Gen) writeln(s string) {
|
fn (mut g Gen) writeln(s string) {
|
||||||
$if trace_gen ? {
|
$if trace_gen ? {
|
||||||
|
if g.file == unsafe { nil } {
|
||||||
|
eprintln('gen file: <nil> | last_fn_c_name: ${g.last_fn_c_name:-45} | writeln: $s')
|
||||||
|
} else {
|
||||||
eprintln('gen file: ${g.file.path:-30} | last_fn_c_name: ${g.last_fn_c_name:-45} | writeln: $s')
|
eprintln('gen file: ${g.file.path:-30} | last_fn_c_name: ${g.last_fn_c_name:-45} | writeln: $s')
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if g.indent > 0 && g.empty_line {
|
if g.indent > 0 && g.empty_line {
|
||||||
g.out.write_string(util.tabs(g.indent))
|
g.out.write_string(util.tabs(g.indent))
|
||||||
// g.out_parallel[g.out_idx].write_string(util.tabs(g.indent))
|
// g.out_parallel[g.out_idx].write_string(util.tabs(g.indent))
|
||||||
|
Loading…
Reference in New Issue
Block a user