Skip to content

Commit c1e76dd

Browse files
committed
Fixes SI-5532
1 parent 105dc63 commit c1e76dd

File tree

3 files changed

+15
-4
lines changed

3 files changed

+15
-4
lines changed

src/compiler/scala/tools/nsc/ast/parser/Scanners.scala

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -670,12 +670,18 @@ trait Scanners extends ScannersCommon {
670670
next.offset = charOffset - 1
671671
}
672672
if (ch == '"') {
673-
nextRawChar()
674-
if (!multiLine || isTripleQuote()) {
673+
if (multiLine) {
674+
nextRawChar()
675+
if (isTripleQuote()) {
676+
setStrVal()
677+
token = STRINGLIT
678+
} else
679+
getStringPart(multiLine)
680+
} else {
681+
nextChar()
675682
setStrVal()
676683
token = STRINGLIT
677-
} else
678-
getStringPart(multiLine)
684+
}
679685
} else if (ch == '$') {
680686
nextRawChar()
681687
if (ch == '$') {

test/files/run/t5532.flags

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
-Xexperimental

test/files/run/t5532.scala

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
object Test extends App {
2+
val x = s"1"
3+
val y = s"2"
4+
}

0 commit comments

Comments
 (0)