PluginProbe
Code Block Pro – Beautiful Syntax Highlighting / 1.6.0
Code Block Pro – Beautiful Syntax Highlighting v1.6.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 / puppet.tmLanguage.json

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

775 lines 18.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 {
2 "scopeName": "source.puppet",
3 "fileTypes": ["pp"],
4 "foldingStartMarker": "(^\\s*/\\*|(\\{|\\[|\\()\\s*$)",
5 "foldingStopMarker": "(\\*/|^\\s*(\\}|\\]|\\)))",
6 "name": "puppet",
7 "patterns": [
8 {
9 "include": "#line_comment"
10 },
11 {
12 "include": "#constants"
13 },
14 {
15 "begin": "^\\s*/\\*",
16 "end": "\\*/",
17 "name": "comment.block.puppet"
18 },
19 {
20 "begin": "\\b(node)\\b",
21 "captures": {
22 "1": {
23 "name": "storage.type.puppet"
24 },
25 "2": {
26 "name": "entity.name.type.class.puppet"
27 }
28 },
29 "end": "(?={)",
30 "name": "meta.definition.class.puppet",
31 "patterns": [
32 {
33 "match": "\\bdefault\\b",
34 "name": "keyword.puppet"
35 },
36 {
37 "include": "#strings"
38 },
39 {
40 "include": "#regex-literal"
41 }
42 ]
43 },
44 {
45 "begin": "\\b(class)\\s+((?#Qualified Resource Name)(?:[a-z][a-z0-9_]*)?(?:::[a-z][a-z0-9_]*)+|(?#Bareword Resource Name)[a-z][a-z0-9_]*)\\s*",
46 "captures": {
47 "1": {
48 "name": "storage.type.puppet"
49 },
50 "2": {
51 "name": "entity.name.type.class.puppet"
52 }
53 },
54 "end": "(?={)",
55 "name": "meta.definition.class.puppet",
56 "patterns": [
57 {
58 "begin": "\\b(inherits)\\b\\s+",
59 "captures": {
60 "1": {
61 "name": "storage.modifier.puppet"
62 }
63 },
64 "end": "(?=\\(|{)",
65 "name": "meta.definition.class.inherits.puppet",
66 "patterns": [
67 {
68 "match": "\\b((?:[-_A-Za-z0-9\".]+::)*[-_A-Za-z0-9\".]+)\\b",
69 "name": "support.type.puppet"
70 }
71 ]
72 },
73 {
74 "include": "#line_comment"
75 },
76 {
77 "include": "#resource-parameters"
78 },
79 {
80 "include": "#parameter-default-types"
81 }
82 ]
83 },
84 {
85 "begin": "^\\s*(plan)\\s+((?#Qualified Resource Name)(?:[a-z][a-z0-9_]*)?(?:::[a-z][a-z0-9_]*)+|(?#Bareword Resource Name)[a-z][a-z0-9_]*)\\s*",
86 "captures": {
87 "1": {
88 "name": "storage.type.puppet"
89 },
90 "2": {
91 "name": "entity.name.type.plan.puppet"
92 }
93 },
94 "end": "(?={)",
95 "name": "meta.definition.plan.puppet",
96 "patterns": [
97 {
98 "include": "#line_comment"
99 },
100 {
101 "include": "#resource-parameters"
102 },
103 {
104 "include": "#parameter-default-types"
105 }
106 ]
107 },
108 {
109 "begin": "^\\s*(define|function)\\s+((?#Bareword Resource Name)[a-z][a-z0-9_]*|(?#Qualified Resource Name)(?:[a-z][a-z0-9_]*)?(?:::[a-z][a-z0-9_]*)+)\\s*(\\()",
110 "captures": {
111 "1": {
112 "name": "storage.type.function.puppet"
113 },
114 "2": {
115 "name": "entity.name.function.puppet"
116 }
117 },
118 "end": "(?={)",
119 "name": "meta.function.puppet",
120 "patterns": [
121 {
122 "include": "#line_comment"
123 },
124 {
125 "include": "#resource-parameters"
126 },
127 {
128 "include": "#parameter-default-types"
129 }
130 ]
131 },
132 {
133 "match": "\\b(case|else|elsif|if|unless)(?!::)\\b",
134 "captures": {
135 "1": {
136 "name": "keyword.control.puppet"
137 }
138 }
139 },
140 {
141 "include": "#keywords"
142 },
143 {
144 "include": "#resource-definition"
145 },
146 {
147 "include": "#heredoc"
148 },
149 {
150 "include": "#strings"
151 },
152 {
153 "include": "#puppet-datatypes"
154 },
155 {
156 "include": "#array"
157 },
158 {
159 "match": "((\\$?)\"?[a-zA-Z_\\x{7f}-\\x{ff}][a-zA-Z0-9_\\x{7f}-\\x{ff}]*\"?):(?=\\s+|$)",
160 "name": "entity.name.section.puppet"
161 },
162 {
163 "include": "#numbers"
164 },
165 {
166 "include": "#variable"
167 },
168 {
169 "begin": "\\b(import|include|contain|require)\\s+(?!.*=>)",
170 "beginCaptures": {
171 "1": {
172 "name": "keyword.control.import.include.puppet"
173 }
174 },
175 "end": "(?=\\s|$)",
176 "contentName": "variable.parameter.include.puppet",
177 "name": "meta.include.puppet"
178 },
179 {
180 "match": "\\b\\w+\\s*(?==>)\\s*",
181 "name": "constant.other.key.puppet"
182 },
183 {
184 "match": "(?<={)\\s*\\w+\\s*(?=})",
185 "name": "constant.other.bareword.puppet"
186 },
187 {
188 "match": "\\b(alert|crit|debug|defined|emerg|err|escape|fail|failed|file|generate|gsub|info|notice|package|realize|search|tag|tagged|template|warning)\\b(?!.*{)",
189 "name": "support.function.puppet"
190 },
191 {
192 "match": "=>",
193 "name": "punctuation.separator.key-value.puppet"
194 },
195 {
196 "match": "->",
197 "name": "keyword.control.orderarrow.puppet"
198 },
199 {
200 "match": "~>",
201 "name": "keyword.control.notifyarrow.puppet"
202 },
203 {
204 "include": "#regex-literal"
205 }
206 ],
207 "repository": {
208 "constants": {
209 "patterns": [
210 {
211 "match": "\\b(absent|directory|false|file|present|running|stopped|true)\\b(?!.*{)",
212 "name": "constant.language.puppet"
213 }
214 ]
215 },
216 "double-quoted-string": {
217 "begin": "\"",
218 "beginCaptures": {
219 "0": {
220 "name": "punctuation.definition.string.begin.puppet"
221 }
222 },
223 "end": "\"",
224 "endCaptures": {
225 "0": {
226 "name": "punctuation.definition.string.end.puppet"
227 }
228 },
229 "name": "string.quoted.double.interpolated.puppet",
230 "patterns": [
231 {
232 "include": "#escaped_char"
233 },
234 {
235 "include": "#interpolated_puppet"
236 }
237 ]
238 },
239 "interpolated_puppet": {
240 "patterns": [
241 {
242 "begin": "(\\${)(\\d+)",
243 "beginCaptures": {
244 "1": {
245 "name": "punctuation.section.embedded.begin.puppet"
246 },
247 "2": {
248 "name": "source.puppet variable.other.readwrite.global.pre-defined.puppet"
249 }
250 },
251 "end": "}",
252 "endCaptures": {
253 "0": {
254 "name": "punctuation.section.embedded.end.puppet"
255 }
256 },
257 "contentName": "source.puppet",
258 "name": "meta.embedded.line.puppet",
259 "patterns": [
260 {
261 "include": "$self"
262 }
263 ]
264 },
265 {
266 "begin": "(\\${)(_[a-zA-Z0-9_]*)",
267 "beginCaptures": {
268 "1": {
269 "name": "punctuation.section.embedded.begin.puppet"
270 },
271 "2": {
272 "name": "source.puppet variable.other.readwrite.global.puppet"
273 }
274 },
275 "end": "}",
276 "endCaptures": {
277 "0": {
278 "name": "punctuation.section.embedded.end.puppet"
279 }
280 },
281 "contentName": "source.puppet",
282 "name": "meta.embedded.line.puppet",
283 "patterns": [
284 {
285 "include": "$self"
286 }
287 ]
288 },
289 {
290 "begin": "(\\${)(([a-z][a-z0-9_]*)?(?:::[a-z][a-z0-9_]*)*)",
291 "beginCaptures": {
292 "1": {
293 "name": "punctuation.section.embedded.begin.puppet"
294 },
295 "2": {
296 "name": "source.puppet variable.other.readwrite.global.puppet"
297 }
298 },
299 "end": "}",
300 "endCaptures": {
301 "0": {
302 "name": "punctuation.section.embedded.end.puppet"
303 }
304 },
305 "contentName": "source.puppet",
306 "name": "meta.embedded.line.puppet",
307 "patterns": [
308 {
309 "include": "$self"
310 }
311 ]
312 },
313 {
314 "begin": "\\${",
315 "beginCaptures": {
316 "0": {
317 "name": "punctuation.section.embedded.begin.puppet"
318 }
319 },
320 "end": "}",
321 "endCaptures": {
322 "0": {
323 "name": "punctuation.section.embedded.end.puppet"
324 }
325 },
326 "contentName": "source.puppet",
327 "name": "meta.embedded.line.puppet",
328 "patterns": [
329 {
330 "include": "$self"
331 }
332 ]
333 }
334 ]
335 },
336 "escaped_char": {
337 "match": "\\\\.",
338 "name": "constant.character.escape.puppet"
339 },
340 "line_comment": {
341 "patterns": [
342 {
343 "captures": {
344 "1": {
345 "name": "comment.line.number-sign.puppet"
346 },
347 "2": {
348 "name": "punctuation.definition.comment.puppet"
349 }
350 },
351 "match": "^((#).*$\\n?)",
352 "name": "meta.comment.full-line.puppet"
353 },
354 {
355 "captures": {
356 "1": {
357 "name": "punctuation.definition.comment.puppet"
358 }
359 },
360 "match": "(#).*$\\n?",
361 "name": "comment.line.number-sign.puppet"
362 }
363 ]
364 },
365 "nested_braces": {
366 "begin": "\\{",
367 "captures": {
368 "1": {
369 "name": "punctuation.section.scope.puppet"
370 }
371 },
372 "end": "\\}",
373 "patterns": [
374 {
375 "include": "#escaped_char"
376 },
377 {
378 "include": "#nested_braces"
379 }
380 ]
381 },
382 "nested_braces_interpolated": {
383 "begin": "\\{",
384 "captures": {
385 "1": {
386 "name": "punctuation.section.scope.puppet"
387 }
388 },
389 "end": "\\}",
390 "patterns": [
391 {
392 "include": "#escaped_char"
393 },
394 {
395 "include": "#variable"
396 },
397 {
398 "include": "#nested_braces_interpolated"
399 }
400 ]
401 },
402 "nested_brackets": {
403 "begin": "\\[",
404 "captures": {
405 "1": {
406 "name": "punctuation.section.scope.puppet"
407 }
408 },
409 "end": "\\]",
410 "patterns": [
411 {
412 "include": "#escaped_char"
413 },
414 {
415 "include": "#nested_brackets"
416 }
417 ]
418 },
419 "nested_brackets_interpolated": {
420 "begin": "\\[",
421 "captures": {
422 "1": {
423 "name": "punctuation.section.scope.puppet"
424 }
425 },
426 "end": "\\]",
427 "patterns": [
428 {
429 "include": "#escaped_char"
430 },
431 {
432 "include": "#variable"
433 },
434 {
435 "include": "#nested_brackets_interpolated"
436 }
437 ]
438 },
439 "nested_parens": {
440 "begin": "\\(",
441 "captures": {
442 "1": {
443 "name": "punctuation.section.scope.puppet"
444 }
445 },
446 "end": "\\)",
447 "patterns": [
448 {
449 "include": "#escaped_char"
450 },
451 {
452 "include": "#nested_parens"
453 }
454 ]
455 },
456 "nested_parens_interpolated": {
457 "begin": "\\(",
458 "captures": {
459 "1": {
460 "name": "punctuation.section.scope.puppet"
461 }
462 },
463 "end": "\\)",
464 "patterns": [
465 {
466 "include": "#escaped_char"
467 },
468 {
469 "include": "#variable"
470 },
471 {
472 "include": "#nested_parens_interpolated"
473 }
474 ]
475 },
476 "parameter-default-types": {
477 "patterns": [
478 {
479 "include": "#strings"
480 },
481 {
482 "include": "#numbers"
483 },
484 {
485 "include": "#variable"
486 },
487 {
488 "include": "#hash"
489 },
490 {
491 "include": "#array"
492 },
493 {
494 "include": "#function_call"
495 },
496 {
497 "include": "#constants"
498 },
499 {
500 "include": "#puppet-datatypes"
501 }
502 ]
503 },
504 "resource-parameters": {
505 "patterns": [
506 {
507 "captures": {
508 "1": {
509 "name": "variable.other.puppet"
510 },
511 "2": {
512 "name": "punctuation.definition.variable.puppet"
513 }
514 },
515 "match": "((\\$+)[a-zA-Z_][a-zA-Z0-9_]*)\\s*(?=,|\\))",
516 "name": "meta.function.argument.puppet"
517 },
518 {
519 "begin": "((\\$+)[a-zA-Z_][a-zA-Z0-9_]*)(?:\\s*(=)\\s*)\\s*",
520 "captures": {
521 "1": {
522 "name": "variable.other.puppet"
523 },
524 "2": {
525 "name": "punctuation.definition.variable.puppet"
526 },
527 "3": {
528 "name": "keyword.operator.assignment.puppet"
529 }
530 },
531 "end": "(?=,|\\))",
532 "name": "meta.function.argument.puppet",
533 "patterns": [
534 {
535 "include": "#parameter-default-types"
536 }
537 ]
538 }
539 ]
540 },
541 "array": {
542 "begin": "(\\[)",
543 "beginCaptures": {
544 "1": {
545 "name": "punctuation.definition.array.begin.puppet"
546 }
547 },
548 "end": "\\]",
549 "endCaptures": {
550 "0": {
551 "name": "punctuation.definition.array.end.puppet"
552 }
553 },
554 "name": "meta.array.puppet",
555 "patterns": [
556 {
557 "match": "\\s*,\\s*"
558 },
559 {
560 "include": "#parameter-default-types"
561 },
562 {
563 "include": "#line_comment"
564 }
565 ]
566 },
567 "hash": {
568 "begin": "\\{",
569 "beginCaptures": {
570 "0": {
571 "name": "punctuation.definition.hash.begin.puppet"
572 }
573 },
574 "end": "\\}",
575 "endCaptures": {
576 "0": {
577 "name": "punctuation.definition.hash.end.puppet"
578 }
579 },
580 "name": "meta.hash.puppet",
581 "patterns": [
582 {
583 "match": "\\b\\w+\\s*(?==>)\\s*",
584 "name": "constant.other.key.puppet"
585 },
586 {
587 "include": "#parameter-default-types"
588 },
589 {
590 "include": "#line_comment"
591 }
592 ]
593 },
594 "single-quoted-string": {
595 "begin": "'",
596 "beginCaptures": {
597 "0": {
598 "name": "punctuation.definition.string.begin.puppet"
599 }
600 },
601 "end": "'",
602 "endCaptures": {
603 "0": {
604 "name": "punctuation.definition.string.end.puppet"
605 }
606 },
607 "name": "string.quoted.single.puppet",
608 "patterns": [
609 {
610 "include": "#escaped_char"
611 }
612 ]
613 },
614 "strings": {
615 "patterns": [
616 {
617 "include": "#double-quoted-string"
618 },
619 {
620 "include": "#single-quoted-string"
621 }
622 ]
623 },
624 "keywords": {
625 "match": "\\b(undef)\\b",
626 "captures": {
627 "1": {
628 "name": "keyword.puppet"
629 }
630 }
631 },
632 "numbers": {
633 "patterns": [
634 {
635 "comment": "HEX 0x 0-f",
636 "match": "(?<!\\w|\\d)([-+]?)(?i:0x)(?i:[0-9a-f])+(?!\\w|\\d)",
637 "name": "constant.numeric.hexadecimal.puppet"
638 },
639 {
640 "comment": "INTEGERS [(+|-)] digits [e [(+|-)] digits]",
641 "match": "(?<!\\w|\\.)([-+]?)(?<!\\d)\\d+(?i:e(\\+|-){0,1}\\d+){0,1}(?!\\w|\\d|\\.)",
642 "name": "constant.numeric.integer.puppet"
643 },
644 {
645 "comment": "FLOAT [(+|-)] digits . digits [e [(+|-)] digits]",
646 "match": "(?<!\\w)([-+]?)\\d+\\.\\d+(?i:e(\\+|-){0,1}\\d+){0,1}(?!\\w|\\d)",
647 "name": "constant.numeric.integer.puppet"
648 }
649 ]
650 },
651 "resource-definition": {
652 "begin": "(?:^|\\b)((?#Toplevel Bareword)::[a-z][a-z0-9_]*|(?#Bareword Resource Name)[a-z][a-z0-9_]*|(?#Qualified Resource Name)(?:[a-z][a-z0-9_]*)?(?:::[a-z][a-z0-9_]*)+)\\s*({)\\s*",
653 "beginCaptures": {
654 "1": {
655 "name": "meta.definition.resource.puppet storage.type.puppet"
656 }
657 },
658 "end": ":",
659 "contentName": "entity.name.section.puppet",
660 "patterns": [
661 {
662 "include": "#strings"
663 },
664 {
665 "include": "#variable"
666 },
667 {
668 "include": "#array"
669 }
670 ]
671 },
672 "variable": {
673 "patterns": [
674 {
675 "match": "(\\$)(\\d+)",
676 "name": "variable.other.readwrite.global.pre-defined.puppet",
677 "captures": {
678 "1": {
679 "name": "punctuation.definition.variable.puppet"
680 }
681 }
682 },
683 {
684 "match": "(\\$)_[a-zA-Z0-9_]*",
685 "name": "variable.other.readwrite.global.puppet",
686 "captures": {
687 "1": {
688 "name": "punctuation.definition.variable.puppet"
689 }
690 }
691 },
692 {
693 "match": "(\\$)(([a-z][a-zA-Z0-9_]*)?(?:::[a-z][a-zA-Z0-9_]*)*)",
694 "name": "variable.other.readwrite.global.puppet",
695 "captures": {
696 "1": {
697 "name": "punctuation.definition.variable.puppet"
698 }
699 }
700 }
701 ]
702 },
703 "function_call": {
704 "begin": "([a-zA-Z_][a-zA-Z0-9_]*)(\\()",
705 "end": "\\)",
706 "name": "meta.function-call.puppet",
707 "patterns": [
708 {
709 "include": "#parameter-default-types"
710 },
711 {
712 "match": ",",
713 "name": "punctuation.separator.parameters.puppet"
714 }
715 ]
716 },
717 "puppet-datatypes": {
718 "patterns": [
719 {
720 "comment": "Puppet Data type",
721 "match": "(?<![a-zA-Z\\$])([A-Z][a-zA-Z0-9_]*)(?![a-zA-Z0-9_])",
722 "name": "storage.type.puppet"
723 }
724 ]
725 },
726 "regex-literal": {
727 "match": "(\\/)(.+?)(?:[^\\\\]\\/)",
728 "name": "string.regexp.literal.puppet",
729 "comment": "Puppet Regular expression literal without interpolation"
730 },
731 "heredoc": {
732 "patterns": [
733 {
734 "begin": "@\\([[:blank:]]*\"([^:\\/) \\t]+)\"[[:blank:]]*(:[[:blank:]]*[a-z][a-zA-Z0-9_+]*[[:blank:]]*)?(\\/[[:blank:]]*[tsrnL$]*)?[[:blank:]]*\\)",
735 "beginCaptures": {
736 "0": {
737 "name": "punctuation.definition.string.begin.puppet"
738 }
739 },
740 "end": "^[[:blank:]]*(\\|[[:blank:]]*-|\\||-)?[[:blank:]]*\\1",
741 "endCaptures": {
742 "0": {
743 "name": "punctuation.definition.string.end.puppet"
744 }
745 },
746 "name": "string.interpolated.heredoc.puppet",
747 "patterns": [
748 {
749 "include": "#escaped_char"
750 },
751 {
752 "include": "#interpolated_puppet"
753 }
754 ]
755 },
756 {
757 "begin": "@\\([[:blank:]]*([^:\\/) \\t]+)[[:blank:]]*(:[[:blank:]]*[a-z][a-zA-Z0-9_+]*[[:blank:]]*)?(\\/[[:blank:]]*[tsrnL$]*)?[[:blank:]]*\\)",
758 "beginCaptures": {
759 "0": {
760 "name": "punctuation.definition.string.begin.puppet"
761 }
762 },
763 "end": "^[[:blank:]]*(\\|[[:blank:]]*-|\\||-)?[[:blank:]]*\\1",
764 "endCaptures": {
765 "0": {
766 "name": "punctuation.definition.string.end.puppet"
767 }
768 },
769 "name": "string.unquoted.heredoc.puppet"
770 }
771 ]
772 }
773 }
774 }
775