File: repl-no-uescape.scala

package info (click to toggle)
scala 2.11.12-5
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 62,828 kB
  • sloc: javascript: 28,808; java: 13,415; xml: 3,250; sh: 1,620; python: 756; makefile: 38; awk: 36; ansic: 6
file content (31 lines) | stat: -rw-r--r-- 984 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import scala.tools.partest.ReplTest
import scala.tools.nsc.Settings

/*
scala> object A
<console>:10: error: invalid escape character
+ "defined object " + "A" + "\u000A"

Under -Dscala.color=true control chars are common
  $eval.this.$print = {
    $line2.$read.$iw.$iw;
    "\033[1m\033[34mres1\033[0m: \033[1m\033[32mInt\033[0m = ".+(scala.runtime.ScalaRunTime.replStringOf($line2.$read.$iw.$iw.res1, 1000))
  };

$ skala -Dscala.color=true -Xno-uescape
Welcome to Scala 2.11.9-20160323-163638-1fcfdd8c8b (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_60).
Type in expressions for evaluation. Or try :help.

scala> 42
<console>:10: error: invalid escape character
 + "\u001B[1m\u001B[34mres0\u001B[0m: \u001B[1m\u001B[32mInt\u001B[0m = " + scala.runtime.ScalaRunTime.replStringOf(res0, 1000)
 */
object Test extends ReplTest {
  override def transformSettings(settings: Settings): Settings = {
    settings.nouescape.value = true
    settings
  }
  def code = """
object A
  """
}