@@ -70,12 +70,12 @@ object SyntaxHighlighting {
70
70
val n = takeChar()
71
71
if (interpolationPrefixes.contains(n)) {
72
72
// Interpolation prefixes are a superset of the keyword start chars
73
- val next = remaining.take( 3 ).mkString
74
- if (next .startsWith(" \" " )) {
75
- newBuf += n
76
- prev = n
77
- if (remaining.nonEmpty) takeChar( ) // drop 1 for appendLiteral
78
- appendString('"' , next == " \"\"\" " )
73
+ val (prefix, after) = remaining.span(interpolationPrefixes.contains)
74
+ if (after .startsWith(" \" " )) {
75
+ newBuf += n ++= prefix
76
+ prev = prefix.lastOption.getOrElse(n)
77
+ if (remaining.nonEmpty) takeChars(prefix.length + 1 ) // drop 1 for appendLiteral
78
+ appendString('"' , after.startsWith( " \"\"\" " ), true )
79
79
} else {
80
80
if (n.isUpper && (keywordStart || prev == '.' )) {
81
81
appendWhile(n, ! typeEnders.contains(_), typeDef)
@@ -116,7 +116,7 @@ object SyntaxHighlighting {
116
116
case '@' =>
117
117
appendWhile('@' , ! typeEnders.contains(_), annotation)
118
118
case '\" ' =>
119
- appendString('\" ' , multiline = remaining.take(2 ).mkString == " \"\" " )
119
+ appendString('\" ' , multiline = remaining.take(2 ).mkString == " \"\" " , false )
120
120
case '\' ' =>
121
121
appendSingleQuote('\' ' )
122
122
case '`' =>
@@ -181,11 +181,10 @@ object SyntaxHighlighting {
181
181
newBuf append NoColor
182
182
}
183
183
184
- def appendString (delim : Char , multiline : Boolean = false ) = {
184
+ def appendString (delim : Char , multiline : Boolean = false , inInterpolation : Boolean ) = {
185
185
var curr : Char = 0
186
186
var continue = true
187
187
var closing = 0
188
- val inInterpolation = interpolationPrefixes.contains(prev)
189
188
newBuf append (LiteralColor + delim)
190
189
191
190
def shouldInterpolate =
0 commit comments