1
0
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:
Felipe Pena 2023-03-02 10:40:53 -03:00 committed by GitHub
parent 9fc2860074
commit 8f7c35552d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 2 deletions

View File

@ -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

View File

@ -0,0 +1,3 @@
fn main() {
$compile_warn('WARN')
}