1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

cgen: support -d trace_gen_source_line_info

This commit is contained in:
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

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)
}
}