Skip to content

Commit

Permalink
tweaking the acceptance of quote escapings in strings
Browse files Browse the repository at this point in the history
  • Loading branch information
elzr committed Jun 4, 2014
1 parent 7d521db commit e26db67
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion syntax/json.vim
Expand Up @@ -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
Expand Down Expand Up @@ -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*\>"
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit e26db67

Please sign in to comment.