summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDominik Gruntz <dominik.gruntz@fhnw.ch>2012-04-13 00:51:39 +0200
committerDominik Gruntz <dominik.gruntz@fhnw.ch>2012-04-13 00:51:39 +0200
commit983f414dd32752ff2dbca5a4637b0978b31d35a7 (patch)
tree8c59849505710c0f2854c7bec40ea54014e25c87 /src
parent6e7382b5da213ca56bde1b1ad9e48f94b24de172 (diff)
downloadscala-983f414dd32752ff2dbca5a4637b0978b31d35a7.tar.gz
scala-983f414dd32752ff2dbca5a4637b0978b31d35a7.tar.bz2
scala-983f414dd32752ff2dbca5a4637b0978b31d35a7.zip
SI-5510: string interpolation: parser no longer hangs on unclosed string
Diffstat (limited to 'src')
-rw-r--r--src/compiler/scala/tools/nsc/ast/parser/Scanners.scala10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/nsc/ast/parser/Scanners.scala b/src/compiler/scala/tools/nsc/ast/parser/Scanners.scala
index 81d81a4fb7..ce38f034cf 100644
--- a/src/compiler/scala/tools/nsc/ast/parser/Scanners.scala
+++ b/src/compiler/scala/tools/nsc/ast/parser/Scanners.scala
@@ -231,6 +231,12 @@ trait Scanners extends ScannersCommon {
lastOffset -= 1
}
if (inStringInterpolation) fetchStringPart() else fetchToken()
+ if(token == ERROR) {
+ if (inMultiLineInterpolation)
+ sepRegions = sepRegions.tail.tail
+ else if (inStringInterpolation)
+ sepRegions = sepRegions.tail
+ }
} else {
this copyFrom next
next.token = EMPTY
@@ -328,7 +334,7 @@ trait Scanners extends ScannersCommon {
putChar(ch)
nextChar()
getIdentRest()
- if (ch == '"' && token == IDENTIFIER && settings.Xexperimental.value)
+ if (ch == '"' && token == IDENTIFIER)
token = INTERPOLATIONID
case '<' => // is XMLSTART?
val last = if (charOffset >= 2) buf(charOffset - 2) else ' '
@@ -697,7 +703,7 @@ trait Scanners extends ScannersCommon {
do {
putChar(ch)
nextRawChar()
- } while (Character.isUnicodeIdentifierPart(ch))
+ } while (ch != SU && Character.isUnicodeIdentifierPart(ch))
next.token = IDENTIFIER
next.name = newTermName(cbuf.toString)
cbuf.clear()