cgen: support `-d trace_gen_source_line_info`

pull/13559/head
Delyan Angelov 2022-02-21 23:04:10 +02:00
parent f2e5bb447e
commit 4a765bc33b
No known key found for this signature in database
GPG Key ID: 66886C0F12D595ED
1 changed files with 3 additions and 0 deletions

View File

@ -1534,6 +1534,9 @@ fn (mut g Gen) write_v_source_line_info(pos token.Pos) {
if g.inside_ternary == 0 && g.pref.is_vlines && g.is_vlines_enabled {
nline := pos.line_nr + 1
lineinfo := '\n#line $nline "$g.vlines_path"'
$if trace_gen_source_line_info ? {
eprintln('> lineinfo: ${lineinfo.replace('\n', '')}')
}
g.writeln(lineinfo)
}
}