| 1 |
{ |
| 2 |
"scopeName": "source.json5", |
| 3 |
"fileTypes": ["json5"], |
| 4 |
"name": "json5", |
| 5 |
"patterns": [ |
| 6 |
{ |
| 7 |
"include": "#comments" |
| 8 |
}, |
| 9 |
{ |
| 10 |
"include": "#value" |
| 11 |
} |
| 12 |
], |
| 13 |
"repository": { |
| 14 |
"array": { |
| 15 |
"begin": "\\[", |
| 16 |
"beginCaptures": { |
| 17 |
"0": { |
| 18 |
"name": "punctuation.definition.array.begin.json5" |
| 19 |
} |
| 20 |
}, |
| 21 |
"end": "\\]", |
| 22 |
"endCaptures": { |
| 23 |
"0": { |
| 24 |
"name": "punctuation.definition.array.end.json5" |
| 25 |
} |
| 26 |
}, |
| 27 |
"name": "meta.structure.array.json5", |
| 28 |
"patterns": [ |
| 29 |
{ |
| 30 |
"include": "#comments" |
| 31 |
}, |
| 32 |
{ |
| 33 |
"include": "#value" |
| 34 |
}, |
| 35 |
{ |
| 36 |
"match": ",", |
| 37 |
"name": "punctuation.separator.array.json5" |
| 38 |
}, |
| 39 |
{ |
| 40 |
"match": "[^\\s\\]]", |
| 41 |
"name": "invalid.illegal.expected-array-separator.json5" |
| 42 |
} |
| 43 |
] |
| 44 |
}, |
| 45 |
"constant": { |
| 46 |
"match": "\\b(?:true|false|null|Infinity|NaN)\\b", |
| 47 |
"name": "constant.language.json5" |
| 48 |
}, |
| 49 |
"infinity": { |
| 50 |
"match": "(-)*\\b(?:Infinity|NaN)\\b", |
| 51 |
"name": "constant.language.json5" |
| 52 |
}, |
| 53 |
"number": { |
| 54 |
"patterns": [ |
| 55 |
{ |
| 56 |
"comment": "handles hexadecimal numbers", |
| 57 |
"match": "(0x)[0-9a-fA-f]*", |
| 58 |
"name": "constant.hex.numeric.json5" |
| 59 |
}, |
| 60 |
{ |
| 61 |
"comment": "handles integer and decimal numbers", |
| 62 |
"match": "[+-.]?(?=[1-9]|0(?!\\d))\\d+(\\.\\d+)?([eE][+-]?\\d+)?", |
| 63 |
"name": "constant.dec.numeric.json5" |
| 64 |
} |
| 65 |
] |
| 66 |
}, |
| 67 |
"object": { |
| 68 |
"begin": "\\{", |
| 69 |
"beginCaptures": { |
| 70 |
"0": { |
| 71 |
"name": "punctuation.definition.dictionary.begin.json5" |
| 72 |
} |
| 73 |
}, |
| 74 |
"comment": "a json5 object", |
| 75 |
"end": "\\}", |
| 76 |
"endCaptures": { |
| 77 |
"0": { |
| 78 |
"name": "punctuation.definition.dictionary.end.json5" |
| 79 |
} |
| 80 |
}, |
| 81 |
"name": "meta.structure.dictionary.json5", |
| 82 |
"patterns": [ |
| 83 |
{ |
| 84 |
"include": "#comments" |
| 85 |
}, |
| 86 |
{ |
| 87 |
"comment": "the json5 object key", |
| 88 |
"include": "#key" |
| 89 |
}, |
| 90 |
{ |
| 91 |
"begin": ":", |
| 92 |
"beginCaptures": { |
| 93 |
"0": { |
| 94 |
"name": "punctuation.separator.dictionary.key-value.json5" |
| 95 |
} |
| 96 |
}, |
| 97 |
"end": "(,)|(?=\\})", |
| 98 |
"endCaptures": { |
| 99 |
"1": { |
| 100 |
"name": "punctuation.separator.dictionary.pair.json5" |
| 101 |
} |
| 102 |
}, |
| 103 |
"name": "meta.structure.dictionary.value.json5", |
| 104 |
"patterns": [ |
| 105 |
{ |
| 106 |
"comment": "the json5 object value", |
| 107 |
"include": "#value" |
| 108 |
}, |
| 109 |
{ |
| 110 |
"match": "[^\\s,]", |
| 111 |
"name": "invalid.illegal.expected-dictionary-separator.json5" |
| 112 |
} |
| 113 |
] |
| 114 |
}, |
| 115 |
{ |
| 116 |
"match": "[^\\s\\}]", |
| 117 |
"name": "invalid.illegal.expected-dictionary-separator.json5" |
| 118 |
} |
| 119 |
] |
| 120 |
}, |
| 121 |
"stringSingle": { |
| 122 |
"begin": "[']", |
| 123 |
"beginCaptures": { |
| 124 |
"0": { |
| 125 |
"name": "punctuation.definition.string.begin.json5" |
| 126 |
} |
| 127 |
}, |
| 128 |
"end": "[']", |
| 129 |
"endCaptures": { |
| 130 |
"0": { |
| 131 |
"name": "punctuation.definition.string.end.json5" |
| 132 |
} |
| 133 |
}, |
| 134 |
"name": "string.quoted.json5", |
| 135 |
"patterns": [ |
| 136 |
{ |
| 137 |
"match": "(?x: # turn on extended mode\n \\\\ # a literal backslash\n (?: # ...followed by...\n [\"\\\\/bfnrt] # one of these characters\n | # ...or...\n u # a u\n [0-9a-fA-F]{4} # and four hex digits\n )\n )", |
| 138 |
"name": "constant.character.escape.json5" |
| 139 |
}, |
| 140 |
{ |
| 141 |
"match": "\\\\.", |
| 142 |
"name": "invalid.illegal.unrecognized-string-escape.json5" |
| 143 |
} |
| 144 |
] |
| 145 |
}, |
| 146 |
"stringDouble": { |
| 147 |
"begin": "[\"]", |
| 148 |
"beginCaptures": { |
| 149 |
"0": { |
| 150 |
"name": "punctuation.definition.string.begin.json5" |
| 151 |
} |
| 152 |
}, |
| 153 |
"end": "[\"]", |
| 154 |
"endCaptures": { |
| 155 |
"0": { |
| 156 |
"name": "punctuation.definition.string.end.json5" |
| 157 |
} |
| 158 |
}, |
| 159 |
"name": "string.quoted.json5", |
| 160 |
"patterns": [ |
| 161 |
{ |
| 162 |
"match": "(?x: # turn on extended mode\n \\\\ # a literal backslash\n (?: # ...followed by...\n [\"\\\\/bfnrt] # one of these characters\n | # ...or...\n u # a u\n [0-9a-fA-F]{4} # and four hex digits\n )\n )", |
| 163 |
"name": "constant.character.escape.json5" |
| 164 |
}, |
| 165 |
{ |
| 166 |
"match": "\\\\.", |
| 167 |
"name": "invalid.illegal.unrecognized-string-escape.json5" |
| 168 |
} |
| 169 |
] |
| 170 |
}, |
| 171 |
"key": { |
| 172 |
"name": "string.key.json5", |
| 173 |
"patterns": [ |
| 174 |
{ |
| 175 |
"include": "#stringSingle" |
| 176 |
}, |
| 177 |
{ |
| 178 |
"include": "#stringDouble" |
| 179 |
}, |
| 180 |
{ |
| 181 |
"match": "[a-zA-Z0-9_-]", |
| 182 |
"name": "string.key.json5" |
| 183 |
} |
| 184 |
] |
| 185 |
}, |
| 186 |
"value": { |
| 187 |
"comment": "the 'value' diagram at http://json.org", |
| 188 |
"patterns": [ |
| 189 |
{ |
| 190 |
"include": "#constant" |
| 191 |
}, |
| 192 |
{ |
| 193 |
"include": "#infinity" |
| 194 |
}, |
| 195 |
{ |
| 196 |
"include": "#number" |
| 197 |
}, |
| 198 |
{ |
| 199 |
"include": "#stringSingle" |
| 200 |
}, |
| 201 |
{ |
| 202 |
"include": "#stringDouble" |
| 203 |
}, |
| 204 |
{ |
| 205 |
"include": "#array" |
| 206 |
}, |
| 207 |
{ |
| 208 |
"include": "#object" |
| 209 |
} |
| 210 |
] |
| 211 |
}, |
| 212 |
"comments": { |
| 213 |
"patterns": [ |
| 214 |
{ |
| 215 |
"match": "/{2}.*", |
| 216 |
"name": "comment.single.json5" |
| 217 |
}, |
| 218 |
{ |
| 219 |
"begin": "/\\*\\*(?!/)", |
| 220 |
"captures": { |
| 221 |
"0": { |
| 222 |
"name": "punctuation.definition.comment.json5" |
| 223 |
} |
| 224 |
}, |
| 225 |
"end": "\\*/", |
| 226 |
"name": "comment.block.documentation.json5" |
| 227 |
}, |
| 228 |
{ |
| 229 |
"begin": "/\\*", |
| 230 |
"captures": { |
| 231 |
"0": { |
| 232 |
"name": "punctuation.definition.comment.json5" |
| 233 |
} |
| 234 |
}, |
| 235 |
"end": "\\*/", |
| 236 |
"name": "comment.block.json5" |
| 237 |
} |
| 238 |
] |
| 239 |
} |
| 240 |
} |
| 241 |
} |
| 242 |
|