mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
fmt: keep {} in string interpolation for chained CallExprs (#8422)
This commit is contained in:
parent
2774db077d
commit
a044441224
@ -158,6 +158,9 @@ pub fn (lit &StringInterLiteral) get_fspec_braces(i int) (string, bool) {
|
||||
CallExpr {
|
||||
if sub_expr.args.len != 0 {
|
||||
needs_braces = true
|
||||
} else if sub_expr.left is CallExpr {
|
||||
sub_expr = sub_expr.left
|
||||
continue
|
||||
}
|
||||
break
|
||||
}
|
||||
|
@ -9,5 +9,5 @@ fn main() {
|
||||
d := 'a: ${a:5s} b: ${b:-5s} i: ${i:20d}'
|
||||
println('a: $a $b xxx')
|
||||
eprintln('e: $e')
|
||||
println(d)
|
||||
_ = ' ${foo.method(bar).str()} '
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user