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

fmt: fix compiler_error('...') broken by fmt (fix #16218) (#16231)

This commit is contained in:
shove 2022-10-28 11:48:09 +08:00 committed by GitHub
parent 219079e3a6
commit af56719f9d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 0 deletions

View File

@ -1868,6 +1868,8 @@ pub fn (mut f Fmt) comptime_call(node ast.ComptimeCall) {
f.write("\$env('$node.args_var')")
} else if node.is_pkgconfig {
f.write("\$pkgconfig('$node.args_var')")
} else if node.method_name == 'compile_error' {
f.write("\$compile_error('$node.args_var')")
} else {
inner_args := if node.args_var != '' {
node.args_var

View File

@ -0,0 +1,3 @@
$if !linux {
$compile_error('Only Lin\"ux is currently supported')
}

View File

@ -0,0 +1,3 @@
$if !linux {
$compile_error("Only Lin\"ux is currently supported")
}