Elffuss BraidHub

kikocis/continue public

80eede9a6f83 · 92.0 KiBRawPermalink
1{
2 "name": "MagicPython",
3 "scopeName": "source.python",
4 "fileTypes": [
5 "py",
6 "py3",
7 "rpy",
8 "pyw",
9 "cpy",
10 "SConstruct",
11 "Sconstruct",
12 "sconstruct",
13 "SConscript",
14 "gyp",
15 "gypi"
16 ],
17 "first_line_match": "^#!/.*\\bpython[\\d\\.]*\\b",
18 "firstLineMatch": "^#!/.*\\bpython[\\d\\.]*\\b",
19 "uuid": "742deb57-6e38-4192-bed6-410746efd85d",
20 "patterns": [
21 {
22 "include": "#statement"
23 },
24 {
25 "include": "#expression"
26 }
27 ],
28 "repository": {
29 "statement": {
30 "patterns": [
31 {
32 "include": "#import"
33 },
34 {
35 "include": "#class-declaration"
36 },
37 {
38 "include": "#function-declaration"
39 },
40 {
41 "include": "#statement-keyword"
42 },
43 {
44 "include": "#assignment-operator"
45 },
46 {
47 "include": "#decorator"
48 },
49 {
50 "include": "#docstring-statement"
51 },
52 {
53 "include": "#semicolon"
54 }
55 ]
56 },
57 "semicolon": {
58 "patterns": [
59 {
60 "name": "invalid.deprecated.semicolon.python",
61 "match": "\\;$"
62 }
63 ]
64 },
65 "comments": {
66 "patterns": [
67 {
68 "name": "comment.line.number-sign.python",
69 "contentName": "meta.typehint.comment.python",
70 "begin": "(?x)\n (?:\n \\# \\s* (type:)\n \\s*+ (?# we want `\\s*+` which is possessive quantifier since\n we do not actually want to backtrack when matching\n whitespace here)\n (?! $ | \\#)\n )\n",
71 "end": "(?:$|(?=\\#))",
72 "beginCaptures": {
73 "0": {
74 "name": "meta.typehint.comment.python"
75 },
76 "1": {
77 "name": "comment.typehint.directive.notation.python"
78 }
79 },
80 "patterns": [
81 {
82 "name": "comment.typehint.ignore.notation.python",
83 "match": "(?x)\n \\G ignore\n (?= \\s* (?: $ | \\#))\n"
84 },
85 {
86 "name": "comment.typehint.type.notation.python",
87 "match": "(?x)\n (?<!\\.)\\b(\n bool | bytes | float | int | object | str\n | List | Dict | Iterable | Sequence | Set\n | FrozenSet | Callable | Union | Tuple\n | Any | None\n )\\b\n"
88 },
89 {
90 "name": "comment.typehint.punctuation.notation.python",
91 "match": "([\\[\\]\\(\\),\\.\\=\\*]|(->))"
92 },
93 {
94 "name": "comment.typehint.variable.notation.python",
95 "match": "([[:alpha:]_]\\w*)"
96 }
97 ]
98 },
99 {
100 "include": "#comments-base"
101 }
102 ]
103 },
104 "docstring-statement": {
105 "begin": "^(?=\\s*[rR]?(\\'\\'\\'|\\\"\\\"\\\"|\\'|\\\"))",
106 "end": "(?<=\\'\\'\\'|\\\"\\\"\\\"|\\'|\\\")",
107 "patterns": [
108 {
109 "include": "#docstring"
110 }
111 ]
112 },
113 "docstring": {
114 "patterns": [
115 {
116 "name": "string.quoted.docstring.multi.python",
117 "begin": "(\\'\\'\\'|\\\"\\\"\\\")",
118 "end": "(\\1)",
119 "beginCaptures": {
120 "1": {
121 "name": "punctuation.definition.string.begin.python"
122 }
123 },
124 "endCaptures": {
125 "1": {
126 "name": "punctuation.definition.string.end.python"
127 }
128 },
129 "patterns": [
130 {
131 "include": "#docstring-prompt"
132 },
133 {
134 "include": "#codetags"
135 },
136 {
137 "include": "#docstring-guts-unicode"
138 }
139 ]
140 },
141 {
142 "name": "string.quoted.docstring.raw.multi.python",
143 "begin": "([rR])(\\'\\'\\'|\\\"\\\"\\\")",
144 "end": "(\\2)",
145 "beginCaptures": {
146 "1": {
147 "name": "storage.type.string.python"
148 },
149 "2": {
150 "name": "punctuation.definition.string.begin.python"
151 }
152 },
153 "endCaptures": {
154 "1": {
155 "name": "punctuation.definition.string.end.python"
156 }
157 },
158 "patterns": [
159 {
160 "include": "#string-consume-escape"
161 },
162 {
163 "include": "#docstring-prompt"
164 },
165 {
166 "include": "#codetags"
167 }
168 ]
169 },
170 {
171 "name": "string.quoted.docstring.single.python",
172 "begin": "(\\'|\\\")",
173 "end": "(\\1)|((?<!\\\\)\\n)",
174 "beginCaptures": {
175 "1": {
176 "name": "punctuation.definition.string.begin.python"
177 }
178 },
179 "endCaptures": {
180 "1": {
181 "name": "punctuation.definition.string.end.python"
182 },
183 "2": {
184 "name": "invalid.illegal.newline.python"
185 }
186 },
187 "patterns": [
188 {
189 "include": "#codetags"
190 },
191 {
192 "include": "#docstring-guts-unicode"
193 }
194 ]
195 },
196 {
197 "name": "string.quoted.docstring.raw.single.python",
198 "begin": "([rR])(\\'|\\\")",
199 "end": "(\\2)|((?<!\\\\)\\n)",
200 "beginCaptures": {
201 "1": {
202 "name": "storage.type.string.python"
203 },
204 "2": {
205 "name": "punctuation.definition.string.begin.python"
206 }
207 },
208 "endCaptures": {
209 "1": {
210 "name": "punctuation.definition.string.end.python"
211 },
212 "2": {
213 "name": "invalid.illegal.newline.python"
214 }
215 },
216 "patterns": [
217 {
218 "include": "#string-consume-escape"
219 },
220 {
221 "include": "#codetags"
222 }
223 ]
224 }
225 ]
226 },
227 "docstring-guts-unicode": {
228 "patterns": [
229 {
230 "include": "#escape-sequence-unicode"
231 },
232 {
233 "include": "#escape-sequence"
234 },
235 {
236 "include": "#string-line-continuation"
237 }
238 ]
239 },
240 "docstring-prompt": {
241 "match": "(?x)\n (?:\n (?:^|\\G) \\s* (?# '\\G' is necessary for ST)\n ((?:>>>|\\.\\.\\.) \\s) (?=\\s*\\S)\n )\n",
242 "captures": {
243 "1": {
244 "name": "keyword.control.flow.python"
245 }
246 }
247 },
248 "codetags": {
249 "match": "(?:\\b(NOTE|XXX|HACK|FIXME|BUG|TODO)\\b)",
250 "captures": {
251 "1": {
252 "name": "keyword.codetag.notation.python"
253 }
254 }
255 },
256 "statement-keyword": {
257 "patterns": [
258 {
259 "name": "storage.type.function.python",
260 "match": "\\b((async\\s+)?\\s*def)\\b"
261 },
262 {
263 "name": "keyword.control.flow.python",
264 "match": "(?x)\n \\b(?<!\\.)(\n as | async | continue | del | assert | break | finally | for\n | from | elif | else | if | except | pass | raise\n | return | try | while | with\n )\\b\n"
265 },
266 {
267 "name": "storage.modifier.declaration.python",
268 "match": "(?x)\n \\b(?<!\\.)(\n global | nonlocal\n )\\b\n"
269 },
270 {
271 "name": "storage.type.class.python",
272 "match": "\\b(?<!\\.)(class)\\b"
273 }
274 ]
275 },
276 "expression-base": {
277 "comment": "All valid Python expressions",
278 "patterns": [
279 {
280 "include": "#backticks"
281 },
282 {
283 "include": "#illegal-anno"
284 },
285 {
286 "include": "#comments"
287 },
288 {
289 "include": "#literal"
290 },
291 {
292 "include": "#regexp"
293 },
294 {
295 "include": "#string"
296 },
297 {
298 "include": "#lambda"
299 },
300 {
301 "include": "#illegal-operator"
302 },
303 {
304 "include": "#operator"
305 },
306 {
307 "include": "#curly-braces"
308 },
309 {
310 "include": "#item-access"
311 },
312 {
313 "include": "#list"
314 },
315 {
316 "include": "#round-braces"
317 },
318 {
319 "include": "#function-call"
320 },
321 {
322 "include": "#builtin-functions"
323 },
324 {
325 "include": "#builtin-types"
326 },
327 {
328 "include": "#builtin-exceptions"
329 },
330 {
331 "include": "#magic-names"
332 },
333 {
334 "include": "#special-names"
335 },
336 {
337 "include": "#illegal-names"
338 },
339 {
340 "include": "#special-variables"
341 },
342 {
343 "include": "#line-continuation"
344 },
345 {
346 "include": "#ellipsis"
347 }
348 ]
349 },
350 "expression": {
351 "comment": "All valid Python expressions",
352 "patterns": [
353 {
354 "include": "#expression-base"
355 },
356 {
357 "include": "#member-access"
358 },
359 {
360 "comment": "Tokenize identifiers to help linters",
361 "match": "(?x) \\b ([[:alpha:]_]\\w*) \\b"
362 }
363 ]
364 },
365 "member-access": {
366 "begin": "\\.\\s*(?!\\.)",
367 "end": "(?x)\n # stop when you've just read non-whitespace followed by non-word\n # i.e. when finished reading an identifier or function call\n (?<=\\S)(?=\\W) |\n # stop when seeing the start of something that's not a word,\n # i.e. when seeing a non-identifier\n (^|(?<=\\s))(?=[^\\\\\\w\\s]) |\n $\n",
368 "patterns": [
369 {
370 "include": "#function-call"
371 },
372 {
373 "include": "#member-access-base"
374 }
375 ]
376 },
377 "member-access-base": {
378 "patterns": [
379 {
380 "include": "#magic-names"
381 },
382 {
383 "include": "#illegal-names"
384 },
385 {
386 "include": "#illegal-object-name"
387 },
388 {
389 "include": "#special-names"
390 },
391 {
392 "include": "#line-continuation"
393 },
394 {
395 "include": "#item-access"
396 }
397 ]
398 },
399 "special-names": {
400 "name": "constant.other.caps.python",
401 "match": "(?x)\n \\b\n (\n _* [[:upper:]]\n )\n [[:upper:]\\d]* (_\\w*)?\n \\b\n"
402 },
403 "curly-braces": {
404 "begin": "\\{",
405 "end": "\\}",
406 "beginCaptures": {
407 "0": {
408 "name": "punctuation.definition.dict.begin.python"
409 }
410 },
411 "endCaptures": {
412 "0": {
413 "name": "punctuation.definition.dict.end.python"
414 }
415 },
416 "patterns": [
417 {
418 "include": "#expression"
419 }
420 ]
421 },
422 "list": {
423 "begin": "\\[",
424 "end": "\\]",
425 "beginCaptures": {
426 "0": {
427 "name": "punctuation.definition.list.begin.python"
428 }
429 },
430 "endCaptures": {
431 "0": {
432 "name": "punctuation.definition.list.end.python"
433 }
434 },
435 "patterns": [
436 {
437 "include": "#expression"
438 }
439 ]
440 },
441 "round-braces": {
442 "begin": "\\(",
443 "end": "\\)",
444 "beginCaptures": {
445 "0": {
446 "name": "punctuation.parenthesis.begin.python"
447 }
448 },
449 "endCaptures": {
450 "0": {
451 "name": "punctuation.parenthesis.end.python"
452 }
453 },
454 "patterns": [
455 {
456 "include": "#expression"
457 }
458 ]
459 },
460 "line-continuation": {
461 "patterns": [
462 {
463 "match": "(\\\\)\\s*(\\S.*$\\n?)",
464 "captures": {
465 "1": {
466 "name": "separator.continuation.line.python"
467 },
468 "2": {
469 "name": "invalid.illegal.line.continuation.python"
470 }
471 }
472 },
473 {
474 "begin": "(\\\\)\\s*$\\n?",
475 "end": "(?x)\n (?=^\\s*$)\n |\n (?! (\\s* [rR]? (\\'\\'\\'|\\\"\\\"\\\"|\\'|\\\"))\n |\n (\\G $) (?# '\\G' is necessary for ST)\n )\n",
476 "beginCaptures": {
477 "1": {
478 "name": "separator.continuation.line.python"
479 }
480 },
481 "patterns": [
482 {
483 "include": "#regexp"
484 },
485 {
486 "include": "#string"
487 }
488 ]
489 }
490 ]
491 },
492 "assignment-operator": {
493 "name": "keyword.operator.assignment.python",
494 "match": "(?x)\n <<= | >>= | //= | \\*\\*=\n | \\+= | -= | /= | @=\n | \\*= | %= | ~= | \\^= | &= | \\|=\n | =(?!=)\n"
495 },
496 "operator": {
497 "match": "(?x)\n \\b(?<!\\.)\n (?:\n (and | or | not | in | is) (?# 1)\n |\n (for | if | else | await | (?:yield(?:\\s+from)?)) (?# 2)\n )\n (?!\\s*:)\\b\n\n | (<< | >> | & | \\| | \\^ | ~) (?# 3)\n\n | (\\*\\* | \\* | \\+ | - | % | // | / | @) (?# 4)\n\n | (!= | == | >= | <= | < | >) (?# 5)\n",
498 "captures": {
499 "1": {
500 "name": "keyword.operator.logical.python"
501 },
502 "2": {
503 "name": "keyword.control.flow.python"
504 },
505 "3": {
506 "name": "keyword.operator.bitwise.python"
507 },
508 "4": {
509 "name": "keyword.operator.arithmetic.python"
510 },
511 "5": {
512 "name": "keyword.operator.comparison.python"
513 }
514 }
515 },
516 "literal": {
517 "patterns": [
518 {
519 "name": "constant.language.python",
520 "match": "\\b(True|False|None|NotImplemented|Ellipsis)\\b"
521 },
522 {
523 "include": "#number"
524 }
525 ]
526 },
527 "number": {
528 "name": "constant.numeric.python",
529 "patterns": [
530 {
531 "include": "#number-float"
532 },
533 {
534 "include": "#number-dec"
535 },
536 {
537 "include": "#number-hex"
538 },
539 {
540 "include": "#number-oct"
541 },
542 {
543 "include": "#number-bin"
544 },
545 {
546 "include": "#number-long"
547 },
548 {
549 "name": "invalid.illegal.name.python",
550 "match": "\\b[0-9]+\\w+"
551 }
552 ]
553 },
554 "number-float": {
555 "name": "constant.numeric.float.python",
556 "match": "(?x)\n (?<! \\w)(?:\n [0-9]*\\.[0-9]+ ([eE][+-]?[0-9]+)?\n | [0-9]+\\. ([eE][+-]?[0-9]+)?\n | [0-9]+ ([eE][+-]?[0-9]+)\n )([jJ])?\\b\n",
557 "captures": {
558 "4": {
559 "name": "storage.type.imaginary.number.python"
560 }
561 }
562 },
563 "number-dec": {
564 "name": "constant.numeric.dec.python",
565 "match": "(?x)\n (?<![\\w\\.])(?:\n [1-9][0-9]*\n |\n 0+\n |\n [0-9]+ ([jJ])\n |\n 0 ([0-9]+)(?![eE\\.])\n )\\b\n",
566 "captures": {
567 "1": {
568 "name": "storage.type.imaginary.number.python"
569 },
570 "2": {
571 "name": "invalid.illegal.dec.python"
572 },
573 "3": {
574 "name": "invalid.illegal.dec.python"
575 }
576 }
577 },
578 "number-hex": {
579 "name": "constant.numeric.hex.python",
580 "match": "(?x)\n (?<![\\w\\.])\n (0[xX]) [0-9a-fA-F]+\n \\b\n",
581 "captures": {
582 "1": {
583 "name": "storage.type.number.python"
584 }
585 }
586 },
587 "number-oct": {
588 "name": "constant.numeric.oct.python",
589 "match": "(?x)\n (?<![\\w\\.])\n (0[oO]) [0-7]+\n \\b\n",
590 "captures": {
591 "1": {
592 "name": "storage.type.number.python"
593 }
594 }
595 },
596 "number-bin": {
597 "name": "constant.numeric.bin.python",
598 "match": "(?x)\n (?<![\\w\\.])\n (0[bB]) [01]+\n \\b\n",
599 "captures": {
600 "1": {
601 "name": "storage.type.number.python"
602 }
603 }
604 },
605 "number-long": {
606 "name": "constant.numeric.bin.python",
607 "comment": "this is to support python2 syntax for long ints",
608 "match": "(?x)\n (?<![\\w\\.])\n ([1-9][0-9]* | 0) ([lL])\n \\b\n",
609 "captures": {
610 "2": {
611 "name": "storage.type.number.python"
612 }
613 }
614 },
615 "regexp": {
616 "patterns": [
617 {
618 "include": "#regexp-single-quoted-multi-line"
619 },
620 {
621 "include": "#regexp-double-quoted-multi-line"
622 },
623 {
624 "include": "#regexp-single-quoted-single-line"
625 },
626 {
627 "include": "#regexp-double-quoted-single-line"
628 }
629 ]
630 },
631 "regexp-single-quoted-single-line": {
632 "name": "string.regexp.quoted.single.python",
633 "begin": "\\b(([uU]r)|([bB]r)|(r[bB]?))(\\')",
634 "end": "(\\')|(?<!\\\\)(\\n)",
635 "beginCaptures": {
636 "2": {
637 "name": "invalid.deprecated.prefix.python"
638 },
639 "3": {
640 "name": "storage.type.string.python"
641 },
642 "4": {
643 "name": "storage.type.string.python"
644 },
645 "5": {
646 "name": "punctuation.definition.string.begin.python"
647 }
648 },
649 "endCaptures": {
650 "1": {
651 "name": "punctuation.definition.string.end.python"
652 },
653 "2": {
654 "name": "invalid.illegal.newline.python"
655 }
656 },
657 "patterns": [
658 {
659 "include": "#single-one-regexp-expression"
660 }
661 ]
662 },
663 "regexp-double-quoted-single-line": {
664 "name": "string.regexp.quoted.single.python",
665 "begin": "\\b(([uU]r)|([bB]r)|(r[bB]?))(\\\")",
666 "end": "(\\\")|(?<!\\\\)(\\n)",
667 "beginCaptures": {
668 "2": {
669 "name": "invalid.deprecated.prefix.python"
670 },
671 "3": {
672 "name": "storage.type.string.python"
673 },
674 "4": {
675 "name": "storage.type.string.python"
676 },
677 "5": {
678 "name": "punctuation.definition.string.begin.python"
679 }
680 },
681 "endCaptures": {
682 "1": {
683 "name": "punctuation.definition.string.end.python"
684 },
685 "2": {
686 "name": "invalid.illegal.newline.python"
687 }
688 },
689 "patterns": [
690 {
691 "include": "#double-one-regexp-expression"
692 }
693 ]
694 },
695 "regexp-single-quoted-multi-line": {
696 "name": "string.regexp.quoted.multi.python",
697 "begin": "\\b(([uU]r)|([bB]r)|(r[bB]?))(\\'\\'\\')",
698 "end": "\\'\\'\\'",
699 "beginCaptures": {
700 "2": {
701 "name": "invalid.deprecated.prefix.python"
702 },
703 "3": {
704 "name": "storage.type.string.python"
705 },
706 "4": {
707 "name": "storage.type.string.python"
708 },
709 "5": {
710 "name": "punctuation.definition.string.begin.python"
711 }
712 },
713 "endCaptures": {
714 "0": {
715 "name": "punctuation.definition.string.end.python"
716 }
717 },
718 "patterns": [
719 {
720 "include": "#single-three-regexp-expression"
721 }
722 ]
723 },
724 "regexp-double-quoted-multi-line": {
725 "name": "string.regexp.quoted.multi.python",
726 "begin": "\\b(([uU]r)|([bB]r)|(r[bB]?))(\\\"\\\"\\\")",
727 "end": "\\\"\\\"\\\"",
728 "beginCaptures": {
729 "2": {
730 "name": "invalid.deprecated.prefix.python"
731 },
732 "3": {
733 "name": "storage.type.string.python"
734 },
735 "4": {
736 "name": "storage.type.string.python"
737 },
738 "5": {
739 "name": "punctuation.definition.string.begin.python"
740 }
741 },
742 "endCaptures": {
743 "0": {
744 "name": "punctuation.definition.string.end.python"
745 }
746 },
747 "patterns": [
748 {
749 "include": "#double-three-regexp-expression"
750 }
751 ]
752 },
753 "string": {
754 "patterns": [
755 {
756 "include": "#string-quoted-multi-line"
757 },
758 {
759 "include": "#string-quoted-single-line"
760 },
761 {
762 "include": "#string-bin-quoted-multi-line"
763 },
764 {
765 "include": "#string-bin-quoted-single-line"
766 },
767 {
768 "include": "#string-raw-quoted-multi-line"
769 },
770 {
771 "include": "#string-raw-quoted-single-line"
772 },
773 {
774 "include": "#string-raw-bin-quoted-multi-line"
775 },
776 {
777 "include": "#string-raw-bin-quoted-single-line"
778 }
779 ]
780 },
781 "string-unicode-guts": {
782 "patterns": [
783 {
784 "include": "#escape-sequence-unicode"
785 },
786 {
787 "include": "#string-entity"
788 },
789 {
790 "include": "#string-brace-formatting"
791 }
792 ]
793 },
794 "string-consume-escape": {
795 "match": "\\\\['\"\\n\\\\]"
796 },
797 "string-raw-guts": {
798 "patterns": [
799 {
800 "include": "#string-consume-escape"
801 },
802 {
803 "include": "#string-formatting"
804 },
805 {
806 "include": "#string-brace-formatting"
807 }
808 ]
809 },
810 "string-raw-bin-guts": {
811 "patterns": [
812 {
813 "include": "#string-consume-escape"
814 },
815 {
816 "include": "#string-formatting"
817 }
818 ]
819 },
820 "string-entity": {
821 "patterns": [
822 {
823 "include": "#escape-sequence"
824 },
825 {
826 "include": "#string-line-continuation"
827 },
828 {
829 "include": "#string-formatting"
830 }
831 ]
832 },
833 "escape-sequence-unicode": {
834 "patterns": [
835 {
836 "name": "constant.character.escape.python",
837 "match": "(?x)\n \\\\ (\n u[0-9A-Fa-f]{4}\n | U[0-9A-Fa-f]{8}\n | N\\{[\\w\\s]+?\\}\n )\n"
838 }
839 ]
840 },
841 "escape-sequence": {
842 "name": "constant.character.escape.python",
843 "match": "(?x)\n \\\\ (\n x[0-9A-Fa-f]{2}\n | [0-7]{1,3}\n | [\\\\\"'abfnrtv]\n )\n"
844 },
845 "string-line-continuation": {
846 "name": "constant.language.python",
847 "match": "\\\\$"
848 },
849 "string-formatting": {
850 "name": "constant.character.format.placeholder.other.python",
851 "match": "(?x)\n % (\\([\\w\\s]*\\))?\n [-+#0 ]*\n (\\d+|\\*)? (\\.(\\d+|\\*))?\n ([hlL])?\n [diouxXeEfFgGcrsa%]\n"
852 },
853 "string-brace-formatting": {
854 "patterns": [
855 {
856 "name": "constant.character.format.placeholder.other.python",
857 "match": "(?x)\n (?:\n {{ | }}\n | (?:\n {\n \\w*? (\\.[[:alpha:]_]\\w*? | \\[[^\\]'\"]+\\])*?\n (![rsa])?\n ( : \\w? [<>=^]? [-+ ]? \\#?\n \\d* ,? (\\.\\d+)? [bcdeEfFgGnosxX%]? )?\n })\n )\n",
858 "captures": {
859 "2": {
860 "name": "storage.type.format.python"
861 },
862 "3": {
863 "name": "support.other.format.python"
864 }
865 }
866 },
867 {
868 "name": "constant.character.format.placeholder.other.python",
869 "begin": "(?x)\n \\{\n \\w*? (\\.[[:alpha:]_]\\w*? | \\[[^\\]'\"]+\\])*?\n (![rsa])?\n (:)\n (?=[^'\"}\\n]*\\})\n",
870 "end": "\\}",
871 "beginCaptures": {
872 "2": {
873 "name": "storage.type.format.python"
874 },
875 "3": {
876 "name": "support.other.format.python"
877 }
878 },
879 "patterns": [
880 {
881 "match": "(?x) \\{ [^'\"}\\n]*? \\} (?=.*?\\})\n"
882 }
883 ]
884 }
885 ]
886 },
887 "import": {
888 "comment": "Import statements\n",
889 "patterns": [
890 {
891 "match": "(?x)\n \\s* \\b(from)\\b (\\s*\\.+\\s*) (import)?\n",
892 "captures": {
893 "1": {
894 "name": "keyword.control.import.python"
895 },
896 "3": {
897 "name": "keyword.control.import.python"
898 }
899 }
900 },
901 {
902 "name": "keyword.control.import.python",
903 "match": "\\b(?<!\\.)import\\b"
904 }
905 ]
906 },
907 "class-declaration": {
908 "patterns": [
909 {
910 "name": "meta.class.python",
911 "begin": "(?x)\n \\s*(class)\\s+\n (?=\n [[:alpha:]_]\\w* \\s* (:|\\()\n )\n",
912 "end": "(:)",
913 "beginCaptures": {
914 "1": {
915 "name": "storage.type.class.python"
916 }
917 },
918 "endCaptures": {
919 "1": {
920 "name": "punctuation.section.class.begin.python"
921 }
922 },
923 "patterns": [
924 {
925 "include": "#class-name"
926 },
927 {
928 "include": "#class-inheritance"
929 }
930 ]
931 }
932 ]
933 },
934 "class-name": {
935 "patterns": [
936 {
937 "include": "#illegal-object-name"
938 },
939 {
940 "include": "#builtin-possible-callables"
941 },
942 {
943 "name": "entity.name.type.class.python",
944 "match": "(?x)\n \\b ([[:alpha:]_]\\w*) \\b\n"
945 }
946 ]
947 },
948 "class-inheritance": {
949 "name": "meta.class.inheritance.python",
950 "begin": "(\\()",
951 "end": "(\\))",
952 "beginCaptures": {
953 "1": {
954 "name": "punctuation.definition.inheritance.begin.python"
955 }
956 },
957 "endCaptures": {
958 "1": {
959 "name": "punctuation.definition.inheritance.end.python"
960 }
961 },
962 "patterns": [
963 {
964 "name": "keyword.operator.unpacking.arguments.python",
965 "match": "(\\*\\*|\\*)"
966 },
967 {
968 "name": "punctuation.separator.inheritance.python",
969 "match": ","
970 },
971 {
972 "name": "keyword.operator.assignment.python",
973 "match": "=(?!=)"
974 },
975 {
976 "include": "#expression-class"
977 },
978 {
979 "name": "support.type.metaclass.python",
980 "match": "\\bmetaclass\\b"
981 },
982 {
983 "include": "#inheritance-identifier"
984 }
985 ]
986 },
987 "inheritance-identifier": {
988 "match": "(?x)\n \\b ([[:alpha:]_]\\w*) \\b\n",
989 "captures": {
990 "1": {
991 "name": "entity.other.inherited-class.python"
992 }
993 }
994 },
995 "expression-class": {
996 "patterns": [
997 {
998 "include": "#call-wrapper-inheritance"
999 },
1000 {
1001 "include": "#expression-base"
1002 },
1003 {
1004 "include": "#member-access-class"
1005 }
1006 ]
1007 },
1008 "member-access-class": {
1009 "begin": "\\.\\s*(?!\\.)",
1010 "end": "(?<=\\S)(?=\\W)|$",
1011 "patterns": [
1012 {
1013 "include": "#call-wrapper-inheritance"
1014 },
1015 {
1016 "include": "#member-access-base"
1017 },
1018 {
1019 "include": "#inheritance-identifier"
1020 }
1021 ]
1022 },
1023 "lambda": {
1024 "patterns": [
1025 {
1026 "match": "((?<=\\.)lambda|lambda(?=\\s*[\\.=]))",
1027 "captures": {
1028 "1": {
1029 "name": "keyword.control.flow.python"
1030 }
1031 }
1032 },
1033 {
1034 "match": "\\b(lambda)\\s*?([,\\n]|$)",
1035 "captures": {
1036 "1": {
1037 "name": "storage.type.function.lambda.python"
1038 }
1039 }
1040 },
1041 {
1042 "name": "meta.lambda-function.python",
1043 "begin": "(?x)\n \\b (lambda) \\b\n",
1044 "end": "(:)|(\\n)",
1045 "beginCaptures": {
1046 "1": {
1047 "name": "storage.type.function.lambda.python"
1048 }
1049 },
1050 "endCaptures": {
1051 "1": {
1052 "name": "punctuation.section.function.lambda.begin.python"
1053 }
1054 },
1055 "contentName": "meta.function.lambda.parameters.python",
1056 "patterns": [
1057 {
1058 "name": "keyword.operator.unpacking.parameter.python",
1059 "match": "(\\*\\*|\\*)"
1060 },
1061 {
1062 "include": "#lambda-incomplete"
1063 },
1064 {
1065 "include": "#illegal-names"
1066 },
1067 {
1068 "match": "([[:alpha:]_]\\w*)\\s*(?:(,)|(?=:|$))",
1069 "captures": {
1070 "1": {
1071 "name": "variable.parameter.function.language.python"
1072 },
1073 "2": {
1074 "name": "punctuation.separator.parameters.python"
1075 }
1076 }
1077 },
1078 {
1079 "include": "#comments"
1080 },
1081 {
1082 "include": "#backticks"
1083 },
1084 {
1085 "include": "#illegal-anno"
1086 },
1087 {
1088 "include": "#lambda-parameter-with-default"
1089 },
1090 {
1091 "include": "#line-continuation"
1092 },
1093 {
1094 "include": "#illegal-operator"
1095 }
1096 ]
1097 }
1098 ]
1099 },
1100 "lambda-incomplete": {
1101 "name": "storage.type.function.lambda.python",
1102 "match": "\\blambda(?=\\s*[:,)])"
1103 },
1104 "lambda-parameter-with-default": {
1105 "begin": "(?x)\n \\b\n ([[:alpha:]_]\\w*) \\s* (=)\n",
1106 "end": "(,)|(?=:|$)",
1107 "beginCaptures": {
1108 "1": {
1109 "name": "variable.parameter.function.language.python"
1110 },
1111 "2": {
1112 "name": "keyword.operator.python"
1113 }
1114 },
1115 "endCaptures": {
1116 "1": {
1117 "name": "punctuation.separator.parameters.python"
1118 }
1119 },
1120 "patterns": [
1121 {
1122 "include": "#expression"
1123 }
1124 ]
1125 },
1126 "function-declaration": {
1127 "name": "meta.function.python",
1128 "begin": "(?x)\n \\s*\n (?:\\b(async) \\s+)? \\b(def)\\s+\n (?=\n [[:alpha:]_][[:word:]]* \\s* \\(\n )\n",
1129 "end": "(:|(?=[#'\"\\n]))",
1130 "beginCaptures": {
1131 "1": {
1132 "name": "storage.type.function.async.python"
1133 },
1134 "2": {
1135 "name": "storage.type.function.python"
1136 }
1137 },
1138 "endCaptures": {
1139 "1": {
1140 "name": "punctuation.section.function.begin.python"
1141 }
1142 },
1143 "patterns": [
1144 {
1145 "include": "#function-def-name"
1146 },
1147 {
1148 "include": "#parameters"
1149 },
1150 {
1151 "include": "#line-continuation"
1152 },
1153 {
1154 "include": "#return-annotation"
1155 }
1156 ]
1157 },
1158 "function-def-name": {
1159 "patterns": [
1160 {
1161 "include": "#illegal-object-name"
1162 },
1163 {
1164 "include": "#builtin-possible-callables"
1165 },
1166 {
1167 "name": "entity.name.function.python",
1168 "match": "(?x)\n \\b ([[:alpha:]_]\\w*) \\b\n"
1169 }
1170 ]
1171 },
1172 "parameters": {
1173 "name": "meta.function.parameters.python",
1174 "begin": "(\\()",
1175 "end": "(\\))",
1176 "beginCaptures": {
1177 "1": {
1178 "name": "punctuation.definition.parameters.begin.python"
1179 }
1180 },
1181 "endCaptures": {
1182 "1": {
1183 "name": "punctuation.definition.parameters.end.python"
1184 }
1185 },
1186 "patterns": [
1187 {
1188 "name": "keyword.operator.unpacking.parameter.python",
1189 "match": "(\\*\\*|\\*)"
1190 },
1191 {
1192 "include": "#lambda-incomplete"
1193 },
1194 {
1195 "include": "#illegal-names"
1196 },
1197 {
1198 "include": "#illegal-object-name"
1199 },
1200 {
1201 "include": "#parameter-special"
1202 },
1203 {
1204 "match": "(?x)\n ([[:alpha:]_]\\w*)\n \\s* (?: (,) | (?=[)#\\n=]))\n",
1205 "captures": {
1206 "1": {
1207 "name": "variable.parameter.function.language.python"
1208 },
1209 "2": {
1210 "name": "punctuation.separator.parameters.python"
1211 }
1212 }
1213 },
1214 {
1215 "include": "#comments"
1216 },
1217 {
1218 "include": "#loose-default"
1219 },
1220 {
1221 "include": "#annotated-parameter"
1222 }
1223 ]
1224 },
1225 "parameter-special": {
1226 "match": "(?x)\n \\b ((self)|(cls)) \\b \\s*(?:(,)|(?=\\)))\n",
1227 "captures": {
1228 "1": {
1229 "name": "variable.parameter.function.language.python"
1230 },
1231 "2": {
1232 "name": "variable.parameter.function.language.special.self.python"
1233 },
1234 "3": {
1235 "name": "variable.parameter.function.language.special.cls.python"
1236 },
1237 "4": {
1238 "name": "punctuation.separator.parameters.python"
1239 }
1240 }
1241 },
1242 "loose-default": {
1243 "begin": "(=)",
1244 "end": "(,)|(?=\\))",
1245 "beginCaptures": {
1246 "1": {
1247 "name": "keyword.operator.python"
1248 }
1249 },
1250 "endCaptures": {
1251 "1": {
1252 "name": "punctuation.separator.parameters.python"
1253 }
1254 },
1255 "patterns": [
1256 {
1257 "include": "#expression"
1258 }
1259 ]
1260 },
1261 "annotated-parameter": {
1262 "begin": "(?x)\n \\b\n ([[:alpha:]_]\\w*) \\s* (:)\n",
1263 "end": "(,)|(?=\\))",
1264 "beginCaptures": {
1265 "1": {
1266 "name": "variable.parameter.function.language.python"
1267 },
1268 "2": {
1269 "name": "punctuation.separator.annotation.python"
1270 }
1271 },
1272 "endCaptures": {
1273 "1": {
1274 "name": "punctuation.separator.parameters.python"
1275 }
1276 },
1277 "patterns": [
1278 {
1279 "include": "#expression"
1280 },
1281 {
1282 "name": "keyword.operator.assignment.python",
1283 "match": "=(?!=)"
1284 }
1285 ]
1286 },
1287 "return-annotation": {
1288 "begin": "(->)",
1289 "end": "(?=:)",
1290 "beginCaptures": {
1291 "1": {
1292 "name": "punctuation.separator.annotation.result.python"
1293 }
1294 },
1295 "patterns": [
1296 {
1297 "include": "#expression"
1298 }
1299 ]
1300 },
1301 "item-access": {
1302 "patterns": [
1303 {
1304 "name": "meta.item-access.python",
1305 "begin": "(?x)\n \\b(?=\n [[:alpha:]_]\\w* \\s* \\[\n )\n",
1306 "end": "(\\])",
1307 "endCaptures": {
1308 "1": {
1309 "name": "punctuation.definition.arguments.end.python"
1310 }
1311 },
1312 "patterns": [
1313 {
1314 "include": "#item-name"
1315 },
1316 {
1317 "include": "#item-index"
1318 },
1319 {
1320 "include": "#expression"
1321 }
1322 ]
1323 }
1324 ]
1325 },
1326 "item-name": {
1327 "patterns": [
1328 {
1329 "include": "#special-variables"
1330 },
1331 {
1332 "include": "#builtin-functions"
1333 },
1334 {
1335 "include": "#special-names"
1336 },
1337 {
1338 "match": "(?x)\n \\b ([[:alpha:]_]\\w*) \\b\n"
1339 }
1340 ]
1341 },
1342 "item-index": {
1343 "begin": "(\\[)",
1344 "end": "(?=\\])",
1345 "beginCaptures": {
1346 "1": {
1347 "name": "punctuation.definition.arguments.begin.python"
1348 }
1349 },
1350 "contentName": "meta.item-access.arguments.python",
1351 "patterns": [
1352 {
1353 "include": "#expression"
1354 }
1355 ]
1356 },
1357 "decorator": {
1358 "name": "meta.function.decorator.python",
1359 "begin": "(?x)\n ^\\s*\n (@) \\s* (?=[[:alpha:]_]\\w*)\n",
1360 "end": "(?x)\n ( \\) ) (?: (?=\\s*\\#|$) | (.*$) )\n | (?=\\n|\\#)\n",
1361 "beginCaptures": {
1362 "1": {
1363 "name": "entity.name.function.decorator.python"
1364 }
1365 },
1366 "endCaptures": {
1367 "1": {
1368 "name": "punctuation.definition.arguments.end.python"
1369 },
1370 "2": {
1371 "name": "invalid.illegal.decorator.python"
1372 }
1373 },
1374 "patterns": [
1375 {
1376 "include": "#decorator-name"
1377 },
1378 {
1379 "include": "#function-arguments"
1380 }
1381 ]
1382 },
1383 "decorator-name": {
1384 "patterns": [
1385 {
1386 "include": "#builtin-callables"
1387 },
1388 {
1389 "include": "#illegal-object-name"
1390 },
1391 {
1392 "name": "entity.name.function.decorator.python",
1393 "match": "(?x)\n ([[:alpha:]_]\\w*) | \\.\n"
1394 },
1395 {
1396 "include": "#line-continuation"
1397 },
1398 {
1399 "name": "invalid.illegal.decorator.python",
1400 "match": "(?x)\n \\s* ([^([:alpha:]\\s_\\.#\\\\] .*?) (?=\\#|$)\n",
1401 "captures": {
1402 "1": {
1403 "name": "invalid.illegal.decorator.python"
1404 }
1405 }
1406 }
1407 ]
1408 },
1409 "call-wrapper-inheritance": {
1410 "comment": "same as a funciton call, but in inheritance context",
1411 "name": "meta.function-call.python",
1412 "begin": "(?x)\n \\b(?=\n ([[:alpha:]_]\\w*) \\s* (\\()\n )\n",
1413 "end": "(\\))",
1414 "endCaptures": {
1415 "1": {
1416 "name": "punctuation.definition.arguments.end.python"
1417 }
1418 },
1419 "patterns": [
1420 {
1421 "include": "#inheritance-name"
1422 },
1423 {
1424 "include": "#function-arguments"
1425 }
1426 ]
1427 },
1428 "inheritance-name": {
1429 "patterns": [
1430 {
1431 "include": "#lambda-incomplete"
1432 },
1433 {
1434 "include": "#builtin-possible-callables"
1435 },
1436 {
1437 "include": "#inheritance-identifier"
1438 }
1439 ]
1440 },
1441 "function-call": {
1442 "name": "meta.function-call.python",
1443 "begin": "(?x)\n \\b(?=\n ([[:alpha:]_]\\w*) \\s* (\\()\n )\n",
1444 "end": "(\\))",
1445 "endCaptures": {
1446 "1": {
1447 "name": "punctuation.definition.arguments.end.python"
1448 }
1449 },
1450 "patterns": [
1451 {
1452 "include": "#special-variables"
1453 },
1454 {
1455 "include": "#function-name"
1456 },
1457 {
1458 "include": "#function-arguments"
1459 }
1460 ]
1461 },
1462 "function-name": {
1463 "patterns": [
1464 {
1465 "include": "#builtin-possible-callables"
1466 },
1467 {
1468 "comment": "Some color schemas support meta.function-call.generic scope",
1469 "name": "meta.function-call.generic.python",
1470 "match": "(?x)\n \\b ([[:alpha:]_]\\w*) \\b\n"
1471 }
1472 ]
1473 },
1474 "function-arguments": {
1475 "begin": "(?x)\n (?:\n (\\()\n (?:\\s*(\\*\\*|\\*))?\n )\n",
1476 "end": "(?=\\))(?!\\)\\s*\\()",
1477 "beginCaptures": {
1478 "1": {
1479 "name": "punctuation.definition.arguments.begin.python"
1480 },
1481 "2": {
1482 "name": "keyword.operator.unpacking.arguments.python"
1483 }
1484 },
1485 "contentName": "meta.function-call.arguments.python",
1486 "patterns": [
1487 {
1488 "match": "(?x)\n (?:\n (,)\n (?:\\s*(\\*\\*|\\*))?\n )\n",
1489 "captures": {
1490 "1": {
1491 "name": "punctuation.separator.arguments.python"
1492 },
1493 "2": {
1494 "name": "keyword.operator.unpacking.arguments.python"
1495 }
1496 }
1497 },
1498 {
1499 "include": "#lambda-incomplete"
1500 },
1501 {
1502 "include": "#illegal-names"
1503 },
1504 {
1505 "match": "\\b([[:alpha:]_]\\w*)\\s*(=)(?!=)",
1506 "captures": {
1507 "1": {
1508 "name": "variable.parameter.function-call.python"
1509 },
1510 "2": {
1511 "name": "keyword.operator.assignment.python"
1512 }
1513 }
1514 },
1515 {
1516 "name": "keyword.operator.assignment.python",
1517 "match": "=(?!=)"
1518 },
1519 {
1520 "include": "#expression"
1521 },
1522 {
1523 "match": "\\s*(\\))\\s*(\\()",
1524 "captures": {
1525 "1": {
1526 "name": "punctuation.definition.arguments.end.python"
1527 },
1528 "2": {
1529 "name": "punctuation.definition.arguments.begin.python"
1530 }
1531 }
1532 }
1533 ]
1534 },
1535 "builtin-callables": {
1536 "patterns": [
1537 {
1538 "include": "#illegal-names"
1539 },
1540 {
1541 "include": "#illegal-object-name"
1542 },
1543 {
1544 "include": "#builtin-exceptions"
1545 },
1546 {
1547 "include": "#builtin-functions"
1548 },
1549 {
1550 "include": "#builtin-types"
1551 }
1552 ]
1553 },
1554 "builtin-possible-callables": {
1555 "patterns": [
1556 {
1557 "include": "#builtin-callables"
1558 },
1559 {
1560 "include": "#magic-names"
1561 }
1562 ]
1563 },
1564 "builtin-exceptions": {
1565 "name": "support.type.exception.python",
1566 "match": "(?x) (?<!\\.) \\b(\n (\n Arithmetic | Assertion | Attribute | Buffer | BlockingIO\n | BrokenPipe | ChildProcess\n | (Connection (Aborted | Refused | Reset)?)\n | EOF | Environment | FileExists | FileNotFound\n | FloatingPoint | IO | Import | Indentation | Index | Interrupted\n | IsADirectory | NotADirectory | Permission | ProcessLookup\n | Timeout\n | Key | Lookup | Memory | Name | NotImplemented | OS | Overflow\n | Reference | Runtime | Recursion | Syntax | System\n | Tab | Type | UnboundLocal | Unicode(Encode|Decode|Translate)?\n | Value | Windows | ZeroDivision\n ) Error\n|\n ((Pending)?Deprecation | Runtime | Syntax | User | Future | Import\n | Unicode | Bytes | Resource\n )? Warning\n|\n SystemExit | Stop(Async)?Iteration\n | KeyboardInterrupt\n | GeneratorExit | (Base)?Exception\n)\\b\n"
1567 },
1568 "builtin-functions": {
1569 "patterns": [
1570 {
1571 "name": "support.function.builtin.python",
1572 "match": "(?x)\n (?<!\\.) \\b(\n __import__ | abs | all | any | ascii | bin | callable\n | chr | compile | copyright | credits | delattr | dir | divmod\n | enumerate | eval | exec | exit | filter | format | getattr\n | globals | hasattr | hash | help | hex | id | input\n | isinstance | issubclass | iter | len | license | locals | map\n | max | memoryview | min | next | oct | open | ord | pow | print\n | quit | range | reload | repr | reversed | round\n | setattr | sorted | sum | vars | zip\n )\\b\n"
1573 },
1574 {
1575 "name": "variable.legacy.builtin.python",
1576 "match": "(?x)\n (?<!\\.) \\b(\n file | reduce | intern | raw_input | unicode | cmp | basestring\n | execfile | long | xrange\n )\\b\n"
1577 }
1578 ]
1579 },
1580 "builtin-types": {
1581 "name": "support.type.python",
1582 "match": "(?x)\n (?<!\\.) \\b(\n bool | bytearray | bytes | classmethod | complex | dict\n | float | frozenset | int | list | object | property\n | set | slice | staticmethod | str | tuple | type\n\n (?# Although 'super' is not a type, it's related to types,\n and is special enough to be highlighted differently from\n other built-ins)\n | super\n )\\b\n"
1583 },
1584 "magic-function-names": {
1585 "comment": "these methods have magic interpretation by python and are generally called\nindirectly through syntactic constructs\n",
1586 "match": "(?x)\n \\b(\n __(?:\n abs | add | aenter | aexit | aiter | and | anext | await\n | bool | call | ceil | cmp | coerce | complex | contains\n | copy | deepcopy | del | delattr | delete | delitem\n | delslice | dir | div | divmod | enter | eq | exit | float\n | floor | floordiv | format | ge | get | getattr\n | getattribute | getinitargs | getitem | getnewargs\n | getslice | getstate | gt | hash | hex | iadd | iand | idiv\n | ifloordiv | ilshift | imod | imul | index | init\n | instancecheck | int | invert | ior | ipow | irshift | isub\n | iter | itruediv | ixor | le | len | long | lshift | lt\n | missing | mod | mul | ne | neg | new | next | nonzero | oct | or\n | pos | pow | radd | rand | rdiv | rdivmod | reduce\n | reduce_ex | repr | reversed | rfloordiv | rlshift | rmod\n | rmul | ror | round | rpow | rrshift | rshift | rsub\n | rtruediv | rxor | set | setattr | setitem | setslice\n | setstate | sizeof | str | sub | subclasscheck | truediv\n | trunc | unicode | xor\n )__\n )\\b\n",
1587 "captures": {
1588 "1": {
1589 "name": "support.function.magic.python"
1590 }
1591 }
1592 },
1593 "magic-variable-names": {
1594 "comment": "magic variables which a class/module may have.",
1595 "match": "(?x)\n \\b(\n __(?:\n all | bases | builtins | class | code | debug | defaults | dict\n | doc | file | func | kwdefaults | members\n | metaclass | methods | module | mro | name\n | qualname | self | signature | slots | subclasses\n | version | weakref | wrapped\n )__\n )\\b\n",
1596 "captures": {
1597 "1": {
1598 "name": "support.variable.magic.python"
1599 }
1600 }
1601 },
1602 "magic-names": {
1603 "patterns": [
1604 {
1605 "include": "#magic-function-names"
1606 },
1607 {
1608 "include": "#magic-variable-names"
1609 }
1610 ]
1611 },
1612 "illegal-names": {
1613 "name": "keyword.control.flow.python",
1614 "match": "(?x)\n \\b(\n and | as | assert | async | await | break | class | continue | def\n | del | elif | else | except | exec | finally | for | from | global\n | if | import | in | is | (?<=\\.)lambda | lambda(?=\\s*[\\.=])\n | nonlocal | not | or | pass | raise | return | try | while | with\n | yield\n )\\b\n"
1615 },
1616 "special-variables": {
1617 "match": "(?x)\n \\b (?<!\\.) (?:\n (self) | (cls)\n )\\b\n",
1618 "captures": {
1619 "1": {
1620 "name": "variable.language.special.self.python"
1621 },
1622 "2": {
1623 "name": "variable.language.special.cls.python"
1624 }
1625 }
1626 },
1627 "ellipsis": {
1628 "name": "constant.other.ellipsis.python",
1629 "match": "\\.\\.\\."
1630 },
1631 "backticks": {
1632 "name": "invalid.deprecated.backtick.python",
1633 "begin": "\\`",
1634 "end": "(?:\\`|(?<!\\\\)(\\n))",
1635 "patterns": [
1636 {
1637 "include": "#expression"
1638 }
1639 ]
1640 },
1641 "illegal-operator": {
1642 "patterns": [
1643 {
1644 "name": "invalid.illegal.operator.python",
1645 "match": "&&|\\|\\||--|\\+\\+"
1646 },
1647 {
1648 "name": "invalid.illegal.operator.python",
1649 "match": "[?$]"
1650 },
1651 {
1652 "name": "invalid.illegal.operator.python",
1653 "comment": "We don't want `!` to flash when we're typing `!=`",
1654 "match": "!\\b"
1655 }
1656 ]
1657 },
1658 "illegal-object-name": {
1659 "comment": "It's illegal to name class or function \"True\"",
1660 "name": "keyword.illegal.name.python",
1661 "match": "\\b(True|False|None)\\b"
1662 },
1663 "illegal-anno": {
1664 "name": "invalid.illegal.annotation.python",
1665 "match": "->"
1666 },
1667 "regexp-base-expression": {
1668 "patterns": [
1669 {
1670 "name": "support.other.match.any.regexp",
1671 "match": "\\."
1672 },
1673 {
1674 "name": "support.other.match.begin.regexp",
1675 "match": "\\^"
1676 },
1677 {
1678 "name": "support.other.match.end.regexp",
1679 "match": "\\$"
1680 },
1681 {
1682 "name": "keyword.operator.quantifier.regexp",
1683 "match": "[+*?]\\??"
1684 },
1685 {
1686 "name": "keyword.operator.disjunction.regexp",
1687 "match": "\\|"
1688 },
1689 {
1690 "name": "keyword.operator.quantifier.regexp",
1691 "match": "(?x)\n \\{(\n \\d+ | \\d+,(\\d+)? | ,\\d+\n )\\}\n"
1692 },
1693 {
1694 "include": "#regexp-escape-sequence"
1695 }
1696 ]
1697 },
1698 "regexp-backreference-number": {
1699 "name": "meta.backreference.regexp",
1700 "match": "(\\\\[1-9]\\d?)",
1701 "captures": {
1702 "1": {
1703 "name": "entity.name.tag.backreference.regexp"
1704 }
1705 }
1706 },
1707 "regexp-backreference": {
1708 "name": "meta.backreference.named.regexp",
1709 "match": "(?x)\n (\\() (\\?P= \\w+(?:\\s+[[:alnum:]]+)?) (\\))\n",
1710 "captures": {
1711 "1": {
1712 "name": "punctuation.parenthesis.backreference.named.begin.regexp support.other.parenthesis.regexp"
1713 },
1714 "2": {
1715 "name": "entity.name.tag.named.backreference.regexp"
1716 },
1717 "3": {
1718 "name": "punctuation.parenthesis.backreference.named.end.regexp support.other.parenthesis.regexp"
1719 }
1720 }
1721 },
1722 "regexp-flags": {
1723 "name": "storage.modifier.flag.regexp",
1724 "match": "\\(\\?[aiLmsux]+\\)"
1725 },
1726 "regexp-escape-special": {
1727 "name": "support.other.escape.special.regexp",
1728 "match": "\\\\([AbBdDsSwWZ])"
1729 },
1730 "regexp-escape-character": {
1731 "name": "constant.character.escape.regexp",
1732 "match": "(?x)\n \\\\ (\n x[0-9A-Fa-f]{2}\n | 0[0-7]{1,2}\n | [0-7]{3}\n )\n"
1733 },
1734 "regexp-escape-unicode": {
1735 "name": "constant.character.unicode.regexp",
1736 "match": "(?x)\n \\\\ (\n u[0-9A-Fa-f]{4}\n | U[0-9A-Fa-f]{8}\n )\n"
1737 },
1738 "regexp-escape-catchall": {
1739 "name": "constant.character.escape.regexp",
1740 "match": "\\\\(.|\\n)"
1741 },
1742 "regexp-escape-sequence": {
1743 "patterns": [
1744 {
1745 "include": "#regexp-escape-special"
1746 },
1747 {
1748 "include": "#regexp-escape-character"
1749 },
1750 {
1751 "include": "#regexp-escape-unicode"
1752 },
1753 {
1754 "include": "#regexp-backreference-number"
1755 },
1756 {
1757 "include": "#regexp-escape-catchall"
1758 }
1759 ]
1760 },
1761 "regexp-charecter-set-escapes": {
1762 "patterns": [
1763 {
1764 "name": "constant.character.escape.regexp",
1765 "match": "\\\\[abfnrtv\\\\]"
1766 },
1767 {
1768 "include": "#regexp-escape-special"
1769 },
1770 {
1771 "name": "constant.character.escape.regexp",
1772 "match": "\\\\([0-7]{1,3})"
1773 },
1774 {
1775 "include": "#regexp-escape-character"
1776 },
1777 {
1778 "include": "#regexp-escape-unicode"
1779 },
1780 {
1781 "include": "#regexp-escape-catchall"
1782 }
1783 ]
1784 },
1785 "comments-base": {
1786 "name": "comment.line.number-sign.python",
1787 "begin": "(\\#)",
1788 "beginCaptures": {
1789 "1": {
1790 "name": "punctuation.definition.comment.python"
1791 }
1792 },
1793 "end": "($)",
1794 "patterns": [
1795 {
1796 "include": "#codetags"
1797 }
1798 ]
1799 },
1800 "comments-string-single-three": {
1801 "name": "comment.line.number-sign.python",
1802 "begin": "(\\#)",
1803 "beginCaptures": {
1804 "1": {
1805 "name": "punctuation.definition.comment.python"
1806 }
1807 },
1808 "end": "($|(?='''))",
1809 "patterns": [
1810 {
1811 "include": "#codetags"
1812 }
1813 ]
1814 },
1815 "comments-string-double-three": {
1816 "name": "comment.line.number-sign.python",
1817 "begin": "(\\#)",
1818 "beginCaptures": {
1819 "1": {
1820 "name": "punctuation.definition.comment.python"
1821 }
1822 },
1823 "end": "($|(?=\"\"\"))",
1824 "patterns": [
1825 {
1826 "include": "#codetags"
1827 }
1828 ]
1829 },
1830 "single-one-regexp-expression": {
1831 "patterns": [
1832 {
1833 "include": "#regexp-base-expression"
1834 },
1835 {
1836 "include": "#single-one-regexp-character-set"
1837 },
1838 {
1839 "include": "#single-one-regexp-comments"
1840 },
1841 {
1842 "include": "#regexp-flags"
1843 },
1844 {
1845 "include": "#single-one-regexp-named-group"
1846 },
1847 {
1848 "include": "#regexp-backreference"
1849 },
1850 {
1851 "include": "#single-one-regexp-lookahead"
1852 },
1853 {
1854 "include": "#single-one-regexp-lookahead-negative"
1855 },
1856 {
1857 "include": "#single-one-regexp-lookbehind"
1858 },
1859 {
1860 "include": "#single-one-regexp-lookbehind-negative"
1861 },
1862 {
1863 "include": "#single-one-regexp-conditional"
1864 },
1865 {
1866 "include": "#single-one-regexp-parentheses-non-capturing"
1867 },
1868 {
1869 "include": "#single-one-regexp-parentheses"
1870 }
1871 ]
1872 },
1873 "single-one-regexp-character-set": {
1874 "patterns": [
1875 {
1876 "match": "(?x)\n \\[ \\^? \\] (?! .*?\\])\n"
1877 },
1878 {
1879 "name": "meta.character.set.regexp",
1880 "begin": "(\\[)(\\^)?(\\])?",
1881 "end": "(\\]|(?=\\'))|((?=(?<!\\\\)\\n))",
1882 "beginCaptures": {
1883 "1": {
1884 "name": "constant.other.set.regexp punctuation.character.set.begin.regexp"
1885 },
1886 "2": {
1887 "name": "keyword.operator.negation.regexp"
1888 },
1889 "3": {
1890 "name": "constant.character.set.regexp"
1891 }
1892 },
1893 "endCaptures": {
1894 "1": {
1895 "name": "constant.other.set.regexp punctuation.character.set.end.regexp"
1896 },
1897 "2": {
1898 "name": "invalid.illegal.newline.python"
1899 }
1900 },
1901 "patterns": [
1902 {
1903 "include": "#regexp-charecter-set-escapes"
1904 },
1905 {
1906 "name": "constant.character.set.regexp",
1907 "match": "[^\\n]"
1908 }
1909 ]
1910 }
1911 ]
1912 },
1913 "single-one-regexp-named-group": {
1914 "name": "meta.named.regexp",
1915 "begin": "(?x)\n (\\() (\\?P <\\w+(?:\\s+[[:alnum:]]+)?>)\n",
1916 "end": "(\\)|(?=\\'))|((?=(?<!\\\\)\\n))",
1917 "beginCaptures": {
1918 "1": {
1919 "name": "punctuation.parenthesis.named.begin.regexp support.other.parenthesis.regexp"
1920 },
1921 "2": {
1922 "name": "entity.name.tag.named.group.regexp"
1923 }
1924 },
1925 "endCaptures": {
1926 "1": {
1927 "name": "punctuation.parenthesis.named.end.regexp support.other.parenthesis.regexp"
1928 },
1929 "2": {
1930 "name": "invalid.illegal.newline.python"
1931 }
1932 },
1933 "patterns": [
1934 {
1935 "include": "#single-one-regexp-expression"
1936 }
1937 ]
1938 },
1939 "single-one-regexp-comments": {
1940 "name": "comment.regexp",
1941 "begin": "\\(\\?#",
1942 "end": "(\\)|(?=\\'))|((?=(?<!\\\\)\\n))",
1943 "beginCaptures": {
1944 "0": {
1945 "name": "punctuation.comment.begin.regexp"
1946 }
1947 },
1948 "endCaptures": {
1949 "1": {
1950 "name": "punctuation.comment.end.regexp"
1951 },
1952 "2": {
1953 "name": "invalid.illegal.newline.python"
1954 }
1955 },
1956 "patterns": [
1957 {
1958 "include": "#codetags"
1959 }
1960 ]
1961 },
1962 "single-one-regexp-lookahead": {
1963 "begin": "(\\()\\?=",
1964 "end": "(\\)|(?=\\'))|((?=(?<!\\\\)\\n))",
1965 "beginCaptures": {
1966 "0": {
1967 "name": "keyword.operator.lookahead.regexp"
1968 },
1969 "1": {
1970 "name": "punctuation.parenthesis.lookahead.begin.regexp"
1971 }
1972 },
1973 "endCaptures": {
1974 "1": {
1975 "name": "punctuation.parenthesis.lookahead.end.regexp keyword.operator.lookahead.regexp"
1976 },
1977 "2": {
1978 "name": "invalid.illegal.newline.python"
1979 }
1980 },
1981 "patterns": [
1982 {
1983 "include": "#single-one-regexp-expression"
1984 }
1985 ]
1986 },
1987 "single-one-regexp-lookahead-negative": {
1988 "begin": "(\\()\\?!",
1989 "end": "(\\)|(?=\\'))|((?=(?<!\\\\)\\n))",
1990 "beginCaptures": {
1991 "0": {
1992 "name": "keyword.operator.lookahead.negative.regexp"
1993 },
1994 "1": {
1995 "name": "punctuation.parenthesis.lookahead.begin.regexp"
1996 }
1997 },
1998 "endCaptures": {
1999 "1": {
2000 "name": "punctuation.parenthesis.lookahead.end.regexp keyword.operator.lookahead.negative.regexp"
2001 },
2002 "2": {
2003 "name": "invalid.illegal.newline.python"
2004 }
2005 },
2006 "patterns": [
2007 {
2008 "include": "#single-one-regexp-expression"
2009 }
2010 ]
2011 },
2012 "single-one-regexp-lookbehind": {
2013 "begin": "(\\()\\?<=",
2014 "end": "(\\)|(?=\\'))|((?=(?<!\\\\)\\n))",
2015 "beginCaptures": {
2016 "0": {
2017 "name": "keyword.operator.lookbehind.regexp"
2018 },
2019 "1": {
2020 "name": "punctuation.parenthesis.lookbehind.begin.regexp"
2021 }
2022 },
2023 "endCaptures": {
2024 "1": {
2025 "name": "punctuation.parenthesis.lookbehind.end.regexp keyword.operator.lookbehind.regexp"
2026 },
2027 "2": {
2028 "name": "invalid.illegal.newline.python"
2029 }
2030 },
2031 "patterns": [
2032 {
2033 "include": "#single-one-regexp-expression"
2034 }
2035 ]
2036 },
2037 "single-one-regexp-lookbehind-negative": {
2038 "begin": "(\\()\\?<!",
2039 "end": "(\\)|(?=\\'))|((?=(?<!\\\\)\\n))",
2040 "beginCaptures": {
2041 "0": {
2042 "name": "keyword.operator.lookbehind.negative.regexp"
2043 },
2044 "1": {
2045 "name": "punctuation.parenthesis.lookbehind.begin.regexp"
2046 }
2047 },
2048 "endCaptures": {
2049 "1": {
2050 "name": "punctuation.parenthesis.lookbehind.end.regexp keyword.operator.lookbehind.negative.regexp"
2051 },
2052 "2": {
2053 "name": "invalid.illegal.newline.python"
2054 }
2055 },
2056 "patterns": [
2057 {
2058 "include": "#single-one-regexp-expression"
2059 }
2060 ]
2061 },
2062 "single-one-regexp-conditional": {
2063 "begin": "(\\()\\?\\((\\w+(?:\\s+[[:alnum:]]+)?|\\d+)\\)",
2064 "end": "(\\)|(?=\\'))|((?=(?<!\\\\)\\n))",
2065 "beginCaptures": {
2066 "0": {
2067 "name": "keyword.operator.conditional.regexp"
2068 },
2069 "1": {
2070 "name": "punctuation.parenthesis.conditional.begin.regexp"
2071 }
2072 },
2073 "endCaptures": {
2074 "1": {
2075 "name": "punctuation.parenthesis.conditional.end.regexp keyword.operator.conditional.negative.regexp"
2076 },
2077 "2": {
2078 "name": "invalid.illegal.newline.python"
2079 }
2080 },
2081 "patterns": [
2082 {
2083 "include": "#single-one-regexp-expression"
2084 }
2085 ]
2086 },
2087 "single-one-regexp-parentheses-non-capturing": {
2088 "begin": "\\(\\?:",
2089 "end": "(\\)|(?=\\'))|((?=(?<!\\\\)\\n))",
2090 "beginCaptures": {
2091 "0": {
2092 "name": "punctuation.parenthesis.non-capturing.begin.regexp support.other.parenthesis.regexp"
2093 }
2094 },
2095 "endCaptures": {
2096 "1": {
2097 "name": "punctuation.parenthesis.non-capturing.end.regexp support.other.parenthesis.regexp"
2098 },
2099 "2": {
2100 "name": "invalid.illegal.newline.python"
2101 }
2102 },
2103 "patterns": [
2104 {
2105 "include": "#single-one-regexp-expression"
2106 }
2107 ]
2108 },
2109 "single-one-regexp-parentheses": {
2110 "begin": "\\(",
2111 "end": "(\\)|(?=\\'))|((?=(?<!\\\\)\\n))",
2112 "beginCaptures": {
2113 "0": {
2114 "name": "punctuation.parenthesis.begin.regexp support.other.parenthesis.regexp"
2115 }
2116 },
2117 "endCaptures": {
2118 "1": {
2119 "name": "punctuation.parenthesis.end.regexp support.other.parenthesis.regexp"
2120 },
2121 "2": {
2122 "name": "invalid.illegal.newline.python"
2123 }
2124 },
2125 "patterns": [
2126 {
2127 "include": "#single-one-regexp-expression"
2128 }
2129 ]
2130 },
2131 "single-three-regexp-expression": {
2132 "patterns": [
2133 {
2134 "include": "#regexp-base-expression"
2135 },
2136 {
2137 "include": "#single-three-regexp-character-set"
2138 },
2139 {
2140 "include": "#single-three-regexp-comments"
2141 },
2142 {
2143 "include": "#regexp-flags"
2144 },
2145 {
2146 "include": "#single-three-regexp-named-group"
2147 },
2148 {
2149 "include": "#regexp-backreference"
2150 },
2151 {
2152 "include": "#single-three-regexp-lookahead"
2153 },
2154 {
2155 "include": "#single-three-regexp-lookahead-negative"
2156 },
2157 {
2158 "include": "#single-three-regexp-lookbehind"
2159 },
2160 {
2161 "include": "#single-three-regexp-lookbehind-negative"
2162 },
2163 {
2164 "include": "#single-three-regexp-conditional"
2165 },
2166 {
2167 "include": "#single-three-regexp-parentheses-non-capturing"
2168 },
2169 {
2170 "include": "#single-three-regexp-parentheses"
2171 },
2172 {
2173 "include": "#comments-string-single-three"
2174 }
2175 ]
2176 },
2177 "single-three-regexp-character-set": {
2178 "patterns": [
2179 {
2180 "match": "(?x)\n \\[ \\^? \\] (?! .*?\\])\n"
2181 },
2182 {
2183 "name": "meta.character.set.regexp",
2184 "begin": "(\\[)(\\^)?(\\])?",
2185 "end": "(\\]|(?=\\'\\'\\'))",
2186 "beginCaptures": {
2187 "1": {
2188 "name": "constant.other.set.regexp punctuation.character.set.begin.regexp"
2189 },
2190 "2": {
2191 "name": "keyword.operator.negation.regexp"
2192 },
2193 "3": {
2194 "name": "constant.character.set.regexp"
2195 }
2196 },
2197 "endCaptures": {
2198 "1": {
2199 "name": "constant.other.set.regexp punctuation.character.set.end.regexp"
2200 },
2201 "2": {
2202 "name": "invalid.illegal.newline.python"
2203 }
2204 },
2205 "patterns": [
2206 {
2207 "include": "#regexp-charecter-set-escapes"
2208 },
2209 {
2210 "name": "constant.character.set.regexp",
2211 "match": "[^\\n]"
2212 }
2213 ]
2214 }
2215 ]
2216 },
2217 "single-three-regexp-named-group": {
2218 "name": "meta.named.regexp",
2219 "begin": "(?x)\n (\\() (\\?P <\\w+(?:\\s+[[:alnum:]]+)?>)\n",
2220 "end": "(\\)|(?=\\'\\'\\'))",
2221 "beginCaptures": {
2222 "1": {
2223 "name": "punctuation.parenthesis.named.begin.regexp support.other.parenthesis.regexp"
2224 },
2225 "2": {
2226 "name": "entity.name.tag.named.group.regexp"
2227 }
2228 },
2229 "endCaptures": {
2230 "1": {
2231 "name": "punctuation.parenthesis.named.end.regexp support.other.parenthesis.regexp"
2232 },
2233 "2": {
2234 "name": "invalid.illegal.newline.python"
2235 }
2236 },
2237 "patterns": [
2238 {
2239 "include": "#single-three-regexp-expression"
2240 },
2241 {
2242 "include": "#comments-string-single-three"
2243 }
2244 ]
2245 },
2246 "single-three-regexp-comments": {
2247 "name": "comment.regexp",
2248 "begin": "\\(\\?#",
2249 "end": "(\\)|(?=\\'\\'\\'))",
2250 "beginCaptures": {
2251 "0": {
2252 "name": "punctuation.comment.begin.regexp"
2253 }
2254 },
2255 "endCaptures": {
2256 "1": {
2257 "name": "punctuation.comment.end.regexp"
2258 },
2259 "2": {
2260 "name": "invalid.illegal.newline.python"
2261 }
2262 },
2263 "patterns": [
2264 {
2265 "include": "#codetags"
2266 }
2267 ]
2268 },
2269 "single-three-regexp-lookahead": {
2270 "begin": "(\\()\\?=",
2271 "end": "(\\)|(?=\\'\\'\\'))",
2272 "beginCaptures": {
2273 "0": {
2274 "name": "keyword.operator.lookahead.regexp"
2275 },
2276 "1": {
2277 "name": "punctuation.parenthesis.lookahead.begin.regexp"
2278 }
2279 },
2280 "endCaptures": {
2281 "1": {
2282 "name": "punctuation.parenthesis.lookahead.end.regexp keyword.operator.lookahead.regexp"
2283 },
2284 "2": {
2285 "name": "invalid.illegal.newline.python"
2286 }
2287 },
2288 "patterns": [
2289 {
2290 "include": "#single-three-regexp-expression"
2291 },
2292 {
2293 "include": "#comments-string-single-three"
2294 }
2295 ]
2296 },
2297 "single-three-regexp-lookahead-negative": {
2298 "begin": "(\\()\\?!",
2299 "end": "(\\)|(?=\\'\\'\\'))",
2300 "beginCaptures": {
2301 "0": {
2302 "name": "keyword.operator.lookahead.negative.regexp"
2303 },
2304 "1": {
2305 "name": "punctuation.parenthesis.lookahead.begin.regexp"
2306 }
2307 },
2308 "endCaptures": {
2309 "1": {
2310 "name": "punctuation.parenthesis.lookahead.end.regexp keyword.operator.lookahead.negative.regexp"
2311 },
2312 "2": {
2313 "name": "invalid.illegal.newline.python"
2314 }
2315 },
2316 "patterns": [
2317 {
2318 "include": "#single-three-regexp-expression"
2319 },
2320 {
2321 "include": "#comments-string-single-three"
2322 }
2323 ]
2324 },
2325 "single-three-regexp-lookbehind": {
2326 "begin": "(\\()\\?<=",
2327 "end": "(\\)|(?=\\'\\'\\'))",
2328 "beginCaptures": {
2329 "0": {
2330 "name": "keyword.operator.lookbehind.regexp"
2331 },
2332 "1": {
2333 "name": "punctuation.parenthesis.lookbehind.begin.regexp"
2334 }
2335 },
2336 "endCaptures": {
2337 "1": {
2338 "name": "punctuation.parenthesis.lookbehind.end.regexp keyword.operator.lookbehind.regexp"
2339 },
2340 "2": {
2341 "name": "invalid.illegal.newline.python"
2342 }
2343 },
2344 "patterns": [
2345 {
2346 "include": "#single-three-regexp-expression"
2347 },
2348 {
2349 "include": "#comments-string-single-three"
2350 }
2351 ]
2352 },
2353 "single-three-regexp-lookbehind-negative": {
2354 "begin": "(\\()\\?<!",
2355 "end": "(\\)|(?=\\'\\'\\'))",
2356 "beginCaptures": {
2357 "0": {
2358 "name": "keyword.operator.lookbehind.negative.regexp"
2359 },
2360 "1": {
2361 "name": "punctuation.parenthesis.lookbehind.begin.regexp"
2362 }
2363 },
2364 "endCaptures": {
2365 "1": {
2366 "name": "punctuation.parenthesis.lookbehind.end.regexp keyword.operator.lookbehind.negative.regexp"
2367 },
2368 "2": {
2369 "name": "invalid.illegal.newline.python"
2370 }
2371 },
2372 "patterns": [
2373 {
2374 "include": "#single-three-regexp-expression"
2375 },
2376 {
2377 "include": "#comments-string-single-three"
2378 }
2379 ]
2380 },
2381 "single-three-regexp-conditional": {
2382 "begin": "(\\()\\?\\((\\w+(?:\\s+[[:alnum:]]+)?|\\d+)\\)",
2383 "end": "(\\)|(?=\\'\\'\\'))",
2384 "beginCaptures": {
2385 "0": {
2386 "name": "keyword.operator.conditional.regexp"
2387 },
2388 "1": {
2389 "name": "punctuation.parenthesis.conditional.begin.regexp"
2390 }
2391 },
2392 "endCaptures": {
2393 "1": {
2394 "name": "punctuation.parenthesis.conditional.end.regexp keyword.operator.conditional.negative.regexp"
2395 },
2396 "2": {
2397 "name": "invalid.illegal.newline.python"
2398 }
2399 },
2400 "patterns": [
2401 {
2402 "include": "#single-three-regexp-expression"
2403 },
2404 {
2405 "include": "#comments-string-single-three"
2406 }
2407 ]
2408 },
2409 "single-three-regexp-parentheses-non-capturing": {
2410 "begin": "\\(\\?:",
2411 "end": "(\\)|(?=\\'\\'\\'))",
2412 "beginCaptures": {
2413 "0": {
2414 "name": "punctuation.parenthesis.non-capturing.begin.regexp support.other.parenthesis.regexp"
2415 }
2416 },
2417 "endCaptures": {
2418 "1": {
2419 "name": "punctuation.parenthesis.non-capturing.end.regexp support.other.parenthesis.regexp"
2420 },
2421 "2": {
2422 "name": "invalid.illegal.newline.python"
2423 }
2424 },
2425 "patterns": [
2426 {
2427 "include": "#single-three-regexp-expression"
2428 },
2429 {
2430 "include": "#comments-string-single-three"
2431 }
2432 ]
2433 },
2434 "single-three-regexp-parentheses": {
2435 "begin": "\\(",
2436 "end": "(\\)|(?=\\'\\'\\'))",
2437 "beginCaptures": {
2438 "0": {
2439 "name": "punctuation.parenthesis.begin.regexp support.other.parenthesis.regexp"
2440 }
2441 },
2442 "endCaptures": {
2443 "1": {
2444 "name": "punctuation.parenthesis.end.regexp support.other.parenthesis.regexp"
2445 },
2446 "2": {
2447 "name": "invalid.illegal.newline.python"
2448 }
2449 },
2450 "patterns": [
2451 {
2452 "include": "#single-three-regexp-expression"
2453 },
2454 {
2455 "include": "#comments-string-single-three"
2456 }
2457 ]
2458 },
2459 "double-one-regexp-expression": {
2460 "patterns": [
2461 {
2462 "include": "#regexp-base-expression"
2463 },
2464 {
2465 "include": "#double-one-regexp-character-set"
2466 },
2467 {
2468 "include": "#double-one-regexp-comments"
2469 },
2470 {
2471 "include": "#regexp-flags"
2472 },
2473 {
2474 "include": "#double-one-regexp-named-group"
2475 },
2476 {
2477 "include": "#regexp-backreference"
2478 },
2479 {
2480 "include": "#double-one-regexp-lookahead"
2481 },
2482 {
2483 "include": "#double-one-regexp-lookahead-negative"
2484 },
2485 {
2486 "include": "#double-one-regexp-lookbehind"
2487 },
2488 {
2489 "include": "#double-one-regexp-lookbehind-negative"
2490 },
2491 {
2492 "include": "#double-one-regexp-conditional"
2493 },
2494 {
2495 "include": "#double-one-regexp-parentheses-non-capturing"
2496 },
2497 {
2498 "include": "#double-one-regexp-parentheses"
2499 }
2500 ]
2501 },
2502 "double-one-regexp-character-set": {
2503 "patterns": [
2504 {
2505 "match": "(?x)\n \\[ \\^? \\] (?! .*?\\])\n"
2506 },
2507 {
2508 "name": "meta.character.set.regexp",
2509 "begin": "(\\[)(\\^)?(\\])?",
2510 "end": "(\\]|(?=\"))|((?=(?<!\\\\)\\n))",
2511 "beginCaptures": {
2512 "1": {
2513 "name": "constant.other.set.regexp punctuation.character.set.begin.regexp"
2514 },
2515 "2": {
2516 "name": "keyword.operator.negation.regexp"
2517 },
2518 "3": {
2519 "name": "constant.character.set.regexp"
2520 }
2521 },
2522 "endCaptures": {
2523 "1": {
2524 "name": "constant.other.set.regexp punctuation.character.set.end.regexp"
2525 },
2526 "2": {
2527 "name": "invalid.illegal.newline.python"
2528 }
2529 },
2530 "patterns": [
2531 {
2532 "include": "#regexp-charecter-set-escapes"
2533 },
2534 {
2535 "name": "constant.character.set.regexp",
2536 "match": "[^\\n]"
2537 }
2538 ]
2539 }
2540 ]
2541 },
2542 "double-one-regexp-named-group": {
2543 "name": "meta.named.regexp",
2544 "begin": "(?x)\n (\\() (\\?P <\\w+(?:\\s+[[:alnum:]]+)?>)\n",
2545 "end": "(\\)|(?=\"))|((?=(?<!\\\\)\\n))",
2546 "beginCaptures": {
2547 "1": {
2548 "name": "punctuation.parenthesis.named.begin.regexp support.other.parenthesis.regexp"
2549 },
2550 "2": {
2551 "name": "entity.name.tag.named.group.regexp"
2552 }
2553 },
2554 "endCaptures": {
2555 "1": {
2556 "name": "punctuation.parenthesis.named.end.regexp support.other.parenthesis.regexp"
2557 },
2558 "2": {
2559 "name": "invalid.illegal.newline.python"
2560 }
2561 },
2562 "patterns": [
2563 {
2564 "include": "#double-one-regexp-expression"
2565 }
2566 ]
2567 },
2568 "double-one-regexp-comments": {
2569 "name": "comment.regexp",
2570 "begin": "\\(\\?#",
2571 "end": "(\\)|(?=\"))|((?=(?<!\\\\)\\n))",
2572 "beginCaptures": {
2573 "0": {
2574 "name": "punctuation.comment.begin.regexp"
2575 }
2576 },
2577 "endCaptures": {
2578 "1": {
2579 "name": "punctuation.comment.end.regexp"
2580 },
2581 "2": {
2582 "name": "invalid.illegal.newline.python"
2583 }
2584 },
2585 "patterns": [
2586 {
2587 "include": "#codetags"
2588 }
2589 ]
2590 },
2591 "double-one-regexp-lookahead": {
2592 "begin": "(\\()\\?=",
2593 "end": "(\\)|(?=\"))|((?=(?<!\\\\)\\n))",
2594 "beginCaptures": {
2595 "0": {
2596 "name": "keyword.operator.lookahead.regexp"
2597 },
2598 "1": {
2599 "name": "punctuation.parenthesis.lookahead.begin.regexp"
2600 }
2601 },
2602 "endCaptures": {
2603 "1": {
2604 "name": "punctuation.parenthesis.lookahead.end.regexp keyword.operator.lookahead.regexp"
2605 },
2606 "2": {
2607 "name": "invalid.illegal.newline.python"
2608 }
2609 },
2610 "patterns": [
2611 {
2612 "include": "#double-one-regexp-expression"
2613 }
2614 ]
2615 },
2616 "double-one-regexp-lookahead-negative": {
2617 "begin": "(\\()\\?!",
2618 "end": "(\\)|(?=\"))|((?=(?<!\\\\)\\n))",
2619 "beginCaptures": {
2620 "0": {
2621 "name": "keyword.operator.lookahead.negative.regexp"
2622 },
2623 "1": {
2624 "name": "punctuation.parenthesis.lookahead.begin.regexp"
2625 }
2626 },
2627 "endCaptures": {
2628 "1": {
2629 "name": "punctuation.parenthesis.lookahead.end.regexp keyword.operator.lookahead.negative.regexp"
2630 },
2631 "2": {
2632 "name": "invalid.illegal.newline.python"
2633 }
2634 },
2635 "patterns": [
2636 {
2637 "include": "#double-one-regexp-expression"
2638 }
2639 ]
2640 },
2641 "double-one-regexp-lookbehind": {
2642 "begin": "(\\()\\?<=",
2643 "end": "(\\)|(?=\"))|((?=(?<!\\\\)\\n))",
2644 "beginCaptures": {
2645 "0": {
2646 "name": "keyword.operator.lookbehind.regexp"
2647 },
2648 "1": {
2649 "name": "punctuation.parenthesis.lookbehind.begin.regexp"
2650 }
2651 },
2652 "endCaptures": {
2653 "1": {
2654 "name": "punctuation.parenthesis.lookbehind.end.regexp keyword.operator.lookbehind.regexp"
2655 },
2656 "2": {
2657 "name": "invalid.illegal.newline.python"
2658 }
2659 },
2660 "patterns": [
2661 {
2662 "include": "#double-one-regexp-expression"
2663 }
2664 ]
2665 },
2666 "double-one-regexp-lookbehind-negative": {
2667 "begin": "(\\()\\?<!",
2668 "end": "(\\)|(?=\"))|((?=(?<!\\\\)\\n))",
2669 "beginCaptures": {
2670 "0": {
2671 "name": "keyword.operator.lookbehind.negative.regexp"
2672 },
2673 "1": {
2674 "name": "punctuation.parenthesis.lookbehind.begin.regexp"
2675 }
2676 },
2677 "endCaptures": {
2678 "1": {
2679 "name": "punctuation.parenthesis.lookbehind.end.regexp keyword.operator.lookbehind.negative.regexp"
2680 },
2681 "2": {
2682 "name": "invalid.illegal.newline.python"
2683 }
2684 },
2685 "patterns": [
2686 {
2687 "include": "#double-one-regexp-expression"
2688 }
2689 ]
2690 },
2691 "double-one-regexp-conditional": {
2692 "begin": "(\\()\\?\\((\\w+(?:\\s+[[:alnum:]]+)?|\\d+)\\)",
2693 "end": "(\\)|(?=\"))|((?=(?<!\\\\)\\n))",
2694 "beginCaptures": {
2695 "0": {
2696 "name": "keyword.operator.conditional.regexp"
2697 },
2698 "1": {
2699 "name": "punctuation.parenthesis.conditional.begin.regexp"
2700 }
2701 },
2702 "endCaptures": {
2703 "1": {
2704 "name": "punctuation.parenthesis.conditional.end.regexp keyword.operator.conditional.negative.regexp"
2705 },
2706 "2": {
2707 "name": "invalid.illegal.newline.python"
2708 }
2709 },
2710 "patterns": [
2711 {
2712 "include": "#double-one-regexp-expression"
2713 }
2714 ]
2715 },
2716 "double-one-regexp-parentheses-non-capturing": {
2717 "begin": "\\(\\?:",
2718 "end": "(\\)|(?=\"))|((?=(?<!\\\\)\\n))",
2719 "beginCaptures": {
2720 "0": {
2721 "name": "punctuation.parenthesis.non-capturing.begin.regexp support.other.parenthesis.regexp"
2722 }
2723 },
2724 "endCaptures": {
2725 "1": {
2726 "name": "punctuation.parenthesis.non-capturing.end.regexp support.other.parenthesis.regexp"
2727 },
2728 "2": {
2729 "name": "invalid.illegal.newline.python"
2730 }
2731 },
2732 "patterns": [
2733 {
2734 "include": "#double-one-regexp-expression"
2735 }
2736 ]
2737 },
2738 "double-one-regexp-parentheses": {
2739 "begin": "\\(",
2740 "end": "(\\)|(?=\"))|((?=(?<!\\\\)\\n))",
2741 "beginCaptures": {
2742 "0": {
2743 "name": "punctuation.parenthesis.begin.regexp support.other.parenthesis.regexp"
2744 }
2745 },
2746 "endCaptures": {
2747 "1": {
2748 "name": "punctuation.parenthesis.end.regexp support.other.parenthesis.regexp"
2749 },
2750 "2": {
2751 "name": "invalid.illegal.newline.python"
2752 }
2753 },
2754 "patterns": [
2755 {
2756 "include": "#double-one-regexp-expression"
2757 }
2758 ]
2759 },
2760 "double-three-regexp-expression": {
2761 "patterns": [
2762 {
2763 "include": "#regexp-base-expression"
2764 },
2765 {
2766 "include": "#double-three-regexp-character-set"
2767 },
2768 {
2769 "include": "#double-three-regexp-comments"
2770 },
2771 {
2772 "include": "#regexp-flags"
2773 },
2774 {
2775 "include": "#double-three-regexp-named-group"
2776 },
2777 {
2778 "include": "#regexp-backreference"
2779 },
2780 {
2781 "include": "#double-three-regexp-lookahead"
2782 },
2783 {
2784 "include": "#double-three-regexp-lookahead-negative"
2785 },
2786 {
2787 "include": "#double-three-regexp-lookbehind"
2788 },
2789 {
2790 "include": "#double-three-regexp-lookbehind-negative"
2791 },
2792 {
2793 "include": "#double-three-regexp-conditional"
2794 },
2795 {
2796 "include": "#double-three-regexp-parentheses-non-capturing"
2797 },
2798 {
2799 "include": "#double-three-regexp-parentheses"
2800 },
2801 {
2802 "include": "#comments-string-double-three"
2803 }
2804 ]
2805 },
2806 "double-three-regexp-character-set": {
2807 "patterns": [
2808 {
2809 "match": "(?x)\n \\[ \\^? \\] (?! .*?\\])\n"
2810 },
2811 {
2812 "name": "meta.character.set.regexp",
2813 "begin": "(\\[)(\\^)?(\\])?",
2814 "end": "(\\]|(?=\"\"\"))",
2815 "beginCaptures": {
2816 "1": {
2817 "name": "constant.other.set.regexp punctuation.character.set.begin.regexp"
2818 },
2819 "2": {
2820 "name": "keyword.operator.negation.regexp"
2821 },
2822 "3": {
2823 "name": "constant.character.set.regexp"
2824 }
2825 },
2826 "endCaptures": {
2827 "1": {
2828 "name": "constant.other.set.regexp punctuation.character.set.end.regexp"
2829 },
2830 "2": {
2831 "name": "invalid.illegal.newline.python"
2832 }
2833 },
2834 "patterns": [
2835 {
2836 "include": "#regexp-charecter-set-escapes"
2837 },
2838 {
2839 "name": "constant.character.set.regexp",
2840 "match": "[^\\n]"
2841 }
2842 ]
2843 }
2844 ]
2845 },
2846 "double-three-regexp-named-group": {
2847 "name": "meta.named.regexp",
2848 "begin": "(?x)\n (\\() (\\?P <\\w+(?:\\s+[[:alnum:]]+)?>)\n",
2849 "end": "(\\)|(?=\"\"\"))",
2850 "beginCaptures": {
2851 "1": {
2852 "name": "punctuation.parenthesis.named.begin.regexp support.other.parenthesis.regexp"
2853 },
2854 "2": {
2855 "name": "entity.name.tag.named.group.regexp"
2856 }
2857 },
2858 "endCaptures": {
2859 "1": {
2860 "name": "punctuation.parenthesis.named.end.regexp support.other.parenthesis.regexp"
2861 },
2862 "2": {
2863 "name": "invalid.illegal.newline.python"
2864 }
2865 },
2866 "patterns": [
2867 {
2868 "include": "#double-three-regexp-expression"
2869 },
2870 {
2871 "include": "#comments-string-double-three"
2872 }
2873 ]
2874 },
2875 "double-three-regexp-comments": {
2876 "name": "comment.regexp",
2877 "begin": "\\(\\?#",
2878 "end": "(\\)|(?=\"\"\"))",
2879 "beginCaptures": {
2880 "0": {
2881 "name": "punctuation.comment.begin.regexp"
2882 }
2883 },
2884 "endCaptures": {
2885 "1": {
2886 "name": "punctuation.comment.end.regexp"
2887 },
2888 "2": {
2889 "name": "invalid.illegal.newline.python"
2890 }
2891 },
2892 "patterns": [
2893 {
2894 "include": "#codetags"
2895 }
2896 ]
2897 },
2898 "double-three-regexp-lookahead": {
2899 "begin": "(\\()\\?=",
2900 "end": "(\\)|(?=\"\"\"))",
2901 "beginCaptures": {
2902 "0": {
2903 "name": "keyword.operator.lookahead.regexp"
2904 },
2905 "1": {
2906 "name": "punctuation.parenthesis.lookahead.begin.regexp"
2907 }
2908 },
2909 "endCaptures": {
2910 "1": {
2911 "name": "punctuation.parenthesis.lookahead.end.regexp keyword.operator.lookahead.regexp"
2912 },
2913 "2": {
2914 "name": "invalid.illegal.newline.python"
2915 }
2916 },
2917 "patterns": [
2918 {
2919 "include": "#double-three-regexp-expression"
2920 },
2921 {
2922 "include": "#comments-string-double-three"
2923 }
2924 ]
2925 },
2926 "double-three-regexp-lookahead-negative": {
2927 "begin": "(\\()\\?!",
2928 "end": "(\\)|(?=\"\"\"))",
2929 "beginCaptures": {
2930 "0": {
2931 "name": "keyword.operator.lookahead.negative.regexp"
2932 },
2933 "1": {
2934 "name": "punctuation.parenthesis.lookahead.begin.regexp"
2935 }
2936 },
2937 "endCaptures": {
2938 "1": {
2939 "name": "punctuation.parenthesis.lookahead.end.regexp keyword.operator.lookahead.negative.regexp"
2940 },
2941 "2": {
2942 "name": "invalid.illegal.newline.python"
2943 }
2944 },
2945 "patterns": [
2946 {
2947 "include": "#double-three-regexp-expression"
2948 },
2949 {
2950 "include": "#comments-string-double-three"
2951 }
2952 ]
2953 },
2954 "double-three-regexp-lookbehind": {
2955 "begin": "(\\()\\?<=",
2956 "end": "(\\)|(?=\"\"\"))",
2957 "beginCaptures": {
2958 "0": {
2959 "name": "keyword.operator.lookbehind.regexp"
2960 },
2961 "1": {
2962 "name": "punctuation.parenthesis.lookbehind.begin.regexp"
2963 }
2964 },
2965 "endCaptures": {
2966 "1": {
2967 "name": "punctuation.parenthesis.lookbehind.end.regexp keyword.operator.lookbehind.regexp"
2968 },
2969 "2": {
2970 "name": "invalid.illegal.newline.python"
2971 }
2972 },
2973 "patterns": [
2974 {
2975 "include": "#double-three-regexp-expression"
2976 },
2977 {
2978 "include": "#comments-string-double-three"
2979 }
2980 ]
2981 },
2982 "double-three-regexp-lookbehind-negative": {
2983 "begin": "(\\()\\?<!",
2984 "end": "(\\)|(?=\"\"\"))",
2985 "beginCaptures": {
2986 "0": {
2987 "name": "keyword.operator.lookbehind.negative.regexp"
2988 },
2989 "1": {
2990 "name": "punctuation.parenthesis.lookbehind.begin.regexp"
2991 }
2992 },
2993 "endCaptures": {
2994 "1": {
2995 "name": "punctuation.parenthesis.lookbehind.end.regexp keyword.operator.lookbehind.negative.regexp"
2996 },
2997 "2": {
2998 "name": "invalid.illegal.newline.python"
2999 }
3000 },
3001 "patterns": [
3002 {
3003 "include": "#double-three-regexp-expression"
3004 },
3005 {
3006 "include": "#comments-string-double-three"
3007 }
3008 ]
3009 },
3010 "double-three-regexp-conditional": {
3011 "begin": "(\\()\\?\\((\\w+(?:\\s+[[:alnum:]]+)?|\\d+)\\)",
3012 "end": "(\\)|(?=\"\"\"))",
3013 "beginCaptures": {
3014 "0": {
3015 "name": "keyword.operator.conditional.regexp"
3016 },
3017 "1": {
3018 "name": "punctuation.parenthesis.conditional.begin.regexp"
3019 }
3020 },
3021 "endCaptures": {
3022 "1": {
3023 "name": "punctuation.parenthesis.conditional.end.regexp keyword.operator.conditional.negative.regexp"
3024 },
3025 "2": {
3026 "name": "invalid.illegal.newline.python"
3027 }
3028 },
3029 "patterns": [
3030 {
3031 "include": "#double-three-regexp-expression"
3032 },
3033 {
3034 "include": "#comments-string-double-three"
3035 }
3036 ]
3037 },
3038 "double-three-regexp-parentheses-non-capturing": {
3039 "begin": "\\(\\?:",
3040 "end": "(\\)|(?=\"\"\"))",
3041 "beginCaptures": {
3042 "0": {
3043 "name": "punctuation.parenthesis.non-capturing.begin.regexp support.other.parenthesis.regexp"
3044 }
3045 },
3046 "endCaptures": {
3047 "1": {
3048 "name": "punctuation.parenthesis.non-capturing.end.regexp support.other.parenthesis.regexp"
3049 },
3050 "2": {
3051 "name": "invalid.illegal.newline.python"
3052 }
3053 },
3054 "patterns": [
3055 {
3056 "include": "#double-three-regexp-expression"
3057 },
3058 {
3059 "include": "#comments-string-double-three"
3060 }
3061 ]
3062 },
3063 "double-three-regexp-parentheses": {
3064 "begin": "\\(",
3065 "end": "(\\)|(?=\"\"\"))",
3066 "beginCaptures": {
3067 "0": {
3068 "name": "punctuation.parenthesis.begin.regexp support.other.parenthesis.regexp"
3069 }
3070 },
3071 "endCaptures": {
3072 "1": {
3073 "name": "punctuation.parenthesis.end.regexp support.other.parenthesis.regexp"
3074 },
3075 "2": {
3076 "name": "invalid.illegal.newline.python"
3077 }
3078 },
3079 "patterns": [
3080 {
3081 "include": "#double-three-regexp-expression"
3082 },
3083 {
3084 "include": "#comments-string-double-three"
3085 }
3086 ]
3087 },
3088 "string-raw-quoted-single-line": {
3089 "name": "string.quoted.raw.single.python",
3090 "begin": "\\b(([uU]R)|(R))((['\"]))",
3091 "end": "(\\4)|((?<!\\\\)\\n)",
3092 "beginCaptures": {
3093 "2": {
3094 "name": "invalid.deprecated.prefix.python"
3095 },
3096 "3": {
3097 "name": "storage.type.string.python"
3098 },
3099 "4": {
3100 "name": "punctuation.definition.string.begin.python"
3101 }
3102 },
3103 "endCaptures": {
3104 "1": {
3105 "name": "punctuation.definition.string.end.python"
3106 },
3107 "2": {
3108 "name": "invalid.illegal.newline.python"
3109 }
3110 },
3111 "patterns": [
3112 {
3113 "include": "#string-single-bad-brace1-formatting-raw"
3114 },
3115 {
3116 "include": "#string-single-bad-brace2-formatting-raw"
3117 },
3118 {
3119 "include": "#string-raw-guts"
3120 }
3121 ]
3122 },
3123 "string-bin-quoted-single-line": {
3124 "name": "string.quoted.binary.single.python",
3125 "begin": "(\\b[bB])((['\"]))",
3126 "end": "(\\2)|((?<!\\\\)\\n)",
3127 "beginCaptures": {
3128 "1": {
3129 "name": "storage.type.string.python"
3130 },
3131 "2": {
3132 "name": "punctuation.definition.string.begin.python"
3133 }
3134 },
3135 "endCaptures": {
3136 "1": {
3137 "name": "punctuation.definition.string.end.python"
3138 },
3139 "2": {
3140 "name": "invalid.illegal.newline.python"
3141 }
3142 },
3143 "patterns": [
3144 {
3145 "include": "#string-entity"
3146 }
3147 ]
3148 },
3149 "string-raw-bin-quoted-single-line": {
3150 "name": "string.quoted.raw.binary.single.python",
3151 "begin": "(\\b(?:R[bB]|[bB]R))((['\"]))",
3152 "end": "(\\2)|((?<!\\\\)\\n)",
3153 "beginCaptures": {
3154 "1": {
3155 "name": "storage.type.string.python"
3156 },
3157 "2": {
3158 "name": "punctuation.definition.string.begin.python"
3159 }
3160 },
3161 "endCaptures": {
3162 "1": {
3163 "name": "punctuation.definition.string.end.python"
3164 },
3165 "2": {
3166 "name": "invalid.illegal.newline.python"
3167 }
3168 },
3169 "patterns": [
3170 {
3171 "include": "#string-raw-bin-guts"
3172 }
3173 ]
3174 },
3175 "string-quoted-single-line": {
3176 "name": "string.quoted.single.python",
3177 "begin": "(\\b[rR](?=[uU]))?([uU])?((['\"]))",
3178 "end": "(\\3)|((?<!\\\\)\\n)",
3179 "beginCaptures": {
3180 "1": {
3181 "name": "invalid.illegal.prefix.python"
3182 },
3183 "2": {
3184 "name": "storage.type.string.python"
3185 },
3186 "3": {
3187 "name": "punctuation.definition.string.begin.python"
3188 }
3189 },
3190 "endCaptures": {
3191 "1": {
3192 "name": "punctuation.definition.string.end.python"
3193 },
3194 "2": {
3195 "name": "invalid.illegal.newline.python"
3196 }
3197 },
3198 "patterns": [
3199 {
3200 "include": "#string-single-bad-brace1-formatting-unicode"
3201 },
3202 {
3203 "include": "#string-single-bad-brace2-formatting-unicode"
3204 },
3205 {
3206 "include": "#string-unicode-guts"
3207 }
3208 ]
3209 },
3210 "string-single-bad-brace1-formatting-unicode": {
3211 "comment": "template using {% ... %}",
3212 "begin": "(?x)\n (?= \\{%\n ( .*? (?!(['\"])|((?<!\\\\)\\n)) )\n %\\}\n )\n",
3213 "end": "(?=(['\"])|((?<!\\\\)\\n))",
3214 "patterns": [
3215 {
3216 "include": "#escape-sequence-unicode"
3217 },
3218 {
3219 "include": "#escape-sequence"
3220 },
3221 {
3222 "include": "#string-line-continuation"
3223 }
3224 ]
3225 },
3226 "string-single-bad-brace1-formatting-raw": {
3227 "comment": "template using {% ... %}",
3228 "begin": "(?x)\n (?= \\{%\n ( .*? (?!(['\"])|((?<!\\\\)\\n)) )\n %\\}\n )\n",
3229 "end": "(?=(['\"])|((?<!\\\\)\\n))",
3230 "patterns": [
3231 {
3232 "include": "#string-consume-escape"
3233 }
3234 ]
3235 },
3236 "string-single-bad-brace2-formatting-unicode": {
3237 "comment": "odd format or format-like syntax",
3238 "begin": "(?x)\n (?!\\{\\{)\n (?= \\{ (\n \\w*? (?!(['\"])|((?<!\\\\)\\n)) [^!:\\.\\[}\\w]\n )\n .*?(?!(['\"])|((?<!\\\\)\\n))\n \\}\n )\n",
3239 "end": "(?=(['\"])|((?<!\\\\)\\n))",
3240 "patterns": [
3241 {
3242 "include": "#escape-sequence-unicode"
3243 },
3244 {
3245 "include": "#string-entity"
3246 }
3247 ]
3248 },
3249 "string-single-bad-brace2-formatting-raw": {
3250 "comment": "odd format or format-like syntax",
3251 "begin": "(?x)\n (?!\\{\\{)\n (?= \\{ (\n \\w*? (?!(['\"])|((?<!\\\\)\\n)) [^!:\\.\\[}\\w]\n )\n .*?(?!(['\"])|((?<!\\\\)\\n))\n \\}\n )\n",
3252 "end": "(?=(['\"])|((?<!\\\\)\\n))",
3253 "patterns": [
3254 {
3255 "include": "#string-consume-escape"
3256 },
3257 {
3258 "include": "#string-formatting"
3259 }
3260 ]
3261 },
3262 "string-raw-quoted-multi-line": {
3263 "name": "string.quoted.raw.multi.python",
3264 "begin": "\\b(([uU]R)|(R))('''|\"\"\")",
3265 "end": "(\\4)",
3266 "beginCaptures": {
3267 "2": {
3268 "name": "invalid.deprecated.prefix.python"
3269 },
3270 "3": {
3271 "name": "storage.type.string.python"
3272 },
3273 "4": {
3274 "name": "punctuation.definition.string.begin.python"
3275 }
3276 },
3277 "endCaptures": {
3278 "1": {
3279 "name": "punctuation.definition.string.end.python"
3280 },
3281 "2": {
3282 "name": "invalid.illegal.newline.python"
3283 }
3284 },
3285 "patterns": [
3286 {
3287 "include": "#string-multi-bad-brace1-formatting-raw"
3288 },
3289 {
3290 "include": "#string-multi-bad-brace2-formatting-raw"
3291 },
3292 {
3293 "include": "#string-raw-guts"
3294 }
3295 ]
3296 },
3297 "string-bin-quoted-multi-line": {
3298 "name": "string.quoted.binary.multi.python",
3299 "begin": "(\\b[bB])('''|\"\"\")",
3300 "end": "(\\2)",
3301 "beginCaptures": {
3302 "1": {
3303 "name": "storage.type.string.python"
3304 },
3305 "2": {
3306 "name": "punctuation.definition.string.begin.python"
3307 }
3308 },
3309 "endCaptures": {
3310 "1": {
3311 "name": "punctuation.definition.string.end.python"
3312 },
3313 "2": {
3314 "name": "invalid.illegal.newline.python"
3315 }
3316 },
3317 "patterns": [
3318 {
3319 "include": "#string-entity"
3320 }
3321 ]
3322 },
3323 "string-raw-bin-quoted-multi-line": {
3324 "name": "string.quoted.raw.binary.multi.python",
3325 "begin": "(\\b(?:R[bB]|[bB]R))('''|\"\"\")",
3326 "end": "(\\2)",
3327 "beginCaptures": {
3328 "1": {
3329 "name": "storage.type.string.python"
3330 },
3331 "2": {
3332 "name": "punctuation.definition.string.begin.python"
3333 }
3334 },
3335 "endCaptures": {
3336 "1": {
3337 "name": "punctuation.definition.string.end.python"
3338 },
3339 "2": {
3340 "name": "invalid.illegal.newline.python"
3341 }
3342 },
3343 "patterns": [
3344 {
3345 "include": "#string-raw-bin-guts"
3346 }
3347 ]
3348 },
3349 "string-quoted-multi-line": {
3350 "name": "string.quoted.multi.python",
3351 "begin": "(\\b[rR](?=[uU]))?([uU])?('''|\"\"\")",
3352 "end": "(\\3)",
3353 "beginCaptures": {
3354 "1": {
3355 "name": "invalid.illegal.prefix.python"
3356 },
3357 "2": {
3358 "name": "storage.type.string.python"
3359 },
3360 "3": {
3361 "name": "punctuation.definition.string.begin.python"
3362 }
3363 },
3364 "endCaptures": {
3365 "1": {
3366 "name": "punctuation.definition.string.end.python"
3367 },
3368 "2": {
3369 "name": "invalid.illegal.newline.python"
3370 }
3371 },
3372 "patterns": [
3373 {
3374 "include": "#string-multi-bad-brace1-formatting-unicode"
3375 },
3376 {
3377 "include": "#string-multi-bad-brace2-formatting-unicode"
3378 },
3379 {
3380 "include": "#string-unicode-guts"
3381 }
3382 ]
3383 },
3384 "string-multi-bad-brace1-formatting-unicode": {
3385 "comment": "template using {% ... %}",
3386 "begin": "(?x)\n (?= \\{%\n ( .*? (?!'''|\"\"\") )\n %\\}\n )\n",
3387 "end": "(?='''|\"\"\")",
3388 "patterns": [
3389 {
3390 "include": "#escape-sequence-unicode"
3391 },
3392 {
3393 "include": "#escape-sequence"
3394 },
3395 {
3396 "include": "#string-line-continuation"
3397 }
3398 ]
3399 },
3400 "string-multi-bad-brace1-formatting-raw": {
3401 "comment": "template using {% ... %}",
3402 "begin": "(?x)\n (?= \\{%\n ( .*? (?!'''|\"\"\") )\n %\\}\n )\n",
3403 "end": "(?='''|\"\"\")",
3404 "patterns": [
3405 {
3406 "include": "#string-consume-escape"
3407 }
3408 ]
3409 },
3410 "string-multi-bad-brace2-formatting-unicode": {
3411 "comment": "odd format or format-like syntax",
3412 "begin": "(?x)\n (?!\\{\\{)\n (?= \\{ (\n \\w*? (?!'''|\"\"\") [^!:\\.\\[}\\w]\n )\n .*?(?!'''|\"\"\")\n \\}\n )\n",
3413 "end": "(?='''|\"\"\")",
3414 "patterns": [
3415 {
3416 "include": "#escape-sequence-unicode"
3417 },
3418 {
3419 "include": "#string-entity"
3420 }
3421 ]
3422 },
3423 "string-multi-bad-brace2-formatting-raw": {
3424 "comment": "odd format or format-like syntax",
3425 "begin": "(?x)\n (?!\\{\\{)\n (?= \\{ (\n \\w*? (?!'''|\"\"\") [^!:\\.\\[}\\w]\n )\n .*?(?!'''|\"\"\")\n \\}\n )\n",
3426 "end": "(?='''|\"\"\")",
3427 "patterns": [
3428 {
3429 "include": "#string-consume-escape"
3430 },
3431 {
3432 "include": "#string-formatting"
3433 }
3434 ]
3435 }
3436 },
3437 "version": "https://github.com/MagicStack/MagicPython/commit/37b660d0490d69ffd8cb4eabc0dd768e6cdaae7a"
3438}