From 031bae6b9918f90f33ca0ec12827fc819015302d Mon Sep 17 00:00:00 2001 From: Yadu Krishnan Date: Thu, 26 Jan 2023 20:39:40 +0100 Subject: [PATCH 1/2] Small correction in documentation I believe that the current doc is confusing a bit. Readers might get confused with the usage `single quote` in the doc with the `'` symbol. I also added an additional message to avoid confusion between that and the triple quote interpolation. --- docs/_docs/reference/changed-features/interpolation-escapes.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/_docs/reference/changed-features/interpolation-escapes.md b/docs/_docs/reference/changed-features/interpolation-escapes.md index 594e7671c5ab..ed1cb89cce7a 100644 --- a/docs/_docs/reference/changed-features/interpolation-escapes.md +++ b/docs/_docs/reference/changed-features/interpolation-escapes.md @@ -4,7 +4,7 @@ title: "Escapes in interpolations" nightlyOf: https://docs.scala-lang.org/scala3/reference/changed-features/interpolation-escapes.html --- -In Scala 2 there is no straightforward way to represent a single quote character `"` in a single quoted interpolation. A `\` character can't be used for that because interpolators themselves decide how to handle escaping, so the parser doesn't know whether the `"` character should be escaped or used as a terminator. +In Scala 2 there is no straightforward way to represent a double-quote character `"` in a quoted interpolation(except in triple-quote interpolation). A `\` character can't be used for that because interpolators themselves decide how to handle escaping, so the parser doesn't know whether the `"` character should be escaped or used as a terminator. In Scala 3, we can use the `$` meta character of interpolations to escape a `"` character. Example: From 113c5735925a1cc243cdd163654faff96ce0a367 Mon Sep 17 00:00:00 2001 From: Yadu Krishnan Date: Thu, 26 Jan 2023 20:47:19 +0100 Subject: [PATCH 2/2] update documentation message --- docs/_docs/reference/changed-features/interpolation-escapes.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/_docs/reference/changed-features/interpolation-escapes.md b/docs/_docs/reference/changed-features/interpolation-escapes.md index ed1cb89cce7a..4abeabdce3ac 100644 --- a/docs/_docs/reference/changed-features/interpolation-escapes.md +++ b/docs/_docs/reference/changed-features/interpolation-escapes.md @@ -4,7 +4,7 @@ title: "Escapes in interpolations" nightlyOf: https://docs.scala-lang.org/scala3/reference/changed-features/interpolation-escapes.html --- -In Scala 2 there is no straightforward way to represent a double-quote character `"` in a quoted interpolation(except in triple-quote interpolation). A `\` character can't be used for that because interpolators themselves decide how to handle escaping, so the parser doesn't know whether the `"` character should be escaped or used as a terminator. +In Scala 2 there is no straightforward way to represent a double-quote character `"` in a quoted interpolation (except in triple-quote interpolation). A `\` character can't be used for that because interpolators themselves decide how to handle escaping, so the parser doesn't know whether the `"` character should be escaped or used as a terminator. In Scala 3, we can use the `$` meta character of interpolations to escape a `"` character. Example: