summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/compiler/scala/tools/nsc/ast/parser/Scanners.scala14
-rw-r--r--test/files/run/t5532.flags1
-rw-r--r--test/files/run/t5532.scala4
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