From 23513ae35c94a7ceb38d2906fbf0d9390b9b9ed0 Mon Sep 17 00:00:00 2001 From: Louis Schmieder Date: Sat, 8 May 2021 20:11:13 +0200 Subject: [PATCH] v.parser: fix vfmt eating the file name in `$tmpl('non_existant_file')` (#10056) --- vlib/v/parser/comptime.v | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vlib/v/parser/comptime.v b/vlib/v/parser/comptime.v index 1ba8b27513..02ee54265b 100644 --- a/vlib/v/parser/comptime.v +++ b/vlib/v/parser/comptime.v @@ -140,8 +140,8 @@ fn (mut p Parser) comp_call() ast.ComptimeCall { path = os.join_path(dir, tmpl_path) } if !os.exists(path) { - // can be in `templates/` if is_html { + // can be in `templates/` path = os.join_path(dir, 'templates', fn_path_joined) path += '.html' } @@ -151,6 +151,7 @@ fn (mut p Parser) comp_call() ast.ComptimeCall { scope: 0 is_vweb: true method_name: n + args_var: literal_string_param pos: start_pos.extend(p.prev_tok.position()) } }