diff --git a/vlib/strings/builder.c.v b/vlib/strings/builder.c.v index 24b6c645c0c106..1370791fe1ffec 100644 --- a/vlib/strings/builder.c.v +++ b/vlib/strings/builder.c.v @@ -131,7 +131,7 @@ pub fn (b &Builder) byte_at(n int) u8 { } // write appends the string `s` to the buffer -@[inline] +@[expand_simple_interpolation; inline] pub fn (mut b Builder) write_string(s string) { if s.len == 0 { return diff --git a/vlib/v/gen/c/text_manipulation.v b/vlib/v/gen/c/text_manipulation.v index 93ac00041b40ec..6d4ec11bbe0c37 100644 --- a/vlib/v/gen/c/text_manipulation.v +++ b/vlib/v/gen/c/text_manipulation.v @@ -5,6 +5,7 @@ module c import v.util +@[expand_simple_interpolation] fn (mut g Gen) write(s string) { $if trace_gen ? { if g.file == unsafe { nil } { @@ -15,10 +16,23 @@ fn (mut g Gen) write(s string) { } if g.indent > 0 && g.empty_line { g.out.write_string(util.tabs(g.indent)) - // g.out_parallel[g.out_idx].write_string(util.tabs(g.indent)) } g.out.write_string(s) - ////g.out_parallel[g.out_idx].write_string(s) + g.empty_line = false +} + +fn (mut g Gen) write_decimal(x i64) { + $if trace_gen ? { + if g.file == unsafe { nil } { + eprintln('gen file: | last_fn_c_name: ${g.last_fn_c_name:-45} | write_decimal: ${x}') + } else { + eprintln('gen file: ${g.file.path:-30} | last_fn_c_name: ${g.last_fn_c_name:-45} | write_decimal: ${x}') + } + } + if g.indent > 0 && g.empty_line { + g.out.write_string(util.tabs(g.indent)) + } + g.out.write_decimal(x) g.empty_line = false }