diff options
author | Eugene Burmako <xeno.by@gmail.com> | 2012-03-01 09:59:42 +0100 |
---|---|---|
committer | Eugene Burmako <xeno.by@gmail.com> | 2012-03-01 09:59:42 +0100 |
commit | c1e76ddb80cf7737bfe0e8c99e70ee2ace66e43e (patch) | |
tree | 28a9bd6415668d076d207e8c0603708b1bdcbbf5 | |
parent | 105dc63121c84a45711b02f77f8e4a04074f7425 (diff) | |
download | scala-c1e76ddb80cf7737bfe0e8c99e70ee2ace66e43e.tar.gz scala-c1e76ddb80cf7737bfe0e8c99e70ee2ace66e43e.tar.bz2 scala-c1e76ddb80cf7737bfe0e8c99e70ee2ace66e43e.zip |
Fixes SI-5532
-rw-r--r-- | src/compiler/scala/tools/nsc/ast/parser/Scanners.scala | 14 | ||||
-rw-r--r-- | test/files/run/t5532.flags | 1 | ||||
-rw-r--r-- | test/files/run/t5532.scala | 4 |
3 files changed, 15 insertions, 4 deletions
diff --git a/src/compiler/scala/tools/nsc/ast/parser/Scanners.scala b/src/compiler/scala/tools/nsc/ast/parser/Scanners.scala index 2626ca26a6..9d33e7e9e1 100644 --- a/src/compiler/scala/tools/nsc/ast/parser/Scanners.scala +++ b/src/compiler/scala/tools/nsc/ast/parser/Scanners.scala @@ -670,12 +670,18 @@ trait Scanners extends ScannersCommon { next.offset = charOffset - 1 } if (ch == '"') { - nextRawChar() - if (!multiLine || isTripleQuote()) { + if (multiLine) { + nextRawChar() + if (isTripleQuote()) { + setStrVal() + token = STRINGLIT + } else + getStringPart(multiLine) + } else { + nextChar() setStrVal() token = STRINGLIT - } else - getStringPart(multiLine) + } } else if (ch == '$') { nextRawChar() if (ch == '$') { diff --git a/test/files/run/t5532.flags b/test/files/run/t5532.flags new file mode 100644 index 0000000000..e1b37447c9 --- /dev/null +++ b/test/files/run/t5532.flags @@ -0,0 +1 @@ +-Xexperimental
\ No newline at end of file diff --git a/test/files/run/t5532.scala b/test/files/run/t5532.scala new file mode 100644 index 0000000000..75004730bf --- /dev/null +++ b/test/files/run/t5532.scala @@ -0,0 +1,4 @@ +object Test extends App { + val x = s"1" + val y = s"2" +}
\ No newline at end of file |