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/de877502aa4a77ccdc2c7f0c9180436aea3effff",
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": "(-?\\d+/\\d+)",
83					"name": "constant.numeric.ratio.clojure"
84				},
85				{
86					"match": "(-?\\d+[rR]\\w+)",
87					"name": "constant.numeric.arbitrary-radix.clojure"
88				},
89				{
90					"match": "(-?0[xX][0-9a-fA-F]+)",
91					"name": "constant.numeric.hexadecimal.clojure"
92				},
93				{
94					"match": "(-?0\\d+)",
95					"name": "constant.numeric.octal.clojure"
96				},
97				{
98					"match": "(-?\\d+\\.\\d+([eE][+-]?\\d+)?M)",
99					"name": "constant.numeric.bigdecimal.clojure"
100				},
101				{
102					"match": "(-?\\d+\\.\\d+([eE][+-]?\\d+)?)",
103					"name": "constant.numeric.double.clojure"
104				},
105				{
106					"match": "(-?\\d+N)",
107					"name": "constant.numeric.bigint.clojure"
108				},
109				{
110					"match": "(-?\\d+)",
111					"name": "constant.numeric.long.clojure"
112				},
113				{
114					"include": "#keyword"
115				}
116			]
117		},
118		"keyword": {
119			"match": "(?<=(\\s|\\(|\\[|\\{)):[\\w\\#\\.\\-\\_\\:\\+\\=\\>\\<\\/\\!\\?\\*]+(?=(\\s|\\)|\\]|\\}|\\,))",
120			"name": "constant.keyword.clojure"
121		},
122		"keyfn": {
123			"patterns": [
124				{
125					"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|\\)|\\]|\\}))",
126					"name": "storage.control.clojure"
127				},
128				{
129					"match": "(?<=(\\s|\\(|\\[|\\{))(declare-?|(in-)?ns|import|use|require|load|compile|(def[\\p{Ll}\\-]*))(?=(\\s|\\)|\\]|\\}))",
130					"name": "keyword.control.clojure"
131				}
132			]
133		},
134		"dynamic-variables": {
135			"match": "\\*[\\w\\.\\-\\_\\:\\+\\=\\>\\<\\!\\?\\d]+\\*",
136			"name": "meta.symbol.dynamic.clojure"
137		},
138		"map": {
139			"begin": "(\\{)",
140			"beginCaptures": {
141				"1": {
142					"name": "punctuation.section.map.begin.clojure"
143				}
144			},
145			"end": "(\\}(?=[\\}\\]\\)\\s]*(?:;|$)))|(\\})",
146			"endCaptures": {
147				"1": {
148					"name": "punctuation.section.map.end.trailing.clojure"
149				},
150				"2": {
151					"name": "punctuation.section.map.end.clojure"
152				}
153			},
154			"name": "meta.map.clojure",
155			"patterns": [
156				{
157					"include": "$self"
158				}
159			]
160		},
161		"metadata": {
162			"patterns": [
163				{
164					"begin": "(\\^\\{)",
165					"beginCaptures": {
166						"1": {
167							"name": "punctuation.section.metadata.map.begin.clojure"
168						}
169					},
170					"end": "(\\}(?=[\\}\\]\\)\\s]*(?:;|$)))|(\\})",
171					"endCaptures": {
172						"1": {
173							"name": "punctuation.section.metadata.map.end.trailing.clojure"
174						},
175						"2": {
176							"name": "punctuation.section.metadata.map.end.clojure"
177						}
178					},
179					"name": "meta.metadata.map.clojure",
180					"patterns": [
181						{
182							"include": "$self"
183						}
184					]
185				},
186				{
187					"begin": "(\\^)",
188					"end": "(\\s)",
189					"name": "meta.metadata.simple.clojure",
190					"patterns": [
191						{
192							"include": "#keyword"
193						},
194						{
195							"include": "$self"
196						}
197					]
198				}
199			]
200		},
201		"quoted-sexp": {
202			"begin": "(['``]\\()",
203			"beginCaptures": {
204				"1": {
205					"name": "punctuation.section.expression.begin.clojure"
206				}
207			},
208			"end": "(\\))$|(\\)(?=[\\}\\]\\)\\s]*(?:;|$)))|(\\))",
209			"endCaptures": {
210				"1": {
211					"name": "punctuation.section.expression.end.trailing.clojure"
212				},
213				"2": {
214					"name": "punctuation.section.expression.end.trailing.clojure"
215				},
216				"3": {
217					"name": "punctuation.section.expression.end.clojure"
218				}
219			},
220			"name": "meta.quoted-expression.clojure",
221			"patterns": [
222				{
223					"include": "$self"
224				}
225			]
226		},
227		"regexp": {
228			"begin": "#\"",
229			"beginCaptures": {
230				"0": {
231					"name": "punctuation.definition.regexp.begin.clojure"
232				}
233			},
234			"end": "\"",
235			"endCaptures": {
236				"0": {
237					"name": "punctuation.definition.regexp.end.clojure"
238				}
239			},
240			"name": "string.regexp.clojure",
241			"patterns": [
242				{
243					"include": "#regexp_escaped_char"
244				}
245			]
246		},
247		"regexp_escaped_char": {
248			"match": "\\\\.",
249			"name": "constant.character.escape.clojure"
250		},
251		"set": {
252			"begin": "(\\#\\{)",
253			"beginCaptures": {
254				"1": {
255					"name": "punctuation.section.set.begin.clojure"
256				}
257			},
258			"end": "(\\}(?=[\\}\\]\\)\\s]*(?:;|$)))|(\\})",
259			"endCaptures": {
260				"1": {
261					"name": "punctuation.section.set.end.trailing.clojure"
262				},
263				"2": {
264					"name": "punctuation.section.set.end.clojure"
265				}
266			},
267			"name": "meta.set.clojure",
268			"patterns": [
269				{
270					"include": "$self"
271				}
272			]
273		},
274		"sexp": {
275			"begin": "(\\()",
276			"beginCaptures": {
277				"1": {
278					"name": "punctuation.section.expression.begin.clojure"
279				}
280			},
281			"end": "(\\))$|(\\)(?=[\\}\\]\\)\\s]*(?:;|$)))|(\\))",
282			"endCaptures": {
283				"1": {
284					"name": "punctuation.section.expression.end.trailing.clojure"
285				},
286				"2": {
287					"name": "punctuation.section.expression.end.trailing.clojure"
288				},
289				"3": {
290					"name": "punctuation.section.expression.end.clojure"
291				}
292			},
293			"name": "meta.expression.clojure",
294			"patterns": [
295				{
296					"begin": "(?<=\\()(ns|declare|def[\\w\\d._:+=><!?*-]*|[\\w._:+=><!?*-][\\w\\d._:+=><!?*-]*/def[\\w\\d._:+=><!?*-]*)\\s+",
297					"beginCaptures": {
298						"1": {
299							"name": "keyword.control.clojure"
300						}
301					},
302					"end": "(?=\\))",
303					"name": "meta.definition.global.clojure",
304					"patterns": [
305						{
306							"include": "#metadata"
307						},
308						{
309							"include": "#dynamic-variables"
310						},
311						{
312							"match": "([\\p{L}\\.\\-\\_\\+\\=\\>\\<\\!\\?\\*][\\w\\.\\-\\_\\:\\+\\=\\>\\<\\!\\?\\*\\d]*)",
313							"name": "entity.global.clojure"
314						},
315						{
316							"include": "$self"
317						}
318					]
319				},
320				{
321					"include": "#keyfn"
322				},
323				{
324					"include": "#constants"
325				},
326				{
327					"include": "#vector"
328				},
329				{
330					"include": "#map"
331				},
332				{
333					"include": "#set"
334				},
335				{
336					"include": "#sexp"
337				},
338				{
339					"match": "(?<=\\()(.+?)(?=\\s|\\))",
340					"captures": {
341						"1": {
342							"name": "entity.name.function.clojure"
343						}
344					},
345					"patterns": [
346						{
347							"include": "$self"
348						}
349					]
350				},
351				{
352					"include": "$self"
353				}
354			]
355		},
356		"shebang-comment": {
357			"begin": "^(#!)",
358			"beginCaptures": {
359				"1": {
360					"name": "punctuation.definition.comment.shebang.clojure"
361				}
362			},
363			"end": "$",
364			"name": "comment.line.shebang.clojure"
365		},
366		"string": {
367			"begin": "(?<!\\\\)(\")",
368			"beginCaptures": {
369				"1": {
370					"name": "punctuation.definition.string.begin.clojure"
371				}
372			},
373			"end": "(\")",
374			"endCaptures": {
375				"1": {
376					"name": "punctuation.definition.string.end.clojure"
377				}
378			},
379			"name": "string.quoted.double.clojure",
380			"patterns": [
381				{
382					"match": "\\\\.",
383					"name": "constant.character.escape.clojure"
384				}
385			]
386		},
387		"namespace-symbol": {
388			"patterns": [
389				{
390					"match": "([\\p{L}\\.\\-\\_\\+\\=\\>\\<\\!\\?\\*][\\w\\.\\-\\_\\:\\+\\=\\>\\<\\!\\?\\*\\d]*)/",
391					"captures": {
392						"1": {
393							"name": "meta.symbol.namespace.clojure"
394						}
395					}
396				}
397			]
398		},
399		"symbol": {
400			"patterns": [
401				{
402					"match": "([\\p{L}\\.\\-\\_\\+\\=\\>\\<\\!\\?\\*][\\w\\.\\-\\_\\:\\+\\=\\>\\<\\!\\?\\*\\d]*)",
403					"name": "meta.symbol.clojure"
404				}
405			]
406		},
407		"var": {
408			"match": "(?<=(\\s|\\(|\\[|\\{)\\#)'[\\w\\.\\-\\_\\:\\+\\=\\>\\<\\/\\!\\?\\*]+(?=(\\s|\\)|\\]|\\}))",
409			"name": "meta.var.clojure"
410		},
411		"vector": {
412			"begin": "(\\[)",
413			"beginCaptures": {
414				"1": {
415					"name": "punctuation.section.vector.begin.clojure"
416				}
417			},
418			"end": "(\\](?=[\\}\\]\\)\\s]*(?:;|$)))|(\\])",
419			"endCaptures": {
420				"1": {
421					"name": "punctuation.section.vector.end.trailing.clojure"
422				},
423				"2": {
424					"name": "punctuation.section.vector.end.clojure"
425				}
426			},
427			"name": "meta.vector.clojure",
428			"patterns": [
429				{
430					"include": "$self"
431				}
432			]
433		}
434	}
435}