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

vfmt: change all '$expr' to '${expr}' (#16428)

This commit is contained in:
yuyi
2022-11-15 21:53:13 +08:00
committed by GitHub
parent 56239b4a23
commit 017ace6ea7
859 changed files with 7156 additions and 7135 deletions

View File

@ -13,25 +13,25 @@ fn (mut app App) method_three(s string) string {
fn main() {
$for method in App.methods {
$if method.typ is fn (string) string {
println('$method.name IS `fn(string) string`')
println('${method.name} IS `fn(string) string`')
} $else {
println('$method.name is NOT `fn(string) string`')
println('${method.name} is NOT `fn(string) string`')
}
$if method.return_type !is int {
println('$method.name does NOT return `int`')
println('${method.name} does NOT return `int`')
} $else {
println('$method.name DOES return `int`')
println('${method.name} DOES return `int`')
}
$if method.args[0].typ !is string {
println("$method.name's first arg is NOT `string`")
println("${method.name}'s first arg is NOT `string`")
} $else {
println("$method.name's first arg IS `string`")
println("${method.name}'s first arg IS `string`")
}
// TODO: Double inversion, should this even be allowed?
$if method.typ is fn () {
println('$method.name IS a void method')
println('${method.name} IS a void method')
} $else {
println('$method.name is NOT a void method')
println('${method.name} is NOT a void method')
}
println('')
}