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

parser: add -d print_vweb_template_expansions to ease vweb template debugging

This commit is contained in:
Delyan Angelov 2020-11-21 17:59:02 +02:00
parent 4b19a6e00d
commit fa55c247a2

View File

@ -72,6 +72,12 @@ fn (mut p Parser) vweb() ast.ComptimeCall {
println('>>> compiling vweb HTML template "$path"') println('>>> compiling vweb HTML template "$path"')
} }
v_code := tmpl.compile_file(path, p.cur_fn_name) v_code := tmpl.compile_file(path, p.cur_fn_name)
$if print_vweb_template_expansions ? {
lines := v_code.split('\n')
for i, line in lines {
println('$path:${i+1}: $line')
}
}
mut scope := &ast.Scope{ mut scope := &ast.Scope{
start_pos: 0 start_pos: 0
parent: p.global_scope parent: p.global_scope