Skip to content

Commit 07d2bb6

Browse files
author
Jendrik Wenke
committed
move comment to escapeChar
1 parent ebe6f1c commit 07d2bb6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

library/src/dotty/Show.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ object Show extends LowPrioShow {
2727
* @return a string describing how to escape the give char in source code.
2828
*/
2929
private def escapeChar(c: Char): String = c match {
30+
// From 2.12 spec, `charEscapeSeq`:
31+
// ‘\‘ (‘b‘ | ‘t‘ | ‘n‘ | ‘f‘ | ‘r‘ | ‘"‘ | ‘'‘ | ‘\‘)
3032
case '\b' => "\\b"
3133
case '\t' => "\\t"
3234
case '\n' => "\\n"
@@ -39,8 +41,6 @@ object Show extends LowPrioShow {
3941
}
4042

4143
implicit val stringShow: Show[String] = new Show[String] {
42-
// From 2.12 spec, `charEscapeSeq`:
43-
// ‘\‘ (‘b‘ | ‘t‘ | ‘n‘ | ‘f‘ | ‘r‘ | ‘"‘ | ‘'‘ | ‘\‘)
4444
def show(str: String) = str.flatMap(escapeChar).mkString("\"", "", "\"")
4545
}
4646

0 commit comments

Comments
 (0)