PluginProbe
Code Block Pro – Beautiful Syntax Highlighting / 1.4.0
Code Block Pro – Beautiful Syntax Highlighting v1.4.0
1.27.1 1.27.2 1.27.3 1.27.4 1.27.5 1.27.6 1.27.7 1.28.0 1.3.0 1.4.0 1.5.0 1.5.1 1.5.2 1.6.0 1.7.0 1.8.0 1.9.0 1.9.1 1.9.2 1.9.3 trunk 1.1.0 1.10.0 1.11.0 1.11.1 All 63 releases
code-block-pro / build / shiki / languages / elm.tmLanguage.json

elm.tmLanguage.json in Code Block Pro – Beautiful Syntax Highlighting 1.4.0, at build/shiki/languages/elm.tmLanguage.json

749 lines 16.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 {
2 "fileTypes": ["elm"],
3 "name": "elm",
4 "scopeName": "source.elm",
5 "patterns": [
6 {
7 "include": "#import"
8 },
9 {
10 "include": "#module"
11 },
12 {
13 "include": "#debug"
14 },
15 {
16 "include": "#comments"
17 },
18 {
19 "match": "\\b(_)\\b",
20 "name": "keyword.unused.elm"
21 },
22 {
23 "include": "#type-signature"
24 },
25 {
26 "include": "#type-declaration"
27 },
28 {
29 "include": "#type-alias-declaration"
30 },
31 {
32 "include": "#string-triple"
33 },
34 {
35 "include": "#string-quote"
36 },
37 {
38 "include": "#char"
39 },
40 {
41 "comment": "Floats are always decimal",
42 "match": "\\b([0-9]+\\.[0-9]+([eE][+-]?[0-9]+)?|[0-9]+[eE][+-]?[0-9]+)\\b",
43 "name": "constant.numeric.float.elm"
44 },
45 {
46 "match": "\\b([0-9]+)\\b",
47 "name": "constant.numeric.elm"
48 },
49 {
50 "match": "\\b(0x[0-9a-fA-F]+)\\b",
51 "name": "constant.numeric.elm"
52 },
53 {
54 "include": "#glsl"
55 },
56 {
57 "include": "#record-prefix"
58 },
59 {
60 "include": "#module-prefix"
61 },
62 {
63 "include": "#constructor"
64 },
65 {
66 "name": "meta.record.field.update.elm",
67 "match": "(\\{)\\s+([a-z][a-zA-Z0-9_]*)\\s+(\\|)\\s+([a-z][a-zA-Z0-9_]*)",
68 "captures": {
69 "1": {
70 "name": "punctuation.bracket.elm"
71 },
72 "2": {
73 "name": "record.name.elm"
74 },
75 "3": {
76 "name": "keyword.pipe.elm"
77 },
78 "4": {
79 "name": "entity.name.record.field.elm"
80 }
81 }
82 },
83 {
84 "name": "meta.record.field.update.elm",
85 "match": "(\\|)\\s+([a-z][a-zA-Z0-9_]*)\\s+(\\=)",
86 "captures": {
87 "1": {
88 "name": "keyword.pipe.elm"
89 },
90 "2": {
91 "name": "entity.name.record.field.elm"
92 },
93 "3": {
94 "name": "keyword.operator.assignment.elm"
95 }
96 }
97 },
98 {
99 "name": "meta.record.field.update.elm",
100 "match": "(\\{)\\s+([a-z][a-zA-Z0-9_]*)\\s+$",
101 "captures": {
102 "1": {
103 "name": "punctuation.bracket.elm"
104 },
105 "2": {
106 "name": "record.name.elm"
107 }
108 }
109 },
110 {
111 "name": "meta.record.field.elm",
112 "match": "(\\{)\\s+([a-z][a-zA-Z0-9_]*)\\s+(\\=)",
113 "captures": {
114 "1": {
115 "name": "punctuation.bracket.elm"
116 },
117 "2": {
118 "name": "entity.name.record.field.elm"
119 },
120 "3": {
121 "name": "keyword.operator.assignment.elm"
122 }
123 }
124 },
125 {
126 "name": "meta.record.field.elm",
127 "match": "(,)\\s+([a-z][a-zA-Z0-9_]*)\\s+(\\=)",
128 "captures": {
129 "1": {
130 "name": "punctuation.separator.comma.elm"
131 },
132 "2": {
133 "name": "entity.name.record.field.elm"
134 },
135 "3": {
136 "name": "keyword.operator.assignment.elm"
137 }
138 }
139 },
140 {
141 "match": "(\\}|\\{)",
142 "name": "punctuation.bracket.elm"
143 },
144 {
145 "include": "#unit"
146 },
147 {
148 "include": "#comma"
149 },
150 {
151 "include": "#parens"
152 },
153 {
154 "match": "(->)",
155 "name": "keyword.operator.arrow.elm"
156 },
157 {
158 "include": "#infix_op"
159 },
160 {
161 "match": "(\\=|\\:|\\||\\\\)",
162 "name": "keyword.other.elm"
163 },
164 {
165 "match": "\\b(type|as|port|exposing|alias|infixl|infixr|infix)\\s+",
166 "name": "keyword.other.elm"
167 },
168 {
169 "match": "\\b(if|then|else|case|of|let|in)\\s+",
170 "name": "keyword.control.elm"
171 },
172 {
173 "include": "#record-accessor"
174 },
175 {
176 "include": "#top_level_value"
177 },
178 {
179 "include": "#value"
180 },
181 {
182 "include": "#period"
183 },
184 {
185 "include": "#square_brackets"
186 }
187 ],
188 "repository": {
189 "comma": {
190 "match": "(,)",
191 "name": "punctuation.separator.comma.elm"
192 },
193 "parens": {
194 "match": "(\\(|\\))",
195 "name": "punctuation.parens.elm"
196 },
197 "block_comment": {
198 "applyEndPatternLast": 1,
199 "begin": "\\{-(?!#)",
200 "captures": {
201 "0": {
202 "name": "punctuation.definition.comment.elm"
203 }
204 },
205 "end": "-\\}",
206 "name": "comment.block.elm",
207 "patterns": [
208 {
209 "include": "#block_comment"
210 }
211 ]
212 },
213 "comments": {
214 "patterns": [
215 {
216 "captures": {
217 "1": {
218 "name": "punctuation.definition.comment.elm"
219 }
220 },
221 "begin": "--",
222 "end": "$",
223 "name": "comment.line.double-dash.elm"
224 },
225 {
226 "include": "#block_comment"
227 }
228 ]
229 },
230 "import": {
231 "name": "meta.import.elm",
232 "begin": "^\\b(import)\\s+",
233 "beginCaptures": {
234 "1": {
235 "name": "keyword.control.import.elm"
236 }
237 },
238 "end": "\\n(?!\\s)",
239 "patterns": [
240 {
241 "match": "(as|exposing)",
242 "name": "keyword.control.elm"
243 },
244 {
245 "include": "#module_chunk"
246 },
247 {
248 "include": "#period"
249 },
250 {
251 "match": "\\s+",
252 "name": "punctuation.spaces.elm"
253 },
254 {
255 "include": "#module-exports"
256 }
257 ]
258 },
259 "module": {
260 "begin": "^\\b((port |effect )?module)\\s+",
261 "beginCaptures": {
262 "1": {
263 "name": "keyword.other.elm"
264 }
265 },
266 "end": "\\n(?!\\s)",
267 "endCaptures": {
268 "1": {
269 "name": "keyword.other.elm"
270 }
271 },
272 "name": "meta.declaration.module.elm",
273 "patterns": [
274 {
275 "include": "#module_chunk"
276 },
277 {
278 "include": "#period"
279 },
280 {
281 "match": "(exposing)",
282 "name": "keyword.other.elm"
283 },
284 {
285 "match": "\\s+",
286 "name": "punctuation.spaces.elm"
287 },
288 {
289 "include": "#module-exports"
290 }
291 ]
292 },
293 "string-triple": {
294 "name": "string.quoted.triple.elm",
295 "begin": "\"\"\"",
296 "beginCaptures": {
297 "0": {
298 "name": "punctuation.definition.string.begin.elm"
299 }
300 },
301 "end": "\"\"\"",
302 "endCaptures": {
303 "0": {
304 "name": "punctuation.definition.string.end.elm"
305 }
306 },
307 "patterns": [
308 {
309 "match": "\\\\(NUL|SOH|STX|ETX|EOT|ENQ|ACK|BEL|BS|HT|LF|VT|FF|CR|SO|SI|DLE|DC1|DC2|DC3|DC4|NAK|SYN|ETB|CAN|EM|SUB|ESC|FS|GS|RS|US|SP|DEL|[abfnrtv\\\\\\\"'\\&]|x[0-9a-fA-F]{1,5})",
310 "name": "constant.character.escape.elm"
311 },
312 {
313 "match": "\\^[A-Z@\\[\\]\\\\\\^_]",
314 "name": "constant.character.escape.control.elm"
315 }
316 ]
317 },
318 "string-quote": {
319 "name": "string.quoted.double.elm",
320 "begin": "\"",
321 "beginCaptures": {
322 "0": {
323 "name": "punctuation.definition.string.begin.elm"
324 }
325 },
326 "end": "\"",
327 "endCaptures": {
328 "0": {
329 "name": "punctuation.definition.string.end.elm"
330 }
331 },
332 "patterns": [
333 {
334 "match": "\\\\(NUL|SOH|STX|ETX|EOT|ENQ|ACK|BEL|BS|HT|LF|VT|FF|CR|SO|SI|DLE|DC1|DC2|DC3|DC4|NAK|SYN|ETB|CAN|EM|SUB|ESC|FS|GS|RS|US|SP|DEL|[abfnrtv\\\\\\\"'\\&]|x[0-9a-fA-F]{1,5})",
335 "name": "constant.character.escape.elm"
336 },
337 {
338 "match": "\\^[A-Z@\\[\\]\\\\\\^_]",
339 "name": "constant.character.escape.control.elm"
340 }
341 ]
342 },
343 "char": {
344 "name": "string.quoted.single.elm",
345 "begin": "'",
346 "beginCaptures": {
347 "0": {
348 "name": "punctuation.definition.char.begin.elm"
349 }
350 },
351 "end": "'",
352 "endCaptures": {
353 "0": {
354 "name": "punctuation.definition.char.end.elm"
355 }
356 },
357 "patterns": [
358 {
359 "match": "\\\\(NUL|SOH|STX|ETX|EOT|ENQ|ACK|BEL|BS|HT|LF|VT|FF|CR|SO|SI|DLE|DC1|DC2|DC3|DC4|NAK|SYN|ETB|CAN|EM|SUB|ESC|FS|GS|RS|US|SP|DEL|[abfnrtv\\\\\\\"'\\&]|x[0-9a-fA-F]{1,5})",
360 "name": "constant.character.escape.elm"
361 },
362 {
363 "match": "\\^[A-Z@\\[\\]\\\\\\^_]",
364 "name": "constant.character.escape.control.elm"
365 }
366 ]
367 },
368 "debug": {
369 "match": "\\b(Debug)\\b",
370 "name": "invalid.illegal.debug.elm"
371 },
372 "module-exports": {
373 "begin": "(\\()",
374 "beginCaptures": {
375 "1": {
376 "name": "punctuation.parens.module-export.elm"
377 }
378 },
379 "end": "(\\))",
380 "endCaptures": {
381 "1": {
382 "name": "punctuation.parens.module-export.elm"
383 }
384 },
385 "name": "meta.declaration.exports.elm",
386 "patterns": [
387 {
388 "match": "\\b[a-z][a-zA-Z_'0-9]*",
389 "name": "entity.name.function.elm"
390 },
391 {
392 "match": "\\b[A-Z][A-Za-z_'0-9]*",
393 "name": "storage.type.elm"
394 },
395 {
396 "match": ",",
397 "name": "punctuation.separator.comma.elm"
398 },
399 {
400 "match": "\\s+",
401 "name": "punctuation.spaces.elm"
402 },
403 {
404 "include": "#comma"
405 },
406 {
407 "match": "\\(\\.\\.\\)",
408 "name": "punctuation.parens.ellipses.elm"
409 },
410 {
411 "match": "\\.\\.",
412 "name": "punctuation.parens.ellipses.elm"
413 },
414 {
415 "include": "#infix_op"
416 },
417 {
418 "comment": "So named because I don't know what to call this.",
419 "match": "\\(.*?\\)",
420 "name": "meta.other.unknown.elm"
421 }
422 ]
423 },
424 "module_chunk": {
425 "match": "[A-Z][a-zA-Z0-9_]*",
426 "name": "support.module.elm"
427 },
428 "period": {
429 "match": "[.]",
430 "name": "keyword.other.period.elm"
431 },
432 "square_brackets": {
433 "match": "[\\[\\]]",
434 "name": "punctuation.definition.list.elm"
435 },
436 "record-prefix": {
437 "match": "([a-z][a-zA-Z0-9_]*)(\\.)([a-z][a-zA-Z0-9_]*)",
438 "name": "record.accessor.elm",
439 "captures": {
440 "1": {
441 "name": "record.name.elm"
442 },
443 "2": {
444 "name": "keyword.other.period.elm"
445 },
446 "3": {
447 "name": "entity.name.record.field.accessor.elm"
448 }
449 }
450 },
451 "module-prefix": {
452 "match": "([A-Z][a-zA-Z0-9_]*)(\\.)",
453 "name": "meta.module.name.elm",
454 "captures": {
455 "1": {
456 "name": "support.module.elm"
457 },
458 "2": {
459 "name": "keyword.other.period.elm"
460 }
461 }
462 },
463 "constructor": {
464 "match": "\\b[A-Z][a-zA-Z0-9_]*\\b",
465 "name": "constant.type-constructor.elm"
466 },
467 "value": {
468 "match": "\\b[a-z][a-zA-Z0-9_]*\\b",
469 "name": "meta.value.elm"
470 },
471 "unit": {
472 "match": "\\(\\)",
473 "name": "constant.unit.elm"
474 },
475 "top_level_value": {
476 "match": "^[a-z][a-zA-Z0-9_]*\\b",
477 "name": "entity.name.function.top_level.elm"
478 },
479 "record-accessor": {
480 "match": "(\\.)([a-z][a-zA-Z0-9_]*)",
481 "name": "meta.record.accessor",
482 "captures": {
483 "1": {
484 "name": "keyword.other.period.elm"
485 },
486 "2": {
487 "name": "entity.name.record.field.accessor.elm"
488 }
489 }
490 },
491 "infix_op": {
492 "match": "(</>|<\\?>|<\\||<=|\\|\\||&&|>=|\\|>|\\|=|\\|\\.|\\+\\+|::|/=|==|//|>>|<<|<|>|\\^|\\+|-|/|\\*)",
493 "name": "keyword.operator.elm"
494 },
495 "type-declaration": {
496 "begin": "^(type\\s+)([A-Z][a-zA-Z0-9_']*)\\s+",
497 "beginCaptures": {
498 "1": {
499 "name": "keyword.type.elm"
500 },
501 "2": {
502 "name": "storage.type.elm"
503 }
504 },
505 "end": "^(?=\\S)",
506 "name": "meta.function.type-declaration.elm",
507 "patterns": [
508 {
509 "name": "meta.record.field.elm",
510 "match": "^\\s*([A-Z][a-zA-Z0-9_]*)\\b",
511 "captures": {
512 "1": {
513 "name": "constant.type-constructor.elm"
514 }
515 }
516 },
517 {
518 "match": "\\s+",
519 "name": "punctuation.spaces.elm"
520 },
521 {
522 "name": "meta.record.field.elm",
523 "match": "(\\=|\\|)\\s+([A-Z][a-zA-Z0-9_]*)\\b",
524 "captures": {
525 "1": {
526 "name": "keyword.operator.assignment.elm"
527 },
528 "2": {
529 "name": "constant.type-constructor.elm"
530 }
531 }
532 },
533 {
534 "match": "\\=",
535 "name": "keyword.operator.assignment.elm"
536 },
537 {
538 "match": "\\-\\>",
539 "name": "keyword.operator.arrow.elm"
540 },
541 {
542 "include": "#module-prefix"
543 },
544 {
545 "match": "\\b[a-z][a-zA-Z0-9_]*\\b",
546 "name": "variable.type.elm"
547 },
548 {
549 "match": "\\b[A-Z][a-zA-Z0-9_]*\\b",
550 "name": "storage.type.elm"
551 },
552 {
553 "include": "#comments"
554 },
555 {
556 "include": "#type-record"
557 }
558 ]
559 },
560 "type-alias-declaration": {
561 "begin": "^(type\\s+)(alias\\s+)([A-Z][a-zA-Z0-9_']*)\\s+",
562 "beginCaptures": {
563 "1": {
564 "name": "keyword.type.elm"
565 },
566 "2": {
567 "name": "keyword.type-alias.elm"
568 },
569 "3": {
570 "name": "storage.type.elm"
571 }
572 },
573 "end": "^(?=\\S)",
574 "name": "meta.function.type-declaration.elm",
575 "patterns": [
576 {
577 "match": "\\n\\s+",
578 "name": "punctuation.spaces.elm"
579 },
580 {
581 "match": "\\=",
582 "name": "keyword.operator.assignment.elm"
583 },
584 {
585 "include": "#module-prefix"
586 },
587 {
588 "match": "\\b[A-Z][a-zA-Z0-9_]*\\b",
589 "name": "storage.type.elm"
590 },
591 {
592 "match": "\\b[a-z][a-zA-Z0-9_]*\\b",
593 "name": "variable.type.elm"
594 },
595 {
596 "include": "#comments"
597 },
598 {
599 "include": "#type-record"
600 }
601 ]
602 },
603 "type-record": {
604 "begin": "(\\{)",
605 "beginCaptures": {
606 "1": {
607 "name": "punctuation.section.braces.begin"
608 }
609 },
610 "end": "(\\})",
611 "endCaptures": {
612 "1": {
613 "name": "punctuation.section.braces.end"
614 }
615 },
616 "name": "meta.function.type-record.elm",
617 "patterns": [
618 {
619 "match": "\\s+",
620 "name": "punctuation.spaces.elm"
621 },
622 {
623 "match": "->",
624 "name": "keyword.operator.arrow.elm"
625 },
626 {
627 "name": "meta.record.field.elm",
628 "match": "([a-z][a-zA-Z0-9_]*)\\s+(\\:)",
629 "captures": {
630 "1": {
631 "name": "entity.name.record.field.elm"
632 },
633 "2": {
634 "name": "keyword.other.elm"
635 }
636 }
637 },
638 {
639 "match": "\\,",
640 "name": "punctuation.separator.comma.elm"
641 },
642 {
643 "include": "#module-prefix"
644 },
645 {
646 "match": "\\b[a-z][a-zA-Z0-9_]*\\b",
647 "name": "variable.type.elm"
648 },
649 {
650 "match": "\\b[A-Z][a-zA-Z0-9_]*\\b",
651 "name": "storage.type.elm"
652 },
653 {
654 "include": "#comments"
655 },
656 {
657 "include": "#type-record"
658 }
659 ]
660 },
661 "type-signature": {
662 "begin": "^(port\\s+)?([a-z_][a-zA-Z0-9_']*)\\s+(\\:)",
663 "beginCaptures": {
664 "1": {
665 "name": "keyword.other.port.elm"
666 },
667 "2": {
668 "name": "entity.name.function.elm"
669 },
670 "3": {
671 "name": "keyword.other.colon.elm"
672 }
673 },
674 "end": "((^(?=[a-z]))|^$)",
675 "name": "meta.function.type-declaration.elm",
676 "patterns": [
677 {
678 "include": "#type-signature-chunk"
679 }
680 ]
681 },
682 "type-signature-chunk": {
683 "patterns": [
684 {
685 "match": "->",
686 "name": "keyword.operator.arrow.elm"
687 },
688 {
689 "match": "\\s+",
690 "name": "punctuation.spaces.elm"
691 },
692 {
693 "include": "#module-prefix"
694 },
695 {
696 "match": "\\b[a-z][a-zA-Z0-9_]*\\b",
697 "name": "variable.type.elm"
698 },
699 {
700 "match": "\\b[A-Z][a-zA-Z0-9_]*\\b",
701 "name": "storage.type.elm"
702 },
703 {
704 "match": "\\(\\)",
705 "name": "constant.unit.elm"
706 },
707 {
708 "include": "#comma"
709 },
710 {
711 "include": "#parens"
712 },
713 {
714 "include": "#comments"
715 },
716 {
717 "include": "#type-record"
718 }
719 ]
720 },
721 "glsl": {
722 "begin": "(\\[)(glsl)(\\|)",
723 "beginCaptures": {
724 "1": {
725 "name": "entity.glsl.bracket.elm"
726 },
727 "2": {
728 "name": "entity.glsl.name.elm"
729 },
730 "3": {
731 "name": "entity.glsl.bracket.elm"
732 }
733 },
734 "end": "(\\|\\])",
735 "endCaptures": {
736 "1": {
737 "name": "entity.glsl.bracket.elm"
738 }
739 },
740 "name": "meta.embedded.block.glsl",
741 "patterns": [
742 {
743 "include": "source.glsl"
744 }
745 ]
746 }
747 }
748 }
749