v.parser: fix vfmt eating the file name in `$tmpl('non_existant_file')` (#10056)

pull/10052/head
Louis Schmieder 2021-05-08 20:11:13 +02:00 committed by GitHub
parent 0d205510d5
commit 23513ae35c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

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