-
Notifications
You must be signed in to change notification settings - Fork 1
/
closure.lang
101 lines (86 loc) · 3.3 KB
/
closure.lang
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
<?xml version="1.0" encoding="UTF-8"?>
<language id="closure" _name="Closure" version="2.0" _section="Sources">
<metadata>
<property name="mimetypes">text/x-clojure;application/x-clojure</property>
<property name="globs">*.clj</property>
<property name="line-comment-start">;</property>
</metadata>
<styles> <!-- these styles are chosen purely for their colors -->
<style id="comment" _name="Comment" map-to="def:comment"/>
<style id="clj-string" _name="String" map-to="def:string"/>
<style id="string-escape" _name="String escape" map-to="def:special-char"/>
<style id="clj-number" _name="Number" map-to="def:special-constant"/>
<style id="clj-char" _name="Character" map-to="def:constant"/>
<style id="clj-symbol" _name="Symbol" map-to="def:keyword"/>
<style id="clj-keyword" _name="Keyword" map-to="def:special-constant"/>
<style id="clj-regex" _name="Regex" map-to="def:string"/>
<style id="regex-escape" _name="Regex escape" map-to="def:special-char"/>
</styles>
<definitions>
<context id="line-comment" style-ref="comment" end-at-line-end="true">
<start>(;|#!)</start>
<include>
<context ref="def:in-comment"/>
</include>
</context>
<context id="clj-string" style-ref="clj-string">
<start>"</start>
<end>"</end>
<include>
<context id="string-escape" style-ref="string-escape" extend-parent="true">
<match extended="true">
\\( # open
[\\"btnfr] | # simple
u[0-9A-Fa-f]{4} | # 16-bit hex value
[0-7]{1,3} # octal
)
</match>
</context>
</include>
</context>
<context id="clj-number" style-ref="clj-number">
<prefix></prefix>
<suffix></suffix>
<keyword>\d[^\s\[\]\{\}\(\);\\"@~`\^,'%#]*</keyword>
</context>
<context id="clj-char" style-ref="clj-char">
<prefix></prefix>
<suffix></suffix>
<keyword>\\.[^\s,";@\^`~\(\)\[\]\{\}\\]*</keyword>
</context>
<context id="clj-symbol" style-ref="clj-symbol">
<prefix></prefix>
<suffix></suffix>
<keyword>[^:\d\s,";@\^`~\(\)\[\]\{\}\\'#][^\s,";@\^`~\(\)\[\]\{\}\\]*</keyword>
</context>
<context id="clj-keyword" style-ref="clj-keyword">
<prefix></prefix>
<suffix></suffix>
<keyword>:[^\s\[\]\{\}\(\);\\"@~`\^,']+</keyword>
</context>
<context id="clj-regex" style-ref="clj-regex">
<start>#"</start>
<end>"</end>
<include>
<context id="regex-escape" style-ref="regex-escape" extend-parent="true">
<match extended="true">
\\( # open
[\\"] # just \ or " (ignoring internal syntax of regex)
)
</match>
</context>
</include>
</context>
<context id="closure">
<include>
<context ref="line-comment"/>
<context ref="clj-string" />
<context ref="clj-number" />
<context ref="clj-char" />
<context ref="clj-symbol" />
<context ref="clj-keyword" />
<context ref="clj-regex" />
</include>
</context>
</definitions>
</language>