Browse files

restored detection of trailing commas

  • Loading branch information...
1 parent faaebc9 commit 8fcc9be3e63906ef4d70d8c861ee09f68c755efc @elzr committed Apr 14, 2014
Showing with 5 additions and 3 deletions.
  1. +3 −2 json-test.json
  2. +2 −1 syntax/json.vim
View
5 json-test.json
@@ -3,11 +3,12 @@
{
unquotedKeyword:'singleQuotedString',
'singleQuotedKeyword':true,
- "decimalCantStartWithPeriod":.1,
+ "decimalCantStartWithPeriod":.1
+ "semicolonAtEndOfThisObject":"trailingComma",
};
{
- "object1": "missingComma"
+ "object1": "missingComma"
"object2": "value"
}
View
3 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 /"[^\"]\+"[[: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
@@ -101,6 +101,7 @@ if version >= 508 || !exists("did_json_syn_inits")
endif
HiLink jsonPadding Operator
HiLink jsonString String
+ HiLink jsonTest Label
HiLink jsonEscape Special
HiLink jsonNumber Number
HiLink jsonBraces Delimiter

0 comments on commit 8fcc9be

Please sign in to comment.