File tree Expand file tree Collapse file tree 3 files changed +3
-3
lines changed
scala/quoted/runtime/impl/printers Expand file tree Collapse file tree 3 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -1253,7 +1253,7 @@ object Scanners {
12531253 nextChar()
12541254 }
12551255 }
1256- val alt = if oct == LF then raw " \n " else f " \\ u $oct%04x "
1256+ val alt = if oct == LF then raw " \n " else f " ${ " \\ " } u $oct%04x "
12571257 error(s " octal escape literals are unsupported: use $alt instead " , start)
12581258 putChar(oct.toChar)
12591259 }
Original file line number Diff line number Diff line change @@ -542,7 +542,7 @@ class PlainPrinter(_ctx: Context) extends Printer {
542542 case '"' => " \\\" "
543543 case '\' ' => " \\\' "
544544 case '\\ ' => " \\\\ "
545- case _ => if ch.isControl then f " \\ u ${ch.toInt}%04x " else String .valueOf(ch)
545+ case _ => if ch.isControl then f " ${ " \\ " } u ${ch.toInt}%04x " else String .valueOf(ch)
546546 }
547547
548548 def toText (const : Constant ): Text = const.tag match {
Original file line number Diff line number Diff line change @@ -1423,7 +1423,7 @@ object SourceCode {
14231423 case '"' => " \\\" "
14241424 case '\' ' => " \\\' "
14251425 case '\\ ' => " \\\\ "
1426- case _ => if ch.isControl then f " \\ u ${ch.toInt}%04x " else String .valueOf(ch)
1426+ case _ => if ch.isControl then f " ${ " \\ " } u ${ch.toInt}%04x " else String .valueOf(ch)
14271427 }
14281428
14291429 private def escapedString (str : String ): String = str flatMap escapedChar
You can’t perform that action at this time.
0 commit comments