Permalink
Browse files

tweaking the acceptance of quote escapings in strings

  • Loading branch information...
1 parent 7d521db commit e26db6721ee87a0d89cd5f1c0c48693bec3330ef @elzr committed Jun 4, 2014
Showing with 3 additions and 1 deletion.
  1. +3 −1 syntax/json.vim
View
4 syntax/json.vim
@@ -19,7 +19,7 @@ syntax match jsonNoise /\%(:\|,\)/
" Syntax: Strings
" Separated into a match and region because a region by itself is always greedy
-syn match jsonStringMatch /"\([^"]\|\"\)\+"\ze[[:blank:]\r\n]*[,}\]]/ contains=jsonString
+syn match jsonStringMatch /"\([^"]\|\\\"\)\+"\ze[[:blank:]\r\n]*[,}\]]/ contains=jsonString
if has('conceal')
syn region jsonString oneline matchgroup=jsonQuote start=/"/ skip=/\\\\\|\\"/ end=/"/ concealends contains=jsonEscape contained
else
@@ -49,6 +49,7 @@ syn match jsonNumber "-\=\<\%(0\|[1-9]\d*\)\%(\.\d\+\)\=\%([eE][-+]\=\d\+\)
if (!exists("g:vim_json_warnings") || g:vim_json_warnings==1)
" Syntax: Strings should always be enclosed with quotes.
syn match jsonNoQuotesError "\<[[:alpha:]]\+\>"
+ syn match jsonTripleQuotesError /"""/
" Syntax: An integer part of 0 followed by other digits is not allowed.
syn match jsonNumError "-\=\<0\d\.\d*\>"
@@ -119,6 +120,7 @@ if version >= 508 || !exists("did_json_syn_inits")
HiLink jsonMissingCommaError Error
HiLink jsonStringSQError Error
HiLink jsonNoQuotesError Error
+ HiLink jsonTripleQuotesError Error
endif
HiLink jsonQuote Quote
HiLink jsonNoise Noise

0 comments on commit e26db67

Please sign in to comment.