mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
This commit is contained in:
parent
572e26204e
commit
53c6e46a51
@ -106,6 +106,7 @@ fn (mut p Parser) comptime_call() ast.ComptimeCall {
|
||||
is_html := method_name == 'html'
|
||||
// $env('ENV_VAR_NAME')
|
||||
p.check(.lpar)
|
||||
arg_pos := p.tok.pos()
|
||||
if method_name in ['env', 'pkgconfig', 'compile_error', 'compile_warn'] {
|
||||
s := p.tok.lit
|
||||
p.check(.string)
|
||||
@ -213,9 +214,9 @@ fn (mut p Parser) comptime_call() ast.ComptimeCall {
|
||||
}
|
||||
}
|
||||
if is_html {
|
||||
p.error('vweb HTML template "$path" not found')
|
||||
p.error_with_pos('vweb HTML template "$tmpl_path" not found', arg_pos)
|
||||
} else {
|
||||
p.error('template file "$path" not found')
|
||||
p.error_with_pos('template file "$tmpl_path" not found', arg_pos)
|
||||
}
|
||||
return err_node
|
||||
}
|
||||
|
6
vlib/v/parser/tests/comptime_path_not_found_err.out
Normal file
6
vlib/v/parser/tests/comptime_path_not_found_err.out
Normal file
@ -0,0 +1,6 @@
|
||||
vlib/v/parser/tests/comptime_path_not_found_err.vv:2:15: error: template file "tempate.txt" not found
|
||||
1 | fn main() {
|
||||
2 | tmp := $tmpl('tempate.txt')
|
||||
| ~~~~~~~~~~~~~
|
||||
3 | a := tmp
|
||||
4 | }
|
4
vlib/v/parser/tests/comptime_path_not_found_err.vv
Normal file
4
vlib/v/parser/tests/comptime_path_not_found_err.vv
Normal file
@ -0,0 +1,4 @@
|
||||
fn main() {
|
||||
tmp := $tmpl('tempate.txt')
|
||||
a := tmp
|
||||
}
|
Loading…
Reference in New Issue
Block a user