swiftlang / swift-book

The Swift Programming Language book
Apache License 2.0
1.72k stars 159 forks source link

Grammar of string interpolation does not support SE-0228 #295

Open jansorg opened 5 months ago

jansorg commented 5 months ago

Location

https://docs.swift.org/swift-book/documentation/the-swift-programming-language/lexicalstructure#String-Literals

Description

If I'm not mistaken, the current form of the grammar rules does not support SE-0228. For example the following would not be accepted:

"The price is $\(cost, format: "%.2f")"

Correction

The changes outlined at https://github.com/apple/swift-evolution/blob/main/proposals/0228-fix-expressiblebystringinterpolation.md should be supported.