mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
fmt: fix formatting for $compile_warn (#17450)
This commit is contained in:
parent
9fc2860074
commit
8f7c35552d
@ -1901,8 +1901,8 @@ pub fn (mut f Fmt) comptime_call(node ast.ComptimeCall) {
|
|||||||
f.write("\$env('${node.args_var}')")
|
f.write("\$env('${node.args_var}')")
|
||||||
} else if node.is_pkgconfig {
|
} else if node.is_pkgconfig {
|
||||||
f.write("\$pkgconfig('${node.args_var}')")
|
f.write("\$pkgconfig('${node.args_var}')")
|
||||||
} else if node.method_name == 'compile_error' {
|
} else if node.method_name in ['compile_error', 'compile_warn'] {
|
||||||
f.write("\$compile_error('${node.args_var}')")
|
f.write("\$${node.method_name}('${node.args_var}')")
|
||||||
} else {
|
} else {
|
||||||
inner_args := if node.args_var != '' {
|
inner_args := if node.args_var != '' {
|
||||||
node.args_var
|
node.args_var
|
||||||
|
3
vlib/v/fmt/tests/comptime_warn_keep.vv
Normal file
3
vlib/v/fmt/tests/comptime_warn_keep.vv
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
fn main() {
|
||||||
|
$compile_warn('WARN')
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user