[OCaml] Mobile-friendly clone of cgit.
1
{
2
"information_for_contributors":[
3
"This file has been converted from https://github.com/atom/language-clojure/blob/master/grammars/clojure.cson",
4
"If you want to provide a fix or improvement, please create a pull request against the original repository.",
5
"Once accepted there, we are happy to receive an update request."
6
],
7
"version":"https://github.com/atom/language-clojure/commit/45bdb881501d0b8f8b707ca1d3fcc8b4b99fca03",
8
"name":"Clojure",
9
"scopeName":"source.clojure",
10
"patterns":[
11
{
12
"include":"#comment"
13
},
14
{
15
"include":"#shebang-comment"
16
},
17
{
18
"include":"#quoted-sexp"
19
},
20
{
21
"include":"#sexp"
22
},
23
{
24
"include":"#keyfn"
25
},
26
{
27
"include":"#string"
28
},
29
{
30
"include":"#vector"
31
},
32
{
33
"include":"#set"
34
},
35
{
36
"include":"#map"
37
},
38
{
39
"include":"#regexp"
40
},
41
{
42
"include":"#var"
43
},
44
{
45
"include":"#constants"
46
},
47
{
48
"include":"#dynamic-variables"
49
},
50
{
51
"include":"#metadata"
52
},
53
{
54
"include":"#namespace-symbol"
55
},
56
{
57
"include":"#symbol"
58
}
59
],
60
"repository":{
61
"comment":{
62
"begin":"(?<!\\\\);",
63
"beginCaptures":{
64
"0":{
65
"name":"punctuation.definition.comment.clojure"
66
}
67
},
68
"end":"$",
69
"name":"comment.line.semicolon.clojure"
70
},
71
"constants":{
72
"patterns":[
73
{
74
"match":"(nil)(?=(\\s|\\)|\\]|\\}))",
75
"name":"constant.language.nil.clojure"
76
},
77
{
78
"match":"(true|false)",
79
"name":"constant.language.boolean.clojure"
80
},
81
{
82
"match":"(##(?:Inf|-Inf|NaN))",
83
"name":"constant.numeric.symbol.clojure"
84
},
85
{
86
"match":"([-+]?\\d+/\\d+)",
87
"name":"constant.numeric.ratio.clojure"
88
},
89
{
90
"match":"([-+]?(?:(?:3[0-6])|(?:[12]\\d)|[2-9])[rR][0-9A-Za-z]+N?)",
91
"name":"constant.numeric.arbitrary-radix.clojure"
92
},
93
{
94
"match":"([-+]?0[xX][0-9a-fA-F]+N?)",
95
"name":"constant.numeric.hexadecimal.clojure"
96
},
97
{
98
"match":"([-+]?0[0-7]+N?)",
99
"name":"constant.numeric.octal.clojure"
100
},
101
{
102
"match":"([-+]?[0-9]+(?:(\\.|(?=[eEM]))[0-9]*([eE][-+]?[0-9]+)?)M?)",
103
"name":"constant.numeric.double.clojure"
104
},
105
{
106
"match":"([-+]?\\d+N?)",
107
"name":"constant.numeric.long.clojure"
108
},
109
{
110
"include":"#keyword"
111
}
112
]
113
},
114
"keyword":{
115
"match":"(?<=(\\s|\\(|\\[|\\{)):[\\w\\#\\.\\-\\_\\:\\+\\=\\>\\<\\/\\!\\?\\*]+(?=(\\s|\\)|\\]|\\}|\\,))",
116
"name":"constant.keyword.clojure"
117
},
118
"keyfn":{
119
"patterns":[
120
{
121
"match":"(?<=(\\s|\\(|\\[|\\{))(if(-[-\\p{Ll}\\?]*)?|when(-[-\\p{Ll}]*)?|for(-[-\\p{Ll}]*)?|cond|do|let(-[-\\p{Ll}\\?]*)?|binding|loop|recur|fn|throw[\\p{Ll}\\-]*|try|catch|finally|([\\p{Ll}]*case))(?=(\\s|\\)|\\]|\\}))",
122
"name":"storage.control.clojure"
123
},
124
{
125
"match":"(?<=(\\s|\\(|\\[|\\{))(declare-?|(in-)?ns|import|use|require|load|compile|(def[\\p{Ll}\\-]*))(?=(\\s|\\)|\\]|\\}))",
126
"name":"keyword.control.clojure"
127
}
128
]
129
},
130
"dynamic-variables":{
131
"match":"\\*[\\w\\.\\-\\_\\:\\+\\=\\>\\<\\!\\?\\d]+\\*",
132
"name":"meta.symbol.dynamic.clojure"
133
},
134
"map":{
135
"begin":"(\\{)",
136
"beginCaptures":{
137
"1":{
138
"name":"punctuation.section.map.begin.clojure"
139
}
140
},
141
"end":"(\\}(?=[\\}\\]\\)\\s]*(?:;|$)))|(\\})",
142
"endCaptures":{
143
"1":{
144
"name":"punctuation.section.map.end.trailing.clojure"
145
},
146
"2":{
147
"name":"punctuation.section.map.end.clojure"
148
}
149
},
150
"name":"meta.map.clojure",
151
"patterns":[
152
{
153
"include":"$self"
154
}
155
]
156
},
157
"metadata":{
158
"patterns":[
159
{
160
"begin":"(\\^\\{)",
161
"beginCaptures":{
162
"1":{
163
"name":"punctuation.section.metadata.map.begin.clojure"
164
}
165
},
166
"end":"(\\}(?=[\\}\\]\\)\\s]*(?:;|$)))|(\\})",
167
"endCaptures":{
168
"1":{
169
"name":"punctuation.section.metadata.map.end.trailing.clojure"
170
},
171
"2":{
172
"name":"punctuation.section.metadata.map.end.clojure"
173
}
174
},
175
"name":"meta.metadata.map.clojure",
176
"patterns":[
177
{
178
"include":"$self"
179
}
180
]
181
},
182
{
183
"begin":"(\\^)",
184
"end":"(\\s)",
185
"name":"meta.metadata.simple.clojure",
186
"patterns":[
187
{
188
"include":"#keyword"
189
},
190
{
191
"include":"$self"
192
}
193
]
194
}
195
]
196
},
197
"quoted-sexp":{
198
"begin":"(['``]\\()",
199
"beginCaptures":{
200
"1":{
201
"name":"punctuation.section.expression.begin.clojure"
202
}
203
},
204
"end":"(\\))$|(\\)(?=[\\}\\]\\)\\s]*(?:;|$)))|(\\))",
205
"endCaptures":{
206
"1":{
207
"name":"punctuation.section.expression.end.trailing.clojure"
208
},
209
"2":{
210
"name":"punctuation.section.expression.end.trailing.clojure"
211
},
212
"3":{
213
"name":"punctuation.section.expression.end.clojure"
214
}
215
},
216
"name":"meta.quoted-expression.clojure",
217
"patterns":[
218
{
219
"include":"$self"
220
}
221
]
222
},
223
"regexp":{
224
"begin":"#\"",
225
"beginCaptures":{
226
"0":{
227
"name":"punctuation.definition.regexp.begin.clojure"
228
}
229
},
230
"end":"\"",
231
"endCaptures":{
232
"0":{
233
"name":"punctuation.definition.regexp.end.clojure"
234
}
235
},
236
"name":"string.regexp.clojure",
237
"patterns":[
238
{
239
"include":"#regexp_escaped_char"
240
}
241
]
242
},
243
"regexp_escaped_char":{
244
"match":"\\\\.",
245
"name":"constant.character.escape.clojure"
246
},
247
"set":{
248
"begin":"(\\#\\{)",
249
"beginCaptures":{
250
"1":{
251
"name":"punctuation.section.set.begin.clojure"
252
}
253
},
254
"end":"(\\}(?=[\\}\\]\\)\\s]*(?:;|$)))|(\\})",
255
"endCaptures":{
256
"1":{
257
"name":"punctuation.section.set.end.trailing.clojure"
258
},
259
"2":{
260
"name":"punctuation.section.set.end.clojure"
261
}
262
},
263
"name":"meta.set.clojure",
264
"patterns":[
265
{
266
"include":"$self"
267
}
268
]
269
},
270
"sexp":{
271
"begin":"(\\()",
272
"beginCaptures":{
273
"1":{
274
"name":"punctuation.section.expression.begin.clojure"
275
}
276
},
277
"end":"(\\))$|(\\)(?=[\\}\\]\\)\\s]*(?:;|$)))|(\\))",
278
"endCaptures":{
279
"1":{
280
"name":"punctuation.section.expression.end.trailing.clojure"
281
},
282
"2":{
283
"name":"punctuation.section.expression.end.trailing.clojure"
284
},
285
"3":{
286
"name":"punctuation.section.expression.end.clojure"
287
}
288
},
289
"name":"meta.expression.clojure",
290
"patterns":[
291
{
292
"begin":"(?<=\\()(ns|declare|def[\\w\\d._:+=><!?*-]*|[\\w._:+=><!?*-][\\w\\d._:+=><!?*-]*/def[\\w\\d._:+=><!?*-]*)\\s+",
293
"beginCaptures":{
294
"1":{
295
"name":"keyword.control.clojure"
296
}
297
},
298
"end":"(?=\\))",
299
"name":"meta.definition.global.clojure",
300
"patterns":[
301
{
302
"include":"#metadata"
303
},
304
{
305
"include":"#dynamic-variables"
306
},
307
{
308
"match":"([\\p{L}\\.\\-\\_\\+\\=\\>\\<\\!\\?\\*][\\w\\.\\-\\_\\:\\+\\=\\>\\<\\!\\?\\*\\d]*)",
309
"name":"entity.global.clojure"
310
},
311
{
312
"include":"$self"
313
}
314
]
315
},
316
{
317
"include":"#keyfn"
318
},
319
{
320
"include":"#constants"
321
},
322
{
323
"include":"#vector"
324
},
325
{
326
"include":"#map"
327
},
328
{
329
"include":"#set"
330
},
331
{
332
"include":"#sexp"
333
},
334
{
335
"match":"(?<=\\()(.+?)(?=\\s|\\))",
336
"captures":{
337
"1":{
338
"name":"entity.name.function.clojure"
339
}
340
},
341
"patterns":[
342
{
343
"include":"$self"
344
}
345
]
346
},
347
{
348
"include":"$self"
349
}
350
]
351
},
352
"shebang-comment":{
353
"begin":"^(#!)",
354
"beginCaptures":{
355
"1":{
356
"name":"punctuation.definition.comment.shebang.clojure"
357
}
358
},
359
"end":"$",
360
"name":"comment.line.shebang.clojure"
361
},
362
"string":{
363
"begin":"(?<!\\\\)(\")",
364
"beginCaptures":{
365
"1":{
366
"name":"punctuation.definition.string.begin.clojure"
367
}
368
},
369
"end":"(\")",
370
"endCaptures":{
371
"1":{
372
"name":"punctuation.definition.string.end.clojure"
373
}
374
},
375
"name":"string.quoted.double.clojure",
376
"patterns":[
377
{
378
"match":"\\\\.",
379
"name":"constant.character.escape.clojure"
380
}
381
]
382
},
383
"namespace-symbol":{
384
"patterns":[
385
{
386
"match":"([\\p{L}\\.\\-\\_\\+\\=\\>\\<\\!\\?\\*][\\w\\.\\-\\_\\:\\+\\=\\>\\<\\!\\?\\*\\d]*)/",
387
"captures":{
388
"1":{
389
"name":"meta.symbol.namespace.clojure"
390
}
391
}
392
}
393
]
394
},
395
"symbol":{
396
"patterns":[
397
{
398
"match":"([\\p{L}\\.\\-\\_\\+\\=\\>\\<\\!\\?\\*][\\w\\.\\-\\_\\:\\+\\=\\>\\<\\!\\?\\*\\d]*)",
399
"name":"meta.symbol.clojure"
400
}
401
]
402
},
403
"var":{
404
"match":"(?<=(\\s|\\(|\\[|\\{)\\#)'[\\w\\.\\-\\_\\:\\+\\=\\>\\<\\/\\!\\?\\*]+(?=(\\s|\\)|\\]|\\}))",
405
"name":"meta.var.clojure"
406
},
407
"vector":{
408
"begin":"(\\[)",
409
"beginCaptures":{
410
"1":{
411
"name":"punctuation.section.vector.begin.clojure"
412
}
413
},
414
"end":"(\\](?=[\\}\\]\\)\\s]*(?:;|$)))|(\\])",
415
"endCaptures":{
416
"1":{
417
"name":"punctuation.section.vector.end.trailing.clojure"
418
},
419
"2":{
420
"name":"punctuation.section.vector.end.clojure"
421
}
422
},
423
"name":"meta.vector.clojure",
424
"patterns":[
425
{
426
"include":"$self"
427
}
428
]
429
}
430
}
431
}