fmt: keep {} in string interpolation for chained CallExprs (#8422)
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