source: tools/vscode/uwaterloo.cforall-0.1.0/syntaxes/cfa.tmLanguage.json@ bb7422a

ADT ast-experimental
Last change on this file since bb7422a was b7d94ac5, checked in by Thierry Delisle <tdelisle@…>, 4 years ago

Last step tools and benchmark

  • Property mode set to 100644
File size: 13.8 KB
Line 
1{
2 "scopeName": "source.cfa",
3 "patterns": [
4 { "include": "#comment"},
5 { "include": "#preprocessor"},
6 { "include": "#extern"},
7 { "include": "#declaration"},
8 { "include": "#constant"},
9 { "include": "#statement"},
10 { "include": "#operator"}
11 ],
12 "repository": {
13 "preprocessor": {
14 "patterns":[
15 { "include": "#directive.pragma" },
16 { "include": "#directive.include" },
17 { "include": "#directive.define" },
18 { "include": "#directive.undef" },
19 { "include": "#directive.ifdef" },
20 { "include": "#directive.condition.arg" },
21 { "include": "#directive.condition.noargs" }
22 ],
23 "repository": {
24 "directive.punctuation": {
25 "match": "#",
26 "name": "punctuation.definition.directive.cfa"
27 },
28 "directive.pragma": {
29 "name": "meta.preprocessor.pragma.cfa",
30 "match": "^\\s*(#\\s*pragma)\\s+(((?!//|/\\*).)*)",
31 "captures":{
32 "1": {
33 "name": "keyword.control.directive.pragma.cfa",
34 "patterns":[{ "include": "#directive.punctuation"} ]
35 },
36 "2": {"name": "keyword.control.directive.pragma.argument.cfa"}
37 }
38 },
39 "directive.include.string": {
40 "begin": "<|\"",
41 "end": ">|\"",
42 "beginCaptures": {
43 "0": { "name": "punctuation.definition.string.begin.cfa" }
44 },
45 "endCaptures": {
46 "0": { "name": "punctuation.definition.string.end.cfa" }
47 },
48 "name": "string.quoted.include.cfa"
49 },
50 "directive.include": {
51 "name": "meta.preprocessor.include.cfa",
52 "match": "^\\s*(#\\s*include)\\s+(<.*>|\".*\")",
53 "captures": {
54 "1": {
55 "name": "keyword.control.directive.include.cfa",
56 "patterns":[{ "include": "#directive.punctuation"} ]
57 },
58 "2": {"patterns": [{ "include": "#directive.include.string"}]}
59 }
60 },
61 "directive.macro.name": {
62 "name": "entity.name.function.preprocessor.cfa",
63 "match": "[A-z0-9_]+"
64 },
65 "directive.define": {
66 "name": "meta.preprocessor.macro.cfa",
67 "match": "(#\\s*define)\\s+([A-z0-9_]+)(\\(.*\\))?\\s+(.*)?",
68 "captures": {
69 "1": {
70 "name": "keyword.control.directive.define.cfa",
71 "patterns":[{ "include": "#directive.punctuation"} ]
72 },
73 "2": {"patterns": [{ "include": "#directive.macro.name"}]},
74 "3": {"name":"meta.preprocessor.macro.args.cfa"},
75 "4": {"name":"meta.preprocessor.macro.definition.cfa", "patterns": [{ "include": "$self" }]}
76 }
77 },
78 "directive.undef": {
79 "name": "meta.preprocessor.macro.cfa",
80 "match": "^\\s*(#\\s*undef)\\s+(\\w+)",
81 "captures": {
82 "1": {
83 "name": "keyword.control.directive.undef.cfa",
84 "patterns":[{ "include": "#directive.punctuation"} ]
85 },
86 "2": {"name":"meta.define.B", "patterns": [{ "include": "#directive.macro.name"}]}
87 }
88 },
89 "directive.isdef": {
90 "match": "(defined)\\s*\\(\\s*(\\w+)\\s*\\)",
91 "captures": {
92 "1": {
93 "name": "keyword.control.directive.conditional.cfa",
94 "match": "defined"
95 },
96 "2": {"patterns": [{ "include": "#directive.macro.name"}]}
97 }
98 },
99 "directive.ifdef": {
100 "name": "meta.preprocessor.cfa",
101 "match": "^\\s*(#\\s*ifdef)\\s+(\\w+)",
102 "captures": {
103 "1": {
104 "name": "keyword.control.directive.conditional.cfa",
105 "patterns":[{ "include": "#directive.punctuation"} ]
106 },
107 "2": {"patterns": [{ "include": "#directive.macro.name"}]}
108 }
109 },
110 "directive.condition.arg": {
111 "name": "meta.preprocessor.cfa",
112 "match": "^\\s*(#\\s*if|#\\s*elif)\\s+(.*)",
113 "captures": {
114 "1": {
115 "name": "keyword.control.directive.conditional.cfa",
116 "patterns":[{ "include": "#directive.punctuation"} ]
117 },
118 "2": {"patterns":[
119 { "include": "#expression"},
120 { "include": "#directive.isdef"}
121 ]}
122 }
123 },
124 "directive.condition.noargs": {
125 "name": "meta.preprocessor.cfa",
126 "match": "^\\s*(#\\s*endif|#\\s*else)\\s+",
127 "captures": {
128 "1": {
129 "name": "keyword.control.directive.conditional.cfa",
130 "patterns":[{ "include": "#directive.punctuation"} ]
131 }
132 }
133 }
134 }
135 },
136 "comment": {
137 "patterns":[
138 { "include": "#comments.line"},
139 { "include": "#comments.block"}
140 ],
141 "repository": {
142 "comments.line":{
143 "name": "comment.line.double-slash.cfa",
144 "match": "(\/\/).*",
145 "captures": {
146 "1": {"name": "punctuation.definition.comment.c", "match": "\/\/"}
147 }
148 },
149 "comments.block":{
150 "name": "comment.block.cfa",
151 "begin": "/\\*",
152 "end": "\\*/",
153 "beginCaptures": {
154 "0": { "name": "punctuation.definition.comment.begin.cfa" }
155 },
156 "endCaptures": {
157 "0": { "name": "punctuation.definition.comment.end.cfa" }
158 }
159 }
160 }
161 },
162 "extern": {
163 "patterns": [{ "include": "#extern.block"}],
164 "repository": {
165 "extern.head.string": {
166 "begin": "\"",
167 "end": "\"",
168 "beginCaptures": {
169 "0": { "name": "punctuation.definition.string.begin.cfa" }
170 },
171 "endCaptures": {
172 "0": { "name": "punctuation.definition.string.end.cfa" }
173 },
174 "name": "string.quoted.extern.cfa"
175 },
176 "extern.head": {
177 "match": "(extern)\\s+(.*)\\s+(\\{)",
178 "captures": {
179 "1": { "name": "storage.modifier.cfa" },
180 "2": { "patterns":[{ "include": "#extern.head.string"}] },
181 "3": { "name": "punctuation.section.block.begin.bracket.curly.extern.cfa" }
182 }
183 },
184 "extern.block": {
185 "name": "meta.block.extern.cfa",
186 "begin": "(extern\\s+.*\\s+\\{)",
187 "end": "(\\})",
188 "beginCaptures": {
189 "0": { "name": "meta.head.extern.cfa", "patterns":[{ "include": "#extern.head" }] }
190 },
191 "endCaptures": {
192 "0": { "name": "punctuation.section.block.end.bracket.curly.extern.cfa" }
193 },
194 "contentName": "meta.body.extern.cfa",
195 "patterns": [{ "include": "$self" }]
196 }
197 }
198 },
199 "declaration": {
200 "patterns": [
201 {"include": "#declaration.type"},
202 {"include": "#declaration.aggregate"}
203 ],
204 "repository": {
205 "declaration.type": {
206 "patterns": [
207 { "match": "(\\b|^|\\s)(void|bool|char|short|int|long|signed|unsigned|float|double)(\\b|$|\\s)", "name": "storage.type.built-in.primitive.cfa"},
208 { "match": "(\\b|^|\\s)(zero_t|one_t|size_t|ssize_t|intptr_t|uintptr_t|thread\\$|coroutine\\$|generator\\$|monitor\\$)(\\b|$|\\s)", "name": "storage.type.built-in.cfa"},
209 { "match": "(\\b|^|\\s)(extern|static|inline|volatile|const|thread_local)(\\b|$|\\s)", "name": "storage.modifier.cfa"}
210 ]
211 },
212 "declaration.aggregate": {
213 "patterns": [
214 { "name": "storage.type.struct.cfa" , "match": "(\\b|^|\\s)struct(\\s+(\\w+))?(\\b|$|\\s)" , "captures": { "3": { "name": "entity.name.type.struct.cfa" }} },
215 { "name": "storage.type.union.cfa" , "match": "(\\b|^|\\s)union(\\s+(\\w+))?(\\b|$|\\s)" , "captures": { "3": { "name": "entity.name.type.union.cfa" }} },
216 { "name": "storage.type.enum.cfa" , "match": "(\\b|^|\\s)enum(\\s+(\\w+))?(\\b|$|\\s)" , "captures": { "3": { "name": "entity.name.type.enum.cfa" }} },
217 { "name": "storage.type.trait.cfa" , "match": "(\\b|^|\\s)trait(\\s+(\\w+))?(\\b|$|\\s)" , "captures": { "3": { "name": "entity.name.type.trait.cfa" }} },
218 { "name": "storage.type.generator.cfa", "match": "(\\b|^|\\s)generator(\\s+(\\w+))?(\\b|$|\\s)", "captures": { "3": { "name": "entity.name.type.generator.cfa"}} },
219 { "name": "storage.type.coroutine.cfa", "match": "(\\b|^|\\s)coroutine(\\s+(\\w+))?(\\b|$|\\s)", "captures": { "3": { "name": "entity.name.type.coroutine.cfa"}} },
220 { "name": "storage.type.thread.cfa" , "match": "(\\b|^|\\s)thread(\\s+(\\w+))?(\\b|$|\\s)" , "captures": { "3": { "name": "entity.name.type.thread.cfa" }} },
221 { "name": "storage.type.monitor.cfa" , "match": "(\\b|^|\\s)monitor(\\s+(\\w+))?(\\b|$|\\s)" , "captures": { "3": { "name": "entity.name.type.monitor.cfa" }} },
222 { "name": "storage.type.dtype.cfa" , "match": "(\\b|^|\\s)dtype(\\s+(\\w+))?(\\b|$|\\s)" , "captures": { "3": { "name": "entity.name.type.dtype.cfa" }} },
223 { "name": "storage.type.otype.cfa" , "match": "(\\b|^|\\s)otype(\\s+(\\w+))?(\\b|$|\\s)" , "captures": { "3": { "name": "entity.name.type.otype.cfa" }} },
224 { "name": "storage.type.ttype.cfa" , "match": "(\\b|^|\\s)ttyp(\\s+(\\w+))?(\\b|$|\\s)" , "captures": { "3": { "name": "entity.name.type.ttype.cfa" }} }
225 ]
226 }
227 }
228 },
229 "constant": {
230 "patterns": [
231 {"include": "#constant.pointer"},
232 {"include": "#constant.number"},
233 {"include": "#constant.string.single"},
234 {"include": "#constant.string.double"},
235 {"include": "#constant.endline"}
236 ],
237 "repository": {
238 "constant.number": {
239 "patterns":[
240 {"name": "constant.numeric.binary.cfa", "match": "\\b0[b|B][_01\\.e]+(u?(hh|h|z|l\\d+|L\\d+|ll|l)u?)?"},
241 {"name": "constant.numeric.hexadecimal.cfa", "match": "\\b0[x|X][_\\dabcdefABCDEF\\.p]+(u?(hh|h|z|l\\d+|L\\d+|ll|l)u?)?"},
242 {"name": "constant.numeric.octal.cfa", "match": "\\b0[_0-7\\.]+(u?(hh|h|z|l\\d+|L\\d+|ll|l)u?)?"},
243 {"name": "constant.numeric.decimal.cfa", "match": "\\b[\\d\\.][_\\d\\.e\\+]*(u?(hh|h|z|l\\d+|L\\d+|ll|l)u?)?"}
244 ]
245 },
246 "constant.pointer": {
247 "patterns":[
248 {"name": "constant.language.binary.cfa", "match": "\\b0[b|B][_01]+p"},
249 {"name": "constant.language.hexadecimal.cfa", "match": "\\b0[x|X][_\\dabcdefABCDEF]+p"},
250 {"name": "constant.language.octal.cfa", "match": "\\b0[_0-7]+p"},
251 {"name": "constant.language.decimal.cfa", "match": "\\b[\\d][_\\d\\.e\\+]*p"}
252 ]
253 },
254 "constant.string.content": {
255 "patterns": [
256 { "name": "constant.character.escape.cfa" , "match": "\\\\."},
257 { "name": "constant.other.placeholder.cfa", "match": "%\\+?(\\.(\\d+|\\*))?(hh|h|ll|l|j|z|t|L)?[diuoxXfFeEgGaAcspn%]"}
258 ]
259 },
260 "constant.string.double": {
261 "name": "string.quoted.double.cfa",
262 "begin": "\"",
263 "end": "\"",
264 "beginCaptures": {
265 "0": { "name": "punctuation.definition.string.begin.cfa" }
266 },
267 "endCaptures": {
268 "0": { "name": "punctuation.definition.string.end.cfa" }
269 },
270 "patterns": [
271 { "include": "#constant.string.content"}
272 ]
273 },
274 "constant.string.single": {
275 "name": "string.quoted.single.cfa",
276 "begin": "'",
277 "end": "'",
278 "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.cfa" } },
279 "endCaptures" : { "0": { "name": "punctuation.definition.string.end.cfa" } },
280 "patterns": [
281 { "include": "#constant.string.content"}
282 ]
283 },
284 "constant.endline": {
285 "name": "constant.character.escape.line-continuation.cfa",
286 "match": "\\\\\\s*(//.*)?"
287 }
288 }
289 },
290 "operator": {
291 "patterns":[
292 {
293 "name": "keyword.operator.declaration.cfa",
294 "match": "\\?\\[\\?\\]|\\^\\?{}|\\?{}|\\?\\(\\)|\\?\\+\\+|\\?--|\\+\\+\\?|--\\?|\\*\\?|\\+\\?|\\-\\?|\\~\\?|\\!\\?|\\?\\\\=\\?|\\?\\\\\\?|\\?\\*=\\?|\\?\\*\\?|\\?/=\\?|\\?/\\?|\\?%=\\?|\\?%\\?|\\?\\+=\\?|\\?\\+\\?|\\?-=\\?|\\?-\\?|\\?<<=\\?|\\?<<\\?|\\?<=\\?|\\?<\\?|\\?>>=\\?|\\?>>\\?|\\?>=\\?|\\?>\\?|\\?==\\?|\\?\\!=\\?|\\?&=\\?|\\?&\\?|\\?\\^=\\?|\\?\\^\\?|\\?\\|=\\?|\\?\\|\\?|\\?=\\?"
295 },
296 {
297 "name": "keyword.operator.cfa",
298 "match": "\\?|\\+\\+|--|\\~|\\!|\\=|\\\\|->|\\*=|\\*|/=|/|%=|%|\\+=|\\+|-=|-|<<=|<<|<=|<|>>=|>>|>=|>|==|\\!=|&&|&=|&|\\^=|\\^|\\|\\||\\|=|\\||="
299 }
300 ]
301 },
302 "statement": {
303 "patterns":[
304 { "match": "\\b(if)\\s*\\(" , "captures": { "1": { "name": "keyword.control.if.cfa" } } },
305 { "match": "\\b(for)\\s*\\(" , "captures": { "1": { "name": "keyword.control.for.cfa" } } },
306 { "match": "\\b(while)\\s*\\(" , "captures": { "1": { "name": "keyword.control.while.cfa" } } },
307 { "match": "\\b(switch)\\s*\\(" , "captures": { "1": { "name": "keyword.control.switch.cfa" } } },
308 { "match": "\\b(choose)\\s*\\(" , "captures": { "1": { "name": "keyword.control.choose.cfa" } } },
309 { "match": "\\b(waitfor)\\s*\\(" , "captures": { "1": { "name": "keyword.control.waitfor.cfa" } } },
310 { "match": "\\b(when)\\s*\\(" , "captures": { "1": { "name": "keyword.control.when.cfa" } } },
311 { "match": "\\b(timeout)\\s*\\(" , "captures": { "1": { "name": "keyword.control.timeout.cfa" } } },
312 { "match": "\\b(or)\\b" , "captures": { "1": { "name": "keyword.contol.or.cfa" } } },
313 { "match": "\\b(else)\\b" , "captures": { "1": { "name": "keyword.contol.else.cfa" } } },
314 { "match": "\\b(do)\\b" , "captures": { "1": { "name": "keyword.contol.do.cfa" } } },
315 { "match": "\\b(case)\\b" , "captures": { "1": { "name": "keyword.contol.case.cfa" } } },
316 { "match": "\\b(default)\\b" , "captures": { "1": { "name": "keyword.contol.default.cfa" } } },
317 { "match": "\\b(suspend)\\b" , "captures": { "1": { "name": "keyword.contol.suspend.cfa" } } },
318 { "match": "\\b(try)\\b" , "captures": { "1": { "name": "keyword.contol.try.cfa" } } },
319 { "match": "\\b(catch(Resume)?)\\b" , "captures": { "1": { "name": "keyword.contol.catch.cfa" } } },
320 { "match": "\\b(finally)\\b" , "captures": { "1": { "name": "keyword.contol.finally.cfa" } } },
321 { "match": "\\b(goto)\\b" , "captures": { "1": { "name": "keyword.contol.goto.cfa" } } },
322 { "match": "\\b(return)\\b" , "captures": { "1": { "name": "keyword.contol.return.cfa" } } },
323 { "match": "\\b(break)\\b" , "captures": { "1": { "name": "keyword.contol.break.cfa" } } },
324 { "match": "\\b(continue)\\b" , "captures": { "1": { "name": "keyword.contol.continue.cfa" } } },
325 { "match": "\\b(fallthr(u|ough))\\b", "captures": { "1": { "name": "keyword.contol.fallthrough.cfa"} } },
326 { "match": "\\b(throw(Resume)?)\\b" , "captures": { "1": { "name": "keyword.contol.throw.cfa" } } }
327 ]
328 }
329 }
330}
Note: See TracBrowser for help on using the repository browser.