-
Notifications
You must be signed in to change notification settings - Fork 9
/
Clojure.textmate
181 lines (168 loc) · 4.25 KB
/
Clojure.textmate
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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
{ scopeName = 'source.clojure';
comment = '';
fileTypes = ( 'clj' );
foldingStartMarker = '\(';
foldingStopMarker = '\)';
patterns = (
{ include = '#comment'; },
{ include = '#shebang-comment'; },
{ include = '#qouted-sexp'; },
{ include = '#sexp'; },
{ include = '#string'; },
{ include = '#vector'; },
{ include = '#set'; },
{ include = '#map'; },
{ include = '#regexp'; },
{ include = '#constants'; },
{ include = '#symbol'; },
);
repository = {
comment = {
name = 'comment.line.semicolon.clojure';
match = '(;).*$\n?';
captures = { 1 = { name = 'punctuation.definition.comment.clojure'; }; };
};
shebang-comment = {
name = 'comment.line.semicolon.clojure';
match = '^(\#!).*$\n?';
captures = { 1 = { name = 'punctuation.definition.comment.shebang.clojure'; }; };
};
symbol = {
patterns = (
{ name = 'meta.symbol.clojure';
match = '(\w[\w\d]+)';
},
);
};
constants = {
patterns = (
{ name = 'constant.language.nil.clojure';
match = '(nil)';
},
{ name = 'constant.language.boolean.clojure';
match = '(true|false)';
},
{ name = 'constant.numeric.ratio.clojure';
match = '(\d+/\d+)';
},
{ name = 'constant.numeric.arbitrary-radix.clojure';
match = '(\d+r\d+)';
},
{ name = 'constant.numeric.hexidecimal.clojure';
match = '(0x\d+)';
},
{ name = 'constant.numeric.octal.clojure';
match = '(0\d+)';
},
{ name = 'constant.numeric.decimal.clojure';
match = '(\d+)';
},
);
};
regexp = {
name = 'string.regexp.clojure';
begin = '#\"';
end = '\"';
patterns = ( { include = '#regexp_escaped_char'; } );
};
regexp_escaped_char = {
name = 'string.regexp.clojure';
match = '\\(\")';
};
sexp = {
name = 'meta.expression.clojure';
begin = '(\()';
end = '(\))(\n)?';
beginCaptures = { 1 = { name = 'punctuation.section.expression.begin.clojure'; }; };
endCaptures = {
1 = { name = 'punctuation.section.expression.end.clojure'; };
2 = { name = 'meta.after-expression.clojure'; };
};
patterns = (
{ name = 'meta.definition.global.clojure';
begin = '(?<=\()(def|def-)\s+(.+?)(?=\s)';
end = '(?=\))';
beginCaptures = {
1 = { name = 'keyword.control.clojure'; };
2 = { name = 'entity.global.clojure'; };
};
patterns = (
{ include = '$self'; },
);
},
{ name = 'meta.definition.function.clojure';
begin = '(?<=\()(defn|defn-)\s+(.+?)(?=\s)';
end = '(?=\))';
beginCaptures = {
1 = { name = 'keyword.control.clojure'; };
2 = { name = 'entity.function.clojure'; };
};
patterns = (
{ include = '$self'; },
);
},
{ name = 'meta.definition.macro.clojure';
begin = '(?<=\()(defmacro|defmacro-)\s+(.+?)(?=\s)';
end = '(?=\))';
beginCaptures = {
1 = { name = 'keyword.control.clojure'; };
2 = { name = 'entity.macro.clojure'; };
};
patterns = (
{ include = '$self'; },
);
},
{ include = '$self'; },
);
};
qouted-sexp = {
name = 'meta.qouted-expression.clojure';
begin = '([''``]\()';
end = '(\))(\n)?';
beginCaptures = { 1 = { name = 'punctuation.section.expression.begin.clojure'; }; };
endCaptures = {
1 = { name = 'punctuation.section.expression.end.clojure'; };
2 = { name = 'meta.after-expression.clojure'; };
};
patterns = (
{ include = '$self'; },
);
};
string = {
name = 'string.quoted.double.clojure';
begin = '(")';
end = '(")';
beginCaptures = { 1 = { name = 'punctuation.definition.string.begin.clojure'; }; };
endCaptures = { 1 = { name = 'punctuation.definition.string.end.clojure'; }; };
patterns = (
{ name = 'constant.character.escape.clojure';
match = '\\.';
},
);
};
vector = {
name = "meta.vector.clojure";
begin = '(\[)';
end = '(\])';
patterns = (
{ include = '$self'; },
);
};
set = {
name = "meta.set.clojure";
begin = '(\#\{)';
end = '(\})';
patterns = (
{ include = '$self'; },
);
};
map = {
name = "meta.map.clojure";
begin = '(\{)';
end = '(\})';
patterns = (
{ include = '$self'; },
);
};
};
}