tm-grammars 0.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (181) hide show
  1. package/LICENSE +22 -0
  2. package/NOTICE +6565 -0
  3. package/README.md +211 -0
  4. package/grammars/abap.json +380 -0
  5. package/grammars/actionscript-3.json +951 -0
  6. package/grammars/ada.json +3874 -0
  7. package/grammars/apache.json +562 -0
  8. package/grammars/apex.json +3203 -0
  9. package/grammars/apl.json +1479 -0
  10. package/grammars/applescript.json +1406 -0
  11. package/grammars/ara.json +428 -0
  12. package/grammars/asm.json +1741 -0
  13. package/grammars/astro.json +776 -0
  14. package/grammars/awk.json +388 -0
  15. package/grammars/ballerina.json +3768 -0
  16. package/grammars/bat.json +783 -0
  17. package/grammars/beancount.json +831 -0
  18. package/grammars/berry.json +172 -0
  19. package/grammars/bibtex.json +315 -0
  20. package/grammars/bicep.json +239 -0
  21. package/grammars/blade.json +3870 -0
  22. package/grammars/c.json +3552 -0
  23. package/grammars/cadence.json +738 -0
  24. package/grammars/clarity.json +877 -0
  25. package/grammars/clojure.json +426 -0
  26. package/grammars/cmake.json +143 -0
  27. package/grammars/cobol.json +1124 -0
  28. package/grammars/codeql.json +1540 -0
  29. package/grammars/coffee.json +1311 -0
  30. package/grammars/cpp-macro.json +9498 -0
  31. package/grammars/cpp.json +16635 -0
  32. package/grammars/crystal.json +1866 -0
  33. package/grammars/csharp.json +5722 -0
  34. package/grammars/css.json +1860 -0
  35. package/grammars/csv.json +46 -0
  36. package/grammars/cue.json +1128 -0
  37. package/grammars/cypher.json +353 -0
  38. package/grammars/d.json +3185 -0
  39. package/grammars/dart.json +522 -0
  40. package/grammars/dax.json +185 -0
  41. package/grammars/diff.json +155 -0
  42. package/grammars/docker.json +97 -0
  43. package/grammars/dream-maker.json +640 -0
  44. package/grammars/elixir.json +1014 -0
  45. package/grammars/elm.json +751 -0
  46. package/grammars/erb.json +156 -0
  47. package/grammars/erlang.json +1757 -0
  48. package/grammars/fish.json +189 -0
  49. package/grammars/fsharp.json +1831 -0
  50. package/grammars/gdresource.json +290 -0
  51. package/grammars/gdscript.json +969 -0
  52. package/grammars/gdshader.json +405 -0
  53. package/grammars/gherkin.json +133 -0
  54. package/grammars/git-commit.json +85 -0
  55. package/grammars/git-rebase.json +56 -0
  56. package/grammars/glimmer-js.json +98 -0
  57. package/grammars/glimmer-ts.json +98 -0
  58. package/grammars/glsl.json +57 -0
  59. package/grammars/gnuplot.json +892 -0
  60. package/grammars/go.json +1012 -0
  61. package/grammars/graphql.json +1295 -0
  62. package/grammars/groovy.json +1378 -0
  63. package/grammars/hack.json +2650 -0
  64. package/grammars/haml.json +598 -0
  65. package/grammars/handlebars.json +848 -0
  66. package/grammars/haskell.json +2431 -0
  67. package/grammars/hcl.json +787 -0
  68. package/grammars/hjson.json +821 -0
  69. package/grammars/hlsl.json +212 -0
  70. package/grammars/html.json +93 -0
  71. package/grammars/imba.json +2696 -0
  72. package/grammars/ini.json +108 -0
  73. package/grammars/java.json +1885 -0
  74. package/grammars/javascript.json +5984 -0
  75. package/grammars/jinja-html.json +16 -0
  76. package/grammars/jinja.json +345 -0
  77. package/grammars/jison.json +715 -0
  78. package/grammars/jsdoc.json +21 -0
  79. package/grammars/json.json +208 -0
  80. package/grammars/json5.json +244 -0
  81. package/grammars/jsonc.json +208 -0
  82. package/grammars/jsonl.json +208 -0
  83. package/grammars/jsonnet.json +211 -0
  84. package/grammars/jssm.json +159 -0
  85. package/grammars/jsx.json +5984 -0
  86. package/grammars/julia.json +1061 -0
  87. package/grammars/kotlin.json +580 -0
  88. package/grammars/kusto.json +687 -0
  89. package/grammars/latex.json +2395 -0
  90. package/grammars/less.json +5012 -0
  91. package/grammars/liquid.json +990 -0
  92. package/grammars/lisp.json +121 -0
  93. package/grammars/logo.json +55 -0
  94. package/grammars/lua.json +956 -0
  95. package/grammars/make.json +629 -0
  96. package/grammars/markdown.json +3066 -0
  97. package/grammars/marko.json +1344 -0
  98. package/grammars/matlab.json +1131 -0
  99. package/grammars/mdc.json +571 -0
  100. package/grammars/mdx.json +5629 -0
  101. package/grammars/mermaid.json +1382 -0
  102. package/grammars/mojo.json +4153 -0
  103. package/grammars/narrat.json +227 -0
  104. package/grammars/nextflow.json +298 -0
  105. package/grammars/nginx.json +2121 -0
  106. package/grammars/nim.json +1522 -0
  107. package/grammars/nix.json +1200 -0
  108. package/grammars/nushell.json +1047 -0
  109. package/grammars/objective-c.json +3750 -0
  110. package/grammars/objective-cpp.json +7242 -0
  111. package/grammars/ocaml.json +2967 -0
  112. package/grammars/pascal.json +154 -0
  113. package/grammars/perl.json +2971 -0
  114. package/grammars/php.json +4024 -0
  115. package/grammars/plsql.json +241 -0
  116. package/grammars/postcss.json +377 -0
  117. package/grammars/powerquery.json +349 -0
  118. package/grammars/powershell.json +1024 -0
  119. package/grammars/prisma.json +443 -0
  120. package/grammars/prolog.json +298 -0
  121. package/grammars/proto.json +507 -0
  122. package/grammars/pug.json +1033 -0
  123. package/grammars/puppet.json +777 -0
  124. package/grammars/purescript.json +871 -0
  125. package/grammars/python.json +4208 -0
  126. package/grammars/r.json +637 -0
  127. package/grammars/raku.json +310 -0
  128. package/grammars/razor.json +1813 -0
  129. package/grammars/reg.json +136 -0
  130. package/grammars/rel.json +200 -0
  131. package/grammars/riscv.json +298 -0
  132. package/grammars/rst.json +734 -0
  133. package/grammars/ruby.json +2769 -0
  134. package/grammars/rust.json +1171 -0
  135. package/grammars/sas.json +302 -0
  136. package/grammars/sass.json +618 -0
  137. package/grammars/scala.json +1313 -0
  138. package/grammars/scheme.json +384 -0
  139. package/grammars/scss.json +1874 -0
  140. package/grammars/shaderlab.json +199 -0
  141. package/grammars/shellscript.json +2025 -0
  142. package/grammars/shellsession.json +33 -0
  143. package/grammars/smalltalk.json +235 -0
  144. package/grammars/solidity.json +1210 -0
  145. package/grammars/sparql.json +45 -0
  146. package/grammars/splunk.json +91 -0
  147. package/grammars/sql.json +631 -0
  148. package/grammars/ssh-config.json +88 -0
  149. package/grammars/stata.json +3050 -0
  150. package/grammars/stylus.json +1208 -0
  151. package/grammars/svelte.json +1171 -0
  152. package/grammars/swift.json +4203 -0
  153. package/grammars/system-verilog.json +1063 -0
  154. package/grammars/tasl.json +292 -0
  155. package/grammars/tcl.json +291 -0
  156. package/grammars/tex.json +281 -0
  157. package/grammars/toml.json +431 -0
  158. package/grammars/tsx.json +5984 -0
  159. package/grammars/turtle.json +261 -0
  160. package/grammars/twig.json +1394 -0
  161. package/grammars/typescript.json +5735 -0
  162. package/grammars/v.json +1001 -0
  163. package/grammars/vb.json +232 -0
  164. package/grammars/verilog.json +305 -0
  165. package/grammars/vhdl.json +1484 -0
  166. package/grammars/viml.json +445 -0
  167. package/grammars/vue-html.json +559 -0
  168. package/grammars/vue.json +1237 -0
  169. package/grammars/vyper.json +5415 -0
  170. package/grammars/wasm.json +831 -0
  171. package/grammars/wenyan.json +129 -0
  172. package/grammars/wgsl.json +391 -0
  173. package/grammars/wolfram.json +2370 -0
  174. package/grammars/xml.json +382 -0
  175. package/grammars/xsl.json +89 -0
  176. package/grammars/yaml.json +616 -0
  177. package/grammars/zenscript.json +257 -0
  178. package/grammars/zig.json +312 -0
  179. package/index.d.ts +18 -0
  180. package/index.js +2165 -0
  181. package/package.json +46 -0
@@ -0,0 +1,1014 @@
1
+ {
2
+ "displayName": "Elixir",
3
+ "fileTypes": [
4
+ "ex",
5
+ "exs"
6
+ ],
7
+ "firstLineMatch": "^#!/.*\\belixir",
8
+ "foldingStartMarker": "(after|else|catch|rescue|\\-\\>|\\{|\\[|do)\\s*$",
9
+ "foldingStopMarker": "^\\s*((\\}|\\]|after|else|catch|rescue)\\s*$|end\\b)",
10
+ "name": "elixir",
11
+ "patterns": [
12
+ {
13
+ "begin": "\\b(fn)\\b(?!.*->)",
14
+ "beginCaptures": {
15
+ "1": {
16
+ "name": "keyword.control.elixir"
17
+ }
18
+ },
19
+ "end": "$",
20
+ "patterns": [
21
+ {
22
+ "include": "#core_syntax"
23
+ }
24
+ ]
25
+ },
26
+ {
27
+ "captures": {
28
+ "1": {
29
+ "name": "entity.name.type.class.elixir"
30
+ },
31
+ "2": {
32
+ "name": "punctuation.separator.method.elixir"
33
+ },
34
+ "3": {
35
+ "name": "entity.name.function.elixir"
36
+ }
37
+ },
38
+ "match": "([A-Z]\\w+)\\s*(\\.)\\s*([a-z_]\\w*[!?]?)"
39
+ },
40
+ {
41
+ "captures": {
42
+ "1": {
43
+ "name": "constant.other.symbol.elixir"
44
+ },
45
+ "2": {
46
+ "name": "punctuation.separator.method.elixir"
47
+ },
48
+ "3": {
49
+ "name": "entity.name.function.elixir"
50
+ }
51
+ },
52
+ "match": "(\\:\\w+)\\s*(\\.)\\s*([_]?\\w*[!?]?)"
53
+ },
54
+ {
55
+ "captures": {
56
+ "1": {
57
+ "name": "keyword.operator.other.elixir"
58
+ },
59
+ "2": {
60
+ "name": "entity.name.function.elixir"
61
+ }
62
+ },
63
+ "match": "(\\|\\>)\\s*([a-z_]\\w*[!?]?)"
64
+ },
65
+ {
66
+ "match": "\\b[a-z_]\\w*[!?]?(?=\\s*\\.?\\s*\\()",
67
+ "name": "entity.name.function.elixir"
68
+ },
69
+ {
70
+ "begin": "\\b(fn)\\b(?=.*->)",
71
+ "beginCaptures": {
72
+ "1": {
73
+ "name": "keyword.control.elixir"
74
+ }
75
+ },
76
+ "end": "(?>(->)|(when)|(\\)))",
77
+ "endCaptures": {
78
+ "1": {
79
+ "name": "keyword.operator.other.elixir"
80
+ },
81
+ "2": {
82
+ "name": "keyword.control.elixir"
83
+ },
84
+ "3": {
85
+ "name": "punctuation.section.function.elixir"
86
+ }
87
+ },
88
+ "patterns": [
89
+ {
90
+ "include": "#core_syntax"
91
+ }
92
+ ]
93
+ },
94
+ {
95
+ "include": "#core_syntax"
96
+ },
97
+ {
98
+ "begin": "^(?=.*->)((?![^\"']*(\"|')[^\"']*->)|(?=.*->[^\"']*(\"|')[^\"']*->))((?!.*\\([^\\)]*->)|(?=[^\\(\\)]*->)|(?=\\s*\\(.*\\).*->))((?!.*\\b(fn)\\b)|(?=.*->.*\\bfn\\b))",
99
+ "beginCaptures": {
100
+ "1": {
101
+ "name": "keyword.control.elixir"
102
+ }
103
+ },
104
+ "end": "(?>(->)|(when)|(\\)))",
105
+ "endCaptures": {
106
+ "1": {
107
+ "name": "keyword.operator.other.elixir"
108
+ },
109
+ "2": {
110
+ "name": "keyword.control.elixir"
111
+ },
112
+ "3": {
113
+ "name": "punctuation.section.function.elixir"
114
+ }
115
+ },
116
+ "patterns": [
117
+ {
118
+ "include": "#core_syntax"
119
+ }
120
+ ]
121
+ }
122
+ ],
123
+ "repository": {
124
+ "core_syntax": {
125
+ "patterns": [
126
+ {
127
+ "begin": "^\\s*(defmodule)\\b",
128
+ "beginCaptures": {
129
+ "1": {
130
+ "name": "keyword.control.module.elixir"
131
+ }
132
+ },
133
+ "end": "\\b(do)\\b",
134
+ "endCaptures": {
135
+ "1": {
136
+ "name": "keyword.control.module.elixir"
137
+ }
138
+ },
139
+ "name": "meta.module.elixir",
140
+ "patterns": [
141
+ {
142
+ "match": "\\b[A-Z]\\w*(?=\\.)",
143
+ "name": "entity.other.inherited-class.elixir"
144
+ },
145
+ {
146
+ "match": "\\b[A-Z]\\w*\\b",
147
+ "name": "entity.name.type.class.elixir"
148
+ }
149
+ ]
150
+ },
151
+ {
152
+ "begin": "^\\s*(defprotocol)\\b",
153
+ "beginCaptures": {
154
+ "1": {
155
+ "name": "keyword.control.protocol.elixir"
156
+ }
157
+ },
158
+ "end": "\\b(do)\\b",
159
+ "endCaptures": {
160
+ "1": {
161
+ "name": "keyword.control.protocol.elixir"
162
+ }
163
+ },
164
+ "name": "meta.protocol_declaration.elixir",
165
+ "patterns": [
166
+ {
167
+ "match": "\\b[A-Z]\\w*\\b",
168
+ "name": "entity.name.type.protocol.elixir"
169
+ }
170
+ ]
171
+ },
172
+ {
173
+ "begin": "^\\s*(defimpl)\\b",
174
+ "beginCaptures": {
175
+ "1": {
176
+ "name": "keyword.control.protocol.elixir"
177
+ }
178
+ },
179
+ "end": "\\b(do)\\b",
180
+ "endCaptures": {
181
+ "1": {
182
+ "name": "keyword.control.protocol.elixir"
183
+ }
184
+ },
185
+ "name": "meta.protocol_implementation.elixir",
186
+ "patterns": [
187
+ {
188
+ "match": "\\b[A-Z]\\w*\\b",
189
+ "name": "entity.name.type.protocol.elixir"
190
+ }
191
+ ]
192
+ },
193
+ {
194
+ "begin": "^\\s*(def|defmacro|defdelegate|defguard)\\s+((?>[a-zA-Z_]\\w*(?>\\.|::))?(?>[a-zA-Z_]\\w*(?>[?!]|=(?!>))?|===?|>[>=]?|<=>|<[<=]?|[%&`/\\|]|\\*\\*?|=?~|[-+]@?|\\[\\]=?))((\\()|\\s*)",
195
+ "beginCaptures": {
196
+ "1": {
197
+ "name": "keyword.control.module.elixir"
198
+ },
199
+ "2": {
200
+ "name": "entity.name.function.public.elixir"
201
+ },
202
+ "4": {
203
+ "name": "punctuation.section.function.elixir"
204
+ }
205
+ },
206
+ "end": "(\\bdo:)|(\\bdo\\b)|(?=\\s+(def|defn|defmacro|defdelegate|defguard)\\b)",
207
+ "endCaptures": {
208
+ "1": {
209
+ "name": "constant.other.keywords.elixir"
210
+ },
211
+ "2": {
212
+ "name": "keyword.control.module.elixir"
213
+ }
214
+ },
215
+ "name": "meta.function.public.elixir",
216
+ "patterns": [
217
+ {
218
+ "include": "$self"
219
+ },
220
+ {
221
+ "begin": "\\s(\\\\\\\\)",
222
+ "beginCaptures": {
223
+ "1": {
224
+ "name": "keyword.operator.other.elixir"
225
+ }
226
+ },
227
+ "end": ",|\\)|$",
228
+ "patterns": [
229
+ {
230
+ "include": "$self"
231
+ }
232
+ ]
233
+ },
234
+ {
235
+ "match": "\\b(is_atom|is_binary|is_bitstring|is_boolean|is_float|is_function|is_integer|is_list|is_map|is_nil|is_number|is_pid|is_port|is_record|is_reference|is_tuple|is_exception|abs|bit_size|byte_size|div|elem|hd|length|map_size|node|rem|round|tl|trunc|tuple_size)\\b",
236
+ "name": "keyword.control.elixir"
237
+ }
238
+ ]
239
+ },
240
+ {
241
+ "begin": "^\\s*(defp|defnp|defmacrop|defguardp)\\s+((?>[a-zA-Z_]\\w*(?>\\.|::))?(?>[a-zA-Z_]\\w*(?>[?!]|=(?!>))?|===?|>[>=]?|<=>|<[<=]?|[%&`/\\|]|\\*\\*?|=?~|[-+]@?|\\[\\]=?))((\\()|\\s*)",
242
+ "beginCaptures": {
243
+ "1": {
244
+ "name": "keyword.control.module.elixir"
245
+ },
246
+ "2": {
247
+ "name": "entity.name.function.private.elixir"
248
+ },
249
+ "4": {
250
+ "name": "punctuation.section.function.elixir"
251
+ }
252
+ },
253
+ "end": "(\\bdo:)|(\\bdo\\b)|(?=\\s+(defp|defmacrop|defguardp)\\b)",
254
+ "endCaptures": {
255
+ "1": {
256
+ "name": "constant.other.keywords.elixir"
257
+ },
258
+ "2": {
259
+ "name": "keyword.control.module.elixir"
260
+ }
261
+ },
262
+ "name": "meta.function.private.elixir",
263
+ "patterns": [
264
+ {
265
+ "include": "$self"
266
+ },
267
+ {
268
+ "begin": "\\s(\\\\\\\\)",
269
+ "beginCaptures": {
270
+ "1": {
271
+ "name": "keyword.operator.other.elixir"
272
+ }
273
+ },
274
+ "end": ",|\\)|$",
275
+ "patterns": [
276
+ {
277
+ "include": "$self"
278
+ }
279
+ ]
280
+ },
281
+ {
282
+ "match": "\\b(is_atom|is_binary|is_bitstring|is_boolean|is_float|is_function|is_integer|is_list|is_map|is_nil|is_number|is_pid|is_port|is_record|is_reference|is_tuple|is_exception|abs|bit_size|byte_size|div|elem|hd|length|map_size|node|rem|round|tl|trunc|tuple_size)\\b",
283
+ "name": "keyword.control.elixir"
284
+ }
285
+ ]
286
+ },
287
+ {
288
+ "begin": "\\s*~L\"\"\"",
289
+ "comment": "Leex Sigil",
290
+ "end": "\\s*\"\"\"",
291
+ "name": "sigil.leex",
292
+ "patterns": [
293
+ {
294
+ "include": "text.elixir"
295
+ },
296
+ {
297
+ "include": "text.html.basic"
298
+ }
299
+ ]
300
+ },
301
+ {
302
+ "begin": "\\s*~H\"\"\"",
303
+ "comment": "HEEx Sigil",
304
+ "end": "\\s*\"\"\"",
305
+ "name": "sigil.heex",
306
+ "patterns": [
307
+ {
308
+ "include": "text.elixir"
309
+ },
310
+ {
311
+ "include": "text.html.basic"
312
+ }
313
+ ]
314
+ },
315
+ {
316
+ "begin": "@(module|type)?doc (~[a-z])?\"\"\"",
317
+ "comment": "@doc with heredocs is treated as documentation",
318
+ "end": "\\s*\"\"\"",
319
+ "name": "comment.block.documentation.heredoc",
320
+ "patterns": [
321
+ {
322
+ "include": "#interpolated_elixir"
323
+ },
324
+ {
325
+ "include": "#escaped_char"
326
+ }
327
+ ]
328
+ },
329
+ {
330
+ "begin": "@(module|type)?doc ~[A-Z]\"\"\"",
331
+ "comment": "@doc with heredocs is treated as documentation",
332
+ "end": "\\s*\"\"\"",
333
+ "name": "comment.block.documentation.heredoc"
334
+ },
335
+ {
336
+ "begin": "@(module|type)?doc (~[a-z])?'''",
337
+ "comment": "@doc with heredocs is treated as documentation",
338
+ "end": "\\s*'''",
339
+ "name": "comment.block.documentation.heredoc",
340
+ "patterns": [
341
+ {
342
+ "include": "#interpolated_elixir"
343
+ },
344
+ {
345
+ "include": "#escaped_char"
346
+ }
347
+ ]
348
+ },
349
+ {
350
+ "begin": "@(module|type)?doc ~[A-Z]'''",
351
+ "comment": "@doc with heredocs is treated as documentation",
352
+ "end": "\\s*'''",
353
+ "name": "comment.block.documentation.heredoc"
354
+ },
355
+ {
356
+ "comment": "@doc false is treated as documentation",
357
+ "match": "@(module|type)?doc false",
358
+ "name": "comment.block.documentation.false"
359
+ },
360
+ {
361
+ "begin": "@(module|type)?doc \"",
362
+ "comment": "@doc with string is treated as documentation",
363
+ "end": "\"",
364
+ "name": "comment.block.documentation.string",
365
+ "patterns": [
366
+ {
367
+ "include": "#interpolated_elixir"
368
+ },
369
+ {
370
+ "include": "#escaped_char"
371
+ }
372
+ ]
373
+ },
374
+ {
375
+ "match": "(?<!\\.)\\b(do|end|case|bc|lc|for|if|cond|unless|try|receive|fn|defmodule|defp?|defprotocol|defimpl|defrecord|defstruct|defnp?|defmacrop?|defguardp?|defdelegate|defexception|defoverridable|exit|after|rescue|catch|else|raise|reraise|throw|import|require|alias|use|quote|unquote|super|with)\\b(?![?!:])",
376
+ "name": "keyword.control.elixir"
377
+ },
378
+ {
379
+ "comment": " as above, just doesn't need a 'end' and does a logic operation",
380
+ "match": "(?<!\\.)\\b(and|not|or|when|xor|in)\\b",
381
+ "name": "keyword.operator.elixir"
382
+ },
383
+ {
384
+ "match": "\\b[A-Z]\\w*\\b",
385
+ "name": "entity.name.type.class.elixir"
386
+ },
387
+ {
388
+ "match": "\\b(nil|true|false)\\b(?![?!])",
389
+ "name": "constant.language.elixir"
390
+ },
391
+ {
392
+ "match": "\\b(__(CALLER|ENV|MODULE|DIR|STACKTRACE)__)\\b(?![?!])",
393
+ "name": "variable.language.elixir"
394
+ },
395
+ {
396
+ "captures": {
397
+ "1": {
398
+ "name": "punctuation.definition.variable.elixir"
399
+ }
400
+ },
401
+ "match": "(@)[a-zA-Z_]\\w*",
402
+ "name": "variable.other.readwrite.module.elixir"
403
+ },
404
+ {
405
+ "captures": {
406
+ "1": {
407
+ "name": "punctuation.definition.variable.elixir"
408
+ }
409
+ },
410
+ "match": "(&)\\d+",
411
+ "name": "variable.other.anonymous.elixir"
412
+ },
413
+ {
414
+ "match": "&(?![&])",
415
+ "name": "variable.other.anonymous.elixir"
416
+ },
417
+ {
418
+ "captures": {
419
+ "1": {
420
+ "name": "punctuation.definition.variable.elixir"
421
+ }
422
+ },
423
+ "match": "\\^[a-z_]\\w*",
424
+ "name": "variable.other.capture.elixir"
425
+ },
426
+ {
427
+ "match": "\\b0x[0-9A-Fa-f](?>_?[0-9A-Fa-f])*\\b",
428
+ "name": "constant.numeric.hex.elixir"
429
+ },
430
+ {
431
+ "match": "\\b\\d(?>_?\\d)*(\\.(?![^[:space:][:digit:]])(?>_?\\d)+)([eE][-+]?\\d(?>_?\\d)*)?\\b",
432
+ "name": "constant.numeric.float.elixir"
433
+ },
434
+ {
435
+ "match": "\\b\\d(?>_?\\d)*\\b",
436
+ "name": "constant.numeric.integer.elixir"
437
+ },
438
+ {
439
+ "match": "\\b0b[01](?>_?[01])*\\b",
440
+ "name": "constant.numeric.binary.elixir"
441
+ },
442
+ {
443
+ "match": "\\b0o[0-7](?>_?[0-7])*\\b",
444
+ "name": "constant.numeric.octal.elixir"
445
+ },
446
+ {
447
+ "begin": ":'",
448
+ "captures": {
449
+ "0": {
450
+ "name": "punctuation.definition.constant.elixir"
451
+ }
452
+ },
453
+ "end": "'",
454
+ "name": "constant.other.symbol.single-quoted.elixir",
455
+ "patterns": [
456
+ {
457
+ "include": "#interpolated_elixir"
458
+ },
459
+ {
460
+ "include": "#escaped_char"
461
+ }
462
+ ]
463
+ },
464
+ {
465
+ "begin": ":\"",
466
+ "captures": {
467
+ "0": {
468
+ "name": "punctuation.definition.constant.elixir"
469
+ }
470
+ },
471
+ "end": "\"",
472
+ "name": "constant.other.symbol.double-quoted.elixir",
473
+ "patterns": [
474
+ {
475
+ "include": "#interpolated_elixir"
476
+ },
477
+ {
478
+ "include": "#escaped_char"
479
+ }
480
+ ]
481
+ },
482
+ {
483
+ "begin": "(?>''')",
484
+ "beginCaptures": {
485
+ "0": {
486
+ "name": "punctuation.definition.string.begin.elixir"
487
+ }
488
+ },
489
+ "comment": "Single-quoted heredocs",
490
+ "end": "^\\s*'''",
491
+ "endCaptures": {
492
+ "0": {
493
+ "name": "punctuation.definition.string.end.elixir"
494
+ }
495
+ },
496
+ "name": "string.quoted.single.heredoc.elixir",
497
+ "patterns": [
498
+ {
499
+ "include": "#interpolated_elixir"
500
+ },
501
+ {
502
+ "include": "#escaped_char"
503
+ }
504
+ ]
505
+ },
506
+ {
507
+ "begin": "'",
508
+ "beginCaptures": {
509
+ "0": {
510
+ "name": "punctuation.definition.string.begin.elixir"
511
+ }
512
+ },
513
+ "comment": "single quoted string (allows for interpolation)",
514
+ "end": "'",
515
+ "endCaptures": {
516
+ "0": {
517
+ "name": "punctuation.definition.string.end.elixir"
518
+ }
519
+ },
520
+ "name": "string.quoted.single.elixir",
521
+ "patterns": [
522
+ {
523
+ "include": "#interpolated_elixir"
524
+ },
525
+ {
526
+ "include": "#escaped_char"
527
+ }
528
+ ]
529
+ },
530
+ {
531
+ "begin": "(?>\"\"\")",
532
+ "beginCaptures": {
533
+ "0": {
534
+ "name": "punctuation.definition.string.begin.elixir"
535
+ }
536
+ },
537
+ "comment": "Double-quoted heredocs",
538
+ "end": "^\\s*\"\"\"",
539
+ "endCaptures": {
540
+ "0": {
541
+ "name": "punctuation.definition.string.end.elixir"
542
+ }
543
+ },
544
+ "name": "string.quoted.double.heredoc.elixir",
545
+ "patterns": [
546
+ {
547
+ "include": "#interpolated_elixir"
548
+ },
549
+ {
550
+ "include": "#escaped_char"
551
+ }
552
+ ]
553
+ },
554
+ {
555
+ "begin": "\"",
556
+ "beginCaptures": {
557
+ "0": {
558
+ "name": "punctuation.definition.string.begin.elixir"
559
+ }
560
+ },
561
+ "comment": "double quoted string (allows for interpolation)",
562
+ "end": "\"",
563
+ "endCaptures": {
564
+ "0": {
565
+ "name": "punctuation.definition.string.end.elixir"
566
+ }
567
+ },
568
+ "name": "string.quoted.double.elixir",
569
+ "patterns": [
570
+ {
571
+ "include": "#interpolated_elixir"
572
+ },
573
+ {
574
+ "include": "#escaped_char"
575
+ }
576
+ ]
577
+ },
578
+ {
579
+ "begin": "~[a-z](?>\"\"\")",
580
+ "beginCaptures": {
581
+ "0": {
582
+ "name": "punctuation.definition.string.begin.elixir"
583
+ }
584
+ },
585
+ "comment": "Double-quoted heredocs sigils",
586
+ "end": "^\\s*\"\"\"",
587
+ "endCaptures": {
588
+ "0": {
589
+ "name": "punctuation.definition.string.end.elixir"
590
+ }
591
+ },
592
+ "name": "string.quoted.other.sigil.heredoc.elixir",
593
+ "patterns": [
594
+ {
595
+ "include": "#interpolated_elixir"
596
+ },
597
+ {
598
+ "include": "#escaped_char"
599
+ }
600
+ ]
601
+ },
602
+ {
603
+ "begin": "~[a-z]\\{",
604
+ "beginCaptures": {
605
+ "0": {
606
+ "name": "punctuation.definition.string.begin.elixir"
607
+ }
608
+ },
609
+ "comment": "sigil (allow for interpolation)",
610
+ "end": "\\}[a-z]*",
611
+ "endCaptures": {
612
+ "0": {
613
+ "name": "punctuation.definition.string.end.elixir"
614
+ }
615
+ },
616
+ "name": "string.quoted.other.sigil.elixir",
617
+ "patterns": [
618
+ {
619
+ "include": "#interpolated_elixir"
620
+ },
621
+ {
622
+ "include": "#escaped_char"
623
+ }
624
+ ]
625
+ },
626
+ {
627
+ "begin": "~[a-z]\\[",
628
+ "beginCaptures": {
629
+ "0": {
630
+ "name": "punctuation.definition.string.begin.elixir"
631
+ }
632
+ },
633
+ "comment": "sigil (allow for interpolation)",
634
+ "end": "\\][a-z]*",
635
+ "endCaptures": {
636
+ "0": {
637
+ "name": "punctuation.definition.string.end.elixir"
638
+ }
639
+ },
640
+ "name": "string.quoted.other.sigil.elixir",
641
+ "patterns": [
642
+ {
643
+ "include": "#interpolated_elixir"
644
+ },
645
+ {
646
+ "include": "#escaped_char"
647
+ }
648
+ ]
649
+ },
650
+ {
651
+ "begin": "~[a-z]\\<",
652
+ "beginCaptures": {
653
+ "0": {
654
+ "name": "punctuation.definition.string.begin.elixir"
655
+ }
656
+ },
657
+ "comment": "sigil (allow for interpolation)",
658
+ "end": "\\>[a-z]*",
659
+ "endCaptures": {
660
+ "0": {
661
+ "name": "punctuation.definition.string.end.elixir"
662
+ }
663
+ },
664
+ "name": "string.quoted.other.sigil.elixir",
665
+ "patterns": [
666
+ {
667
+ "include": "#interpolated_elixir"
668
+ },
669
+ {
670
+ "include": "#escaped_char"
671
+ }
672
+ ]
673
+ },
674
+ {
675
+ "begin": "~[a-z]\\(",
676
+ "beginCaptures": {
677
+ "0": {
678
+ "name": "punctuation.definition.string.begin.elixir"
679
+ }
680
+ },
681
+ "comment": "sigil (allow for interpolation)",
682
+ "end": "\\)[a-z]*",
683
+ "endCaptures": {
684
+ "0": {
685
+ "name": "punctuation.definition.string.end.elixir"
686
+ }
687
+ },
688
+ "name": "string.quoted.other.sigil.elixir",
689
+ "patterns": [
690
+ {
691
+ "include": "#interpolated_elixir"
692
+ },
693
+ {
694
+ "include": "#escaped_char"
695
+ }
696
+ ]
697
+ },
698
+ {
699
+ "begin": "~[a-z]([^\\w])",
700
+ "beginCaptures": {
701
+ "0": {
702
+ "name": "punctuation.definition.string.begin.elixir"
703
+ }
704
+ },
705
+ "comment": "sigil (allow for interpolation)",
706
+ "end": "\\1[a-z]*",
707
+ "endCaptures": {
708
+ "0": {
709
+ "name": "punctuation.definition.string.end.elixir"
710
+ }
711
+ },
712
+ "name": "string.quoted.other.sigil.elixir",
713
+ "patterns": [
714
+ {
715
+ "include": "#interpolated_elixir"
716
+ },
717
+ {
718
+ "include": "#escaped_char"
719
+ }
720
+ ]
721
+ },
722
+ {
723
+ "begin": "~[A-Z](?>\"\"\")",
724
+ "beginCaptures": {
725
+ "0": {
726
+ "name": "punctuation.definition.string.begin.elixir"
727
+ }
728
+ },
729
+ "comment": "Double-quoted heredocs sigils",
730
+ "end": "^\\s*\"\"\"",
731
+ "endCaptures": {
732
+ "0": {
733
+ "name": "punctuation.definition.string.end.elixir"
734
+ }
735
+ },
736
+ "name": "string.quoted.other.sigil.heredoc.literal.elixir"
737
+ },
738
+ {
739
+ "begin": "~[A-Z]\\{",
740
+ "beginCaptures": {
741
+ "0": {
742
+ "name": "punctuation.definition.string.begin.elixir"
743
+ }
744
+ },
745
+ "comment": "sigil (without interpolation)",
746
+ "end": "\\}[a-z]*",
747
+ "endCaptures": {
748
+ "0": {
749
+ "name": "punctuation.definition.string.end.elixir"
750
+ }
751
+ },
752
+ "name": "string.quoted.other.sigil.literal.elixir"
753
+ },
754
+ {
755
+ "begin": "~[A-Z]\\[",
756
+ "beginCaptures": {
757
+ "0": {
758
+ "name": "punctuation.definition.string.begin.elixir"
759
+ }
760
+ },
761
+ "comment": "sigil (without interpolation)",
762
+ "end": "\\][a-z]*",
763
+ "endCaptures": {
764
+ "0": {
765
+ "name": "punctuation.definition.string.end.elixir"
766
+ }
767
+ },
768
+ "name": "string.quoted.other.sigil.literal.elixir"
769
+ },
770
+ {
771
+ "begin": "~[A-Z]\\<",
772
+ "beginCaptures": {
773
+ "0": {
774
+ "name": "punctuation.definition.string.begin.elixir"
775
+ }
776
+ },
777
+ "comment": "sigil (without interpolation)",
778
+ "end": "\\>[a-z]*",
779
+ "endCaptures": {
780
+ "0": {
781
+ "name": "punctuation.definition.string.end.elixir"
782
+ }
783
+ },
784
+ "name": "string.quoted.other.sigil.literal.elixir"
785
+ },
786
+ {
787
+ "begin": "~[A-Z]\\(",
788
+ "beginCaptures": {
789
+ "0": {
790
+ "name": "punctuation.definition.string.begin.elixir"
791
+ }
792
+ },
793
+ "comment": "sigil (without interpolation)",
794
+ "end": "\\)[a-z]*",
795
+ "endCaptures": {
796
+ "0": {
797
+ "name": "punctuation.definition.string.end.elixir"
798
+ }
799
+ },
800
+ "name": "string.quoted.other.sigil.literal.elixir"
801
+ },
802
+ {
803
+ "begin": "~[A-Z]([^\\w])",
804
+ "beginCaptures": {
805
+ "0": {
806
+ "name": "punctuation.definition.string.begin.elixir"
807
+ }
808
+ },
809
+ "comment": "sigil (without interpolation)",
810
+ "end": "\\1[a-z]*",
811
+ "endCaptures": {
812
+ "0": {
813
+ "name": "punctuation.definition.string.end.elixir"
814
+ }
815
+ },
816
+ "name": "string.quoted.other.sigil.literal.elixir"
817
+ },
818
+ {
819
+ "captures": {
820
+ "1": {
821
+ "name": "punctuation.definition.constant.elixir"
822
+ }
823
+ },
824
+ "comment": "symbols",
825
+ "match": "(?<!:)(:)(?>[a-zA-Z_][\\w@]*(?>[?!]|=(?![>=]))?|\\<\\>|===?|!==?|<<>>|<<<|>>>|~~~|::|<\\-|\\|>|=>|=~|=|/|\\\\\\\\|\\*\\*?|\\.\\.?\\.?|\\.\\.//|>=?|<=?|&&?&?|\\+\\+?|\\-\\-?|\\|\\|?\\|?|\\!|@|\\%?\\{\\}|%|\\[\\]|\\^(\\^\\^)?)",
826
+ "name": "constant.other.symbol.elixir"
827
+ },
828
+ {
829
+ "captures": {
830
+ "1": {
831
+ "name": "punctuation.definition.constant.elixir"
832
+ }
833
+ },
834
+ "comment": "symbols",
835
+ "match": "(?>[a-zA-Z_][\\w@]*(?>[?!])?)(:)(?!:)",
836
+ "name": "constant.other.keywords.elixir"
837
+ },
838
+ {
839
+ "begin": "(^[ \\t]+)?(?=##)",
840
+ "beginCaptures": {
841
+ "1": {
842
+ "name": "punctuation.whitespace.comment.leading.elixir"
843
+ }
844
+ },
845
+ "end": "(?!#)",
846
+ "patterns": [
847
+ {
848
+ "begin": "##",
849
+ "beginCaptures": {
850
+ "0": {
851
+ "name": "punctuation.definition.comment.elixir"
852
+ }
853
+ },
854
+ "end": "\\n",
855
+ "name": "comment.line.section.elixir"
856
+ }
857
+ ]
858
+ },
859
+ {
860
+ "begin": "(^[ \\t]+)?(?=#)",
861
+ "beginCaptures": {
862
+ "1": {
863
+ "name": "punctuation.whitespace.comment.leading.elixir"
864
+ }
865
+ },
866
+ "end": "(?!#)",
867
+ "patterns": [
868
+ {
869
+ "begin": "#",
870
+ "beginCaptures": {
871
+ "0": {
872
+ "name": "punctuation.definition.comment.elixir"
873
+ }
874
+ },
875
+ "end": "\\n",
876
+ "name": "comment.line.number-sign.elixir"
877
+ }
878
+ ]
879
+ },
880
+ {
881
+ "match": "\\b_([^_][\\w]+[?!]?)",
882
+ "name": "comment.unused.elixir"
883
+ },
884
+ {
885
+ "match": "\\b_\\b",
886
+ "name": "comment.wildcard.elixir"
887
+ },
888
+ {
889
+ "comment": "\n\t\t\tmatches questionmark-letters.\n\n\t\t\texamples (1st alternation = hex):\n\t\t\t?\\x1 ?\\x61\n\n\t\t\texamples (2rd alternation = escaped):\n\t\t\t?\\n ?\\b\n\n\t\t\texamples (3rd alternation = normal):\n\t\t\t?a ?A ?0\n\t\t\t?* ?\" ?(\n\t\t\t?. ?#\n\n\t\t\tthe negative lookbehind prevents against matching\n\t\t\tp(42.tainted?)\n\t\t\t",
890
+ "match": "(?<!\\w)\\?(\\\\(x[0-9A-Fa-f]{1,2}(?![0-9A-Fa-f])\\b|[^xMC])|[^\\s\\\\])",
891
+ "name": "constant.numeric.elixir"
892
+ },
893
+ {
894
+ "match": "\\+\\+|\\-\\-|<\\|>",
895
+ "name": "keyword.operator.concatenation.elixir"
896
+ },
897
+ {
898
+ "match": "\\|\\>|<~>|<>|<<<|>>>|~>>|<<~|~>|<~|<\\|>",
899
+ "name": "keyword.operator.sigils_1.elixir"
900
+ },
901
+ {
902
+ "match": "&&&|&&",
903
+ "name": "keyword.operator.sigils_2.elixir"
904
+ },
905
+ {
906
+ "match": "<\\-|\\\\\\\\",
907
+ "name": "keyword.operator.sigils_3.elixir"
908
+ },
909
+ {
910
+ "match": "===?|!==?|<=?|>=?",
911
+ "name": "keyword.operator.comparison.elixir"
912
+ },
913
+ {
914
+ "match": "(\\|\\|\\||&&&|\\^\\^\\^|<<<|>>>|~~~)",
915
+ "name": "keyword.operator.bitwise.elixir"
916
+ },
917
+ {
918
+ "match": "(?<=[ \\t])!+|\\bnot\\b|&&|\\band\\b|\\|\\||\\bor\\b|\\bxor\\b",
919
+ "name": "keyword.operator.logical.elixir"
920
+ },
921
+ {
922
+ "match": "(\\*|\\+|\\-|/)",
923
+ "name": "keyword.operator.arithmetic.elixir"
924
+ },
925
+ {
926
+ "match": "\\||\\+\\+|\\-\\-|\\*\\*|\\\\\\\\|\\<\\-|\\<\\>|\\<\\<|\\>\\>|\\:\\:|\\.\\.|//|\\|>|~|=>|&",
927
+ "name": "keyword.operator.other.elixir"
928
+ },
929
+ {
930
+ "match": "=",
931
+ "name": "keyword.operator.assignment.elixir"
932
+ },
933
+ {
934
+ "match": ":",
935
+ "name": "punctuation.separator.other.elixir"
936
+ },
937
+ {
938
+ "match": "\\;",
939
+ "name": "punctuation.separator.statement.elixir"
940
+ },
941
+ {
942
+ "match": ",",
943
+ "name": "punctuation.separator.object.elixir"
944
+ },
945
+ {
946
+ "match": "\\.",
947
+ "name": "punctuation.separator.method.elixir"
948
+ },
949
+ {
950
+ "match": "\\{|\\}",
951
+ "name": "punctuation.section.scope.elixir"
952
+ },
953
+ {
954
+ "match": "\\[|\\]",
955
+ "name": "punctuation.section.array.elixir"
956
+ },
957
+ {
958
+ "match": "\\(|\\)",
959
+ "name": "punctuation.section.function.elixir"
960
+ }
961
+ ]
962
+ },
963
+ "escaped_char": {
964
+ "match": "\\\\(x[\\da-fA-F]{1,2}|.)",
965
+ "name": "constant.character.escaped.elixir"
966
+ },
967
+ "interpolated_elixir": {
968
+ "begin": "#\\{",
969
+ "beginCaptures": {
970
+ "0": {
971
+ "name": "punctuation.section.embedded.begin.elixir"
972
+ }
973
+ },
974
+ "contentName": "source.elixir",
975
+ "end": "\\}",
976
+ "endCaptures": {
977
+ "0": {
978
+ "name": "punctuation.section.embedded.end.elixir"
979
+ }
980
+ },
981
+ "name": "meta.embedded.line.elixir",
982
+ "patterns": [
983
+ {
984
+ "include": "#nest_curly_and_self"
985
+ },
986
+ {
987
+ "include": "$self"
988
+ }
989
+ ]
990
+ },
991
+ "nest_curly_and_self": {
992
+ "patterns": [
993
+ {
994
+ "begin": "\\{",
995
+ "captures": {
996
+ "0": {
997
+ "name": "punctuation.section.scope.elixir"
998
+ }
999
+ },
1000
+ "end": "\\}",
1001
+ "patterns": [
1002
+ {
1003
+ "include": "#nest_curly_and_self"
1004
+ }
1005
+ ]
1006
+ },
1007
+ {
1008
+ "include": "$self"
1009
+ }
1010
+ ]
1011
+ }
1012
+ },
1013
+ "scopeName": "source.elixir"
1014
+ }