diff options
author | Dominik Gruntz <dominik.gruntz@fhnw.ch> | 2012-03-28 16:58:32 +0200 |
---|---|---|
committer | Dominik Gruntz <dominik.gruntz@fhnw.ch> | 2012-03-28 16:58:32 +0200 |
commit | 9a59a2ac54cc8e4c437dc62e651597ec56288072 (patch) | |
tree | 0d0b497da6ae3b7fc5fc5637648368f57fdbb28a | |
parent | fdbca65fd1d50582f336e6ebed3466d6073f6f52 (diff) | |
download | scala-9a59a2ac54cc8e4c437dc62e651597ec56288072.tar.gz scala-9a59a2ac54cc8e4c437dc62e651597ec56288072.tar.bz2 scala-9a59a2ac54cc8e4c437dc62e651597ec56288072.zip |
SIP-11 String Interpolation Simplification
Changed StringContext.f which implements the formatted string interpolator.
Any '%' not in formatting position is left in the resulting string literally.
However, instead of adding '%s' format holders and extending the args with
"%" expressions, these '%' are replaced by '%%'. The formatter then converts
'%%' (percent formatter) to the literal % (\u0025).
The interpolation tests still pass.
-rw-r--r-- | src/library/scala/StringContext.scala | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/library/scala/StringContext.scala b/src/library/scala/StringContext.scala index 06620a82a1..be9e0c290a 100644 --- a/src/library/scala/StringContext.scala +++ b/src/library/scala/StringContext.scala @@ -79,7 +79,7 @@ case class StringContext(parts: String*) { * start a format specifier), then the string format specifier `%s` is inserted. * * 2. Any `%` characters not in formatting positions are left in the resulting - * string literally. This is achieved by replacing each such occurrence by the string + * string literally. This is achieved by replacing each such occurrence by the * format specifier `%%`. */ def f(args: Any*) = { |