[SyntaxColoring] Check if the end quote is escaped when checking if a string ends. rdar://23188457

This commit is contained in:
Xi Ge
2015-11-04 10:54:13 -08:00
parent 33f71c95a9
commit 37370aaa55
2 changed files with 6 additions and 1 deletions

View File

@@ -134,7 +134,8 @@ SyntaxModelContext::SyntaxModelContext(SourceFile &SrcFile)
if (PrevTok.getKind() != tok::string_literal)
continue;
StringRef StrText = PrevTok.getText();
if (StrText.size() > 1 && StrText.back() == '\"')
if (StrText.size() > 1 && StrText.back() == '\"' &&
!StrText.endswith("\\\""))
continue;
Kind = SyntaxNodeKind::StringInterpolationAnchor;
break;