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

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

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

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