File tree Expand file tree Collapse file tree 2 files changed +19
-3
lines changed
compiler/src/dotty/tools/dotc/parsing Expand file tree Collapse file tree 2 files changed +19
-3
lines changed Original file line number Diff line number Diff line change @@ -742,17 +742,22 @@ object Scanners {
742742 if (token == INTERPOLATIONID ) {
743743 nextRawChar()
744744 if (ch == '\" ' ) {
745- nextRawChar()
746- if (ch == '\" ' ) {
745+ if (lookaheadChar() == '\" ' ) {
746+ nextRawChar()
747+ // offset += 3 // first part is positioned at the quote
747748 nextRawChar()
748749 stringPart(multiLine = true )
749750 }
750751 else {
752+ nextChar()
751753 token = STRINGLIT
752754 strVal = " "
753755 }
754756 }
755- else stringPart(multiLine = false )
757+ else {
758+ // offset += 1 // first part is positioned at the quote
759+ stringPart(multiLine = false )
760+ }
756761 }
757762 else {
758763 nextChar()
Original file line number Diff line number Diff line change 1+
2+ object X {
3+ val x = s " "
4+ val y = true
5+ }
6+
7+ /* was:
8+ 4 | val y = true
9+ | ^^^
10+ | end of statement expected but 'val' found
11+ */
You can’t perform that action at this time.
0 commit comments