PluginProbe
Code Block Pro – Beautiful Syntax Highlighting / 1.8.0
Code Block Pro – Beautiful Syntax Highlighting v1.8.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 / python.tmLanguage.json

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

5,333 lines 144.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 {
2 "information_for_contributors": [
3 "This file has been converted from https://github.com/MagicStack/MagicPython/blob/master/grammars/MagicPython.tmLanguage",
4 "If you want to provide a fix or improvement, please create a pull request against the original repository.",
5 "Once accepted there, we are happy to receive an update request."
6 ],
7 "version": "https://github.com/MagicStack/MagicPython/commit/b2b4f4ae7b4e6284e80bda8080106b93bd588f9e",
8 "name": "python",
9 "scopeName": "source.python",
10 "patterns": [
11 {
12 "include": "#statement"
13 },
14 {
15 "include": "#expression"
16 }
17 ],
18 "repository": {
19 "impossible": {
20 "comment": "This is a special rule that should be used where no match is desired. It is not a good idea to match something like '1{0}' because in some cases that can result in infinite loops in token generation. So the rule instead matches and impossible expression to allow a match to fail and move to the next token.",
21 "match": "$.^"
22 },
23 "statement": {
24 "patterns": [
25 {
26 "include": "#import"
27 },
28 {
29 "include": "#class-declaration"
30 },
31 {
32 "include": "#function-declaration"
33 },
34 {
35 "include": "#generator"
36 },
37 {
38 "include": "#statement-keyword"
39 },
40 {
41 "include": "#assignment-operator"
42 },
43 {
44 "include": "#decorator"
45 },
46 {
47 "include": "#docstring-statement"
48 },
49 {
50 "include": "#semicolon"
51 }
52 ]
53 },
54 "semicolon": {
55 "patterns": [
56 {
57 "name": "invalid.deprecated.semicolon.python",
58 "match": "\\;$"
59 }
60 ]
61 },
62 "comments": {
63 "patterns": [
64 {
65 "name": "comment.line.number-sign.python",
66 "contentName": "meta.typehint.comment.python",
67 "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",
68 "end": "(?:$|(?=\\#))",
69 "beginCaptures": {
70 "0": {
71 "name": "meta.typehint.comment.python"
72 },
73 "1": {
74 "name": "comment.typehint.directive.notation.python"
75 }
76 },
77 "patterns": [
78 {
79 "name": "comment.typehint.ignore.notation.python",
80 "match": "(?x)\n \\G ignore\n (?= \\s* (?: $ | \\#))\n"
81 },
82 {
83 "name": "comment.typehint.type.notation.python",
84 "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"
85 },
86 {
87 "name": "comment.typehint.punctuation.notation.python",
88 "match": "([\\[\\]\\(\\),\\.\\=\\*]|(->))"
89 },
90 {
91 "name": "comment.typehint.variable.notation.python",
92 "match": "([[:alpha:]_]\\w*)"
93 }
94 ]
95 },
96 {
97 "include": "#comments-base"
98 }
99 ]
100 },
101 "docstring-statement": {
102 "begin": "^(?=\\s*[rR]?(\\'\\'\\'|\\\"\\\"\\\"|\\'|\\\"))",
103 "comment": "the string either terminates correctly or by the beginning of a new line (this is for single line docstrings that aren't terminated) AND it's not followed by another docstring",
104 "end": "((?<=\\1)|^)(?!\\s*[rR]?(\\'\\'\\'|\\\"\\\"\\\"|\\'|\\\"))",
105 "patterns": [
106 {
107 "include": "#docstring"
108 }
109 ]
110 },
111 "docstring": {
112 "patterns": [
113 {
114 "name": "string.quoted.docstring.multi.python",
115 "begin": "(\\'\\'\\'|\\\"\\\"\\\")",
116 "end": "(\\1)",
117 "beginCaptures": {
118 "1": {
119 "name": "punctuation.definition.string.begin.python"
120 }
121 },
122 "endCaptures": {
123 "1": {
124 "name": "punctuation.definition.string.end.python"
125 }
126 },
127 "patterns": [
128 {
129 "include": "#docstring-prompt"
130 },
131 {
132 "include": "#codetags"
133 },
134 {
135 "include": "#docstring-guts-unicode"
136 }
137 ]
138 },
139 {
140 "name": "string.quoted.docstring.raw.multi.python",
141 "begin": "([rR])(\\'\\'\\'|\\\"\\\"\\\")",
142 "end": "(\\2)",
143 "beginCaptures": {
144 "1": {
145 "name": "storage.type.string.python"
146 },
147 "2": {
148 "name": "punctuation.definition.string.begin.python"
149 }
150 },
151 "endCaptures": {
152 "1": {
153 "name": "punctuation.definition.string.end.python"
154 }
155 },
156 "patterns": [
157 {
158 "include": "#string-consume-escape"
159 },
160 {
161 "include": "#docstring-prompt"
162 },
163 {
164 "include": "#codetags"
165 }
166 ]
167 },
168 {
169 "name": "string.quoted.docstring.single.python",
170 "begin": "(\\'|\\\")",
171 "end": "(\\1)|(\\n)",
172 "beginCaptures": {
173 "1": {
174 "name": "punctuation.definition.string.begin.python"
175 }
176 },
177 "endCaptures": {
178 "1": {
179 "name": "punctuation.definition.string.end.python"
180 },
181 "2": {
182 "name": "invalid.illegal.newline.python"
183 }
184 },
185 "patterns": [
186 {
187 "include": "#codetags"
188 },
189 {
190 "include": "#docstring-guts-unicode"
191 }
192 ]
193 },
194 {
195 "name": "string.quoted.docstring.raw.single.python",
196 "begin": "([rR])(\\'|\\\")",
197 "end": "(\\2)|(\\n)",
198 "beginCaptures": {
199 "1": {
200 "name": "storage.type.string.python"
201 },
202 "2": {
203 "name": "punctuation.definition.string.begin.python"
204 }
205 },
206 "endCaptures": {
207 "1": {
208 "name": "punctuation.definition.string.end.python"
209 },
210 "2": {
211 "name": "invalid.illegal.newline.python"
212 }
213 },
214 "patterns": [
215 {
216 "include": "#string-consume-escape"
217 },
218 {
219 "include": "#codetags"
220 }
221 ]
222 }
223 ]
224 },
225 "docstring-guts-unicode": {
226 "patterns": [
227 {
228 "include": "#escape-sequence-unicode"
229 },
230 {
231 "include": "#escape-sequence"
232 },
233 {
234 "include": "#string-line-continuation"
235 }
236 ]
237 },
238 "docstring-prompt": {
239 "match": "(?x)\n (?:\n (?:^|\\G) \\s* (?# '\\G' is necessary for ST)\n ((?:>>>|\\.\\.\\.) \\s) (?=\\s*\\S)\n )\n",
240 "captures": {
241 "1": {
242 "name": "keyword.control.flow.python"
243 }
244 }
245 },
246 "statement-keyword": {
247 "patterns": [
248 {
249 "name": "storage.type.function.python",
250 "match": "\\b((async\\s+)?\\s*def)\\b"
251 },
252 {
253 "name": "keyword.control.flow.python",
254 "comment": "if `as` is eventually followed by `:` or line continuation\nit's probably control flow like:\n with foo as bar, \\\n Foo as Bar:\n try:\n do_stuff()\n except Exception as e:\n pass\n",
255 "match": "\\b(?<!\\.)as\\b(?=.*[:\\\\])"
256 },
257 {
258 "name": "keyword.control.import.python",
259 "comment": "other legal use of `as` is in an import",
260 "match": "\\b(?<!\\.)as\\b"
261 },
262 {
263 "name": "keyword.control.flow.python",
264 "match": "(?x)\n \\b(?<!\\.)(\n 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-bare": {
277 "comment": "valid Python expressions w/o comments and line continuation",
278 "patterns": [
279 {
280 "include": "#backticks"
281 },
282 {
283 "include": "#illegal-anno"
284 },
285 {
286 "include": "#literal"
287 },
288 {
289 "include": "#regexp"
290 },
291 {
292 "include": "#string"
293 },
294 {
295 "include": "#lambda"
296 },
297 {
298 "include": "#generator"
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": "#odd-function-call"
317 },
318 {
319 "include": "#round-braces"
320 },
321 {
322 "include": "#function-call"
323 },
324 {
325 "include": "#builtin-functions"
326 },
327 {
328 "include": "#builtin-types"
329 },
330 {
331 "include": "#builtin-exceptions"
332 },
333 {
334 "include": "#magic-names"
335 },
336 {
337 "include": "#special-names"
338 },
339 {
340 "include": "#illegal-names"
341 },
342 {
343 "include": "#special-variables"
344 },
345 {
346 "include": "#ellipsis"
347 },
348 {
349 "include": "#punctuation"
350 },
351 {
352 "include": "#line-continuation"
353 }
354 ]
355 },
356 "expression-base": {
357 "comment": "valid Python expressions with comments and line continuation",
358 "patterns": [
359 {
360 "include": "#comments"
361 },
362 {
363 "include": "#expression-bare"
364 },
365 {
366 "include": "#line-continuation"
367 }
368 ]
369 },
370 "expression": {
371 "comment": "All valid Python expressions",
372 "patterns": [
373 {
374 "include": "#expression-base"
375 },
376 {
377 "include": "#member-access"
378 },
379 {
380 "comment": "Tokenize identifiers to help linters",
381 "match": "(?x) \\b ([[:alpha:]_]\\w*) \\b"
382 }
383 ]
384 },
385 "member-access": {
386 "name": "meta.member.access.python",
387 "begin": "(\\.)\\s*(?!\\.)",
388 "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",
389 "beginCaptures": {
390 "1": {
391 "name": "punctuation.separator.period.python"
392 }
393 },
394 "patterns": [
395 {
396 "include": "#function-call"
397 },
398 {
399 "include": "#member-access-base"
400 },
401 {
402 "include": "#member-access-attribute"
403 }
404 ]
405 },
406 "member-access-base": {
407 "patterns": [
408 {
409 "include": "#magic-names"
410 },
411 {
412 "include": "#illegal-names"
413 },
414 {
415 "include": "#illegal-object-name"
416 },
417 {
418 "include": "#special-names"
419 },
420 {
421 "include": "#line-continuation"
422 },
423 {
424 "include": "#item-access"
425 }
426 ]
427 },
428 "member-access-attribute": {
429 "comment": "Highlight attribute access in otherwise non-specialized cases.",
430 "name": "meta.attribute.python",
431 "match": "(?x)\n \\b ([[:alpha:]_]\\w*) \\b\n"
432 },
433 "special-names": {
434 "name": "constant.other.caps.python",
435 "match": "(?x)\n \\b\n # we want to see \"enough\", meaning 2 or more upper-case\n # letters in the beginning of the constant\n #\n # for more details refer to:\n # https://github.com/MagicStack/MagicPython/issues/42\n (\n _* [[:upper:]] [_\\d]* [[:upper:]]\n )\n [[:upper:]\\d]* (_\\w*)?\n \\b\n"
436 },
437 "curly-braces": {
438 "begin": "\\{",
439 "end": "\\}",
440 "beginCaptures": {
441 "0": {
442 "name": "punctuation.definition.dict.begin.python"
443 }
444 },
445 "endCaptures": {
446 "0": {
447 "name": "punctuation.definition.dict.end.python"
448 }
449 },
450 "patterns": [
451 {
452 "name": "punctuation.separator.dict.python",
453 "match": ":"
454 },
455 {
456 "include": "#expression"
457 }
458 ]
459 },
460 "list": {
461 "begin": "\\[",
462 "end": "\\]",
463 "beginCaptures": {
464 "0": {
465 "name": "punctuation.definition.list.begin.python"
466 }
467 },
468 "endCaptures": {
469 "0": {
470 "name": "punctuation.definition.list.end.python"
471 }
472 },
473 "patterns": [
474 {
475 "include": "#expression"
476 }
477 ]
478 },
479 "odd-function-call": {
480 "comment": "A bit obscured function call where there may have been an\narbitrary number of other operations to get the function.\nE.g. \"arr[idx](args)\"\n",
481 "begin": "(?x)\n (?<= \\] | \\) ) \\s*\n (?=\\()\n",
482 "end": "(\\))",
483 "endCaptures": {
484 "1": {
485 "name": "punctuation.definition.arguments.end.python"
486 }
487 },
488 "patterns": [
489 {
490 "include": "#function-arguments"
491 }
492 ]
493 },
494 "round-braces": {
495 "begin": "\\(",
496 "end": "\\)",
497 "beginCaptures": {
498 "0": {
499 "name": "punctuation.parenthesis.begin.python"
500 }
501 },
502 "endCaptures": {
503 "0": {
504 "name": "punctuation.parenthesis.end.python"
505 }
506 },
507 "patterns": [
508 {
509 "include": "#expression"
510 }
511 ]
512 },
513 "line-continuation": {
514 "patterns": [
515 {
516 "match": "(\\\\)\\s*(\\S.*$\\n?)",
517 "captures": {
518 "1": {
519 "name": "punctuation.separator.continuation.line.python"
520 },
521 "2": {
522 "name": "invalid.illegal.line.continuation.python"
523 }
524 }
525 },
526 {
527 "begin": "(\\\\)\\s*$\\n?",
528 "end": "(?x)\n (?=^\\s*$)\n |\n (?! (\\s* [rR]? (\\'\\'\\'|\\\"\\\"\\\"|\\'|\\\"))\n |\n (\\G $) (?# '\\G' is necessary for ST)\n )\n",
529 "beginCaptures": {
530 "1": {
531 "name": "punctuation.separator.continuation.line.python"
532 }
533 },
534 "patterns": [
535 {
536 "include": "#regexp"
537 },
538 {
539 "include": "#string"
540 }
541 ]
542 }
543 ]
544 },
545 "assignment-operator": {
546 "name": "keyword.operator.assignment.python",
547 "match": "(?x)\n <<= | >>= | //= | \\*\\*=\n | \\+= | -= | /= | @=\n | \\*= | %= | ~= | \\^= | &= | \\|=\n | =(?!=)\n"
548 },
549 "operator": {
550 "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",
551 "captures": {
552 "1": {
553 "name": "keyword.operator.logical.python"
554 },
555 "2": {
556 "name": "keyword.control.flow.python"
557 },
558 "3": {
559 "name": "keyword.operator.bitwise.python"
560 },
561 "4": {
562 "name": "keyword.operator.arithmetic.python"
563 },
564 "5": {
565 "name": "keyword.operator.comparison.python"
566 }
567 }
568 },
569 "punctuation": {
570 "patterns": [
571 {
572 "name": "punctuation.separator.colon.python",
573 "match": ":"
574 },
575 {
576 "name": "punctuation.separator.element.python",
577 "match": ","
578 }
579 ]
580 },
581 "literal": {
582 "patterns": [
583 {
584 "name": "constant.language.python",
585 "match": "\\b(True|False|None|NotImplemented|Ellipsis)\\b"
586 },
587 {
588 "include": "#number"
589 }
590 ]
591 },
592 "number": {
593 "name": "constant.numeric.python",
594 "patterns": [
595 {
596 "include": "#number-float"
597 },
598 {
599 "include": "#number-dec"
600 },
601 {
602 "include": "#number-hex"
603 },
604 {
605 "include": "#number-oct"
606 },
607 {
608 "include": "#number-bin"
609 },
610 {
611 "include": "#number-long"
612 },
613 {
614 "name": "invalid.illegal.name.python",
615 "match": "\\b[0-9]+\\w+"
616 }
617 ]
618 },
619 "number-float": {
620 "name": "constant.numeric.float.python",
621 "match": "(?x)\n (?<! \\w)(?:\n (?:\n \\.[0-9](?: _?[0-9] )*\n |\n [0-9](?: _?[0-9] )* \\. [0-9](?: _?[0-9] )*\n |\n [0-9](?: _?[0-9] )* \\.\n ) (?: [eE][+-]?[0-9](?: _?[0-9] )* )?\n |\n [0-9](?: _?[0-9] )* (?: [eE][+-]?[0-9](?: _?[0-9] )* )\n )([jJ])?\\b\n",
622 "captures": {
623 "1": {
624 "name": "storage.type.imaginary.number.python"
625 }
626 }
627 },
628 "number-dec": {
629 "name": "constant.numeric.dec.python",
630 "match": "(?x)\n (?<![\\w\\.])(?:\n [1-9](?: _?[0-9] )*\n |\n 0+\n |\n [0-9](?: _?[0-9] )* ([jJ])\n |\n 0 ([0-9]+)(?![eE\\.])\n )\\b\n",
631 "captures": {
632 "1": {
633 "name": "storage.type.imaginary.number.python"
634 },
635 "2": {
636 "name": "invalid.illegal.dec.python"
637 }
638 }
639 },
640 "number-hex": {
641 "name": "constant.numeric.hex.python",
642 "match": "(?x)\n (?<![\\w\\.])\n (0[xX]) (_?[0-9a-fA-F])+\n \\b\n",
643 "captures": {
644 "1": {
645 "name": "storage.type.number.python"
646 }
647 }
648 },
649 "number-oct": {
650 "name": "constant.numeric.oct.python",
651 "match": "(?x)\n (?<![\\w\\.])\n (0[oO]) (_?[0-7])+\n \\b\n",
652 "captures": {
653 "1": {
654 "name": "storage.type.number.python"
655 }
656 }
657 },
658 "number-bin": {
659 "name": "constant.numeric.bin.python",
660 "match": "(?x)\n (?<![\\w\\.])\n (0[bB]) (_?[01])+\n \\b\n",
661 "captures": {
662 "1": {
663 "name": "storage.type.number.python"
664 }
665 }
666 },
667 "number-long": {
668 "name": "constant.numeric.bin.python",
669 "comment": "this is to support python2 syntax for long ints",
670 "match": "(?x)\n (?<![\\w\\.])\n ([1-9][0-9]* | 0) ([lL])\n \\b\n",
671 "captures": {
672 "2": {
673 "name": "storage.type.number.python"
674 }
675 }
676 },
677 "regexp": {
678 "patterns": [
679 {
680 "include": "#regexp-single-three-line"
681 },
682 {
683 "include": "#regexp-double-three-line"
684 },
685 {
686 "include": "#regexp-single-one-line"
687 },
688 {
689 "include": "#regexp-double-one-line"
690 },
691 {
692 "include": "#fregexp-single-three-line"
693 },
694 {
695 "include": "#fregexp-double-three-line"
696 },
697 {
698 "include": "#fregexp-single-one-line"
699 },
700 {
701 "include": "#fregexp-double-one-line"
702 }
703 ]
704 },
705 "string": {
706 "patterns": [
707 {
708 "include": "#string-quoted-multi-line"
709 },
710 {
711 "include": "#string-quoted-single-line"
712 },
713 {
714 "include": "#string-bin-quoted-multi-line"
715 },
716 {
717 "include": "#string-bin-quoted-single-line"
718 },
719 {
720 "include": "#string-raw-quoted-multi-line"
721 },
722 {
723 "include": "#string-raw-quoted-single-line"
724 },
725 {
726 "include": "#string-raw-bin-quoted-multi-line"
727 },
728 {
729 "include": "#string-raw-bin-quoted-single-line"
730 },
731 {
732 "include": "#fstring-fnorm-quoted-multi-line"
733 },
734 {
735 "include": "#fstring-fnorm-quoted-single-line"
736 },
737 {
738 "include": "#fstring-normf-quoted-multi-line"
739 },
740 {
741 "include": "#fstring-normf-quoted-single-line"
742 },
743 {
744 "include": "#fstring-raw-quoted-multi-line"
745 },
746 {
747 "include": "#fstring-raw-quoted-single-line"
748 }
749 ]
750 },
751 "string-unicode-guts": {
752 "patterns": [
753 {
754 "include": "#escape-sequence-unicode"
755 },
756 {
757 "include": "#string-entity"
758 },
759 {
760 "include": "#string-brace-formatting"
761 }
762 ]
763 },
764 "string-consume-escape": {
765 "match": "\\\\['\"\\n\\\\]"
766 },
767 "string-raw-guts": {
768 "patterns": [
769 {
770 "include": "#string-consume-escape"
771 },
772 {
773 "include": "#string-formatting"
774 },
775 {
776 "include": "#string-brace-formatting"
777 }
778 ]
779 },
780 "string-raw-bin-guts": {
781 "patterns": [
782 {
783 "include": "#string-consume-escape"
784 },
785 {
786 "include": "#string-formatting"
787 }
788 ]
789 },
790 "string-entity": {
791 "patterns": [
792 {
793 "include": "#escape-sequence"
794 },
795 {
796 "include": "#string-line-continuation"
797 },
798 {
799 "include": "#string-formatting"
800 }
801 ]
802 },
803 "fstring-guts": {
804 "patterns": [
805 {
806 "include": "#escape-sequence-unicode"
807 },
808 {
809 "include": "#escape-sequence"
810 },
811 {
812 "include": "#string-line-continuation"
813 },
814 {
815 "include": "#fstring-formatting"
816 }
817 ]
818 },
819 "fstring-raw-guts": {
820 "patterns": [
821 {
822 "include": "#string-consume-escape"
823 },
824 {
825 "include": "#fstring-formatting"
826 }
827 ]
828 },
829 "fstring-illegal-single-brace": {
830 "comment": "it is illegal to have a multiline brace inside a single-line string",
831 "begin": "(\\{)(?=[^\\n}]*$\\n?)",
832 "end": "(\\})|(?=\\n)",
833 "beginCaptures": {
834 "1": {
835 "name": "constant.character.format.placeholder.other.python"
836 }
837 },
838 "endCaptures": {
839 "1": {
840 "name": "constant.character.format.placeholder.other.python"
841 }
842 },
843 "patterns": [
844 {
845 "include": "#fstring-terminator-single"
846 },
847 {
848 "include": "#f-expression"
849 }
850 ]
851 },
852 "fstring-illegal-multi-brace": {
853 "patterns": [
854 {
855 "include": "#impossible"
856 }
857 ]
858 },
859 "f-expression": {
860 "comment": "All valid Python expressions, except comments and line continuation",
861 "patterns": [
862 {
863 "include": "#expression-bare"
864 },
865 {
866 "include": "#member-access"
867 },
868 {
869 "comment": "Tokenize identifiers to help linters",
870 "match": "(?x) \\b ([[:alpha:]_]\\w*) \\b"
871 }
872 ]
873 },
874 "escape-sequence-unicode": {
875 "patterns": [
876 {
877 "name": "constant.character.escape.python",
878 "match": "(?x)\n \\\\ (\n u[0-9A-Fa-f]{4}\n | U[0-9A-Fa-f]{8}\n | N\\{[\\w\\s]+?\\}\n )\n"
879 }
880 ]
881 },
882 "escape-sequence": {
883 "name": "constant.character.escape.python",
884 "match": "(?x)\n \\\\ (\n x[0-9A-Fa-f]{2}\n | [0-7]{1,3}\n | [\\\\\"'abfnrtv]\n )\n"
885 },
886 "string-line-continuation": {
887 "name": "constant.language.python",
888 "match": "\\\\$"
889 },
890 "string-formatting": {
891 "name": "meta.format.percent.python",
892 "match": "(?x)\n (\n % (\\([\\w\\s]*\\))?\n [-+#0 ]*\n (\\d+|\\*)? (\\.(\\d+|\\*))?\n ([hlL])?\n [diouxXeEfFgGcrsab%]\n )\n",
893 "captures": {
894 "1": {
895 "name": "constant.character.format.placeholder.other.python"
896 }
897 }
898 },
899 "string-brace-formatting": {
900 "patterns": [
901 {
902 "name": "meta.format.brace.python",
903 "match": "(?x)\n (\n {{ | }}\n | (?:\n {\n \\w* (\\.[[:alpha:]_]\\w* | \\[[^\\]'\"]+\\])*\n (![rsa])?\n ( : \\w? [<>=^]? [-+ ]? \\#?\n \\d* ,? (\\.\\d+)? [bcdeEfFgGnosxX%]? )?\n })\n )\n",
904 "captures": {
905 "1": {
906 "name": "constant.character.format.placeholder.other.python"
907 },
908 "3": {
909 "name": "storage.type.format.python"
910 },
911 "4": {
912 "name": "storage.type.format.python"
913 }
914 }
915 },
916 {
917 "name": "meta.format.brace.python",
918 "match": "(?x)\n (\n {\n \\w* (\\.[[:alpha:]_]\\w* | \\[[^\\]'\"]+\\])*\n (![rsa])?\n (:)\n [^'\"{}\\n]* (?:\n \\{ [^'\"}\\n]*? \\} [^'\"{}\\n]*\n )*\n }\n )\n",
919 "captures": {
920 "1": {
921 "name": "constant.character.format.placeholder.other.python"
922 },
923 "3": {
924 "name": "storage.type.format.python"
925 },
926 "4": {
927 "name": "storage.type.format.python"
928 }
929 }
930 }
931 ]
932 },
933 "fstring-formatting": {
934 "patterns": [
935 {
936 "include": "#fstring-formatting-braces"
937 },
938 {
939 "include": "#fstring-formatting-singe-brace"
940 }
941 ]
942 },
943 "fstring-formatting-singe-brace": {
944 "name": "invalid.illegal.brace.python",
945 "match": "(}(?!}))"
946 },
947 "import": {
948 "comment": "Import statements used to correctly mark `from`, `import`, and `as`\n",
949 "patterns": [
950 {
951 "begin": "\\b(?<!\\.)(from)\\b(?=.+import)",
952 "end": "$|(?=import)",
953 "beginCaptures": {
954 "1": {
955 "name": "keyword.control.import.python"
956 }
957 },
958 "patterns": [
959 {
960 "name": "punctuation.separator.period.python",
961 "match": "\\.+"
962 },
963 {
964 "include": "#expression"
965 }
966 ]
967 },
968 {
969 "begin": "\\b(?<!\\.)(import)\\b",
970 "end": "$",
971 "beginCaptures": {
972 "1": {
973 "name": "keyword.control.import.python"
974 }
975 },
976 "patterns": [
977 {
978 "name": "keyword.control.import.python",
979 "match": "\\b(?<!\\.)as\\b"
980 },
981 {
982 "include": "#expression"
983 }
984 ]
985 }
986 ]
987 },
988 "class-declaration": {
989 "patterns": [
990 {
991 "name": "meta.class.python",
992 "begin": "(?x)\n \\s*(class)\\s+\n (?=\n [[:alpha:]_]\\w* \\s* (:|\\()\n )\n",
993 "end": "(:)",
994 "beginCaptures": {
995 "1": {
996 "name": "storage.type.class.python"
997 }
998 },
999 "endCaptures": {
1000 "1": {
1001 "name": "punctuation.section.class.begin.python"
1002 }
1003 },
1004 "patterns": [
1005 {
1006 "include": "#class-name"
1007 },
1008 {
1009 "include": "#class-inheritance"
1010 }
1011 ]
1012 }
1013 ]
1014 },
1015 "class-name": {
1016 "patterns": [
1017 {
1018 "include": "#illegal-object-name"
1019 },
1020 {
1021 "include": "#builtin-possible-callables"
1022 },
1023 {
1024 "name": "entity.name.type.class.python",
1025 "match": "(?x)\n \\b ([[:alpha:]_]\\w*) \\b\n"
1026 }
1027 ]
1028 },
1029 "class-inheritance": {
1030 "name": "meta.class.inheritance.python",
1031 "begin": "(\\()",
1032 "end": "(\\))",
1033 "beginCaptures": {
1034 "1": {
1035 "name": "punctuation.definition.inheritance.begin.python"
1036 }
1037 },
1038 "endCaptures": {
1039 "1": {
1040 "name": "punctuation.definition.inheritance.end.python"
1041 }
1042 },
1043 "patterns": [
1044 {
1045 "name": "keyword.operator.unpacking.arguments.python",
1046 "match": "(\\*\\*|\\*)"
1047 },
1048 {
1049 "name": "punctuation.separator.inheritance.python",
1050 "match": ","
1051 },
1052 {
1053 "name": "keyword.operator.assignment.python",
1054 "match": "=(?!=)"
1055 },
1056 {
1057 "name": "support.type.metaclass.python",
1058 "match": "\\bmetaclass\\b"
1059 },
1060 {
1061 "include": "#illegal-names"
1062 },
1063 {
1064 "include": "#class-kwarg"
1065 },
1066 {
1067 "include": "#call-wrapper-inheritance"
1068 },
1069 {
1070 "include": "#expression-base"
1071 },
1072 {
1073 "include": "#member-access-class"
1074 },
1075 {
1076 "include": "#inheritance-identifier"
1077 }
1078 ]
1079 },
1080 "class-kwarg": {
1081 "match": "(?x)\n \\b ([[:alpha:]_]\\w*) \\s*(=)(?!=)\n",
1082 "captures": {
1083 "1": {
1084 "name": "entity.other.inherited-class.python variable.parameter.class.python"
1085 },
1086 "2": {
1087 "name": "keyword.operator.assignment.python"
1088 }
1089 }
1090 },
1091 "inheritance-identifier": {
1092 "match": "(?x)\n \\b ([[:alpha:]_]\\w*) \\b\n",
1093 "captures": {
1094 "1": {
1095 "name": "entity.other.inherited-class.python"
1096 }
1097 }
1098 },
1099 "member-access-class": {
1100 "name": "meta.member.access.python",
1101 "begin": "(\\.)\\s*(?!\\.)",
1102 "end": "(?<=\\S)(?=\\W)|$",
1103 "beginCaptures": {
1104 "1": {
1105 "name": "punctuation.separator.period.python"
1106 }
1107 },
1108 "patterns": [
1109 {
1110 "include": "#call-wrapper-inheritance"
1111 },
1112 {
1113 "include": "#member-access-base"
1114 },
1115 {
1116 "include": "#inheritance-identifier"
1117 }
1118 ]
1119 },
1120 "lambda": {
1121 "patterns": [
1122 {
1123 "match": "((?<=\\.)lambda|lambda(?=\\s*[\\.=]))",
1124 "captures": {
1125 "1": {
1126 "name": "keyword.control.flow.python"
1127 }
1128 }
1129 },
1130 {
1131 "match": "\\b(lambda)\\s*?(?=[,\\n]|$)",
1132 "captures": {
1133 "1": {
1134 "name": "storage.type.function.lambda.python"
1135 }
1136 }
1137 },
1138 {
1139 "name": "meta.lambda-function.python",
1140 "begin": "(?x)\n \\b (lambda) \\b\n",
1141 "end": "(:)|(\\n)",
1142 "beginCaptures": {
1143 "1": {
1144 "name": "storage.type.function.lambda.python"
1145 }
1146 },
1147 "endCaptures": {
1148 "1": {
1149 "name": "punctuation.section.function.lambda.begin.python"
1150 }
1151 },
1152 "contentName": "meta.function.lambda.parameters.python",
1153 "patterns": [
1154 {
1155 "name": "keyword.operator.unpacking.parameter.python",
1156 "match": "(\\*\\*|\\*)"
1157 },
1158 {
1159 "include": "#lambda-nested-incomplete"
1160 },
1161 {
1162 "include": "#illegal-names"
1163 },
1164 {
1165 "match": "([[:alpha:]_]\\w*)\\s*(?:(,)|(?=:|$))",
1166 "captures": {
1167 "1": {
1168 "name": "variable.parameter.function.language.python"
1169 },
1170 "2": {
1171 "name": "punctuation.separator.parameters.python"
1172 }
1173 }
1174 },
1175 {
1176 "include": "#comments"
1177 },
1178 {
1179 "include": "#backticks"
1180 },
1181 {
1182 "include": "#illegal-anno"
1183 },
1184 {
1185 "include": "#lambda-parameter-with-default"
1186 },
1187 {
1188 "include": "#line-continuation"
1189 },
1190 {
1191 "include": "#illegal-operator"
1192 }
1193 ]
1194 }
1195 ]
1196 },
1197 "lambda-incomplete": {
1198 "name": "storage.type.function.lambda.python",
1199 "match": "\\blambda(?=\\s*[,)])"
1200 },
1201 "lambda-nested-incomplete": {
1202 "name": "storage.type.function.lambda.python",
1203 "match": "\\blambda(?=\\s*[:,)])"
1204 },
1205 "lambda-parameter-with-default": {
1206 "begin": "(?x)\n \\b\n ([[:alpha:]_]\\w*) \\s* (=)\n",
1207 "end": "(,)|(?=:|$)",
1208 "beginCaptures": {
1209 "1": {
1210 "name": "variable.parameter.function.language.python"
1211 },
1212 "2": {
1213 "name": "keyword.operator.python"
1214 }
1215 },
1216 "endCaptures": {
1217 "1": {
1218 "name": "punctuation.separator.parameters.python"
1219 }
1220 },
1221 "patterns": [
1222 {
1223 "include": "#expression"
1224 }
1225 ]
1226 },
1227 "generator": {
1228 "comment": "Match \"for ... in\" construct used in generators and for loops to\ncorrectly identify the \"in\" as a control flow keyword.\n",
1229 "begin": "\\bfor\\b",
1230 "beginCaptures": {
1231 "0": {
1232 "name": "keyword.control.flow.python"
1233 }
1234 },
1235 "end": "\\bin\\b",
1236 "endCaptures": {
1237 "0": {
1238 "name": "keyword.control.flow.python"
1239 }
1240 },
1241 "patterns": [
1242 {
1243 "include": "#expression"
1244 }
1245 ]
1246 },
1247 "function-declaration": {
1248 "name": "meta.function.python",
1249 "begin": "(?x)\n \\s*\n (?:\\b(async) \\s+)? \\b(def)\\s+\n (?=\n [[:alpha:]_][[:word:]]* \\s* \\(\n )\n",
1250 "end": "(:|(?=[#'\"\\n]))",
1251 "beginCaptures": {
1252 "1": {
1253 "name": "storage.type.function.async.python"
1254 },
1255 "2": {
1256 "name": "storage.type.function.python"
1257 }
1258 },
1259 "endCaptures": {
1260 "1": {
1261 "name": "punctuation.section.function.begin.python"
1262 }
1263 },
1264 "patterns": [
1265 {
1266 "include": "#function-def-name"
1267 },
1268 {
1269 "include": "#parameters"
1270 },
1271 {
1272 "include": "#line-continuation"
1273 },
1274 {
1275 "include": "#return-annotation"
1276 }
1277 ]
1278 },
1279 "function-def-name": {
1280 "patterns": [
1281 {
1282 "include": "#illegal-object-name"
1283 },
1284 {
1285 "include": "#builtin-possible-callables"
1286 },
1287 {
1288 "name": "entity.name.function.python",
1289 "match": "(?x)\n \\b ([[:alpha:]_]\\w*) \\b\n"
1290 }
1291 ]
1292 },
1293 "parameters": {
1294 "name": "meta.function.parameters.python",
1295 "begin": "(\\()",
1296 "end": "(\\))",
1297 "beginCaptures": {
1298 "1": {
1299 "name": "punctuation.definition.parameters.begin.python"
1300 }
1301 },
1302 "endCaptures": {
1303 "1": {
1304 "name": "punctuation.definition.parameters.end.python"
1305 }
1306 },
1307 "patterns": [
1308 {
1309 "name": "keyword.operator.unpacking.parameter.python",
1310 "match": "(\\*\\*|\\*)"
1311 },
1312 {
1313 "include": "#lambda-incomplete"
1314 },
1315 {
1316 "include": "#illegal-names"
1317 },
1318 {
1319 "include": "#illegal-object-name"
1320 },
1321 {
1322 "include": "#parameter-special"
1323 },
1324 {
1325 "match": "(?x)\n ([[:alpha:]_]\\w*)\n \\s* (?: (,) | (?=[)#\\n=]))\n",
1326 "captures": {
1327 "1": {
1328 "name": "variable.parameter.function.language.python"
1329 },
1330 "2": {
1331 "name": "punctuation.separator.parameters.python"
1332 }
1333 }
1334 },
1335 {
1336 "include": "#comments"
1337 },
1338 {
1339 "include": "#loose-default"
1340 },
1341 {
1342 "include": "#annotated-parameter"
1343 }
1344 ]
1345 },
1346 "parameter-special": {
1347 "match": "(?x)\n \\b ((self)|(cls)) \\b \\s*(?:(,)|(?=\\)))\n",
1348 "captures": {
1349 "1": {
1350 "name": "variable.parameter.function.language.python"
1351 },
1352 "2": {
1353 "name": "variable.parameter.function.language.special.self.python"
1354 },
1355 "3": {
1356 "name": "variable.parameter.function.language.special.cls.python"
1357 },
1358 "4": {
1359 "name": "punctuation.separator.parameters.python"
1360 }
1361 }
1362 },
1363 "loose-default": {
1364 "begin": "(=)",
1365 "end": "(,)|(?=\\))",
1366 "beginCaptures": {
1367 "1": {
1368 "name": "keyword.operator.python"
1369 }
1370 },
1371 "endCaptures": {
1372 "1": {
1373 "name": "punctuation.separator.parameters.python"
1374 }
1375 },
1376 "patterns": [
1377 {
1378 "include": "#expression"
1379 }
1380 ]
1381 },
1382 "annotated-parameter": {
1383 "begin": "(?x)\n \\b\n ([[:alpha:]_]\\w*) \\s* (:)\n",
1384 "end": "(,)|(?=\\))",
1385 "beginCaptures": {
1386 "1": {
1387 "name": "variable.parameter.function.language.python"
1388 },
1389 "2": {
1390 "name": "punctuation.separator.annotation.python"
1391 }
1392 },
1393 "endCaptures": {
1394 "1": {
1395 "name": "punctuation.separator.parameters.python"
1396 }
1397 },
1398 "patterns": [
1399 {
1400 "include": "#expression"
1401 },
1402 {
1403 "name": "keyword.operator.assignment.python",
1404 "match": "=(?!=)"
1405 }
1406 ]
1407 },
1408 "return-annotation": {
1409 "begin": "(->)",
1410 "end": "(?=:)",
1411 "beginCaptures": {
1412 "1": {
1413 "name": "punctuation.separator.annotation.result.python"
1414 }
1415 },
1416 "patterns": [
1417 {
1418 "include": "#expression"
1419 }
1420 ]
1421 },
1422 "item-access": {
1423 "patterns": [
1424 {
1425 "name": "meta.item-access.python",
1426 "begin": "(?x)\n \\b(?=\n [[:alpha:]_]\\w* \\s* \\[\n )\n",
1427 "end": "(\\])",
1428 "endCaptures": {
1429 "1": {
1430 "name": "punctuation.definition.arguments.end.python"
1431 }
1432 },
1433 "patterns": [
1434 {
1435 "include": "#item-name"
1436 },
1437 {
1438 "include": "#item-index"
1439 },
1440 {
1441 "include": "#expression"
1442 }
1443 ]
1444 }
1445 ]
1446 },
1447 "item-name": {
1448 "patterns": [
1449 {
1450 "include": "#special-variables"
1451 },
1452 {
1453 "include": "#builtin-functions"
1454 },
1455 {
1456 "include": "#special-names"
1457 },
1458 {
1459 "name": "meta.indexed-name.python",
1460 "match": "(?x)\n \\b ([[:alpha:]_]\\w*) \\b\n"
1461 }
1462 ]
1463 },
1464 "item-index": {
1465 "begin": "(\\[)",
1466 "end": "(?=\\])",
1467 "beginCaptures": {
1468 "1": {
1469 "name": "punctuation.definition.arguments.begin.python"
1470 }
1471 },
1472 "contentName": "meta.item-access.arguments.python",
1473 "patterns": [
1474 {
1475 "name": "punctuation.separator.slice.python",
1476 "match": ":"
1477 },
1478 {
1479 "include": "#expression"
1480 }
1481 ]
1482 },
1483 "decorator": {
1484 "name": "meta.function.decorator.python",
1485 "begin": "(?x)\n ^\\s*\n ((@)) \\s* (?=[[:alpha:]_]\\w*)\n",
1486 "end": "(?x)\n ( \\) )\n # trailing whitespace and comments are legal\n (?: (.*?) (?=\\s*(?:\\#|$)) )\n | (?=\\n|\\#)\n",
1487 "beginCaptures": {
1488 "1": {
1489 "name": "entity.name.function.decorator.python"
1490 },
1491 "2": {
1492 "name": "punctuation.definition.decorator.python"
1493 }
1494 },
1495 "endCaptures": {
1496 "1": {
1497 "name": "punctuation.definition.arguments.end.python"
1498 },
1499 "2": {
1500 "name": "invalid.illegal.decorator.python"
1501 }
1502 },
1503 "patterns": [
1504 {
1505 "include": "#decorator-name"
1506 },
1507 {
1508 "include": "#function-arguments"
1509 }
1510 ]
1511 },
1512 "decorator-name": {
1513 "patterns": [
1514 {
1515 "include": "#builtin-callables"
1516 },
1517 {
1518 "include": "#illegal-object-name"
1519 },
1520 {
1521 "name": "entity.name.function.decorator.python",
1522 "match": "(?x)\n ([[:alpha:]_]\\w*) | (\\.)\n",
1523 "captures": {
1524 "2": {
1525 "name": "punctuation.separator.period.python"
1526 }
1527 }
1528 },
1529 {
1530 "include": "#line-continuation"
1531 },
1532 {
1533 "name": "invalid.illegal.decorator.python",
1534 "match": "(?x)\n \\s* ([^([:alpha:]\\s_\\.#\\\\] .*?) (?=\\#|$)\n",
1535 "captures": {
1536 "1": {
1537 "name": "invalid.illegal.decorator.python"
1538 }
1539 }
1540 }
1541 ]
1542 },
1543 "call-wrapper-inheritance": {
1544 "comment": "same as a function call, but in inheritance context",
1545 "name": "meta.function-call.python",
1546 "begin": "(?x)\n \\b(?=\n ([[:alpha:]_]\\w*) \\s* (\\()\n )\n",
1547 "end": "(\\))",
1548 "endCaptures": {
1549 "1": {
1550 "name": "punctuation.definition.arguments.end.python"
1551 }
1552 },
1553 "patterns": [
1554 {
1555 "include": "#inheritance-name"
1556 },
1557 {
1558 "include": "#function-arguments"
1559 }
1560 ]
1561 },
1562 "inheritance-name": {
1563 "patterns": [
1564 {
1565 "include": "#lambda-incomplete"
1566 },
1567 {
1568 "include": "#builtin-possible-callables"
1569 },
1570 {
1571 "include": "#inheritance-identifier"
1572 }
1573 ]
1574 },
1575 "function-call": {
1576 "name": "meta.function-call.python",
1577 "comment": "Regular function call of the type \"name(args)\"",
1578 "begin": "(?x)\n \\b(?=\n ([[:alpha:]_]\\w*) \\s* (\\()\n )\n",
1579 "end": "(\\))",
1580 "endCaptures": {
1581 "1": {
1582 "name": "punctuation.definition.arguments.end.python"
1583 }
1584 },
1585 "patterns": [
1586 {
1587 "include": "#special-variables"
1588 },
1589 {
1590 "include": "#function-name"
1591 },
1592 {
1593 "include": "#function-arguments"
1594 }
1595 ]
1596 },
1597 "function-name": {
1598 "patterns": [
1599 {
1600 "include": "#builtin-possible-callables"
1601 },
1602 {
1603 "comment": "Some color schemas support meta.function-call.generic scope",
1604 "name": "meta.function-call.generic.python",
1605 "match": "(?x)\n \\b ([[:alpha:]_]\\w*) \\b\n"
1606 }
1607 ]
1608 },
1609 "function-arguments": {
1610 "begin": "(\\()",
1611 "end": "(?=\\))(?!\\)\\s*\\()",
1612 "beginCaptures": {
1613 "1": {
1614 "name": "punctuation.definition.arguments.begin.python"
1615 }
1616 },
1617 "contentName": "meta.function-call.arguments.python",
1618 "patterns": [
1619 {
1620 "name": "punctuation.separator.arguments.python",
1621 "match": "(,)"
1622 },
1623 {
1624 "match": "(?x)\n (?:(?<=[,(])|^) \\s* (\\*{1,2})\n",
1625 "captures": {
1626 "1": {
1627 "name": "keyword.operator.unpacking.arguments.python"
1628 }
1629 }
1630 },
1631 {
1632 "include": "#lambda-incomplete"
1633 },
1634 {
1635 "include": "#illegal-names"
1636 },
1637 {
1638 "match": "\\b([[:alpha:]_]\\w*)\\s*(=)(?!=)",
1639 "captures": {
1640 "1": {
1641 "name": "variable.parameter.function-call.python"
1642 },
1643 "2": {
1644 "name": "keyword.operator.assignment.python"
1645 }
1646 }
1647 },
1648 {
1649 "name": "keyword.operator.assignment.python",
1650 "match": "=(?!=)"
1651 },
1652 {
1653 "include": "#expression"
1654 },
1655 {
1656 "match": "\\s*(\\))\\s*(\\()",
1657 "captures": {
1658 "1": {
1659 "name": "punctuation.definition.arguments.end.python"
1660 },
1661 "2": {
1662 "name": "punctuation.definition.arguments.begin.python"
1663 }
1664 }
1665 }
1666 ]
1667 },
1668 "builtin-callables": {
1669 "patterns": [
1670 {
1671 "include": "#illegal-names"
1672 },
1673 {
1674 "include": "#illegal-object-name"
1675 },
1676 {
1677 "include": "#builtin-exceptions"
1678 },
1679 {
1680 "include": "#builtin-functions"
1681 },
1682 {
1683 "include": "#builtin-types"
1684 }
1685 ]
1686 },
1687 "builtin-possible-callables": {
1688 "patterns": [
1689 {
1690 "include": "#builtin-callables"
1691 },
1692 {
1693 "include": "#magic-names"
1694 }
1695 ]
1696 },
1697 "builtin-exceptions": {
1698 "name": "support.type.exception.python",
1699 "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 | ModuleNotFound\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"
1700 },
1701 "builtin-functions": {
1702 "patterns": [
1703 {
1704 "name": "support.function.builtin.python",
1705 "match": "(?x)\n (?<!\\.) \\b(\n __import__ | abs | all | any | ascii | bin | breakpoint | 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"
1706 },
1707 {
1708 "name": "variable.legacy.builtin.python",
1709 "match": "(?x)\n (?<!\\.) \\b(\n file | reduce | intern | raw_input | unicode | cmp | basestring\n | execfile | long | xrange\n )\\b\n"
1710 }
1711 ]
1712 },
1713 "builtin-types": {
1714 "name": "support.type.python",
1715 "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"
1716 },
1717 "magic-function-names": {
1718 "comment": "these methods have magic interpretation by python and are generally called\nindirectly through syntactic constructs\n",
1719 "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 | matmul | rmatmul | imatmul\n | init_subclass | set_name | fspath | bytes | prepare\n )__\n )\\b\n",
1720 "captures": {
1721 "1": {
1722 "name": "support.function.magic.python"
1723 }
1724 }
1725 },
1726 "magic-variable-names": {
1727 "comment": "magic variables which a class/module may have.",
1728 "match": "(?x)\n \\b(\n __(?:\n all | bases | builtins | class | class_getitem | code | debug\n | defaults | dict | doc | file | func | kwdefaults | members\n | metaclass | methods | module | mro | mro_entries | name\n | qualname | post_init | self | signature | slots | subclasses\n | version | weakref | wrapped | annotations | classcell\n | spec | path | package | future | traceback\n )__\n )\\b\n",
1729 "captures": {
1730 "1": {
1731 "name": "support.variable.magic.python"
1732 }
1733 }
1734 },
1735 "magic-names": {
1736 "patterns": [
1737 {
1738 "include": "#magic-function-names"
1739 },
1740 {
1741 "include": "#magic-variable-names"
1742 }
1743 ]
1744 },
1745 "illegal-names": {
1746 "match": "(?x)\n \\b(?:\n (\n and | assert | async | await | break | class | continue | def\n | del | elif | else | except | finally | for | from | global\n | if | in | is | (?<=\\.)lambda | lambda(?=\\s*[\\.=])\n | nonlocal | not | or | pass | raise | return | try | while | with\n | yield\n ) | (\n as | import\n )\n )\\b\n",
1747 "captures": {
1748 "1": {
1749 "name": "keyword.control.flow.python"
1750 },
1751 "2": {
1752 "name": "keyword.control.import.python"
1753 }
1754 }
1755 },
1756 "special-variables": {
1757 "match": "(?x)\n \\b (?<!\\.) (?:\n (self) | (cls)\n )\\b\n",
1758 "captures": {
1759 "1": {
1760 "name": "variable.language.special.self.python"
1761 },
1762 "2": {
1763 "name": "variable.language.special.cls.python"
1764 }
1765 }
1766 },
1767 "ellipsis": {
1768 "name": "constant.other.ellipsis.python",
1769 "match": "\\.\\.\\."
1770 },
1771 "backticks": {
1772 "name": "invalid.deprecated.backtick.python",
1773 "begin": "\\`",
1774 "end": "(?:\\`|(?<!\\\\)(\\n))",
1775 "patterns": [
1776 {
1777 "include": "#expression"
1778 }
1779 ]
1780 },
1781 "illegal-operator": {
1782 "patterns": [
1783 {
1784 "name": "invalid.illegal.operator.python",
1785 "match": "&&|\\|\\||--|\\+\\+"
1786 },
1787 {
1788 "name": "invalid.illegal.operator.python",
1789 "match": "[?$]"
1790 },
1791 {
1792 "name": "invalid.illegal.operator.python",
1793 "comment": "We don't want `!` to flash when we're typing `!=`",
1794 "match": "!\\b"
1795 }
1796 ]
1797 },
1798 "illegal-object-name": {
1799 "comment": "It's illegal to name class or function \"True\"",
1800 "name": "keyword.illegal.name.python",
1801 "match": "\\b(True|False|None)\\b"
1802 },
1803 "illegal-anno": {
1804 "name": "invalid.illegal.annotation.python",
1805 "match": "->"
1806 },
1807 "regexp-base-expression": {
1808 "patterns": [
1809 {
1810 "include": "#regexp-quantifier"
1811 },
1812 {
1813 "include": "#regexp-base-common"
1814 }
1815 ]
1816 },
1817 "fregexp-base-expression": {
1818 "patterns": [
1819 {
1820 "include": "#fregexp-quantifier"
1821 },
1822 {
1823 "include": "#fstring-formatting-braces"
1824 },
1825 {
1826 "match": "\\{.*?\\}"
1827 },
1828 {
1829 "include": "#regexp-base-common"
1830 }
1831 ]
1832 },
1833 "fstring-formatting-braces": {
1834 "patterns": [
1835 {
1836 "comment": "empty braces are illegal",
1837 "match": "({)(\\s*?)(})",
1838 "captures": {
1839 "1": {
1840 "name": "constant.character.format.placeholder.other.python"
1841 },
1842 "2": {
1843 "name": "invalid.illegal.brace.python"
1844 },
1845 "3": {
1846 "name": "constant.character.format.placeholder.other.python"
1847 }
1848 }
1849 },
1850 {
1851 "name": "constant.character.escape.python",
1852 "match": "({{|}})"
1853 }
1854 ]
1855 },
1856 "regexp-base-common": {
1857 "patterns": [
1858 {
1859 "name": "support.other.match.any.regexp",
1860 "match": "\\."
1861 },
1862 {
1863 "name": "support.other.match.begin.regexp",
1864 "match": "\\^"
1865 },
1866 {
1867 "name": "support.other.match.end.regexp",
1868 "match": "\\$"
1869 },
1870 {
1871 "name": "keyword.operator.quantifier.regexp",
1872 "match": "[+*?]\\??"
1873 },
1874 {
1875 "name": "keyword.operator.disjunction.regexp",
1876 "match": "\\|"
1877 },
1878 {
1879 "include": "#regexp-escape-sequence"
1880 }
1881 ]
1882 },
1883 "regexp-quantifier": {
1884 "name": "keyword.operator.quantifier.regexp",
1885 "match": "(?x)\n \\{(\n \\d+ | \\d+,(\\d+)? | ,\\d+\n )\\}\n"
1886 },
1887 "fregexp-quantifier": {
1888 "name": "keyword.operator.quantifier.regexp",
1889 "match": "(?x)\n \\{\\{(\n \\d+ | \\d+,(\\d+)? | ,\\d+\n )\\}\\}\n"
1890 },
1891 "regexp-backreference-number": {
1892 "name": "meta.backreference.regexp",
1893 "match": "(\\\\[1-9]\\d?)",
1894 "captures": {
1895 "1": {
1896 "name": "entity.name.tag.backreference.regexp"
1897 }
1898 }
1899 },
1900 "regexp-backreference": {
1901 "name": "meta.backreference.named.regexp",
1902 "match": "(?x)\n (\\() (\\?P= \\w+(?:\\s+[[:alnum:]]+)?) (\\))\n",
1903 "captures": {
1904 "1": {
1905 "name": "support.other.parenthesis.regexp punctuation.parenthesis.backreference.named.begin.regexp"
1906 },
1907 "2": {
1908 "name": "entity.name.tag.named.backreference.regexp"
1909 },
1910 "3": {
1911 "name": "support.other.parenthesis.regexp punctuation.parenthesis.backreference.named.end.regexp"
1912 }
1913 }
1914 },
1915 "regexp-flags": {
1916 "name": "storage.modifier.flag.regexp",
1917 "match": "\\(\\?[aiLmsux]+\\)"
1918 },
1919 "regexp-escape-special": {
1920 "name": "support.other.escape.special.regexp",
1921 "match": "\\\\([AbBdDsSwWZ])"
1922 },
1923 "regexp-escape-character": {
1924 "name": "constant.character.escape.regexp",
1925 "match": "(?x)\n \\\\ (\n x[0-9A-Fa-f]{2}\n | 0[0-7]{1,2}\n | [0-7]{3}\n )\n"
1926 },
1927 "regexp-escape-unicode": {
1928 "name": "constant.character.unicode.regexp",
1929 "match": "(?x)\n \\\\ (\n u[0-9A-Fa-f]{4}\n | U[0-9A-Fa-f]{8}\n )\n"
1930 },
1931 "regexp-escape-catchall": {
1932 "name": "constant.character.escape.regexp",
1933 "match": "\\\\(.|\\n)"
1934 },
1935 "regexp-escape-sequence": {
1936 "patterns": [
1937 {
1938 "include": "#regexp-escape-special"
1939 },
1940 {
1941 "include": "#regexp-escape-character"
1942 },
1943 {
1944 "include": "#regexp-escape-unicode"
1945 },
1946 {
1947 "include": "#regexp-backreference-number"
1948 },
1949 {
1950 "include": "#regexp-escape-catchall"
1951 }
1952 ]
1953 },
1954 "regexp-charecter-set-escapes": {
1955 "patterns": [
1956 {
1957 "name": "constant.character.escape.regexp",
1958 "match": "\\\\[abfnrtv\\\\]"
1959 },
1960 {
1961 "include": "#regexp-escape-special"
1962 },
1963 {
1964 "name": "constant.character.escape.regexp",
1965 "match": "\\\\([0-7]{1,3})"
1966 },
1967 {
1968 "include": "#regexp-escape-character"
1969 },
1970 {
1971 "include": "#regexp-escape-unicode"
1972 },
1973 {
1974 "include": "#regexp-escape-catchall"
1975 }
1976 ]
1977 },
1978 "codetags": {
1979 "match": "(?:\\b(NOTE|XXX|HACK|FIXME|BUG|TODO)\\b)",
1980 "captures": {
1981 "1": {
1982 "name": "keyword.codetag.notation.python"
1983 }
1984 }
1985 },
1986 "comments-base": {
1987 "name": "comment.line.number-sign.python",
1988 "begin": "(\\#)",
1989 "beginCaptures": {
1990 "1": {
1991 "name": "punctuation.definition.comment.python"
1992 }
1993 },
1994 "end": "($)",
1995 "patterns": [
1996 {
1997 "include": "#codetags"
1998 }
1999 ]
2000 },
2001 "comments-string-single-three": {
2002 "name": "comment.line.number-sign.python",
2003 "begin": "(\\#)",
2004 "beginCaptures": {
2005 "1": {
2006 "name": "punctuation.definition.comment.python"
2007 }
2008 },
2009 "end": "($|(?='''))",
2010 "patterns": [
2011 {
2012 "include": "#codetags"
2013 }
2014 ]
2015 },
2016 "comments-string-double-three": {
2017 "name": "comment.line.number-sign.python",
2018 "begin": "(\\#)",
2019 "beginCaptures": {
2020 "1": {
2021 "name": "punctuation.definition.comment.python"
2022 }
2023 },
2024 "end": "($|(?=\"\"\"))",
2025 "patterns": [
2026 {
2027 "include": "#codetags"
2028 }
2029 ]
2030 },
2031 "single-one-regexp-expression": {
2032 "patterns": [
2033 {
2034 "include": "#regexp-base-expression"
2035 },
2036 {
2037 "include": "#single-one-regexp-character-set"
2038 },
2039 {
2040 "include": "#single-one-regexp-comments"
2041 },
2042 {
2043 "include": "#regexp-flags"
2044 },
2045 {
2046 "include": "#single-one-regexp-named-group"
2047 },
2048 {
2049 "include": "#regexp-backreference"
2050 },
2051 {
2052 "include": "#single-one-regexp-lookahead"
2053 },
2054 {
2055 "include": "#single-one-regexp-lookahead-negative"
2056 },
2057 {
2058 "include": "#single-one-regexp-lookbehind"
2059 },
2060 {
2061 "include": "#single-one-regexp-lookbehind-negative"
2062 },
2063 {
2064 "include": "#single-one-regexp-conditional"
2065 },
2066 {
2067 "include": "#single-one-regexp-parentheses-non-capturing"
2068 },
2069 {
2070 "include": "#single-one-regexp-parentheses"
2071 }
2072 ]
2073 },
2074 "single-one-regexp-character-set": {
2075 "patterns": [
2076 {
2077 "match": "(?x)\n \\[ \\^? \\] (?! .*?\\])\n"
2078 },
2079 {
2080 "name": "meta.character.set.regexp",
2081 "begin": "(\\[)(\\^)?(\\])?",
2082 "end": "(\\]|(?=\\'))|((?=(?<!\\\\)\\n))",
2083 "beginCaptures": {
2084 "1": {
2085 "name": "punctuation.character.set.begin.regexp constant.other.set.regexp"
2086 },
2087 "2": {
2088 "name": "keyword.operator.negation.regexp"
2089 },
2090 "3": {
2091 "name": "constant.character.set.regexp"
2092 }
2093 },
2094 "endCaptures": {
2095 "1": {
2096 "name": "punctuation.character.set.end.regexp constant.other.set.regexp"
2097 },
2098 "2": {
2099 "name": "invalid.illegal.newline.python"
2100 }
2101 },
2102 "patterns": [
2103 {
2104 "include": "#regexp-charecter-set-escapes"
2105 },
2106 {
2107 "name": "constant.character.set.regexp",
2108 "match": "[^\\n]"
2109 }
2110 ]
2111 }
2112 ]
2113 },
2114 "single-one-regexp-named-group": {
2115 "name": "meta.named.regexp",
2116 "begin": "(?x)\n (\\() (\\?P <\\w+(?:\\s+[[:alnum:]]+)?>)\n",
2117 "end": "(\\)|(?=\\'))|((?=(?<!\\\\)\\n))",
2118 "beginCaptures": {
2119 "1": {
2120 "name": "support.other.parenthesis.regexp punctuation.parenthesis.named.begin.regexp"
2121 },
2122 "2": {
2123 "name": "entity.name.tag.named.group.regexp"
2124 }
2125 },
2126 "endCaptures": {
2127 "1": {
2128 "name": "support.other.parenthesis.regexp punctuation.parenthesis.named.end.regexp"
2129 },
2130 "2": {
2131 "name": "invalid.illegal.newline.python"
2132 }
2133 },
2134 "patterns": [
2135 {
2136 "include": "#single-one-regexp-expression"
2137 }
2138 ]
2139 },
2140 "single-one-regexp-comments": {
2141 "name": "comment.regexp",
2142 "begin": "\\(\\?#",
2143 "end": "(\\)|(?=\\'))|((?=(?<!\\\\)\\n))",
2144 "beginCaptures": {
2145 "0": {
2146 "name": "punctuation.comment.begin.regexp"
2147 }
2148 },
2149 "endCaptures": {
2150 "1": {
2151 "name": "punctuation.comment.end.regexp"
2152 },
2153 "2": {
2154 "name": "invalid.illegal.newline.python"
2155 }
2156 },
2157 "patterns": [
2158 {
2159 "include": "#codetags"
2160 }
2161 ]
2162 },
2163 "single-one-regexp-lookahead": {
2164 "begin": "(\\()\\?=",
2165 "end": "(\\)|(?=\\'))|((?=(?<!\\\\)\\n))",
2166 "beginCaptures": {
2167 "0": {
2168 "name": "keyword.operator.lookahead.regexp"
2169 },
2170 "1": {
2171 "name": "punctuation.parenthesis.lookahead.begin.regexp"
2172 }
2173 },
2174 "endCaptures": {
2175 "1": {
2176 "name": "keyword.operator.lookahead.regexp punctuation.parenthesis.lookahead.end.regexp"
2177 },
2178 "2": {
2179 "name": "invalid.illegal.newline.python"
2180 }
2181 },
2182 "patterns": [
2183 {
2184 "include": "#single-one-regexp-expression"
2185 }
2186 ]
2187 },
2188 "single-one-regexp-lookahead-negative": {
2189 "begin": "(\\()\\?!",
2190 "end": "(\\)|(?=\\'))|((?=(?<!\\\\)\\n))",
2191 "beginCaptures": {
2192 "0": {
2193 "name": "keyword.operator.lookahead.negative.regexp"
2194 },
2195 "1": {
2196 "name": "punctuation.parenthesis.lookahead.begin.regexp"
2197 }
2198 },
2199 "endCaptures": {
2200 "1": {
2201 "name": "keyword.operator.lookahead.negative.regexp punctuation.parenthesis.lookahead.end.regexp"
2202 },
2203 "2": {
2204 "name": "invalid.illegal.newline.python"
2205 }
2206 },
2207 "patterns": [
2208 {
2209 "include": "#single-one-regexp-expression"
2210 }
2211 ]
2212 },
2213 "single-one-regexp-lookbehind": {
2214 "begin": "(\\()\\?<=",
2215 "end": "(\\)|(?=\\'))|((?=(?<!\\\\)\\n))",
2216 "beginCaptures": {
2217 "0": {
2218 "name": "keyword.operator.lookbehind.regexp"
2219 },
2220 "1": {
2221 "name": "punctuation.parenthesis.lookbehind.begin.regexp"
2222 }
2223 },
2224 "endCaptures": {
2225 "1": {
2226 "name": "keyword.operator.lookbehind.regexp punctuation.parenthesis.lookbehind.end.regexp"
2227 },
2228 "2": {
2229 "name": "invalid.illegal.newline.python"
2230 }
2231 },
2232 "patterns": [
2233 {
2234 "include": "#single-one-regexp-expression"
2235 }
2236 ]
2237 },
2238 "single-one-regexp-lookbehind-negative": {
2239 "begin": "(\\()\\?<!",
2240 "end": "(\\)|(?=\\'))|((?=(?<!\\\\)\\n))",
2241 "beginCaptures": {
2242 "0": {
2243 "name": "keyword.operator.lookbehind.negative.regexp"
2244 },
2245 "1": {
2246 "name": "punctuation.parenthesis.lookbehind.begin.regexp"
2247 }
2248 },
2249 "endCaptures": {
2250 "1": {
2251 "name": "keyword.operator.lookbehind.negative.regexp punctuation.parenthesis.lookbehind.end.regexp"
2252 },
2253 "2": {
2254 "name": "invalid.illegal.newline.python"
2255 }
2256 },
2257 "patterns": [
2258 {
2259 "include": "#single-one-regexp-expression"
2260 }
2261 ]
2262 },
2263 "single-one-regexp-conditional": {
2264 "begin": "(\\()\\?\\((\\w+(?:\\s+[[:alnum:]]+)?|\\d+)\\)",
2265 "end": "(\\)|(?=\\'))|((?=(?<!\\\\)\\n))",
2266 "beginCaptures": {
2267 "0": {
2268 "name": "keyword.operator.conditional.regexp"
2269 },
2270 "1": {
2271 "name": "punctuation.parenthesis.conditional.begin.regexp"
2272 }
2273 },
2274 "endCaptures": {
2275 "1": {
2276 "name": "keyword.operator.conditional.negative.regexp punctuation.parenthesis.conditional.end.regexp"
2277 },
2278 "2": {
2279 "name": "invalid.illegal.newline.python"
2280 }
2281 },
2282 "patterns": [
2283 {
2284 "include": "#single-one-regexp-expression"
2285 }
2286 ]
2287 },
2288 "single-one-regexp-parentheses-non-capturing": {
2289 "begin": "\\(\\?:",
2290 "end": "(\\)|(?=\\'))|((?=(?<!\\\\)\\n))",
2291 "beginCaptures": {
2292 "0": {
2293 "name": "support.other.parenthesis.regexp punctuation.parenthesis.non-capturing.begin.regexp"
2294 }
2295 },
2296 "endCaptures": {
2297 "1": {
2298 "name": "support.other.parenthesis.regexp punctuation.parenthesis.non-capturing.end.regexp"
2299 },
2300 "2": {
2301 "name": "invalid.illegal.newline.python"
2302 }
2303 },
2304 "patterns": [
2305 {
2306 "include": "#single-one-regexp-expression"
2307 }
2308 ]
2309 },
2310 "single-one-regexp-parentheses": {
2311 "begin": "\\(",
2312 "end": "(\\)|(?=\\'))|((?=(?<!\\\\)\\n))",
2313 "beginCaptures": {
2314 "0": {
2315 "name": "support.other.parenthesis.regexp punctuation.parenthesis.begin.regexp"
2316 }
2317 },
2318 "endCaptures": {
2319 "1": {
2320 "name": "support.other.parenthesis.regexp punctuation.parenthesis.end.regexp"
2321 },
2322 "2": {
2323 "name": "invalid.illegal.newline.python"
2324 }
2325 },
2326 "patterns": [
2327 {
2328 "include": "#single-one-regexp-expression"
2329 }
2330 ]
2331 },
2332 "single-three-regexp-expression": {
2333 "patterns": [
2334 {
2335 "include": "#regexp-base-expression"
2336 },
2337 {
2338 "include": "#single-three-regexp-character-set"
2339 },
2340 {
2341 "include": "#single-three-regexp-comments"
2342 },
2343 {
2344 "include": "#regexp-flags"
2345 },
2346 {
2347 "include": "#single-three-regexp-named-group"
2348 },
2349 {
2350 "include": "#regexp-backreference"
2351 },
2352 {
2353 "include": "#single-three-regexp-lookahead"
2354 },
2355 {
2356 "include": "#single-three-regexp-lookahead-negative"
2357 },
2358 {
2359 "include": "#single-three-regexp-lookbehind"
2360 },
2361 {
2362 "include": "#single-three-regexp-lookbehind-negative"
2363 },
2364 {
2365 "include": "#single-three-regexp-conditional"
2366 },
2367 {
2368 "include": "#single-three-regexp-parentheses-non-capturing"
2369 },
2370 {
2371 "include": "#single-three-regexp-parentheses"
2372 },
2373 {
2374 "include": "#comments-string-single-three"
2375 }
2376 ]
2377 },
2378 "single-three-regexp-character-set": {
2379 "patterns": [
2380 {
2381 "match": "(?x)\n \\[ \\^? \\] (?! .*?\\])\n"
2382 },
2383 {
2384 "name": "meta.character.set.regexp",
2385 "begin": "(\\[)(\\^)?(\\])?",
2386 "end": "(\\]|(?=\\'\\'\\'))",
2387 "beginCaptures": {
2388 "1": {
2389 "name": "punctuation.character.set.begin.regexp constant.other.set.regexp"
2390 },
2391 "2": {
2392 "name": "keyword.operator.negation.regexp"
2393 },
2394 "3": {
2395 "name": "constant.character.set.regexp"
2396 }
2397 },
2398 "endCaptures": {
2399 "1": {
2400 "name": "punctuation.character.set.end.regexp constant.other.set.regexp"
2401 },
2402 "2": {
2403 "name": "invalid.illegal.newline.python"
2404 }
2405 },
2406 "patterns": [
2407 {
2408 "include": "#regexp-charecter-set-escapes"
2409 },
2410 {
2411 "name": "constant.character.set.regexp",
2412 "match": "[^\\n]"
2413 }
2414 ]
2415 }
2416 ]
2417 },
2418 "single-three-regexp-named-group": {
2419 "name": "meta.named.regexp",
2420 "begin": "(?x)\n (\\() (\\?P <\\w+(?:\\s+[[:alnum:]]+)?>)\n",
2421 "end": "(\\)|(?=\\'\\'\\'))",
2422 "beginCaptures": {
2423 "1": {
2424 "name": "support.other.parenthesis.regexp punctuation.parenthesis.named.begin.regexp"
2425 },
2426 "2": {
2427 "name": "entity.name.tag.named.group.regexp"
2428 }
2429 },
2430 "endCaptures": {
2431 "1": {
2432 "name": "support.other.parenthesis.regexp punctuation.parenthesis.named.end.regexp"
2433 },
2434 "2": {
2435 "name": "invalid.illegal.newline.python"
2436 }
2437 },
2438 "patterns": [
2439 {
2440 "include": "#single-three-regexp-expression"
2441 },
2442 {
2443 "include": "#comments-string-single-three"
2444 }
2445 ]
2446 },
2447 "single-three-regexp-comments": {
2448 "name": "comment.regexp",
2449 "begin": "\\(\\?#",
2450 "end": "(\\)|(?=\\'\\'\\'))",
2451 "beginCaptures": {
2452 "0": {
2453 "name": "punctuation.comment.begin.regexp"
2454 }
2455 },
2456 "endCaptures": {
2457 "1": {
2458 "name": "punctuation.comment.end.regexp"
2459 },
2460 "2": {
2461 "name": "invalid.illegal.newline.python"
2462 }
2463 },
2464 "patterns": [
2465 {
2466 "include": "#codetags"
2467 }
2468 ]
2469 },
2470 "single-three-regexp-lookahead": {
2471 "begin": "(\\()\\?=",
2472 "end": "(\\)|(?=\\'\\'\\'))",
2473 "beginCaptures": {
2474 "0": {
2475 "name": "keyword.operator.lookahead.regexp"
2476 },
2477 "1": {
2478 "name": "punctuation.parenthesis.lookahead.begin.regexp"
2479 }
2480 },
2481 "endCaptures": {
2482 "1": {
2483 "name": "keyword.operator.lookahead.regexp punctuation.parenthesis.lookahead.end.regexp"
2484 },
2485 "2": {
2486 "name": "invalid.illegal.newline.python"
2487 }
2488 },
2489 "patterns": [
2490 {
2491 "include": "#single-three-regexp-expression"
2492 },
2493 {
2494 "include": "#comments-string-single-three"
2495 }
2496 ]
2497 },
2498 "single-three-regexp-lookahead-negative": {
2499 "begin": "(\\()\\?!",
2500 "end": "(\\)|(?=\\'\\'\\'))",
2501 "beginCaptures": {
2502 "0": {
2503 "name": "keyword.operator.lookahead.negative.regexp"
2504 },
2505 "1": {
2506 "name": "punctuation.parenthesis.lookahead.begin.regexp"
2507 }
2508 },
2509 "endCaptures": {
2510 "1": {
2511 "name": "keyword.operator.lookahead.negative.regexp punctuation.parenthesis.lookahead.end.regexp"
2512 },
2513 "2": {
2514 "name": "invalid.illegal.newline.python"
2515 }
2516 },
2517 "patterns": [
2518 {
2519 "include": "#single-three-regexp-expression"
2520 },
2521 {
2522 "include": "#comments-string-single-three"
2523 }
2524 ]
2525 },
2526 "single-three-regexp-lookbehind": {
2527 "begin": "(\\()\\?<=",
2528 "end": "(\\)|(?=\\'\\'\\'))",
2529 "beginCaptures": {
2530 "0": {
2531 "name": "keyword.operator.lookbehind.regexp"
2532 },
2533 "1": {
2534 "name": "punctuation.parenthesis.lookbehind.begin.regexp"
2535 }
2536 },
2537 "endCaptures": {
2538 "1": {
2539 "name": "keyword.operator.lookbehind.regexp punctuation.parenthesis.lookbehind.end.regexp"
2540 },
2541 "2": {
2542 "name": "invalid.illegal.newline.python"
2543 }
2544 },
2545 "patterns": [
2546 {
2547 "include": "#single-three-regexp-expression"
2548 },
2549 {
2550 "include": "#comments-string-single-three"
2551 }
2552 ]
2553 },
2554 "single-three-regexp-lookbehind-negative": {
2555 "begin": "(\\()\\?<!",
2556 "end": "(\\)|(?=\\'\\'\\'))",
2557 "beginCaptures": {
2558 "0": {
2559 "name": "keyword.operator.lookbehind.negative.regexp"
2560 },
2561 "1": {
2562 "name": "punctuation.parenthesis.lookbehind.begin.regexp"
2563 }
2564 },
2565 "endCaptures": {
2566 "1": {
2567 "name": "keyword.operator.lookbehind.negative.regexp punctuation.parenthesis.lookbehind.end.regexp"
2568 },
2569 "2": {
2570 "name": "invalid.illegal.newline.python"
2571 }
2572 },
2573 "patterns": [
2574 {
2575 "include": "#single-three-regexp-expression"
2576 },
2577 {
2578 "include": "#comments-string-single-three"
2579 }
2580 ]
2581 },
2582 "single-three-regexp-conditional": {
2583 "begin": "(\\()\\?\\((\\w+(?:\\s+[[:alnum:]]+)?|\\d+)\\)",
2584 "end": "(\\)|(?=\\'\\'\\'))",
2585 "beginCaptures": {
2586 "0": {
2587 "name": "keyword.operator.conditional.regexp"
2588 },
2589 "1": {
2590 "name": "punctuation.parenthesis.conditional.begin.regexp"
2591 }
2592 },
2593 "endCaptures": {
2594 "1": {
2595 "name": "keyword.operator.conditional.negative.regexp punctuation.parenthesis.conditional.end.regexp"
2596 },
2597 "2": {
2598 "name": "invalid.illegal.newline.python"
2599 }
2600 },
2601 "patterns": [
2602 {
2603 "include": "#single-three-regexp-expression"
2604 },
2605 {
2606 "include": "#comments-string-single-three"
2607 }
2608 ]
2609 },
2610 "single-three-regexp-parentheses-non-capturing": {
2611 "begin": "\\(\\?:",
2612 "end": "(\\)|(?=\\'\\'\\'))",
2613 "beginCaptures": {
2614 "0": {
2615 "name": "support.other.parenthesis.regexp punctuation.parenthesis.non-capturing.begin.regexp"
2616 }
2617 },
2618 "endCaptures": {
2619 "1": {
2620 "name": "support.other.parenthesis.regexp punctuation.parenthesis.non-capturing.end.regexp"
2621 },
2622 "2": {
2623 "name": "invalid.illegal.newline.python"
2624 }
2625 },
2626 "patterns": [
2627 {
2628 "include": "#single-three-regexp-expression"
2629 },
2630 {
2631 "include": "#comments-string-single-three"
2632 }
2633 ]
2634 },
2635 "single-three-regexp-parentheses": {
2636 "begin": "\\(",
2637 "end": "(\\)|(?=\\'\\'\\'))",
2638 "beginCaptures": {
2639 "0": {
2640 "name": "support.other.parenthesis.regexp punctuation.parenthesis.begin.regexp"
2641 }
2642 },
2643 "endCaptures": {
2644 "1": {
2645 "name": "support.other.parenthesis.regexp punctuation.parenthesis.end.regexp"
2646 },
2647 "2": {
2648 "name": "invalid.illegal.newline.python"
2649 }
2650 },
2651 "patterns": [
2652 {
2653 "include": "#single-three-regexp-expression"
2654 },
2655 {
2656 "include": "#comments-string-single-three"
2657 }
2658 ]
2659 },
2660 "double-one-regexp-expression": {
2661 "patterns": [
2662 {
2663 "include": "#regexp-base-expression"
2664 },
2665 {
2666 "include": "#double-one-regexp-character-set"
2667 },
2668 {
2669 "include": "#double-one-regexp-comments"
2670 },
2671 {
2672 "include": "#regexp-flags"
2673 },
2674 {
2675 "include": "#double-one-regexp-named-group"
2676 },
2677 {
2678 "include": "#regexp-backreference"
2679 },
2680 {
2681 "include": "#double-one-regexp-lookahead"
2682 },
2683 {
2684 "include": "#double-one-regexp-lookahead-negative"
2685 },
2686 {
2687 "include": "#double-one-regexp-lookbehind"
2688 },
2689 {
2690 "include": "#double-one-regexp-lookbehind-negative"
2691 },
2692 {
2693 "include": "#double-one-regexp-conditional"
2694 },
2695 {
2696 "include": "#double-one-regexp-parentheses-non-capturing"
2697 },
2698 {
2699 "include": "#double-one-regexp-parentheses"
2700 }
2701 ]
2702 },
2703 "double-one-regexp-character-set": {
2704 "patterns": [
2705 {
2706 "match": "(?x)\n \\[ \\^? \\] (?! .*?\\])\n"
2707 },
2708 {
2709 "name": "meta.character.set.regexp",
2710 "begin": "(\\[)(\\^)?(\\])?",
2711 "end": "(\\]|(?=\"))|((?=(?<!\\\\)\\n))",
2712 "beginCaptures": {
2713 "1": {
2714 "name": "punctuation.character.set.begin.regexp constant.other.set.regexp"
2715 },
2716 "2": {
2717 "name": "keyword.operator.negation.regexp"
2718 },
2719 "3": {
2720 "name": "constant.character.set.regexp"
2721 }
2722 },
2723 "endCaptures": {
2724 "1": {
2725 "name": "punctuation.character.set.end.regexp constant.other.set.regexp"
2726 },
2727 "2": {
2728 "name": "invalid.illegal.newline.python"
2729 }
2730 },
2731 "patterns": [
2732 {
2733 "include": "#regexp-charecter-set-escapes"
2734 },
2735 {
2736 "name": "constant.character.set.regexp",
2737 "match": "[^\\n]"
2738 }
2739 ]
2740 }
2741 ]
2742 },
2743 "double-one-regexp-named-group": {
2744 "name": "meta.named.regexp",
2745 "begin": "(?x)\n (\\() (\\?P <\\w+(?:\\s+[[:alnum:]]+)?>)\n",
2746 "end": "(\\)|(?=\"))|((?=(?<!\\\\)\\n))",
2747 "beginCaptures": {
2748 "1": {
2749 "name": "support.other.parenthesis.regexp punctuation.parenthesis.named.begin.regexp"
2750 },
2751 "2": {
2752 "name": "entity.name.tag.named.group.regexp"
2753 }
2754 },
2755 "endCaptures": {
2756 "1": {
2757 "name": "support.other.parenthesis.regexp punctuation.parenthesis.named.end.regexp"
2758 },
2759 "2": {
2760 "name": "invalid.illegal.newline.python"
2761 }
2762 },
2763 "patterns": [
2764 {
2765 "include": "#double-one-regexp-expression"
2766 }
2767 ]
2768 },
2769 "double-one-regexp-comments": {
2770 "name": "comment.regexp",
2771 "begin": "\\(\\?#",
2772 "end": "(\\)|(?=\"))|((?=(?<!\\\\)\\n))",
2773 "beginCaptures": {
2774 "0": {
2775 "name": "punctuation.comment.begin.regexp"
2776 }
2777 },
2778 "endCaptures": {
2779 "1": {
2780 "name": "punctuation.comment.end.regexp"
2781 },
2782 "2": {
2783 "name": "invalid.illegal.newline.python"
2784 }
2785 },
2786 "patterns": [
2787 {
2788 "include": "#codetags"
2789 }
2790 ]
2791 },
2792 "double-one-regexp-lookahead": {
2793 "begin": "(\\()\\?=",
2794 "end": "(\\)|(?=\"))|((?=(?<!\\\\)\\n))",
2795 "beginCaptures": {
2796 "0": {
2797 "name": "keyword.operator.lookahead.regexp"
2798 },
2799 "1": {
2800 "name": "punctuation.parenthesis.lookahead.begin.regexp"
2801 }
2802 },
2803 "endCaptures": {
2804 "1": {
2805 "name": "keyword.operator.lookahead.regexp punctuation.parenthesis.lookahead.end.regexp"
2806 },
2807 "2": {
2808 "name": "invalid.illegal.newline.python"
2809 }
2810 },
2811 "patterns": [
2812 {
2813 "include": "#double-one-regexp-expression"
2814 }
2815 ]
2816 },
2817 "double-one-regexp-lookahead-negative": {
2818 "begin": "(\\()\\?!",
2819 "end": "(\\)|(?=\"))|((?=(?<!\\\\)\\n))",
2820 "beginCaptures": {
2821 "0": {
2822 "name": "keyword.operator.lookahead.negative.regexp"
2823 },
2824 "1": {
2825 "name": "punctuation.parenthesis.lookahead.begin.regexp"
2826 }
2827 },
2828 "endCaptures": {
2829 "1": {
2830 "name": "keyword.operator.lookahead.negative.regexp punctuation.parenthesis.lookahead.end.regexp"
2831 },
2832 "2": {
2833 "name": "invalid.illegal.newline.python"
2834 }
2835 },
2836 "patterns": [
2837 {
2838 "include": "#double-one-regexp-expression"
2839 }
2840 ]
2841 },
2842 "double-one-regexp-lookbehind": {
2843 "begin": "(\\()\\?<=",
2844 "end": "(\\)|(?=\"))|((?=(?<!\\\\)\\n))",
2845 "beginCaptures": {
2846 "0": {
2847 "name": "keyword.operator.lookbehind.regexp"
2848 },
2849 "1": {
2850 "name": "punctuation.parenthesis.lookbehind.begin.regexp"
2851 }
2852 },
2853 "endCaptures": {
2854 "1": {
2855 "name": "keyword.operator.lookbehind.regexp punctuation.parenthesis.lookbehind.end.regexp"
2856 },
2857 "2": {
2858 "name": "invalid.illegal.newline.python"
2859 }
2860 },
2861 "patterns": [
2862 {
2863 "include": "#double-one-regexp-expression"
2864 }
2865 ]
2866 },
2867 "double-one-regexp-lookbehind-negative": {
2868 "begin": "(\\()\\?<!",
2869 "end": "(\\)|(?=\"))|((?=(?<!\\\\)\\n))",
2870 "beginCaptures": {
2871 "0": {
2872 "name": "keyword.operator.lookbehind.negative.regexp"
2873 },
2874 "1": {
2875 "name": "punctuation.parenthesis.lookbehind.begin.regexp"
2876 }
2877 },
2878 "endCaptures": {
2879 "1": {
2880 "name": "keyword.operator.lookbehind.negative.regexp punctuation.parenthesis.lookbehind.end.regexp"
2881 },
2882 "2": {
2883 "name": "invalid.illegal.newline.python"
2884 }
2885 },
2886 "patterns": [
2887 {
2888 "include": "#double-one-regexp-expression"
2889 }
2890 ]
2891 },
2892 "double-one-regexp-conditional": {
2893 "begin": "(\\()\\?\\((\\w+(?:\\s+[[:alnum:]]+)?|\\d+)\\)",
2894 "end": "(\\)|(?=\"))|((?=(?<!\\\\)\\n))",
2895 "beginCaptures": {
2896 "0": {
2897 "name": "keyword.operator.conditional.regexp"
2898 },
2899 "1": {
2900 "name": "punctuation.parenthesis.conditional.begin.regexp"
2901 }
2902 },
2903 "endCaptures": {
2904 "1": {
2905 "name": "keyword.operator.conditional.negative.regexp punctuation.parenthesis.conditional.end.regexp"
2906 },
2907 "2": {
2908 "name": "invalid.illegal.newline.python"
2909 }
2910 },
2911 "patterns": [
2912 {
2913 "include": "#double-one-regexp-expression"
2914 }
2915 ]
2916 },
2917 "double-one-regexp-parentheses-non-capturing": {
2918 "begin": "\\(\\?:",
2919 "end": "(\\)|(?=\"))|((?=(?<!\\\\)\\n))",
2920 "beginCaptures": {
2921 "0": {
2922 "name": "support.other.parenthesis.regexp punctuation.parenthesis.non-capturing.begin.regexp"
2923 }
2924 },
2925 "endCaptures": {
2926 "1": {
2927 "name": "support.other.parenthesis.regexp punctuation.parenthesis.non-capturing.end.regexp"
2928 },
2929 "2": {
2930 "name": "invalid.illegal.newline.python"
2931 }
2932 },
2933 "patterns": [
2934 {
2935 "include": "#double-one-regexp-expression"
2936 }
2937 ]
2938 },
2939 "double-one-regexp-parentheses": {
2940 "begin": "\\(",
2941 "end": "(\\)|(?=\"))|((?=(?<!\\\\)\\n))",
2942 "beginCaptures": {
2943 "0": {
2944 "name": "support.other.parenthesis.regexp punctuation.parenthesis.begin.regexp"
2945 }
2946 },
2947 "endCaptures": {
2948 "1": {
2949 "name": "support.other.parenthesis.regexp punctuation.parenthesis.end.regexp"
2950 },
2951 "2": {
2952 "name": "invalid.illegal.newline.python"
2953 }
2954 },
2955 "patterns": [
2956 {
2957 "include": "#double-one-regexp-expression"
2958 }
2959 ]
2960 },
2961 "double-three-regexp-expression": {
2962 "patterns": [
2963 {
2964 "include": "#regexp-base-expression"
2965 },
2966 {
2967 "include": "#double-three-regexp-character-set"
2968 },
2969 {
2970 "include": "#double-three-regexp-comments"
2971 },
2972 {
2973 "include": "#regexp-flags"
2974 },
2975 {
2976 "include": "#double-three-regexp-named-group"
2977 },
2978 {
2979 "include": "#regexp-backreference"
2980 },
2981 {
2982 "include": "#double-three-regexp-lookahead"
2983 },
2984 {
2985 "include": "#double-three-regexp-lookahead-negative"
2986 },
2987 {
2988 "include": "#double-three-regexp-lookbehind"
2989 },
2990 {
2991 "include": "#double-three-regexp-lookbehind-negative"
2992 },
2993 {
2994 "include": "#double-three-regexp-conditional"
2995 },
2996 {
2997 "include": "#double-three-regexp-parentheses-non-capturing"
2998 },
2999 {
3000 "include": "#double-three-regexp-parentheses"
3001 },
3002 {
3003 "include": "#comments-string-double-three"
3004 }
3005 ]
3006 },
3007 "double-three-regexp-character-set": {
3008 "patterns": [
3009 {
3010 "match": "(?x)\n \\[ \\^? \\] (?! .*?\\])\n"
3011 },
3012 {
3013 "name": "meta.character.set.regexp",
3014 "begin": "(\\[)(\\^)?(\\])?",
3015 "end": "(\\]|(?=\"\"\"))",
3016 "beginCaptures": {
3017 "1": {
3018 "name": "punctuation.character.set.begin.regexp constant.other.set.regexp"
3019 },
3020 "2": {
3021 "name": "keyword.operator.negation.regexp"
3022 },
3023 "3": {
3024 "name": "constant.character.set.regexp"
3025 }
3026 },
3027 "endCaptures": {
3028 "1": {
3029 "name": "punctuation.character.set.end.regexp constant.other.set.regexp"
3030 },
3031 "2": {
3032 "name": "invalid.illegal.newline.python"
3033 }
3034 },
3035 "patterns": [
3036 {
3037 "include": "#regexp-charecter-set-escapes"
3038 },
3039 {
3040 "name": "constant.character.set.regexp",
3041 "match": "[^\\n]"
3042 }
3043 ]
3044 }
3045 ]
3046 },
3047 "double-three-regexp-named-group": {
3048 "name": "meta.named.regexp",
3049 "begin": "(?x)\n (\\() (\\?P <\\w+(?:\\s+[[:alnum:]]+)?>)\n",
3050 "end": "(\\)|(?=\"\"\"))",
3051 "beginCaptures": {
3052 "1": {
3053 "name": "support.other.parenthesis.regexp punctuation.parenthesis.named.begin.regexp"
3054 },
3055 "2": {
3056 "name": "entity.name.tag.named.group.regexp"
3057 }
3058 },
3059 "endCaptures": {
3060 "1": {
3061 "name": "support.other.parenthesis.regexp punctuation.parenthesis.named.end.regexp"
3062 },
3063 "2": {
3064 "name": "invalid.illegal.newline.python"
3065 }
3066 },
3067 "patterns": [
3068 {
3069 "include": "#double-three-regexp-expression"
3070 },
3071 {
3072 "include": "#comments-string-double-three"
3073 }
3074 ]
3075 },
3076 "double-three-regexp-comments": {
3077 "name": "comment.regexp",
3078 "begin": "\\(\\?#",
3079 "end": "(\\)|(?=\"\"\"))",
3080 "beginCaptures": {
3081 "0": {
3082 "name": "punctuation.comment.begin.regexp"
3083 }
3084 },
3085 "endCaptures": {
3086 "1": {
3087 "name": "punctuation.comment.end.regexp"
3088 },
3089 "2": {
3090 "name": "invalid.illegal.newline.python"
3091 }
3092 },
3093 "patterns": [
3094 {
3095 "include": "#codetags"
3096 }
3097 ]
3098 },
3099 "double-three-regexp-lookahead": {
3100 "begin": "(\\()\\?=",
3101 "end": "(\\)|(?=\"\"\"))",
3102 "beginCaptures": {
3103 "0": {
3104 "name": "keyword.operator.lookahead.regexp"
3105 },
3106 "1": {
3107 "name": "punctuation.parenthesis.lookahead.begin.regexp"
3108 }
3109 },
3110 "endCaptures": {
3111 "1": {
3112 "name": "keyword.operator.lookahead.regexp punctuation.parenthesis.lookahead.end.regexp"
3113 },
3114 "2": {
3115 "name": "invalid.illegal.newline.python"
3116 }
3117 },
3118 "patterns": [
3119 {
3120 "include": "#double-three-regexp-expression"
3121 },
3122 {
3123 "include": "#comments-string-double-three"
3124 }
3125 ]
3126 },
3127 "double-three-regexp-lookahead-negative": {
3128 "begin": "(\\()\\?!",
3129 "end": "(\\)|(?=\"\"\"))",
3130 "beginCaptures": {
3131 "0": {
3132 "name": "keyword.operator.lookahead.negative.regexp"
3133 },
3134 "1": {
3135 "name": "punctuation.parenthesis.lookahead.begin.regexp"
3136 }
3137 },
3138 "endCaptures": {
3139 "1": {
3140 "name": "keyword.operator.lookahead.negative.regexp punctuation.parenthesis.lookahead.end.regexp"
3141 },
3142 "2": {
3143 "name": "invalid.illegal.newline.python"
3144 }
3145 },
3146 "patterns": [
3147 {
3148 "include": "#double-three-regexp-expression"
3149 },
3150 {
3151 "include": "#comments-string-double-three"
3152 }
3153 ]
3154 },
3155 "double-three-regexp-lookbehind": {
3156 "begin": "(\\()\\?<=",
3157 "end": "(\\)|(?=\"\"\"))",
3158 "beginCaptures": {
3159 "0": {
3160 "name": "keyword.operator.lookbehind.regexp"
3161 },
3162 "1": {
3163 "name": "punctuation.parenthesis.lookbehind.begin.regexp"
3164 }
3165 },
3166 "endCaptures": {
3167 "1": {
3168 "name": "keyword.operator.lookbehind.regexp punctuation.parenthesis.lookbehind.end.regexp"
3169 },
3170 "2": {
3171 "name": "invalid.illegal.newline.python"
3172 }
3173 },
3174 "patterns": [
3175 {
3176 "include": "#double-three-regexp-expression"
3177 },
3178 {
3179 "include": "#comments-string-double-three"
3180 }
3181 ]
3182 },
3183 "double-three-regexp-lookbehind-negative": {
3184 "begin": "(\\()\\?<!",
3185 "end": "(\\)|(?=\"\"\"))",
3186 "beginCaptures": {
3187 "0": {
3188 "name": "keyword.operator.lookbehind.negative.regexp"
3189 },
3190 "1": {
3191 "name": "punctuation.parenthesis.lookbehind.begin.regexp"
3192 }
3193 },
3194 "endCaptures": {
3195 "1": {
3196 "name": "keyword.operator.lookbehind.negative.regexp punctuation.parenthesis.lookbehind.end.regexp"
3197 },
3198 "2": {
3199 "name": "invalid.illegal.newline.python"
3200 }
3201 },
3202 "patterns": [
3203 {
3204 "include": "#double-three-regexp-expression"
3205 },
3206 {
3207 "include": "#comments-string-double-three"
3208 }
3209 ]
3210 },
3211 "double-three-regexp-conditional": {
3212 "begin": "(\\()\\?\\((\\w+(?:\\s+[[:alnum:]]+)?|\\d+)\\)",
3213 "end": "(\\)|(?=\"\"\"))",
3214 "beginCaptures": {
3215 "0": {
3216 "name": "keyword.operator.conditional.regexp"
3217 },
3218 "1": {
3219 "name": "punctuation.parenthesis.conditional.begin.regexp"
3220 }
3221 },
3222 "endCaptures": {
3223 "1": {
3224 "name": "keyword.operator.conditional.negative.regexp punctuation.parenthesis.conditional.end.regexp"
3225 },
3226 "2": {
3227 "name": "invalid.illegal.newline.python"
3228 }
3229 },
3230 "patterns": [
3231 {
3232 "include": "#double-three-regexp-expression"
3233 },
3234 {
3235 "include": "#comments-string-double-three"
3236 }
3237 ]
3238 },
3239 "double-three-regexp-parentheses-non-capturing": {
3240 "begin": "\\(\\?:",
3241 "end": "(\\)|(?=\"\"\"))",
3242 "beginCaptures": {
3243 "0": {
3244 "name": "support.other.parenthesis.regexp punctuation.parenthesis.non-capturing.begin.regexp"
3245 }
3246 },
3247 "endCaptures": {
3248 "1": {
3249 "name": "support.other.parenthesis.regexp punctuation.parenthesis.non-capturing.end.regexp"
3250 },
3251 "2": {
3252 "name": "invalid.illegal.newline.python"
3253 }
3254 },
3255 "patterns": [
3256 {
3257 "include": "#double-three-regexp-expression"
3258 },
3259 {
3260 "include": "#comments-string-double-three"
3261 }
3262 ]
3263 },
3264 "double-three-regexp-parentheses": {
3265 "begin": "\\(",
3266 "end": "(\\)|(?=\"\"\"))",
3267 "beginCaptures": {
3268 "0": {
3269 "name": "support.other.parenthesis.regexp punctuation.parenthesis.begin.regexp"
3270 }
3271 },
3272 "endCaptures": {
3273 "1": {
3274 "name": "support.other.parenthesis.regexp punctuation.parenthesis.end.regexp"
3275 },
3276 "2": {
3277 "name": "invalid.illegal.newline.python"
3278 }
3279 },
3280 "patterns": [
3281 {
3282 "include": "#double-three-regexp-expression"
3283 },
3284 {
3285 "include": "#comments-string-double-three"
3286 }
3287 ]
3288 },
3289 "regexp-single-one-line": {
3290 "name": "string.regexp.quoted.single.python",
3291 "begin": "\\b(([uU]r)|([bB]r)|(r[bB]?))(\\')",
3292 "end": "(\\')|(?<!\\\\)(\\n)",
3293 "beginCaptures": {
3294 "2": {
3295 "name": "invalid.deprecated.prefix.python"
3296 },
3297 "3": {
3298 "name": "storage.type.string.python"
3299 },
3300 "4": {
3301 "name": "storage.type.string.python"
3302 },
3303 "5": {
3304 "name": "punctuation.definition.string.begin.python"
3305 }
3306 },
3307 "endCaptures": {
3308 "1": {
3309 "name": "punctuation.definition.string.end.python"
3310 },
3311 "2": {
3312 "name": "invalid.illegal.newline.python"
3313 }
3314 },
3315 "patterns": [
3316 {
3317 "include": "#single-one-regexp-expression"
3318 }
3319 ]
3320 },
3321 "regexp-single-three-line": {
3322 "name": "string.regexp.quoted.multi.python",
3323 "begin": "\\b(([uU]r)|([bB]r)|(r[bB]?))(\\'\\'\\')",
3324 "end": "(\\'\\'\\')",
3325 "beginCaptures": {
3326 "2": {
3327 "name": "invalid.deprecated.prefix.python"
3328 },
3329 "3": {
3330 "name": "storage.type.string.python"
3331 },
3332 "4": {
3333 "name": "storage.type.string.python"
3334 },
3335 "5": {
3336 "name": "punctuation.definition.string.begin.python"
3337 }
3338 },
3339 "endCaptures": {
3340 "1": {
3341 "name": "punctuation.definition.string.end.python"
3342 },
3343 "2": {
3344 "name": "invalid.illegal.newline.python"
3345 }
3346 },
3347 "patterns": [
3348 {
3349 "include": "#single-three-regexp-expression"
3350 }
3351 ]
3352 },
3353 "regexp-double-one-line": {
3354 "name": "string.regexp.quoted.single.python",
3355 "begin": "\\b(([uU]r)|([bB]r)|(r[bB]?))(\")",
3356 "end": "(\")|(?<!\\\\)(\\n)",
3357 "beginCaptures": {
3358 "2": {
3359 "name": "invalid.deprecated.prefix.python"
3360 },
3361 "3": {
3362 "name": "storage.type.string.python"
3363 },
3364 "4": {
3365 "name": "storage.type.string.python"
3366 },
3367 "5": {
3368 "name": "punctuation.definition.string.begin.python"
3369 }
3370 },
3371 "endCaptures": {
3372 "1": {
3373 "name": "punctuation.definition.string.end.python"
3374 },
3375 "2": {
3376 "name": "invalid.illegal.newline.python"
3377 }
3378 },
3379 "patterns": [
3380 {
3381 "include": "#double-one-regexp-expression"
3382 }
3383 ]
3384 },
3385 "regexp-double-three-line": {
3386 "name": "string.regexp.quoted.multi.python",
3387 "begin": "\\b(([uU]r)|([bB]r)|(r[bB]?))(\"\"\")",
3388 "end": "(\"\"\")",
3389 "beginCaptures": {
3390 "2": {
3391 "name": "invalid.deprecated.prefix.python"
3392 },
3393 "3": {
3394 "name": "storage.type.string.python"
3395 },
3396 "4": {
3397 "name": "storage.type.string.python"
3398 },
3399 "5": {
3400 "name": "punctuation.definition.string.begin.python"
3401 }
3402 },
3403 "endCaptures": {
3404 "1": {
3405 "name": "punctuation.definition.string.end.python"
3406 },
3407 "2": {
3408 "name": "invalid.illegal.newline.python"
3409 }
3410 },
3411 "patterns": [
3412 {
3413 "include": "#double-three-regexp-expression"
3414 }
3415 ]
3416 },
3417 "single-one-fregexp-expression": {
3418 "patterns": [
3419 {
3420 "include": "#fregexp-base-expression"
3421 },
3422 {
3423 "include": "#single-one-regexp-character-set"
3424 },
3425 {
3426 "include": "#single-one-regexp-comments"
3427 },
3428 {
3429 "include": "#regexp-flags"
3430 },
3431 {
3432 "include": "#single-one-regexp-named-group"
3433 },
3434 {
3435 "include": "#regexp-backreference"
3436 },
3437 {
3438 "include": "#single-one-fregexp-lookahead"
3439 },
3440 {
3441 "include": "#single-one-fregexp-lookahead-negative"
3442 },
3443 {
3444 "include": "#single-one-fregexp-lookbehind"
3445 },
3446 {
3447 "include": "#single-one-fregexp-lookbehind-negative"
3448 },
3449 {
3450 "include": "#single-one-fregexp-conditional"
3451 },
3452 {
3453 "include": "#single-one-fregexp-parentheses-non-capturing"
3454 },
3455 {
3456 "include": "#single-one-fregexp-parentheses"
3457 }
3458 ]
3459 },
3460 "single-one-fregexp-named-group": {
3461 "name": "meta.named.regexp",
3462 "begin": "(?x)\n (\\() (\\?P <\\w+(?:\\s+[[:alnum:]]+)?>)\n",
3463 "end": "(\\)|(?=\\'))|((?=(?<!\\\\)\\n))",
3464 "beginCaptures": {
3465 "1": {
3466 "name": "support.other.parenthesis.regexp punctuation.parenthesis.named.begin.regexp"
3467 },
3468 "2": {
3469 "name": "entity.name.tag.named.group.regexp"
3470 }
3471 },
3472 "endCaptures": {
3473 "1": {
3474 "name": "support.other.parenthesis.regexp punctuation.parenthesis.named.end.regexp"
3475 },
3476 "2": {
3477 "name": "invalid.illegal.newline.python"
3478 }
3479 },
3480 "patterns": [
3481 {
3482 "include": "#single-one-fregexp-expression"
3483 }
3484 ]
3485 },
3486 "single-one-fregexp-lookahead": {
3487 "begin": "(\\()\\?=",
3488 "end": "(\\)|(?=\\'))|((?=(?<!\\\\)\\n))",
3489 "beginCaptures": {
3490 "0": {
3491 "name": "keyword.operator.lookahead.regexp"
3492 },
3493 "1": {
3494 "name": "punctuation.parenthesis.lookahead.begin.regexp"
3495 }
3496 },
3497 "endCaptures": {
3498 "1": {
3499 "name": "keyword.operator.lookahead.regexp punctuation.parenthesis.lookahead.end.regexp"
3500 },
3501 "2": {
3502 "name": "invalid.illegal.newline.python"
3503 }
3504 },
3505 "patterns": [
3506 {
3507 "include": "#single-one-fregexp-expression"
3508 }
3509 ]
3510 },
3511 "single-one-fregexp-lookahead-negative": {
3512 "begin": "(\\()\\?!",
3513 "end": "(\\)|(?=\\'))|((?=(?<!\\\\)\\n))",
3514 "beginCaptures": {
3515 "0": {
3516 "name": "keyword.operator.lookahead.negative.regexp"
3517 },
3518 "1": {
3519 "name": "punctuation.parenthesis.lookahead.begin.regexp"
3520 }
3521 },
3522 "endCaptures": {
3523 "1": {
3524 "name": "keyword.operator.lookahead.negative.regexp punctuation.parenthesis.lookahead.end.regexp"
3525 },
3526 "2": {
3527 "name": "invalid.illegal.newline.python"
3528 }
3529 },
3530 "patterns": [
3531 {
3532 "include": "#single-one-fregexp-expression"
3533 }
3534 ]
3535 },
3536 "single-one-fregexp-lookbehind": {
3537 "begin": "(\\()\\?<=",
3538 "end": "(\\)|(?=\\'))|((?=(?<!\\\\)\\n))",
3539 "beginCaptures": {
3540 "0": {
3541 "name": "keyword.operator.lookbehind.regexp"
3542 },
3543 "1": {
3544 "name": "punctuation.parenthesis.lookbehind.begin.regexp"
3545 }
3546 },
3547 "endCaptures": {
3548 "1": {
3549 "name": "keyword.operator.lookbehind.regexp punctuation.parenthesis.lookbehind.end.regexp"
3550 },
3551 "2": {
3552 "name": "invalid.illegal.newline.python"
3553 }
3554 },
3555 "patterns": [
3556 {
3557 "include": "#single-one-fregexp-expression"
3558 }
3559 ]
3560 },
3561 "single-one-fregexp-lookbehind-negative": {
3562 "begin": "(\\()\\?<!",
3563 "end": "(\\)|(?=\\'))|((?=(?<!\\\\)\\n))",
3564 "beginCaptures": {
3565 "0": {
3566 "name": "keyword.operator.lookbehind.negative.regexp"
3567 },
3568 "1": {
3569 "name": "punctuation.parenthesis.lookbehind.begin.regexp"
3570 }
3571 },
3572 "endCaptures": {
3573 "1": {
3574 "name": "keyword.operator.lookbehind.negative.regexp punctuation.parenthesis.lookbehind.end.regexp"
3575 },
3576 "2": {
3577 "name": "invalid.illegal.newline.python"
3578 }
3579 },
3580 "patterns": [
3581 {
3582 "include": "#single-one-fregexp-expression"
3583 }
3584 ]
3585 },
3586 "single-one-fregexp-conditional": {
3587 "begin": "(\\()\\?\\((\\w+(?:\\s+[[:alnum:]]+)?|\\d+)\\)",
3588 "end": "(\\)|(?=\\'))|((?=(?<!\\\\)\\n))",
3589 "beginCaptures": {
3590 "0": {
3591 "name": "keyword.operator.conditional.regexp"
3592 },
3593 "1": {
3594 "name": "punctuation.parenthesis.conditional.begin.regexp"
3595 }
3596 },
3597 "endCaptures": {
3598 "1": {
3599 "name": "keyword.operator.conditional.negative.regexp punctuation.parenthesis.conditional.end.regexp"
3600 },
3601 "2": {
3602 "name": "invalid.illegal.newline.python"
3603 }
3604 },
3605 "patterns": [
3606 {
3607 "include": "#single-one-fregexp-expression"
3608 }
3609 ]
3610 },
3611 "single-one-fregexp-parentheses-non-capturing": {
3612 "begin": "\\(\\?:",
3613 "end": "(\\)|(?=\\'))|((?=(?<!\\\\)\\n))",
3614 "beginCaptures": {
3615 "0": {
3616 "name": "support.other.parenthesis.regexp punctuation.parenthesis.non-capturing.begin.regexp"
3617 }
3618 },
3619 "endCaptures": {
3620 "1": {
3621 "name": "support.other.parenthesis.regexp punctuation.parenthesis.non-capturing.end.regexp"
3622 },
3623 "2": {
3624 "name": "invalid.illegal.newline.python"
3625 }
3626 },
3627 "patterns": [
3628 {
3629 "include": "#single-one-fregexp-expression"
3630 }
3631 ]
3632 },
3633 "single-one-fregexp-parentheses": {
3634 "begin": "\\(",
3635 "end": "(\\)|(?=\\'))|((?=(?<!\\\\)\\n))",
3636 "beginCaptures": {
3637 "0": {
3638 "name": "support.other.parenthesis.regexp punctuation.parenthesis.begin.regexp"
3639 }
3640 },
3641 "endCaptures": {
3642 "1": {
3643 "name": "support.other.parenthesis.regexp punctuation.parenthesis.end.regexp"
3644 },
3645 "2": {
3646 "name": "invalid.illegal.newline.python"
3647 }
3648 },
3649 "patterns": [
3650 {
3651 "include": "#single-one-fregexp-expression"
3652 }
3653 ]
3654 },
3655 "single-three-fregexp-expression": {
3656 "patterns": [
3657 {
3658 "include": "#fregexp-base-expression"
3659 },
3660 {
3661 "include": "#single-three-regexp-character-set"
3662 },
3663 {
3664 "include": "#single-three-regexp-comments"
3665 },
3666 {
3667 "include": "#regexp-flags"
3668 },
3669 {
3670 "include": "#single-three-regexp-named-group"
3671 },
3672 {
3673 "include": "#regexp-backreference"
3674 },
3675 {
3676 "include": "#single-three-fregexp-lookahead"
3677 },
3678 {
3679 "include": "#single-three-fregexp-lookahead-negative"
3680 },
3681 {
3682 "include": "#single-three-fregexp-lookbehind"
3683 },
3684 {
3685 "include": "#single-three-fregexp-lookbehind-negative"
3686 },
3687 {
3688 "include": "#single-three-fregexp-conditional"
3689 },
3690 {
3691 "include": "#single-three-fregexp-parentheses-non-capturing"
3692 },
3693 {
3694 "include": "#single-three-fregexp-parentheses"
3695 },
3696 {
3697 "include": "#comments-string-single-three"
3698 }
3699 ]
3700 },
3701 "single-three-fregexp-named-group": {
3702 "name": "meta.named.regexp",
3703 "begin": "(?x)\n (\\() (\\?P <\\w+(?:\\s+[[:alnum:]]+)?>)\n",
3704 "end": "(\\)|(?=\\'\\'\\'))",
3705 "beginCaptures": {
3706 "1": {
3707 "name": "support.other.parenthesis.regexp punctuation.parenthesis.named.begin.regexp"
3708 },
3709 "2": {
3710 "name": "entity.name.tag.named.group.regexp"
3711 }
3712 },
3713 "endCaptures": {
3714 "1": {
3715 "name": "support.other.parenthesis.regexp punctuation.parenthesis.named.end.regexp"
3716 },
3717 "2": {
3718 "name": "invalid.illegal.newline.python"
3719 }
3720 },
3721 "patterns": [
3722 {
3723 "include": "#single-three-fregexp-expression"
3724 },
3725 {
3726 "include": "#comments-string-single-three"
3727 }
3728 ]
3729 },
3730 "single-three-fregexp-lookahead": {
3731 "begin": "(\\()\\?=",
3732 "end": "(\\)|(?=\\'\\'\\'))",
3733 "beginCaptures": {
3734 "0": {
3735 "name": "keyword.operator.lookahead.regexp"
3736 },
3737 "1": {
3738 "name": "punctuation.parenthesis.lookahead.begin.regexp"
3739 }
3740 },
3741 "endCaptures": {
3742 "1": {
3743 "name": "keyword.operator.lookahead.regexp punctuation.parenthesis.lookahead.end.regexp"
3744 },
3745 "2": {
3746 "name": "invalid.illegal.newline.python"
3747 }
3748 },
3749 "patterns": [
3750 {
3751 "include": "#single-three-fregexp-expression"
3752 },
3753 {
3754 "include": "#comments-string-single-three"
3755 }
3756 ]
3757 },
3758 "single-three-fregexp-lookahead-negative": {
3759 "begin": "(\\()\\?!",
3760 "end": "(\\)|(?=\\'\\'\\'))",
3761 "beginCaptures": {
3762 "0": {
3763 "name": "keyword.operator.lookahead.negative.regexp"
3764 },
3765 "1": {
3766 "name": "punctuation.parenthesis.lookahead.begin.regexp"
3767 }
3768 },
3769 "endCaptures": {
3770 "1": {
3771 "name": "keyword.operator.lookahead.negative.regexp punctuation.parenthesis.lookahead.end.regexp"
3772 },
3773 "2": {
3774 "name": "invalid.illegal.newline.python"
3775 }
3776 },
3777 "patterns": [
3778 {
3779 "include": "#single-three-fregexp-expression"
3780 },
3781 {
3782 "include": "#comments-string-single-three"
3783 }
3784 ]
3785 },
3786 "single-three-fregexp-lookbehind": {
3787 "begin": "(\\()\\?<=",
3788 "end": "(\\)|(?=\\'\\'\\'))",
3789 "beginCaptures": {
3790 "0": {
3791 "name": "keyword.operator.lookbehind.regexp"
3792 },
3793 "1": {
3794 "name": "punctuation.parenthesis.lookbehind.begin.regexp"
3795 }
3796 },
3797 "endCaptures": {
3798 "1": {
3799 "name": "keyword.operator.lookbehind.regexp punctuation.parenthesis.lookbehind.end.regexp"
3800 },
3801 "2": {
3802 "name": "invalid.illegal.newline.python"
3803 }
3804 },
3805 "patterns": [
3806 {
3807 "include": "#single-three-fregexp-expression"
3808 },
3809 {
3810 "include": "#comments-string-single-three"
3811 }
3812 ]
3813 },
3814 "single-three-fregexp-lookbehind-negative": {
3815 "begin": "(\\()\\?<!",
3816 "end": "(\\)|(?=\\'\\'\\'))",
3817 "beginCaptures": {
3818 "0": {
3819 "name": "keyword.operator.lookbehind.negative.regexp"
3820 },
3821 "1": {
3822 "name": "punctuation.parenthesis.lookbehind.begin.regexp"
3823 }
3824 },
3825 "endCaptures": {
3826 "1": {
3827 "name": "keyword.operator.lookbehind.negative.regexp punctuation.parenthesis.lookbehind.end.regexp"
3828 },
3829 "2": {
3830 "name": "invalid.illegal.newline.python"
3831 }
3832 },
3833 "patterns": [
3834 {
3835 "include": "#single-three-fregexp-expression"
3836 },
3837 {
3838 "include": "#comments-string-single-three"
3839 }
3840 ]
3841 },
3842 "single-three-fregexp-conditional": {
3843 "begin": "(\\()\\?\\((\\w+(?:\\s+[[:alnum:]]+)?|\\d+)\\)",
3844 "end": "(\\)|(?=\\'\\'\\'))",
3845 "beginCaptures": {
3846 "0": {
3847 "name": "keyword.operator.conditional.regexp"
3848 },
3849 "1": {
3850 "name": "punctuation.parenthesis.conditional.begin.regexp"
3851 }
3852 },
3853 "endCaptures": {
3854 "1": {
3855 "name": "keyword.operator.conditional.negative.regexp punctuation.parenthesis.conditional.end.regexp"
3856 },
3857 "2": {
3858 "name": "invalid.illegal.newline.python"
3859 }
3860 },
3861 "patterns": [
3862 {
3863 "include": "#single-three-fregexp-expression"
3864 },
3865 {
3866 "include": "#comments-string-single-three"
3867 }
3868 ]
3869 },
3870 "single-three-fregexp-parentheses-non-capturing": {
3871 "begin": "\\(\\?:",
3872 "end": "(\\)|(?=\\'\\'\\'))",
3873 "beginCaptures": {
3874 "0": {
3875 "name": "support.other.parenthesis.regexp punctuation.parenthesis.non-capturing.begin.regexp"
3876 }
3877 },
3878 "endCaptures": {
3879 "1": {
3880 "name": "support.other.parenthesis.regexp punctuation.parenthesis.non-capturing.end.regexp"
3881 },
3882 "2": {
3883 "name": "invalid.illegal.newline.python"
3884 }
3885 },
3886 "patterns": [
3887 {
3888 "include": "#single-three-fregexp-expression"
3889 },
3890 {
3891 "include": "#comments-string-single-three"
3892 }
3893 ]
3894 },
3895 "single-three-fregexp-parentheses": {
3896 "begin": "\\(",
3897 "end": "(\\)|(?=\\'\\'\\'))",
3898 "beginCaptures": {
3899 "0": {
3900 "name": "support.other.parenthesis.regexp punctuation.parenthesis.begin.regexp"
3901 }
3902 },
3903 "endCaptures": {
3904 "1": {
3905 "name": "support.other.parenthesis.regexp punctuation.parenthesis.end.regexp"
3906 },
3907 "2": {
3908 "name": "invalid.illegal.newline.python"
3909 }
3910 },
3911 "patterns": [
3912 {
3913 "include": "#single-three-fregexp-expression"
3914 },
3915 {
3916 "include": "#comments-string-single-three"
3917 }
3918 ]
3919 },
3920 "double-one-fregexp-expression": {
3921 "patterns": [
3922 {
3923 "include": "#fregexp-base-expression"
3924 },
3925 {
3926 "include": "#double-one-regexp-character-set"
3927 },
3928 {
3929 "include": "#double-one-regexp-comments"
3930 },
3931 {
3932 "include": "#regexp-flags"
3933 },
3934 {
3935 "include": "#double-one-regexp-named-group"
3936 },
3937 {
3938 "include": "#regexp-backreference"
3939 },
3940 {
3941 "include": "#double-one-fregexp-lookahead"
3942 },
3943 {
3944 "include": "#double-one-fregexp-lookahead-negative"
3945 },
3946 {
3947 "include": "#double-one-fregexp-lookbehind"
3948 },
3949 {
3950 "include": "#double-one-fregexp-lookbehind-negative"
3951 },
3952 {
3953 "include": "#double-one-fregexp-conditional"
3954 },
3955 {
3956 "include": "#double-one-fregexp-parentheses-non-capturing"
3957 },
3958 {
3959 "include": "#double-one-fregexp-parentheses"
3960 }
3961 ]
3962 },
3963 "double-one-fregexp-named-group": {
3964 "name": "meta.named.regexp",
3965 "begin": "(?x)\n (\\() (\\?P <\\w+(?:\\s+[[:alnum:]]+)?>)\n",
3966 "end": "(\\)|(?=\"))|((?=(?<!\\\\)\\n))",
3967 "beginCaptures": {
3968 "1": {
3969 "name": "support.other.parenthesis.regexp punctuation.parenthesis.named.begin.regexp"
3970 },
3971 "2": {
3972 "name": "entity.name.tag.named.group.regexp"
3973 }
3974 },
3975 "endCaptures": {
3976 "1": {
3977 "name": "support.other.parenthesis.regexp punctuation.parenthesis.named.end.regexp"
3978 },
3979 "2": {
3980 "name": "invalid.illegal.newline.python"
3981 }
3982 },
3983 "patterns": [
3984 {
3985 "include": "#double-one-fregexp-expression"
3986 }
3987 ]
3988 },
3989 "double-one-fregexp-lookahead": {
3990 "begin": "(\\()\\?=",
3991 "end": "(\\)|(?=\"))|((?=(?<!\\\\)\\n))",
3992 "beginCaptures": {
3993 "0": {
3994 "name": "keyword.operator.lookahead.regexp"
3995 },
3996 "1": {
3997 "name": "punctuation.parenthesis.lookahead.begin.regexp"
3998 }
3999 },
4000 "endCaptures": {
4001 "1": {
4002 "name": "keyword.operator.lookahead.regexp punctuation.parenthesis.lookahead.end.regexp"
4003 },
4004 "2": {
4005 "name": "invalid.illegal.newline.python"
4006 }
4007 },
4008 "patterns": [
4009 {
4010 "include": "#double-one-fregexp-expression"
4011 }
4012 ]
4013 },
4014 "double-one-fregexp-lookahead-negative": {
4015 "begin": "(\\()\\?!",
4016 "end": "(\\)|(?=\"))|((?=(?<!\\\\)\\n))",
4017 "beginCaptures": {
4018 "0": {
4019 "name": "keyword.operator.lookahead.negative.regexp"
4020 },
4021 "1": {
4022 "name": "punctuation.parenthesis.lookahead.begin.regexp"
4023 }
4024 },
4025 "endCaptures": {
4026 "1": {
4027 "name": "keyword.operator.lookahead.negative.regexp punctuation.parenthesis.lookahead.end.regexp"
4028 },
4029 "2": {
4030 "name": "invalid.illegal.newline.python"
4031 }
4032 },
4033 "patterns": [
4034 {
4035 "include": "#double-one-fregexp-expression"
4036 }
4037 ]
4038 },
4039 "double-one-fregexp-lookbehind": {
4040 "begin": "(\\()\\?<=",
4041 "end": "(\\)|(?=\"))|((?=(?<!\\\\)\\n))",
4042 "beginCaptures": {
4043 "0": {
4044 "name": "keyword.operator.lookbehind.regexp"
4045 },
4046 "1": {
4047 "name": "punctuation.parenthesis.lookbehind.begin.regexp"
4048 }
4049 },
4050 "endCaptures": {
4051 "1": {
4052 "name": "keyword.operator.lookbehind.regexp punctuation.parenthesis.lookbehind.end.regexp"
4053 },
4054 "2": {
4055 "name": "invalid.illegal.newline.python"
4056 }
4057 },
4058 "patterns": [
4059 {
4060 "include": "#double-one-fregexp-expression"
4061 }
4062 ]
4063 },
4064 "double-one-fregexp-lookbehind-negative": {
4065 "begin": "(\\()\\?<!",
4066 "end": "(\\)|(?=\"))|((?=(?<!\\\\)\\n))",
4067 "beginCaptures": {
4068 "0": {
4069 "name": "keyword.operator.lookbehind.negative.regexp"
4070 },
4071 "1": {
4072 "name": "punctuation.parenthesis.lookbehind.begin.regexp"
4073 }
4074 },
4075 "endCaptures": {
4076 "1": {
4077 "name": "keyword.operator.lookbehind.negative.regexp punctuation.parenthesis.lookbehind.end.regexp"
4078 },
4079 "2": {
4080 "name": "invalid.illegal.newline.python"
4081 }
4082 },
4083 "patterns": [
4084 {
4085 "include": "#double-one-fregexp-expression"
4086 }
4087 ]
4088 },
4089 "double-one-fregexp-conditional": {
4090 "begin": "(\\()\\?\\((\\w+(?:\\s+[[:alnum:]]+)?|\\d+)\\)",
4091 "end": "(\\)|(?=\"))|((?=(?<!\\\\)\\n))",
4092 "beginCaptures": {
4093 "0": {
4094 "name": "keyword.operator.conditional.regexp"
4095 },
4096 "1": {
4097 "name": "punctuation.parenthesis.conditional.begin.regexp"
4098 }
4099 },
4100 "endCaptures": {
4101 "1": {
4102 "name": "keyword.operator.conditional.negative.regexp punctuation.parenthesis.conditional.end.regexp"
4103 },
4104 "2": {
4105 "name": "invalid.illegal.newline.python"
4106 }
4107 },
4108 "patterns": [
4109 {
4110 "include": "#double-one-fregexp-expression"
4111 }
4112 ]
4113 },
4114 "double-one-fregexp-parentheses-non-capturing": {
4115 "begin": "\\(\\?:",
4116 "end": "(\\)|(?=\"))|((?=(?<!\\\\)\\n))",
4117 "beginCaptures": {
4118 "0": {
4119 "name": "support.other.parenthesis.regexp punctuation.parenthesis.non-capturing.begin.regexp"
4120 }
4121 },
4122 "endCaptures": {
4123 "1": {
4124 "name": "support.other.parenthesis.regexp punctuation.parenthesis.non-capturing.end.regexp"
4125 },
4126 "2": {
4127 "name": "invalid.illegal.newline.python"
4128 }
4129 },
4130 "patterns": [
4131 {
4132 "include": "#double-one-fregexp-expression"
4133 }
4134 ]
4135 },
4136 "double-one-fregexp-parentheses": {
4137 "begin": "\\(",
4138 "end": "(\\)|(?=\"))|((?=(?<!\\\\)\\n))",
4139 "beginCaptures": {
4140 "0": {
4141 "name": "support.other.parenthesis.regexp punctuation.parenthesis.begin.regexp"
4142 }
4143 },
4144 "endCaptures": {
4145 "1": {
4146 "name": "support.other.parenthesis.regexp punctuation.parenthesis.end.regexp"
4147 },
4148 "2": {
4149 "name": "invalid.illegal.newline.python"
4150 }
4151 },
4152 "patterns": [
4153 {
4154 "include": "#double-one-fregexp-expression"
4155 }
4156 ]
4157 },
4158 "double-three-fregexp-expression": {
4159 "patterns": [
4160 {
4161 "include": "#fregexp-base-expression"
4162 },
4163 {
4164 "include": "#double-three-regexp-character-set"
4165 },
4166 {
4167 "include": "#double-three-regexp-comments"
4168 },
4169 {
4170 "include": "#regexp-flags"
4171 },
4172 {
4173 "include": "#double-three-regexp-named-group"
4174 },
4175 {
4176 "include": "#regexp-backreference"
4177 },
4178 {
4179 "include": "#double-three-fregexp-lookahead"
4180 },
4181 {
4182 "include": "#double-three-fregexp-lookahead-negative"
4183 },
4184 {
4185 "include": "#double-three-fregexp-lookbehind"
4186 },
4187 {
4188 "include": "#double-three-fregexp-lookbehind-negative"
4189 },
4190 {
4191 "include": "#double-three-fregexp-conditional"
4192 },
4193 {
4194 "include": "#double-three-fregexp-parentheses-non-capturing"
4195 },
4196 {
4197 "include": "#double-three-fregexp-parentheses"
4198 },
4199 {
4200 "include": "#comments-string-double-three"
4201 }
4202 ]
4203 },
4204 "double-three-fregexp-named-group": {
4205 "name": "meta.named.regexp",
4206 "begin": "(?x)\n (\\() (\\?P <\\w+(?:\\s+[[:alnum:]]+)?>)\n",
4207 "end": "(\\)|(?=\"\"\"))",
4208 "beginCaptures": {
4209 "1": {
4210 "name": "support.other.parenthesis.regexp punctuation.parenthesis.named.begin.regexp"
4211 },
4212 "2": {
4213 "name": "entity.name.tag.named.group.regexp"
4214 }
4215 },
4216 "endCaptures": {
4217 "1": {
4218 "name": "support.other.parenthesis.regexp punctuation.parenthesis.named.end.regexp"
4219 },
4220 "2": {
4221 "name": "invalid.illegal.newline.python"
4222 }
4223 },
4224 "patterns": [
4225 {
4226 "include": "#double-three-fregexp-expression"
4227 },
4228 {
4229 "include": "#comments-string-double-three"
4230 }
4231 ]
4232 },
4233 "double-three-fregexp-lookahead": {
4234 "begin": "(\\()\\?=",
4235 "end": "(\\)|(?=\"\"\"))",
4236 "beginCaptures": {
4237 "0": {
4238 "name": "keyword.operator.lookahead.regexp"
4239 },
4240 "1": {
4241 "name": "punctuation.parenthesis.lookahead.begin.regexp"
4242 }
4243 },
4244 "endCaptures": {
4245 "1": {
4246 "name": "keyword.operator.lookahead.regexp punctuation.parenthesis.lookahead.end.regexp"
4247 },
4248 "2": {
4249 "name": "invalid.illegal.newline.python"
4250 }
4251 },
4252 "patterns": [
4253 {
4254 "include": "#double-three-fregexp-expression"
4255 },
4256 {
4257 "include": "#comments-string-double-three"
4258 }
4259 ]
4260 },
4261 "double-three-fregexp-lookahead-negative": {
4262 "begin": "(\\()\\?!",
4263 "end": "(\\)|(?=\"\"\"))",
4264 "beginCaptures": {
4265 "0": {
4266 "name": "keyword.operator.lookahead.negative.regexp"
4267 },
4268 "1": {
4269 "name": "punctuation.parenthesis.lookahead.begin.regexp"
4270 }
4271 },
4272 "endCaptures": {
4273 "1": {
4274 "name": "keyword.operator.lookahead.negative.regexp punctuation.parenthesis.lookahead.end.regexp"
4275 },
4276 "2": {
4277 "name": "invalid.illegal.newline.python"
4278 }
4279 },
4280 "patterns": [
4281 {
4282 "include": "#double-three-fregexp-expression"
4283 },
4284 {
4285 "include": "#comments-string-double-three"
4286 }
4287 ]
4288 },
4289 "double-three-fregexp-lookbehind": {
4290 "begin": "(\\()\\?<=",
4291 "end": "(\\)|(?=\"\"\"))",
4292 "beginCaptures": {
4293 "0": {
4294 "name": "keyword.operator.lookbehind.regexp"
4295 },
4296 "1": {
4297 "name": "punctuation.parenthesis.lookbehind.begin.regexp"
4298 }
4299 },
4300 "endCaptures": {
4301 "1": {
4302 "name": "keyword.operator.lookbehind.regexp punctuation.parenthesis.lookbehind.end.regexp"
4303 },
4304 "2": {
4305 "name": "invalid.illegal.newline.python"
4306 }
4307 },
4308 "patterns": [
4309 {
4310 "include": "#double-three-fregexp-expression"
4311 },
4312 {
4313 "include": "#comments-string-double-three"
4314 }
4315 ]
4316 },
4317 "double-three-fregexp-lookbehind-negative": {
4318 "begin": "(\\()\\?<!",
4319 "end": "(\\)|(?=\"\"\"))",
4320 "beginCaptures": {
4321 "0": {
4322 "name": "keyword.operator.lookbehind.negative.regexp"
4323 },
4324 "1": {
4325 "name": "punctuation.parenthesis.lookbehind.begin.regexp"
4326 }
4327 },
4328 "endCaptures": {
4329 "1": {
4330 "name": "keyword.operator.lookbehind.negative.regexp punctuation.parenthesis.lookbehind.end.regexp"
4331 },
4332 "2": {
4333 "name": "invalid.illegal.newline.python"
4334 }
4335 },
4336 "patterns": [
4337 {
4338 "include": "#double-three-fregexp-expression"
4339 },
4340 {
4341 "include": "#comments-string-double-three"
4342 }
4343 ]
4344 },
4345 "double-three-fregexp-conditional": {
4346 "begin": "(\\()\\?\\((\\w+(?:\\s+[[:alnum:]]+)?|\\d+)\\)",
4347 "end": "(\\)|(?=\"\"\"))",
4348 "beginCaptures": {
4349 "0": {
4350 "name": "keyword.operator.conditional.regexp"
4351 },
4352 "1": {
4353 "name": "punctuation.parenthesis.conditional.begin.regexp"
4354 }
4355 },
4356 "endCaptures": {
4357 "1": {
4358 "name": "keyword.operator.conditional.negative.regexp punctuation.parenthesis.conditional.end.regexp"
4359 },
4360 "2": {
4361 "name": "invalid.illegal.newline.python"
4362 }
4363 },
4364 "patterns": [
4365 {
4366 "include": "#double-three-fregexp-expression"
4367 },
4368 {
4369 "include": "#comments-string-double-three"
4370 }
4371 ]
4372 },
4373 "double-three-fregexp-parentheses-non-capturing": {
4374 "begin": "\\(\\?:",
4375 "end": "(\\)|(?=\"\"\"))",
4376 "beginCaptures": {
4377 "0": {
4378 "name": "support.other.parenthesis.regexp punctuation.parenthesis.non-capturing.begin.regexp"
4379 }
4380 },
4381 "endCaptures": {
4382 "1": {
4383 "name": "support.other.parenthesis.regexp punctuation.parenthesis.non-capturing.end.regexp"
4384 },
4385 "2": {
4386 "name": "invalid.illegal.newline.python"
4387 }
4388 },
4389 "patterns": [
4390 {
4391 "include": "#double-three-fregexp-expression"
4392 },
4393 {
4394 "include": "#comments-string-double-three"
4395 }
4396 ]
4397 },
4398 "double-three-fregexp-parentheses": {
4399 "begin": "\\(",
4400 "end": "(\\)|(?=\"\"\"))",
4401 "beginCaptures": {
4402 "0": {
4403 "name": "support.other.parenthesis.regexp punctuation.parenthesis.begin.regexp"
4404 }
4405 },
4406 "endCaptures": {
4407 "1": {
4408 "name": "support.other.parenthesis.regexp punctuation.parenthesis.end.regexp"
4409 },
4410 "2": {
4411 "name": "invalid.illegal.newline.python"
4412 }
4413 },
4414 "patterns": [
4415 {
4416 "include": "#double-three-fregexp-expression"
4417 },
4418 {
4419 "include": "#comments-string-double-three"
4420 }
4421 ]
4422 },
4423 "fregexp-single-one-line": {
4424 "name": "string.interpolated.python string.regexp.quoted.single.python",
4425 "begin": "\\b(([uU]r)|([fF]r)|(r[fF]?))(\\')",
4426 "end": "(\\')|(?<!\\\\)(\\n)",
4427 "beginCaptures": {
4428 "2": {
4429 "name": "invalid.deprecated.prefix.python"
4430 },
4431 "3": {
4432 "name": "storage.type.string.python"
4433 },
4434 "4": {
4435 "name": "storage.type.string.python"
4436 },
4437 "5": {
4438 "name": "punctuation.definition.string.begin.python"
4439 }
4440 },
4441 "endCaptures": {
4442 "1": {
4443 "name": "punctuation.definition.string.end.python"
4444 },
4445 "2": {
4446 "name": "invalid.illegal.newline.python"
4447 }
4448 },
4449 "patterns": [
4450 {
4451 "include": "#single-one-fregexp-expression"
4452 }
4453 ]
4454 },
4455 "fregexp-single-three-line": {
4456 "name": "string.interpolated.python string.regexp.quoted.multi.python",
4457 "begin": "\\b(([uU]r)|([fF]r)|(r[fF]?))(\\'\\'\\')",
4458 "end": "(\\'\\'\\')",
4459 "beginCaptures": {
4460 "2": {
4461 "name": "invalid.deprecated.prefix.python"
4462 },
4463 "3": {
4464 "name": "storage.type.string.python"
4465 },
4466 "4": {
4467 "name": "storage.type.string.python"
4468 },
4469 "5": {
4470 "name": "punctuation.definition.string.begin.python"
4471 }
4472 },
4473 "endCaptures": {
4474 "1": {
4475 "name": "punctuation.definition.string.end.python"
4476 },
4477 "2": {
4478 "name": "invalid.illegal.newline.python"
4479 }
4480 },
4481 "patterns": [
4482 {
4483 "include": "#single-three-fregexp-expression"
4484 }
4485 ]
4486 },
4487 "fregexp-double-one-line": {
4488 "name": "string.interpolated.python string.regexp.quoted.single.python",
4489 "begin": "\\b(([uU]r)|([fF]r)|(r[fF]?))(\")",
4490 "end": "(\")|(?<!\\\\)(\\n)",
4491 "beginCaptures": {
4492 "2": {
4493 "name": "invalid.deprecated.prefix.python"
4494 },
4495 "3": {
4496 "name": "storage.type.string.python"
4497 },
4498 "4": {
4499 "name": "storage.type.string.python"
4500 },
4501 "5": {
4502 "name": "punctuation.definition.string.begin.python"
4503 }
4504 },
4505 "endCaptures": {
4506 "1": {
4507 "name": "punctuation.definition.string.end.python"
4508 },
4509 "2": {
4510 "name": "invalid.illegal.newline.python"
4511 }
4512 },
4513 "patterns": [
4514 {
4515 "include": "#double-one-fregexp-expression"
4516 }
4517 ]
4518 },
4519 "fregexp-double-three-line": {
4520 "name": "string.interpolated.python string.regexp.quoted.multi.python",
4521 "begin": "\\b(([uU]r)|([fF]r)|(r[fF]?))(\"\"\")",
4522 "end": "(\"\"\")",
4523 "beginCaptures": {
4524 "2": {
4525 "name": "invalid.deprecated.prefix.python"
4526 },
4527 "3": {
4528 "name": "storage.type.string.python"
4529 },
4530 "4": {
4531 "name": "storage.type.string.python"
4532 },
4533 "5": {
4534 "name": "punctuation.definition.string.begin.python"
4535 }
4536 },
4537 "endCaptures": {
4538 "1": {
4539 "name": "punctuation.definition.string.end.python"
4540 },
4541 "2": {
4542 "name": "invalid.illegal.newline.python"
4543 }
4544 },
4545 "patterns": [
4546 {
4547 "include": "#double-three-fregexp-expression"
4548 }
4549 ]
4550 },
4551 "string-raw-quoted-single-line": {
4552 "name": "string.quoted.raw.single.python",
4553 "begin": "\\b(([uU]R)|(R))((['\"]))",
4554 "end": "(\\4)|((?<!\\\\)\\n)",
4555 "beginCaptures": {
4556 "2": {
4557 "name": "invalid.deprecated.prefix.python"
4558 },
4559 "3": {
4560 "name": "storage.type.string.python"
4561 },
4562 "4": {
4563 "name": "punctuation.definition.string.begin.python"
4564 }
4565 },
4566 "endCaptures": {
4567 "1": {
4568 "name": "punctuation.definition.string.end.python"
4569 },
4570 "2": {
4571 "name": "invalid.illegal.newline.python"
4572 }
4573 },
4574 "patterns": [
4575 {
4576 "include": "#string-single-bad-brace1-formatting-raw"
4577 },
4578 {
4579 "include": "#string-single-bad-brace2-formatting-raw"
4580 },
4581 {
4582 "include": "#string-raw-guts"
4583 }
4584 ]
4585 },
4586 "string-bin-quoted-single-line": {
4587 "name": "string.quoted.binary.single.python",
4588 "begin": "(\\b[bB])((['\"]))",
4589 "end": "(\\2)|((?<!\\\\)\\n)",
4590 "beginCaptures": {
4591 "1": {
4592 "name": "storage.type.string.python"
4593 },
4594 "2": {
4595 "name": "punctuation.definition.string.begin.python"
4596 }
4597 },
4598 "endCaptures": {
4599 "1": {
4600 "name": "punctuation.definition.string.end.python"
4601 },
4602 "2": {
4603 "name": "invalid.illegal.newline.python"
4604 }
4605 },
4606 "patterns": [
4607 {
4608 "include": "#string-entity"
4609 }
4610 ]
4611 },
4612 "string-raw-bin-quoted-single-line": {
4613 "name": "string.quoted.raw.binary.single.python",
4614 "begin": "(\\b(?:R[bB]|[bB]R))((['\"]))",
4615 "end": "(\\2)|((?<!\\\\)\\n)",
4616 "beginCaptures": {
4617 "1": {
4618 "name": "storage.type.string.python"
4619 },
4620 "2": {
4621 "name": "punctuation.definition.string.begin.python"
4622 }
4623 },
4624 "endCaptures": {
4625 "1": {
4626 "name": "punctuation.definition.string.end.python"
4627 },
4628 "2": {
4629 "name": "invalid.illegal.newline.python"
4630 }
4631 },
4632 "patterns": [
4633 {
4634 "include": "#string-raw-bin-guts"
4635 }
4636 ]
4637 },
4638 "string-quoted-single-line": {
4639 "name": "string.quoted.single.python",
4640 "begin": "(?:\\b([rR])(?=[uU]))?([uU])?((['\"]))",
4641 "end": "(\\3)|((?<!\\\\)\\n)",
4642 "beginCaptures": {
4643 "1": {
4644 "name": "invalid.illegal.prefix.python"
4645 },
4646 "2": {
4647 "name": "storage.type.string.python"
4648 },
4649 "3": {
4650 "name": "punctuation.definition.string.begin.python"
4651 }
4652 },
4653 "endCaptures": {
4654 "1": {
4655 "name": "punctuation.definition.string.end.python"
4656 },
4657 "2": {
4658 "name": "invalid.illegal.newline.python"
4659 }
4660 },
4661 "patterns": [
4662 {
4663 "include": "#string-single-bad-brace1-formatting-unicode"
4664 },
4665 {
4666 "include": "#string-single-bad-brace2-formatting-unicode"
4667 },
4668 {
4669 "include": "#string-unicode-guts"
4670 }
4671 ]
4672 },
4673 "string-single-bad-brace1-formatting-unicode": {
4674 "comment": "template using {% ... %}",
4675 "begin": "(?x)\n (?= \\{%\n ( .*? (?!(['\"])|((?<!\\\\)\\n)) )\n %\\}\n )\n",
4676 "end": "(?=(['\"])|((?<!\\\\)\\n))",
4677 "patterns": [
4678 {
4679 "include": "#escape-sequence-unicode"
4680 },
4681 {
4682 "include": "#escape-sequence"
4683 },
4684 {
4685 "include": "#string-line-continuation"
4686 }
4687 ]
4688 },
4689 "string-single-bad-brace1-formatting-raw": {
4690 "comment": "template using {% ... %}",
4691 "begin": "(?x)\n (?= \\{%\n ( .*? (?!(['\"])|((?<!\\\\)\\n)) )\n %\\}\n )\n",
4692 "end": "(?=(['\"])|((?<!\\\\)\\n))",
4693 "patterns": [
4694 {
4695 "include": "#string-consume-escape"
4696 }
4697 ]
4698 },
4699 "string-single-bad-brace2-formatting-unicode": {
4700 "comment": "odd format or format-like syntax",
4701 "begin": "(?x)\n (?!\\{\\{)\n (?= \\{ (\n \\w*? (?!(['\"])|((?<!\\\\)\\n)) [^!:\\.\\[}\\w]\n )\n .*?(?!(['\"])|((?<!\\\\)\\n))\n \\}\n )\n",
4702 "end": "(?=(['\"])|((?<!\\\\)\\n))",
4703 "patterns": [
4704 {
4705 "include": "#escape-sequence-unicode"
4706 },
4707 {
4708 "include": "#string-entity"
4709 }
4710 ]
4711 },
4712 "string-single-bad-brace2-formatting-raw": {
4713 "comment": "odd format or format-like syntax",
4714 "begin": "(?x)\n (?!\\{\\{)\n (?= \\{ (\n \\w*? (?!(['\"])|((?<!\\\\)\\n)) [^!:\\.\\[}\\w]\n )\n .*?(?!(['\"])|((?<!\\\\)\\n))\n \\}\n )\n",
4715 "end": "(?=(['\"])|((?<!\\\\)\\n))",
4716 "patterns": [
4717 {
4718 "include": "#string-consume-escape"
4719 },
4720 {
4721 "include": "#string-formatting"
4722 }
4723 ]
4724 },
4725 "string-raw-quoted-multi-line": {
4726 "name": "string.quoted.raw.multi.python",
4727 "begin": "\\b(([uU]R)|(R))('''|\"\"\")",
4728 "end": "(\\4)",
4729 "beginCaptures": {
4730 "2": {
4731 "name": "invalid.deprecated.prefix.python"
4732 },
4733 "3": {
4734 "name": "storage.type.string.python"
4735 },
4736 "4": {
4737 "name": "punctuation.definition.string.begin.python"
4738 }
4739 },
4740 "endCaptures": {
4741 "1": {
4742 "name": "punctuation.definition.string.end.python"
4743 },
4744 "2": {
4745 "name": "invalid.illegal.newline.python"
4746 }
4747 },
4748 "patterns": [
4749 {
4750 "include": "#string-multi-bad-brace1-formatting-raw"
4751 },
4752 {
4753 "include": "#string-multi-bad-brace2-formatting-raw"
4754 },
4755 {
4756 "include": "#string-raw-guts"
4757 }
4758 ]
4759 },
4760 "string-bin-quoted-multi-line": {
4761 "name": "string.quoted.binary.multi.python",
4762 "begin": "(\\b[bB])('''|\"\"\")",
4763 "end": "(\\2)",
4764 "beginCaptures": {
4765 "1": {
4766 "name": "storage.type.string.python"
4767 },
4768 "2": {
4769 "name": "punctuation.definition.string.begin.python"
4770 }
4771 },
4772 "endCaptures": {
4773 "1": {
4774 "name": "punctuation.definition.string.end.python"
4775 },
4776 "2": {
4777 "name": "invalid.illegal.newline.python"
4778 }
4779 },
4780 "patterns": [
4781 {
4782 "include": "#string-entity"
4783 }
4784 ]
4785 },
4786 "string-raw-bin-quoted-multi-line": {
4787 "name": "string.quoted.raw.binary.multi.python",
4788 "begin": "(\\b(?:R[bB]|[bB]R))('''|\"\"\")",
4789 "end": "(\\2)",
4790 "beginCaptures": {
4791 "1": {
4792 "name": "storage.type.string.python"
4793 },
4794 "2": {
4795 "name": "punctuation.definition.string.begin.python"
4796 }
4797 },
4798 "endCaptures": {
4799 "1": {
4800 "name": "punctuation.definition.string.end.python"
4801 },
4802 "2": {
4803 "name": "invalid.illegal.newline.python"
4804 }
4805 },
4806 "patterns": [
4807 {
4808 "include": "#string-raw-bin-guts"
4809 }
4810 ]
4811 },
4812 "string-quoted-multi-line": {
4813 "name": "string.quoted.multi.python",
4814 "begin": "(?:\\b([rR])(?=[uU]))?([uU])?('''|\"\"\")",
4815 "end": "(\\3)",
4816 "beginCaptures": {
4817 "1": {
4818 "name": "invalid.illegal.prefix.python"
4819 },
4820 "2": {
4821 "name": "storage.type.string.python"
4822 },
4823 "3": {
4824 "name": "punctuation.definition.string.begin.python"
4825 }
4826 },
4827 "endCaptures": {
4828 "1": {
4829 "name": "punctuation.definition.string.end.python"
4830 },
4831 "2": {
4832 "name": "invalid.illegal.newline.python"
4833 }
4834 },
4835 "patterns": [
4836 {
4837 "include": "#string-multi-bad-brace1-formatting-unicode"
4838 },
4839 {
4840 "include": "#string-multi-bad-brace2-formatting-unicode"
4841 },
4842 {
4843 "include": "#string-unicode-guts"
4844 }
4845 ]
4846 },
4847 "string-multi-bad-brace1-formatting-unicode": {
4848 "comment": "template using {% ... %}",
4849 "begin": "(?x)\n (?= \\{%\n ( .*? (?!'''|\"\"\") )\n %\\}\n )\n",
4850 "end": "(?='''|\"\"\")",
4851 "patterns": [
4852 {
4853 "include": "#escape-sequence-unicode"
4854 },
4855 {
4856 "include": "#escape-sequence"
4857 },
4858 {
4859 "include": "#string-line-continuation"
4860 }
4861 ]
4862 },
4863 "string-multi-bad-brace1-formatting-raw": {
4864 "comment": "template using {% ... %}",
4865 "begin": "(?x)\n (?= \\{%\n ( .*? (?!'''|\"\"\") )\n %\\}\n )\n",
4866 "end": "(?='''|\"\"\")",
4867 "patterns": [
4868 {
4869 "include": "#string-consume-escape"
4870 }
4871 ]
4872 },
4873 "string-multi-bad-brace2-formatting-unicode": {
4874 "comment": "odd format or format-like syntax",
4875 "begin": "(?x)\n (?!\\{\\{)\n (?= \\{ (\n \\w*? (?!'''|\"\"\") [^!:\\.\\[}\\w]\n )\n .*?(?!'''|\"\"\")\n \\}\n )\n",
4876 "end": "(?='''|\"\"\")",
4877 "patterns": [
4878 {
4879 "include": "#escape-sequence-unicode"
4880 },
4881 {
4882 "include": "#string-entity"
4883 }
4884 ]
4885 },
4886 "string-multi-bad-brace2-formatting-raw": {
4887 "comment": "odd format or format-like syntax",
4888 "begin": "(?x)\n (?!\\{\\{)\n (?= \\{ (\n \\w*? (?!'''|\"\"\") [^!:\\.\\[}\\w]\n )\n .*?(?!'''|\"\"\")\n \\}\n )\n",
4889 "end": "(?='''|\"\"\")",
4890 "patterns": [
4891 {
4892 "include": "#string-consume-escape"
4893 },
4894 {
4895 "include": "#string-formatting"
4896 }
4897 ]
4898 },
4899 "fstring-fnorm-quoted-single-line": {
4900 "name": "meta.fstring.python",
4901 "begin": "(\\b[fF])([bBuU])?((['\"]))",
4902 "end": "(\\3)|((?<!\\\\)\\n)",
4903 "beginCaptures": {
4904 "1": {
4905 "name": "string.interpolated.python string.quoted.single.python storage.type.string.python"
4906 },
4907 "2": {
4908 "name": "invalid.illegal.prefix.python"
4909 },
4910 "3": {
4911 "name": "punctuation.definition.string.begin.python string.interpolated.python string.quoted.single.python"
4912 }
4913 },
4914 "endCaptures": {
4915 "1": {
4916 "name": "punctuation.definition.string.end.python string.interpolated.python string.quoted.single.python"
4917 },
4918 "2": {
4919 "name": "invalid.illegal.newline.python"
4920 }
4921 },
4922 "patterns": [
4923 {
4924 "include": "#fstring-guts"
4925 },
4926 {
4927 "include": "#fstring-illegal-single-brace"
4928 },
4929 {
4930 "include": "#fstring-single-brace"
4931 },
4932 {
4933 "include": "#fstring-single-core"
4934 }
4935 ]
4936 },
4937 "fstring-normf-quoted-single-line": {
4938 "name": "meta.fstring.python",
4939 "begin": "(\\b[bBuU])([fF])((['\"]))",
4940 "end": "(\\3)|((?<!\\\\)\\n)",
4941 "beginCaptures": {
4942 "1": {
4943 "name": "invalid.illegal.prefix.python"
4944 },
4945 "2": {
4946 "name": "string.interpolated.python string.quoted.single.python storage.type.string.python"
4947 },
4948 "3": {
4949 "name": "punctuation.definition.string.begin.python string.quoted.single.python"
4950 }
4951 },
4952 "endCaptures": {
4953 "1": {
4954 "name": "punctuation.definition.string.end.python string.interpolated.python string.quoted.single.python"
4955 },
4956 "2": {
4957 "name": "invalid.illegal.newline.python"
4958 }
4959 },
4960 "patterns": [
4961 {
4962 "include": "#fstring-guts"
4963 },
4964 {
4965 "include": "#fstring-illegal-single-brace"
4966 },
4967 {
4968 "include": "#fstring-single-brace"
4969 },
4970 {
4971 "include": "#fstring-single-core"
4972 }
4973 ]
4974 },
4975 "fstring-raw-quoted-single-line": {
4976 "name": "meta.fstring.python",
4977 "begin": "(\\b(?:[R][fF]|[fF][R]))((['\"]))",
4978 "end": "(\\2)|((?<!\\\\)\\n)",
4979 "beginCaptures": {
4980 "1": {
4981 "name": "string.interpolated.python string.quoted.raw.single.python storage.type.string.python"
4982 },
4983 "2": {
4984 "name": "punctuation.definition.string.begin.python string.quoted.raw.single.python"
4985 }
4986 },
4987 "endCaptures": {
4988 "1": {
4989 "name": "punctuation.definition.string.end.python string.interpolated.python string.quoted.raw.single.python"
4990 },
4991 "2": {
4992 "name": "invalid.illegal.newline.python"
4993 }
4994 },
4995 "patterns": [
4996 {
4997 "include": "#fstring-raw-guts"
4998 },
4999 {
5000 "include": "#fstring-illegal-single-brace"
5001 },
5002 {
5003 "include": "#fstring-single-brace"
5004 },
5005 {
5006 "include": "#fstring-raw-single-core"
5007 }
5008 ]
5009 },
5010 "fstring-single-core": {
5011 "name": "string.interpolated.python string.quoted.single.python",
5012 "match": "(?x)\n (.+?)\n (\n (?# .* and .*? in multi-line match need special handling of\n newlines otherwise SublimeText and Atom will match slightly\n differently.\n\n The guard for newlines has to be separate from the\n lookahead because of special $ matching rule.)\n ($\\n?)\n |\n (?=[\\\\\\}\\{]|(['\"])|((?<!\\\\)\\n))\n )\n (?# due to how multiline regexps are matched we need a special case\n for matching a newline character)\n | \\n\n"
5013 },
5014 "fstring-raw-single-core": {
5015 "name": "string.interpolated.python string.quoted.raw.single.python",
5016 "match": "(?x)\n (.+?)\n (\n (?# .* and .*? in multi-line match need special handling of\n newlines otherwise SublimeText and Atom will match slightly\n differently.\n\n The guard for newlines has to be separate from the\n lookahead because of special $ matching rule.)\n ($\\n?)\n |\n (?=[\\\\\\}\\{]|(['\"])|((?<!\\\\)\\n))\n )\n (?# due to how multiline regexps are matched we need a special case\n for matching a newline character)\n | \\n\n"
5017 },
5018 "fstring-single-brace": {
5019 "comment": "value interpolation using { ... }",
5020 "begin": "(\\{)",
5021 "end": "(?x)\n (\\})|(?=\\n)\n",
5022 "beginCaptures": {
5023 "1": {
5024 "name": "constant.character.format.placeholder.other.python"
5025 }
5026 },
5027 "endCaptures": {
5028 "1": {
5029 "name": "constant.character.format.placeholder.other.python"
5030 }
5031 },
5032 "patterns": [
5033 {
5034 "include": "#fstring-terminator-single"
5035 },
5036 {
5037 "include": "#f-expression"
5038 }
5039 ]
5040 },
5041 "fstring-terminator-single": {
5042 "patterns": [
5043 {
5044 "name": "storage.type.format.python",
5045 "match": "(![rsa])(?=})"
5046 },
5047 {
5048 "match": "(?x)\n (![rsa])?\n ( : \\w? [<>=^]? [-+ ]? \\#?\n \\d* ,? (\\.\\d+)? [bcdeEfFgGnosxX%]? )(?=})\n",
5049 "captures": {
5050 "1": {
5051 "name": "storage.type.format.python"
5052 },
5053 "2": {
5054 "name": "storage.type.format.python"
5055 }
5056 }
5057 },
5058 {
5059 "include": "#fstring-terminator-single-tail"
5060 }
5061 ]
5062 },
5063 "fstring-terminator-single-tail": {
5064 "begin": "(![rsa])?(:)(?=.*?{)",
5065 "end": "(?=})|(?=\\n)",
5066 "beginCaptures": {
5067 "1": {
5068 "name": "storage.type.format.python"
5069 },
5070 "2": {
5071 "name": "storage.type.format.python"
5072 }
5073 },
5074 "patterns": [
5075 {
5076 "include": "#fstring-illegal-single-brace"
5077 },
5078 {
5079 "include": "#fstring-single-brace"
5080 },
5081 {
5082 "name": "storage.type.format.python",
5083 "match": "([bcdeEfFgGnosxX%])(?=})"
5084 },
5085 {
5086 "name": "storage.type.format.python",
5087 "match": "(\\.\\d+)"
5088 },
5089 {
5090 "name": "storage.type.format.python",
5091 "match": "(,)"
5092 },
5093 {
5094 "name": "storage.type.format.python",
5095 "match": "(\\d+)"
5096 },
5097 {
5098 "name": "storage.type.format.python",
5099 "match": "(\\#)"
5100 },
5101 {
5102 "name": "storage.type.format.python",
5103 "match": "([-+ ])"
5104 },
5105 {
5106 "name": "storage.type.format.python",
5107 "match": "([<>=^])"
5108 },
5109 {
5110 "name": "storage.type.format.python",
5111 "match": "(\\w)"
5112 }
5113 ]
5114 },
5115 "fstring-fnorm-quoted-multi-line": {
5116 "name": "meta.fstring.python",
5117 "begin": "(\\b[fF])([bBuU])?('''|\"\"\")",
5118 "end": "(\\3)",
5119 "beginCaptures": {
5120 "1": {
5121 "name": "string.interpolated.python string.quoted.multi.python storage.type.string.python"
5122 },
5123 "2": {
5124 "name": "invalid.illegal.prefix.python"
5125 },
5126 "3": {
5127 "name": "punctuation.definition.string.begin.python string.interpolated.python string.quoted.multi.python"
5128 }
5129 },
5130 "endCaptures": {
5131 "1": {
5132 "name": "punctuation.definition.string.end.python string.interpolated.python string.quoted.multi.python"
5133 },
5134 "2": {
5135 "name": "invalid.illegal.newline.python"
5136 }
5137 },
5138 "patterns": [
5139 {
5140 "include": "#fstring-guts"
5141 },
5142 {
5143 "include": "#fstring-illegal-multi-brace"
5144 },
5145 {
5146 "include": "#fstring-multi-brace"
5147 },
5148 {
5149 "include": "#fstring-multi-core"
5150 }
5151 ]
5152 },
5153 "fstring-normf-quoted-multi-line": {
5154 "name": "meta.fstring.python",
5155 "begin": "(\\b[bBuU])([fF])('''|\"\"\")",
5156 "end": "(\\3)",
5157 "beginCaptures": {
5158 "1": {
5159 "name": "invalid.illegal.prefix.python"
5160 },
5161 "2": {
5162 "name": "string.interpolated.python string.quoted.multi.python storage.type.string.python"
5163 },
5164 "3": {
5165 "name": "punctuation.definition.string.begin.python string.quoted.multi.python"
5166 }
5167 },
5168 "endCaptures": {
5169 "1": {
5170 "name": "punctuation.definition.string.end.python string.interpolated.python string.quoted.multi.python"
5171 },
5172 "2": {
5173 "name": "invalid.illegal.newline.python"
5174 }
5175 },
5176 "patterns": [
5177 {
5178 "include": "#fstring-guts"
5179 },
5180 {
5181 "include": "#fstring-illegal-multi-brace"
5182 },
5183 {
5184 "include": "#fstring-multi-brace"
5185 },
5186 {
5187 "include": "#fstring-multi-core"
5188 }
5189 ]
5190 },
5191 "fstring-raw-quoted-multi-line": {
5192 "name": "meta.fstring.python",
5193 "begin": "(\\b(?:[R][fF]|[fF][R]))('''|\"\"\")",
5194 "end": "(\\2)",
5195 "beginCaptures": {
5196 "1": {
5197 "name": "string.interpolated.python string.quoted.raw.multi.python storage.type.string.python"
5198 },
5199 "2": {
5200 "name": "punctuation.definition.string.begin.python string.quoted.raw.multi.python"
5201 }
5202 },
5203 "endCaptures": {
5204 "1": {
5205 "name": "punctuation.definition.string.end.python string.interpolated.python string.quoted.raw.multi.python"
5206 },
5207 "2": {
5208 "name": "invalid.illegal.newline.python"
5209 }
5210 },
5211 "patterns": [
5212 {
5213 "include": "#fstring-raw-guts"
5214 },
5215 {
5216 "include": "#fstring-illegal-multi-brace"
5217 },
5218 {
5219 "include": "#fstring-multi-brace"
5220 },
5221 {
5222 "include": "#fstring-raw-multi-core"
5223 }
5224 ]
5225 },
5226 "fstring-multi-core": {
5227 "name": "string.interpolated.python string.quoted.multi.python",
5228 "match": "(?x)\n (.+?)\n (\n (?# .* and .*? in multi-line match need special handling of\n newlines otherwise SublimeText and Atom will match slightly\n differently.\n\n The guard for newlines has to be separate from the\n lookahead because of special $ matching rule.)\n ($\\n?)\n |\n (?=[\\\\\\}\\{]|'''|\"\"\")\n )\n (?# due to how multiline regexps are matched we need a special case\n for matching a newline character)\n | \\n\n"
5229 },
5230 "fstring-raw-multi-core": {
5231 "name": "string.interpolated.python string.quoted.raw.multi.python",
5232 "match": "(?x)\n (.+?)\n (\n (?# .* and .*? in multi-line match need special handling of\n newlines otherwise SublimeText and Atom will match slightly\n differently.\n\n The guard for newlines has to be separate from the\n lookahead because of special $ matching rule.)\n ($\\n?)\n |\n (?=[\\\\\\}\\{]|'''|\"\"\")\n )\n (?# due to how multiline regexps are matched we need a special case\n for matching a newline character)\n | \\n\n"
5233 },
5234 "fstring-multi-brace": {
5235 "comment": "value interpolation using { ... }",
5236 "begin": "(\\{)",
5237 "end": "(?x)\n (\\})\n",
5238 "beginCaptures": {
5239 "1": {
5240 "name": "constant.character.format.placeholder.other.python"
5241 }
5242 },
5243 "endCaptures": {
5244 "1": {
5245 "name": "constant.character.format.placeholder.other.python"
5246 }
5247 },
5248 "patterns": [
5249 {
5250 "include": "#fstring-terminator-multi"
5251 },
5252 {
5253 "include": "#f-expression"
5254 }
5255 ]
5256 },
5257 "fstring-terminator-multi": {
5258 "patterns": [
5259 {
5260 "name": "storage.type.format.python",
5261 "match": "(![rsa])(?=})"
5262 },
5263 {
5264 "match": "(?x)\n (![rsa])?\n ( : \\w? [<>=^]? [-+ ]? \\#?\n \\d* ,? (\\.\\d+)? [bcdeEfFgGnosxX%]? )(?=})\n",
5265 "captures": {
5266 "1": {
5267 "name": "storage.type.format.python"
5268 },
5269 "2": {
5270 "name": "storage.type.format.python"
5271 }
5272 }
5273 },
5274 {
5275 "include": "#fstring-terminator-multi-tail"
5276 }
5277 ]
5278 },
5279 "fstring-terminator-multi-tail": {
5280 "begin": "(![rsa])?(:)(?=.*?{)",
5281 "end": "(?=})",
5282 "beginCaptures": {
5283 "1": {
5284 "name": "storage.type.format.python"
5285 },
5286 "2": {
5287 "name": "storage.type.format.python"
5288 }
5289 },
5290 "patterns": [
5291 {
5292 "include": "#fstring-illegal-multi-brace"
5293 },
5294 {
5295 "include": "#fstring-multi-brace"
5296 },
5297 {
5298 "name": "storage.type.format.python",
5299 "match": "([bcdeEfFgGnosxX%])(?=})"
5300 },
5301 {
5302 "name": "storage.type.format.python",
5303 "match": "(\\.\\d+)"
5304 },
5305 {
5306 "name": "storage.type.format.python",
5307 "match": "(,)"
5308 },
5309 {
5310 "name": "storage.type.format.python",
5311 "match": "(\\d+)"
5312 },
5313 {
5314 "name": "storage.type.format.python",
5315 "match": "(\\#)"
5316 },
5317 {
5318 "name": "storage.type.format.python",
5319 "match": "([-+ ])"
5320 },
5321 {
5322 "name": "storage.type.format.python",
5323 "match": "([<>=^])"
5324 },
5325 {
5326 "name": "storage.type.format.python",
5327 "match": "(\\w)"
5328 }
5329 ]
5330 }
5331 }
5332 }
5333