Allow nested strings in interpolated strings

Previously this broke all following syntax highlighting because it
thought it was continuing a string
This commit is contained in:
Keith Smiley
2016-01-08 16:38:51 -08:00
parent f2ce1a39a9
commit b583247fd7
2 changed files with 4 additions and 1 deletions

View File

@@ -309,6 +309,9 @@ key = map.optionalFrom("string") ?? []
key = map.optionalFrom("string") key = map.optionalFrom("string")
thing = map.optionalFrom("string") ?? .Fallback thing = map.optionalFrom("string") ?? .Fallback
// This should not break all highlighting
print("Copying \(NSProcessInfo().environment["SCRIPT_INPUT_FILE_\(index)"]!)")
guard let path = NSBundle.mainBundle().pathForResource(imageName, ofType: "png"), guard let path = NSBundle.mainBundle().pathForResource(imageName, ofType: "png"),
let data = NSData(contentsOfFile: path) else let data = NSData(contentsOfFile: path) else
{ {

View File

@@ -54,7 +54,7 @@ delfunction s:CommentKeywordMatch
" Literals " Literals
" Strings " Strings
syntax region swiftString start=/"/ skip=/\\\\\|\\"/ end=/"/ contains=swiftInterpolatedWrapper syntax region swiftString start=/"/ skip=/\\\\\|\\"/ end=/"/ contains=swiftInterpolatedWrapper
syntax region swiftInterpolatedWrapper start="\v[^\\]\\\(\s*" end="\v\s*\)" contained containedin=swiftString contains=swiftInterpolatedString syntax region swiftInterpolatedWrapper start="\v[^\\]\\\(\s*" end="\v\s*\)" contained containedin=swiftString contains=swiftInterpolatedString,swiftString
syntax match swiftInterpolatedString "\v\w+(\(\))?" contained containedin=swiftInterpolatedWrapper syntax match swiftInterpolatedString "\v\w+(\(\))?" contained containedin=swiftInterpolatedWrapper
" Numbers " Numbers