summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala
diff options
context:
space:
mode:
authorSom Snytt <som.snytt@gmail.com>2014-04-27 00:08:54 -0700
committerSom Snytt <som.snytt@gmail.com>2014-07-18 21:07:37 -0700
commitabb58dcef1b4758f4e3af26c030e1f0630b8d145 (patch)
tree74f61c65e53ce8adfd3e985b4c23fbe9a3986e9b /src/compiler/scala/tools/nsc/ast/parser/Parsers.scala
parentabdd570cee5788000724c6d3b89a978c48a7fa39 (diff)
downloadscala-abb58dcef1b4758f4e3af26c030e1f0630b8d145.tar.gz
scala-abb58dcef1b4758f4e3af26c030e1f0630b8d145.tar.bz2
scala-abb58dcef1b4758f4e3af26c030e1f0630b8d145.zip
SI-6476 Improve error on escapement
Behavior of escape processing under string interpolation can be confusing. This commit improves the exception message so you know at least what sort of escapes are handled. This came up on SO in the form `s"\d".r`, where it may not be obvious what is throwing and how to work around it. ``` scala> s"\d".r scala.StringContext$InvalidEscapeException: invalid escape '\d' not one of [\b, \t, \n, \f, \r, \\, \", \'] at index 0 in "\d". Use \\ for literal \. scala> s"a\" scala.StringContext$InvalidEscapeException: invalid escape at terminal index 1 in "a\". Use \\ for literal \. ``` Referencing SI-6476 because that has become the magnet ticket for "escape processing under string interpolation, huh?" This doesn't address `$"` and doesn't handle the more interesting parse error `s"a\"b"`.
Diffstat (limited to 'src/compiler/scala/tools/nsc/ast/parser/Parsers.scala')
0 files changed, 0 insertions, 0 deletions