Permalink
Browse files

syntax: use negative lookahead to match end of multiline string

This fixes highlighting for things like:-

 - 13 consecutive double qoutes (= 1 + 6n),

    """"""""""""".r
                ^^^^... -- These would be matched as
                          `scalaString' until the next
                           occurring `"`.

 - 11 consecutive double qoutes (= {3 or 4 or 5} + 6n),

    """"""""""".r
               ^^^... -- These would be matched as
                        `scalaMultiLineString' until the next
                         occurring `"""`.

 - 14 consecutive double qoutes (= 2 + 6n),

    """""""""""""".r
                ^^... -- These would be matched as
                        `scalaEmptyString'.
  • Loading branch information...
1 parent 895f6a4 commit 6d17c7439711555643d30b2a4c6dc619ef7b904f @zoonfafer zoonfafer committed Jul 17, 2011
Showing with 1 addition and 1 deletion.
  1. +1 −1 syntax/scala.vim
View
@@ -102,7 +102,7 @@ syn match scalaAnnotation "@[a-zA-Z]\+"
syn match scalaEmptyString "\"\""
" multi-line string literals
-syn region scalaMultiLineString start="\"\"\"" end="\"\"\"" contains=scalaUnicode
+syn region scalaMultiLineString start="\"\"\"" end="\"\"\"\"\@!" contains=scalaUnicode
syn match scalaUnicode "\\u[0-9a-fA-F]\{4}" contained
" string literals with escapes

0 comments on commit 6d17c74

Please sign in to comment.