PluginProbe
Code Block Pro – Beautiful Syntax Highlighting / 1.27.6
Code Block Pro – Beautiful Syntax Highlighting v1.27.6
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 / mojo.tmLanguage.json

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

4,159 lines 114.2 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/7d0f2b22a5ad8fccbd7341bc7b7a715169283044",
8 "name": "mojo",
9 "scopeName": "source.mojo",
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": "#semicolon"
48 }
49 ]
50 },
51 "semicolon": {
52 "patterns": [
53 {
54 "name": "invalid.deprecated.semicolon.python",
55 "match": "\\;$"
56 }
57 ]
58 },
59 "comments": {
60 "patterns": [
61 {
62 "name": "comment.line.number-sign.python",
63 "contentName": "meta.typehint.comment.python",
64 "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",
65 "end": "(?:$|(?=\\#))",
66 "beginCaptures": {
67 "0": {
68 "name": "meta.typehint.comment.python"
69 },
70 "1": {
71 "name": "comment.typehint.directive.notation.python"
72 }
73 },
74 "patterns": [
75 {
76 "name": "comment.typehint.ignore.notation.python",
77 "match": "(?x)\n \\G ignore\n (?= \\s* (?: $ | \\#))\n"
78 },
79 {
80 "name": "comment.typehint.type.notation.python",
81 "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"
82 },
83 {
84 "name": "comment.typehint.punctuation.notation.python",
85 "match": "([\\[\\]\\(\\),\\.\\=\\*]|(->))"
86 },
87 {
88 "name": "comment.typehint.variable.notation.python",
89 "match": "([[:alpha:]_]\\w*)"
90 }
91 ]
92 },
93 {
94 "include": "#comments-base"
95 }
96 ]
97 },
98 "statement-keyword": {
99 "patterns": [
100 {
101 "name": "storage.type.function.python",
102 "match": "\\b((async\\s+)?\\s*def)\\b"
103 },
104 {
105 "name": "keyword.control.flow.python",
106 "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",
107 "match": "\\b(?<!\\.)as\\b(?=.*[:\\\\])"
108 },
109 {
110 "name": "keyword.control.import.python",
111 "comment": "other legal use of `as` is in an import",
112 "match": "\\b(?<!\\.)as\\b"
113 },
114 {
115 "name": "keyword.control.flow.python",
116 "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"
117 },
118 {
119 "name": "storage.modifier.declaration.python",
120 "match": "(?x)\n \\b(?<!\\.)(\n global | nonlocal\n )\\b\n"
121 },
122 {
123 "name": "storage.type.class.python",
124 "match": "\\b(?<!\\.)(class|struct|trait)\\b"
125 },
126 {
127 "match": "(?x)\n ^\\s*(\n case | match\n )(?=\\s*([-+\\w\\d(\\[{'\":#]|$))\\b\n",
128 "captures": {
129 "1": {
130 "name": "keyword.control.flow.python"
131 }
132 }
133 },
134 {
135 "match": "\\b(var|let|alias) \\s*([[:alpha:]_]\\w*)\\b",
136 "captures": {
137 "1": {
138 "name": "storage.modifier.declaration.python"
139 },
140 "2": {
141 "name": "variable.other.python"
142 }
143 }
144 }
145 ]
146 },
147 "expression-bare": {
148 "comment": "valid Python expressions w/o comments and line continuation",
149 "patterns": [
150 {
151 "include": "#backticks"
152 },
153 {
154 "include": "#illegal-anno"
155 },
156 {
157 "include": "#literal"
158 },
159 {
160 "include": "#regexp"
161 },
162 {
163 "include": "#string"
164 },
165 {
166 "include": "#lambda"
167 },
168 {
169 "include": "#generator"
170 },
171 {
172 "include": "#illegal-operator"
173 },
174 {
175 "include": "#operator"
176 },
177 {
178 "include": "#curly-braces"
179 },
180 {
181 "include": "#item-access"
182 },
183 {
184 "include": "#list"
185 },
186 {
187 "include": "#odd-function-call"
188 },
189 {
190 "include": "#round-braces"
191 },
192 {
193 "include": "#function-call"
194 },
195 {
196 "include": "#builtin-functions"
197 },
198 {
199 "include": "#builtin-types"
200 },
201 {
202 "include": "#builtin-exceptions"
203 },
204 {
205 "include": "#magic-names"
206 },
207 {
208 "include": "#special-names"
209 },
210 {
211 "include": "#illegal-names"
212 },
213 {
214 "include": "#special-variables"
215 },
216 {
217 "include": "#ellipsis"
218 },
219 {
220 "include": "#punctuation"
221 },
222 {
223 "include": "#line-continuation"
224 }
225 ]
226 },
227 "expression-base": {
228 "comment": "valid Python expressions with comments and line continuation",
229 "patterns": [
230 {
231 "include": "#comments"
232 },
233 {
234 "include": "#expression-bare"
235 },
236 {
237 "include": "#line-continuation"
238 }
239 ]
240 },
241 "expression": {
242 "comment": "All valid Python expressions",
243 "patterns": [
244 {
245 "include": "#expression-base"
246 },
247 {
248 "include": "#member-access"
249 },
250 {
251 "comment": "Tokenize identifiers to help linters",
252 "match": "(?x) \\b ([[:alpha:]_]\\w*) \\b"
253 }
254 ]
255 },
256 "member-access": {
257 "name": "meta.member.access.python",
258 "begin": "(\\.)\\s*(?!\\.)",
259 "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",
260 "beginCaptures": {
261 "1": {
262 "name": "punctuation.separator.period.python"
263 }
264 },
265 "patterns": [
266 {
267 "include": "#function-call"
268 },
269 {
270 "include": "#member-access-base"
271 },
272 {
273 "include": "#member-access-attribute"
274 }
275 ]
276 },
277 "member-access-base": {
278 "patterns": [
279 {
280 "include": "#magic-names"
281 },
282 {
283 "include": "#illegal-names"
284 },
285 {
286 "include": "#illegal-object-name"
287 },
288 {
289 "include": "#special-names"
290 },
291 {
292 "include": "#line-continuation"
293 },
294 {
295 "include": "#item-access"
296 }
297 ]
298 },
299 "member-access-attribute": {
300 "comment": "Highlight attribute access in otherwise non-specialized cases.",
301 "name": "meta.attribute.python",
302 "match": "(?x)\n \\b ([[:alpha:]_]\\w*) \\b\n"
303 },
304 "special-names": {
305 "name": "constant.other.caps.python",
306 "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"
307 },
308 "curly-braces": {
309 "begin": "\\{",
310 "end": "\\}",
311 "beginCaptures": {
312 "0": {
313 "name": "punctuation.definition.dict.begin.python"
314 }
315 },
316 "endCaptures": {
317 "0": {
318 "name": "punctuation.definition.dict.end.python"
319 }
320 },
321 "patterns": [
322 {
323 "name": "punctuation.separator.dict.python",
324 "match": ":"
325 },
326 {
327 "include": "#expression"
328 }
329 ]
330 },
331 "list": {
332 "begin": "\\[",
333 "end": "\\]",
334 "beginCaptures": {
335 "0": {
336 "name": "punctuation.definition.list.begin.python"
337 }
338 },
339 "endCaptures": {
340 "0": {
341 "name": "punctuation.definition.list.end.python"
342 }
343 },
344 "patterns": [
345 {
346 "include": "#expression"
347 }
348 ]
349 },
350 "odd-function-call": {
351 "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",
352 "begin": "(?x)\n (?<= \\] | \\) ) \\s*\n (?=\\()\n",
353 "end": "(\\))",
354 "endCaptures": {
355 "1": {
356 "name": "punctuation.definition.arguments.end.python"
357 }
358 },
359 "patterns": [
360 {
361 "include": "#function-arguments"
362 }
363 ]
364 },
365 "round-braces": {
366 "begin": "\\(",
367 "end": "\\)",
368 "beginCaptures": {
369 "0": {
370 "name": "punctuation.parenthesis.begin.python"
371 }
372 },
373 "endCaptures": {
374 "0": {
375 "name": "punctuation.parenthesis.end.python"
376 }
377 },
378 "patterns": [
379 {
380 "include": "#expression"
381 }
382 ]
383 },
384 "line-continuation": {
385 "patterns": [
386 {
387 "match": "(\\\\)\\s*(\\S.*$\\n?)",
388 "captures": {
389 "1": {
390 "name": "punctuation.separator.continuation.line.python"
391 },
392 "2": {
393 "name": "invalid.illegal.line.continuation.python"
394 }
395 }
396 },
397 {
398 "begin": "(\\\\)\\s*$\\n?",
399 "end": "(?x)\n (?=^\\s*$)\n |\n (?! (\\s* [rR]? (\\'\\'\\'|\\\"\\\"\\\"|\\'|\\\"))\n |\n (\\G $) (?# '\\G' is necessary for ST)\n )\n",
400 "beginCaptures": {
401 "1": {
402 "name": "punctuation.separator.continuation.line.python"
403 }
404 },
405 "patterns": [
406 {
407 "include": "#regexp"
408 },
409 {
410 "include": "#string"
411 }
412 ]
413 }
414 ]
415 },
416 "assignment-operator": {
417 "name": "keyword.operator.assignment.python",
418 "match": "(?x)\n <<= | >>= | //= | \\*\\*=\n | \\+= | -= | /= | @=\n | \\*= | %= | ~= | \\^= | &= | \\|=\n | =(?!=)\n"
419 },
420 "operator": {
421 "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\n | (:=) (?# 6)\n",
422 "captures": {
423 "1": {
424 "name": "keyword.operator.logical.python"
425 },
426 "2": {
427 "name": "keyword.control.flow.python"
428 },
429 "3": {
430 "name": "keyword.operator.bitwise.python"
431 },
432 "4": {
433 "name": "keyword.operator.arithmetic.python"
434 },
435 "5": {
436 "name": "keyword.operator.comparison.python"
437 },
438 "6": {
439 "name": "keyword.operator.assignment.python"
440 }
441 }
442 },
443 "punctuation": {
444 "patterns": [
445 {
446 "name": "punctuation.separator.colon.python",
447 "match": ":"
448 },
449 {
450 "name": "punctuation.separator.element.python",
451 "match": ","
452 }
453 ]
454 },
455 "literal": {
456 "patterns": [
457 {
458 "name": "constant.language.python",
459 "match": "\\b(True|False|None|NotImplemented|Ellipsis)\\b"
460 },
461 {
462 "include": "#number"
463 }
464 ]
465 },
466 "number": {
467 "name": "constant.numeric.python",
468 "patterns": [
469 {
470 "include": "#number-float"
471 },
472 {
473 "include": "#number-dec"
474 },
475 {
476 "include": "#number-hex"
477 },
478 {
479 "include": "#number-oct"
480 },
481 {
482 "include": "#number-bin"
483 },
484 {
485 "include": "#number-long"
486 },
487 {
488 "name": "invalid.illegal.name.python",
489 "match": "\\b[0-9]+\\w+"
490 }
491 ]
492 },
493 "number-float": {
494 "name": "constant.numeric.float.python",
495 "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",
496 "captures": {
497 "1": {
498 "name": "storage.type.imaginary.number.python"
499 }
500 }
501 },
502 "number-dec": {
503 "name": "constant.numeric.dec.python",
504 "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",
505 "captures": {
506 "1": {
507 "name": "storage.type.imaginary.number.python"
508 },
509 "2": {
510 "name": "invalid.illegal.dec.python"
511 }
512 }
513 },
514 "number-hex": {
515 "name": "constant.numeric.hex.python",
516 "match": "(?x)\n (?<![\\w\\.])\n (0[xX]) (_?[0-9a-fA-F])+\n \\b\n",
517 "captures": {
518 "1": {
519 "name": "storage.type.number.python"
520 }
521 }
522 },
523 "number-oct": {
524 "name": "constant.numeric.oct.python",
525 "match": "(?x)\n (?<![\\w\\.])\n (0[oO]) (_?[0-7])+\n \\b\n",
526 "captures": {
527 "1": {
528 "name": "storage.type.number.python"
529 }
530 }
531 },
532 "number-bin": {
533 "name": "constant.numeric.bin.python",
534 "match": "(?x)\n (?<![\\w\\.])\n (0[bB]) (_?[01])+\n \\b\n",
535 "captures": {
536 "1": {
537 "name": "storage.type.number.python"
538 }
539 }
540 },
541 "number-long": {
542 "name": "constant.numeric.bin.python",
543 "comment": "this is to support python2 syntax for long ints",
544 "match": "(?x)\n (?<![\\w\\.])\n ([1-9][0-9]* | 0) ([lL])\n \\b\n",
545 "captures": {
546 "2": {
547 "name": "storage.type.number.python"
548 }
549 }
550 },
551 "regexp": {
552 "patterns": [
553 {
554 "include": "#regexp-single-three-line"
555 },
556 {
557 "include": "#regexp-double-three-line"
558 },
559 {
560 "include": "#regexp-single-one-line"
561 },
562 {
563 "include": "#regexp-double-one-line"
564 }
565 ]
566 },
567 "string": {
568 "patterns": [
569 {
570 "include": "#string-quoted-multi-line"
571 },
572 {
573 "include": "#string-quoted-single-line"
574 },
575 {
576 "include": "#string-bin-quoted-multi-line"
577 },
578 {
579 "include": "#string-bin-quoted-single-line"
580 },
581 {
582 "include": "#string-raw-quoted-multi-line"
583 },
584 {
585 "include": "#string-raw-quoted-single-line"
586 },
587 {
588 "include": "#string-raw-bin-quoted-multi-line"
589 },
590 {
591 "include": "#string-raw-bin-quoted-single-line"
592 },
593 {
594 "include": "#fstring-fnorm-quoted-multi-line"
595 },
596 {
597 "include": "#fstring-fnorm-quoted-single-line"
598 },
599 {
600 "include": "#fstring-normf-quoted-multi-line"
601 },
602 {
603 "include": "#fstring-normf-quoted-single-line"
604 },
605 {
606 "include": "#fstring-raw-quoted-multi-line"
607 },
608 {
609 "include": "#fstring-raw-quoted-single-line"
610 }
611 ]
612 },
613 "string-unicode-guts": {
614 "patterns": [
615 {
616 "include": "#string-mojo-code-block"
617 },
618 {
619 "include": "#escape-sequence-unicode"
620 },
621 {
622 "include": "#string-entity"
623 },
624 {
625 "include": "#string-brace-formatting"
626 }
627 ]
628 },
629 "string-consume-escape": {
630 "match": "\\\\['\"\\n\\\\]"
631 },
632 "string-raw-guts": {
633 "patterns": [
634 {
635 "include": "#string-consume-escape"
636 },
637 {
638 "include": "#string-formatting"
639 },
640 {
641 "include": "#string-brace-formatting"
642 }
643 ]
644 },
645 "string-raw-bin-guts": {
646 "patterns": [
647 {
648 "include": "#string-consume-escape"
649 },
650 {
651 "include": "#string-formatting"
652 }
653 ]
654 },
655 "string-entity": {
656 "patterns": [
657 {
658 "include": "#escape-sequence"
659 },
660 {
661 "include": "#string-line-continuation"
662 },
663 {
664 "include": "#string-formatting"
665 }
666 ]
667 },
668 "fstring-guts": {
669 "patterns": [
670 {
671 "include": "#escape-sequence-unicode"
672 },
673 {
674 "include": "#escape-sequence"
675 },
676 {
677 "include": "#string-line-continuation"
678 },
679 {
680 "include": "#fstring-formatting"
681 }
682 ]
683 },
684 "fstring-raw-guts": {
685 "patterns": [
686 {
687 "include": "#string-consume-escape"
688 },
689 {
690 "include": "#fstring-formatting"
691 }
692 ]
693 },
694 "fstring-illegal-single-brace": {
695 "comment": "it is illegal to have a multiline brace inside a single-line string",
696 "begin": "(\\{)(?=[^\\n}]*$\\n?)",
697 "end": "(\\})|(?=\\n)",
698 "beginCaptures": {
699 "1": {
700 "name": "constant.character.format.placeholder.other.python"
701 }
702 },
703 "endCaptures": {
704 "1": {
705 "name": "constant.character.format.placeholder.other.python"
706 }
707 },
708 "patterns": [
709 {
710 "include": "#fstring-terminator-single"
711 },
712 {
713 "include": "#f-expression"
714 }
715 ]
716 },
717 "fstring-illegal-multi-brace": {
718 "patterns": [
719 {
720 "include": "#impossible"
721 }
722 ]
723 },
724 "f-expression": {
725 "comment": "All valid Python expressions, except comments and line continuation",
726 "patterns": [
727 {
728 "include": "#expression-bare"
729 },
730 {
731 "include": "#member-access"
732 },
733 {
734 "comment": "Tokenize identifiers to help linters",
735 "match": "(?x) \\b ([[:alpha:]_]\\w*) \\b"
736 }
737 ]
738 },
739 "escape-sequence-unicode": {
740 "patterns": [
741 {
742 "name": "constant.character.escape.python",
743 "match": "(?x)\n \\\\ (\n u[0-9A-Fa-f]{4}\n | U[0-9A-Fa-f]{8}\n | N\\{[\\w\\s]+?\\}\n )\n"
744 }
745 ]
746 },
747 "escape-sequence": {
748 "name": "constant.character.escape.python",
749 "match": "(?x)\n \\\\ (\n x[0-9A-Fa-f]{2}\n | [0-7]{1,3}\n | [\\\\\"'abfnrtv]\n )\n"
750 },
751 "string-line-continuation": {
752 "name": "constant.language.python",
753 "match": "\\\\$"
754 },
755 "string-formatting": {
756 "name": "meta.format.percent.python",
757 "match": "(?x)\n (\n % (\\([\\w\\s]*\\))?\n [-+#0 ]*\n (\\d+|\\*)? (\\.(\\d+|\\*))?\n ([hlL])?\n [diouxXeEfFgGcrsab%]\n )\n",
758 "captures": {
759 "1": {
760 "name": "constant.character.format.placeholder.other.python"
761 }
762 }
763 },
764 "string-brace-formatting": {
765 "patterns": [
766 {
767 "name": "meta.format.brace.python",
768 "match": "(?x)\n (\n {{ | }}\n | (?:\n {\n \\w* (\\.[[:alpha:]_]\\w* | \\[[^\\]'\"]+\\])*\n (![rsa])?\n ( : \\w? [<>=^]? [-+ ]? \\#?\n \\d* ,? (\\.\\d+)? [bcdeEfFgGnosxX%]? )?\n })\n )\n",
769 "captures": {
770 "1": {
771 "name": "constant.character.format.placeholder.other.python"
772 },
773 "3": {
774 "name": "storage.type.format.python"
775 },
776 "4": {
777 "name": "storage.type.format.python"
778 }
779 }
780 },
781 {
782 "name": "meta.format.brace.python",
783 "match": "(?x)\n (\n {\n \\w* (\\.[[:alpha:]_]\\w* | \\[[^\\]'\"]+\\])*\n (![rsa])?\n (:)\n [^'\"{}\\n]* (?:\n \\{ [^'\"}\\n]*? \\} [^'\"{}\\n]*\n )*\n }\n )\n",
784 "captures": {
785 "1": {
786 "name": "constant.character.format.placeholder.other.python"
787 },
788 "3": {
789 "name": "storage.type.format.python"
790 },
791 "4": {
792 "name": "storage.type.format.python"
793 }
794 }
795 }
796 ]
797 },
798 "fstring-formatting": {
799 "patterns": [
800 {
801 "include": "#fstring-formatting-braces"
802 },
803 {
804 "include": "#fstring-formatting-singe-brace"
805 }
806 ]
807 },
808 "fstring-formatting-singe-brace": {
809 "name": "invalid.illegal.brace.python",
810 "match": "(}(?!}))"
811 },
812 "import": {
813 "comment": "Import statements used to correctly mark `from`, `import`, and `as`\n",
814 "patterns": [
815 {
816 "begin": "\\b(?<!\\.)(from)\\b(?=.+import)",
817 "end": "$|(?=import)",
818 "beginCaptures": {
819 "1": {
820 "name": "keyword.control.import.python"
821 }
822 },
823 "patterns": [
824 {
825 "name": "punctuation.separator.period.python",
826 "match": "\\.+"
827 },
828 {
829 "include": "#expression"
830 }
831 ]
832 },
833 {
834 "begin": "\\b(?<!\\.)(import)\\b",
835 "end": "$",
836 "beginCaptures": {
837 "1": {
838 "name": "keyword.control.import.python"
839 }
840 },
841 "patterns": [
842 {
843 "name": "keyword.control.import.python",
844 "match": "\\b(?<!\\.)as\\b"
845 },
846 {
847 "include": "#expression"
848 }
849 ]
850 }
851 ]
852 },
853 "class-declaration": {
854 "patterns": [
855 {
856 "name": "meta.class.python",
857 "begin": "(?x)\n \\s*(class|struct|trait)\\s+\n (?=\n [[:alpha:]_]\\w* \\s* (:|\\()\n )\n",
858 "end": "(:)",
859 "beginCaptures": {
860 "1": {
861 "name": "storage.type.class.python"
862 }
863 },
864 "endCaptures": {
865 "1": {
866 "name": "punctuation.section.class.begin.python"
867 }
868 },
869 "patterns": [
870 {
871 "include": "#class-name"
872 },
873 {
874 "include": "#class-inheritance"
875 }
876 ]
877 }
878 ]
879 },
880 "class-name": {
881 "patterns": [
882 {
883 "include": "#illegal-object-name"
884 },
885 {
886 "include": "#builtin-possible-callables"
887 },
888 {
889 "name": "entity.name.type.class.python",
890 "match": "(?x)\n \\b ([[:alpha:]_]\\w*) \\b\n"
891 }
892 ]
893 },
894 "class-inheritance": {
895 "name": "meta.class.inheritance.python",
896 "begin": "(\\()",
897 "end": "(\\))",
898 "beginCaptures": {
899 "1": {
900 "name": "punctuation.definition.inheritance.begin.python"
901 }
902 },
903 "endCaptures": {
904 "1": {
905 "name": "punctuation.definition.inheritance.end.python"
906 }
907 },
908 "patterns": [
909 {
910 "name": "keyword.operator.unpacking.arguments.python",
911 "match": "(\\*\\*|\\*)"
912 },
913 {
914 "name": "punctuation.separator.inheritance.python",
915 "match": ","
916 },
917 {
918 "name": "keyword.operator.assignment.python",
919 "match": "=(?!=)"
920 },
921 {
922 "name": "support.type.metaclass.python",
923 "match": "\\bmetaclass\\b"
924 },
925 {
926 "include": "#illegal-names"
927 },
928 {
929 "include": "#class-kwarg"
930 },
931 {
932 "include": "#call-wrapper-inheritance"
933 },
934 {
935 "include": "#expression-base"
936 },
937 {
938 "include": "#member-access-class"
939 },
940 {
941 "include": "#inheritance-identifier"
942 }
943 ]
944 },
945 "class-kwarg": {
946 "match": "(?x)\n \\b ([[:alpha:]_]\\w*) \\s*(=)(?!=)\n",
947 "captures": {
948 "1": {
949 "name": "entity.other.inherited-class.python variable.parameter.class.python"
950 },
951 "2": {
952 "name": "keyword.operator.assignment.python"
953 }
954 }
955 },
956 "inheritance-identifier": {
957 "match": "(?x)\n \\b ([[:alpha:]_]\\w*) \\b\n",
958 "captures": {
959 "1": {
960 "name": "entity.other.inherited-class.python"
961 }
962 }
963 },
964 "member-access-class": {
965 "name": "meta.member.access.python",
966 "begin": "(\\.)\\s*(?!\\.)",
967 "end": "(?<=\\S)(?=\\W)|$",
968 "beginCaptures": {
969 "1": {
970 "name": "punctuation.separator.period.python"
971 }
972 },
973 "patterns": [
974 {
975 "include": "#call-wrapper-inheritance"
976 },
977 {
978 "include": "#member-access-base"
979 },
980 {
981 "include": "#inheritance-identifier"
982 }
983 ]
984 },
985 "lambda": {
986 "patterns": [
987 {
988 "match": "((?<=\\.)lambda|lambda(?=\\s*[\\.=]))",
989 "captures": {
990 "1": {
991 "name": "keyword.control.flow.python"
992 }
993 }
994 },
995 {
996 "match": "\\b(lambda)\\s*?(?=[,\\n]|$)",
997 "captures": {
998 "1": {
999 "name": "storage.type.function.lambda.python"
1000 }
1001 }
1002 },
1003 {
1004 "name": "meta.lambda-function.python",
1005 "begin": "(?x)\n \\b (lambda) \\b\n",
1006 "end": "(:)|(\\n)",
1007 "beginCaptures": {
1008 "1": {
1009 "name": "storage.type.function.lambda.python"
1010 }
1011 },
1012 "endCaptures": {
1013 "1": {
1014 "name": "punctuation.section.function.lambda.begin.python"
1015 }
1016 },
1017 "contentName": "meta.function.lambda.parameters.python",
1018 "patterns": [
1019 {
1020 "name": "storage.modifier",
1021 "match": "\\b(owned|borrowed|inout)\\b"
1022 },
1023 {
1024 "name": "keyword.operator.positional.parameter.python",
1025 "match": "/"
1026 },
1027 {
1028 "name": "keyword.operator.unpacking.parameter.python",
1029 "match": "(\\*\\*|\\*)"
1030 },
1031 {
1032 "include": "#lambda-nested-incomplete"
1033 },
1034 {
1035 "include": "#illegal-names"
1036 },
1037 {
1038 "match": "([[:alpha:]_]\\w*)\\s*(?:(,)|(?=:|$))",
1039 "captures": {
1040 "1": {
1041 "name": "variable.parameter.function.language.python"
1042 },
1043 "2": {
1044 "name": "punctuation.separator.parameters.python"
1045 }
1046 }
1047 },
1048 {
1049 "include": "#comments"
1050 },
1051 {
1052 "include": "#backticks"
1053 },
1054 {
1055 "include": "#illegal-anno"
1056 },
1057 {
1058 "include": "#lambda-parameter-with-default"
1059 },
1060 {
1061 "include": "#line-continuation"
1062 },
1063 {
1064 "include": "#illegal-operator"
1065 }
1066 ]
1067 }
1068 ]
1069 },
1070 "lambda-incomplete": {
1071 "name": "storage.type.function.lambda.python",
1072 "match": "\\blambda(?=\\s*[,)])"
1073 },
1074 "lambda-nested-incomplete": {
1075 "name": "storage.type.function.lambda.python",
1076 "match": "\\blambda(?=\\s*[:,)])"
1077 },
1078 "lambda-parameter-with-default": {
1079 "begin": "(?x)\n \\b\n ([[:alpha:]_]\\w*) \\s* (=)\n",
1080 "end": "(,)|(?=:|$)",
1081 "beginCaptures": {
1082 "1": {
1083 "name": "variable.parameter.function.language.python"
1084 },
1085 "2": {
1086 "name": "keyword.operator.python"
1087 }
1088 },
1089 "endCaptures": {
1090 "1": {
1091 "name": "punctuation.separator.parameters.python"
1092 }
1093 },
1094 "patterns": [
1095 {
1096 "include": "#expression"
1097 }
1098 ]
1099 },
1100 "generator": {
1101 "comment": "Match \"for ... in\" construct used in generators and for loops to\ncorrectly identify the \"in\" as a control flow keyword.\n",
1102 "begin": "\\bfor\\b",
1103 "beginCaptures": {
1104 "0": {
1105 "name": "keyword.control.flow.python"
1106 }
1107 },
1108 "end": "\\bin\\b",
1109 "endCaptures": {
1110 "0": {
1111 "name": "keyword.control.flow.python"
1112 }
1113 },
1114 "patterns": [
1115 {
1116 "include": "#expression"
1117 }
1118 ]
1119 },
1120 "function-declaration": {
1121 "name": "meta.function.python",
1122 "begin": "(?x)\n \\s*\n (?:\\b(async) \\s+)? \\b(def|fn)\\s+\n (?=\n [[:alpha:]_][[:word:]]* \\s* [\\(\\[]\n )\n",
1123 "end": "(:|(?=[#'\"\\n]))",
1124 "beginCaptures": {
1125 "1": {
1126 "name": "storage.type.function.async.python"
1127 },
1128 "2": {
1129 "name": "storage.type.function.python"
1130 }
1131 },
1132 "endCaptures": {
1133 "1": {
1134 "name": "punctuation.section.function.begin.python"
1135 }
1136 },
1137 "patterns": [
1138 {
1139 "include": "#raises-modifier"
1140 },
1141 {
1142 "include": "#function-def-name"
1143 },
1144 {
1145 "include": "#parameters"
1146 },
1147 {
1148 "include": "#meta_parameters"
1149 },
1150 {
1151 "include": "#line-continuation"
1152 },
1153 {
1154 "include": "#return-annotation"
1155 }
1156 ]
1157 },
1158 "function-def-name": {
1159 "patterns": [
1160 {
1161 "include": "#illegal-object-name"
1162 },
1163 {
1164 "include": "#builtin-possible-callables"
1165 },
1166 {
1167 "name": "entity.name.function.python",
1168 "match": "(?x)\n \\b ([[:alpha:]_]\\w*) \\b\n"
1169 }
1170 ]
1171 },
1172 "raises-modifier": {
1173 "name": "storage.modifier",
1174 "match": "(raises)"
1175 },
1176 "parameters": {
1177 "name": "meta.function.parameters.python",
1178 "begin": "(\\()",
1179 "end": "(\\))",
1180 "beginCaptures": {
1181 "1": {
1182 "name": "punctuation.definition.parameters.begin.python"
1183 }
1184 },
1185 "endCaptures": {
1186 "1": {
1187 "name": "punctuation.definition.parameters.end.python"
1188 }
1189 },
1190 "patterns": [
1191 {
1192 "name": "storage.modifier",
1193 "match": "\\b(owned|borrowed|inout)\\b"
1194 },
1195 {
1196 "name": "keyword.operator.positional.parameter.python",
1197 "match": "/"
1198 },
1199 {
1200 "name": "keyword.operator.unpacking.parameter.python",
1201 "match": "(\\*\\*|\\*)"
1202 },
1203 {
1204 "include": "#lambda-incomplete"
1205 },
1206 {
1207 "include": "#illegal-names"
1208 },
1209 {
1210 "include": "#illegal-object-name"
1211 },
1212 {
1213 "include": "#parameter-special"
1214 },
1215 {
1216 "match": "(?x)\n ([[:alpha:]_]\\w*)\n \\s* (?: (,) | (?=[)#\\n=]))\n",
1217 "captures": {
1218 "1": {
1219 "name": "variable.parameter.function.language.python"
1220 },
1221 "2": {
1222 "name": "punctuation.separator.parameters.python"
1223 }
1224 }
1225 },
1226 {
1227 "include": "#comments"
1228 },
1229 {
1230 "include": "#loose-default"
1231 },
1232 {
1233 "include": "#annotated-parameter"
1234 }
1235 ]
1236 },
1237 "meta_parameters": {
1238 "name": "meta.function.parameters.python",
1239 "begin": "(\\[)",
1240 "end": "(\\])",
1241 "beginCaptures": {
1242 "1": {
1243 "name": "punctuation.definition.parameters.begin.python"
1244 }
1245 },
1246 "endCaptures": {
1247 "1": {
1248 "name": "punctuation.definition.parameters.end.python"
1249 }
1250 },
1251 "patterns": [
1252 {
1253 "begin": "(?x)\n \\b\n ([[:alpha:]_]\\w*) \\s* (:)\n",
1254 "end": "(,)|(?=\\])",
1255 "beginCaptures": {
1256 "1": {
1257 "name": "variable.parameter.function.language.python"
1258 },
1259 "2": {
1260 "name": "punctuation.separator.annotation.python"
1261 }
1262 },
1263 "endCaptures": {
1264 "1": {
1265 "name": "punctuation.separator.parameters.python"
1266 }
1267 },
1268 "patterns": [
1269 {
1270 "include": "#expression"
1271 }
1272 ]
1273 },
1274 {
1275 "include": "#comments"
1276 }
1277 ]
1278 },
1279 "parameter-special": {
1280 "match": "(?x)\n \\b ((self)|(cls)) \\b \\s*(?:(,)|(?=\\)))\n",
1281 "captures": {
1282 "1": {
1283 "name": "variable.parameter.function.language.python"
1284 },
1285 "2": {
1286 "name": "variable.parameter.function.language.special.self.python"
1287 },
1288 "3": {
1289 "name": "variable.parameter.function.language.special.cls.python"
1290 },
1291 "4": {
1292 "name": "punctuation.separator.parameters.python"
1293 }
1294 }
1295 },
1296 "loose-default": {
1297 "begin": "(=)",
1298 "end": "(,)|(?=\\))",
1299 "beginCaptures": {
1300 "1": {
1301 "name": "keyword.operator.python"
1302 }
1303 },
1304 "endCaptures": {
1305 "1": {
1306 "name": "punctuation.separator.parameters.python"
1307 }
1308 },
1309 "patterns": [
1310 {
1311 "include": "#expression"
1312 }
1313 ]
1314 },
1315 "annotated-parameter": {
1316 "begin": "(?x)\n \\b\n ([[:alpha:]_]\\w*) \\s* (:)\n",
1317 "end": "(,)|(?=\\))",
1318 "beginCaptures": {
1319 "1": {
1320 "name": "variable.parameter.function.language.python"
1321 },
1322 "2": {
1323 "name": "punctuation.separator.annotation.python"
1324 }
1325 },
1326 "endCaptures": {
1327 "1": {
1328 "name": "punctuation.separator.parameters.python"
1329 }
1330 },
1331 "patterns": [
1332 {
1333 "include": "#expression"
1334 },
1335 {
1336 "name": "keyword.operator.assignment.python",
1337 "match": "=(?!=)"
1338 }
1339 ]
1340 },
1341 "return-annotation": {
1342 "begin": "(->)",
1343 "end": "(?=:)",
1344 "beginCaptures": {
1345 "1": {
1346 "name": "punctuation.separator.annotation.result.python"
1347 }
1348 },
1349 "patterns": [
1350 {
1351 "include": "#expression"
1352 }
1353 ]
1354 },
1355 "item-access": {
1356 "patterns": [
1357 {
1358 "name": "meta.item-access.python",
1359 "begin": "(?x)\n \\b(?=\n [[:alpha:]_]\\w* \\s* \\[\n )\n",
1360 "end": "(\\])",
1361 "endCaptures": {
1362 "1": {
1363 "name": "punctuation.definition.arguments.end.python"
1364 }
1365 },
1366 "patterns": [
1367 {
1368 "include": "#item-name"
1369 },
1370 {
1371 "include": "#item-index"
1372 },
1373 {
1374 "include": "#expression"
1375 }
1376 ]
1377 }
1378 ]
1379 },
1380 "item-name": {
1381 "patterns": [
1382 {
1383 "include": "#special-variables"
1384 },
1385 {
1386 "include": "#builtin-functions"
1387 },
1388 {
1389 "include": "#special-names"
1390 },
1391 {
1392 "name": "meta.indexed-name.python",
1393 "match": "(?x)\n \\b ([[:alpha:]_]\\w*) \\b\n"
1394 }
1395 ]
1396 },
1397 "item-index": {
1398 "begin": "(\\[)",
1399 "end": "(?=\\])",
1400 "beginCaptures": {
1401 "1": {
1402 "name": "punctuation.definition.arguments.begin.python"
1403 }
1404 },
1405 "contentName": "meta.item-access.arguments.python",
1406 "patterns": [
1407 {
1408 "name": "punctuation.separator.slice.python",
1409 "match": ":"
1410 },
1411 {
1412 "include": "#expression"
1413 }
1414 ]
1415 },
1416 "decorator": {
1417 "name": "meta.function.decorator.python",
1418 "begin": "(?x)\n ^\\s*\n ((@)) \\s* (?=[[:alpha:]_]\\w*)\n",
1419 "end": "(?x)\n ( \\) )\n # trailing whitespace and comments are legal\n (?: (.*?) (?=\\s*(?:\\#|$)) )\n | (?=\\n|\\#)\n",
1420 "beginCaptures": {
1421 "1": {
1422 "name": "entity.name.function.decorator.python"
1423 },
1424 "2": {
1425 "name": "punctuation.definition.decorator.python"
1426 }
1427 },
1428 "endCaptures": {
1429 "1": {
1430 "name": "punctuation.definition.arguments.end.python"
1431 },
1432 "2": {
1433 "name": "invalid.illegal.decorator.python"
1434 }
1435 },
1436 "patterns": [
1437 {
1438 "include": "#decorator-name"
1439 },
1440 {
1441 "include": "#function-arguments"
1442 }
1443 ]
1444 },
1445 "decorator-name": {
1446 "patterns": [
1447 {
1448 "include": "#builtin-callables"
1449 },
1450 {
1451 "include": "#illegal-object-name"
1452 },
1453 {
1454 "name": "entity.name.function.decorator.python",
1455 "match": "(?x)\n ([[:alpha:]_]\\w*) | (\\.)\n",
1456 "captures": {
1457 "2": {
1458 "name": "punctuation.separator.period.python"
1459 }
1460 }
1461 },
1462 {
1463 "include": "#line-continuation"
1464 },
1465 {
1466 "name": "invalid.illegal.decorator.python",
1467 "match": "(?x)\n \\s* ([^([:alpha:]\\s_\\.#\\\\] .*?) (?=\\#|$)\n",
1468 "captures": {
1469 "1": {
1470 "name": "invalid.illegal.decorator.python"
1471 }
1472 }
1473 }
1474 ]
1475 },
1476 "call-wrapper-inheritance": {
1477 "comment": "same as a function call, but in inheritance context",
1478 "name": "meta.function-call.python",
1479 "begin": "(?x)\n \\b(?=\n ([[:alpha:]_]\\w*) \\s* (\\()\n )\n",
1480 "end": "(\\))",
1481 "endCaptures": {
1482 "1": {
1483 "name": "punctuation.definition.arguments.end.python"
1484 }
1485 },
1486 "patterns": [
1487 {
1488 "include": "#inheritance-name"
1489 },
1490 {
1491 "include": "#function-arguments"
1492 }
1493 ]
1494 },
1495 "inheritance-name": {
1496 "patterns": [
1497 {
1498 "include": "#lambda-incomplete"
1499 },
1500 {
1501 "include": "#builtin-possible-callables"
1502 },
1503 {
1504 "include": "#inheritance-identifier"
1505 }
1506 ]
1507 },
1508 "function-call": {
1509 "name": "meta.function-call.python",
1510 "comment": "Regular function call of the type \"name(args)\"",
1511 "begin": "(?x)\n \\b(?=\n ([[:alpha:]_]\\w*) \\s* (\\()\n )\n",
1512 "end": "(\\))",
1513 "endCaptures": {
1514 "1": {
1515 "name": "punctuation.definition.arguments.end.python"
1516 }
1517 },
1518 "patterns": [
1519 {
1520 "include": "#special-variables"
1521 },
1522 {
1523 "include": "#function-name"
1524 },
1525 {
1526 "include": "#function-arguments"
1527 }
1528 ]
1529 },
1530 "function-name": {
1531 "patterns": [
1532 {
1533 "include": "#builtin-possible-callables"
1534 },
1535 {
1536 "comment": "Some color schemas support meta.function-call.generic scope",
1537 "name": "meta.function-call.generic.python",
1538 "match": "(?x)\n \\b ([[:alpha:]_]\\w*) \\b\n"
1539 }
1540 ]
1541 },
1542 "function-arguments": {
1543 "begin": "(\\()",
1544 "end": "(?=\\))(?!\\)\\s*\\()",
1545 "beginCaptures": {
1546 "1": {
1547 "name": "punctuation.definition.arguments.begin.python"
1548 }
1549 },
1550 "contentName": "meta.function-call.arguments.python",
1551 "patterns": [
1552 {
1553 "name": "punctuation.separator.arguments.python",
1554 "match": "(,)"
1555 },
1556 {
1557 "match": "(?x)\n (?:(?<=[,(])|^) \\s* (\\*{1,2})\n",
1558 "captures": {
1559 "1": {
1560 "name": "keyword.operator.unpacking.arguments.python"
1561 }
1562 }
1563 },
1564 {
1565 "include": "#lambda-incomplete"
1566 },
1567 {
1568 "include": "#illegal-names"
1569 },
1570 {
1571 "match": "\\b([[:alpha:]_]\\w*)\\s*(=)(?!=)",
1572 "captures": {
1573 "1": {
1574 "name": "variable.parameter.function-call.python"
1575 },
1576 "2": {
1577 "name": "keyword.operator.assignment.python"
1578 }
1579 }
1580 },
1581 {
1582 "name": "keyword.operator.assignment.python",
1583 "match": "=(?!=)"
1584 },
1585 {
1586 "include": "#expression"
1587 },
1588 {
1589 "match": "\\s*(\\))\\s*(\\()",
1590 "captures": {
1591 "1": {
1592 "name": "punctuation.definition.arguments.end.python"
1593 },
1594 "2": {
1595 "name": "punctuation.definition.arguments.begin.python"
1596 }
1597 }
1598 }
1599 ]
1600 },
1601 "builtin-callables": {
1602 "patterns": [
1603 {
1604 "include": "#illegal-names"
1605 },
1606 {
1607 "include": "#illegal-object-name"
1608 },
1609 {
1610 "include": "#builtin-exceptions"
1611 },
1612 {
1613 "include": "#builtin-functions"
1614 },
1615 {
1616 "include": "#builtin-types"
1617 }
1618 ]
1619 },
1620 "builtin-possible-callables": {
1621 "patterns": [
1622 {
1623 "include": "#builtin-callables"
1624 },
1625 {
1626 "include": "#magic-names"
1627 }
1628 ]
1629 },
1630 "builtin-exceptions": {
1631 "name": "support.type.exception.python",
1632 "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"
1633 },
1634 "builtin-functions": {
1635 "patterns": [
1636 {
1637 "name": "support.function.builtin.python",
1638 "match": "(?x)\n (?<!\\.) \\b(\n __import__ | abs | aiter | all | any | anext | ascii | bin\n | breakpoint | callable | chr | compile | copyright | credits\n | delattr | dir | divmod | enumerate | eval | exec | exit\n | filter | format | getattr | globals | hasattr | hash | help\n | hex | id | input | isinstance | issubclass | iter | len\n | license | locals | map | max | memoryview | min | next\n | oct | open | ord | pow | print | quit | range | reload | repr\n | reversed | round | setattr | sorted | sum | vars | zip\n )\\b\n"
1639 },
1640 {
1641 "name": "variable.legacy.builtin.python",
1642 "match": "(?x)\n (?<!\\.) \\b(\n file | reduce | intern | raw_input | unicode | cmp | basestring\n | execfile | long | xrange\n )\\b\n"
1643 }
1644 ]
1645 },
1646 "builtin-types": {
1647 "name": "support.type.python",
1648 "match": "(?x)\n (?<!\\.) \\b(\n __mlir_attr | __mlir_op | __mlir_type | 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"
1649 },
1650 "magic-function-names": {
1651 "comment": "these methods have magic interpretation by python and are generally called\nindirectly through syntactic constructs\n",
1652 "match": "(?x)\n \\b(\n __(?:\n abs | add | aenter | aexit | aiter | and | anext\n | await | bool | call | ceil | class_getitem\n | cmp | coerce | complex | contains | copy\n | deepcopy | del | delattr | delete | delitem\n | delslice | dir | div | divmod | enter | eq\n | exit | float | floor | floordiv | format | ge\n | get | getattr | getattribute | getinitargs\n | getitem | getnewargs | getslice | getstate | gt\n | hash | hex | iadd | iand | idiv | ifloordiv |\n | ilshift | imod | imul | index | init\n | instancecheck | int | invert | ior | ipow\n | irshift | isub | iter | itruediv | ixor | le\n | len | long | lshift | lt | missing | mod | mul\n | ne | neg | new | next | nonzero | oct | or | pos\n | pow | radd | rand | rdiv | rdivmod | reduce\n | reduce_ex | repr | reversed | rfloordiv |\n | rlshift | rmod | rmul | ror | round | rpow\n | rrshift | rshift | rsub | rtruediv | rxor | set\n | setattr | setitem | set_name | setslice\n | setstate | sizeof | str | sub | subclasscheck\n | truediv | trunc | unicode | xor | matmul\n | rmatmul | imatmul | init_subclass | set_name\n | fspath | bytes | prepare | length_hint\n )__\n )\\b\n",
1653 "captures": {
1654 "1": {
1655 "name": "support.function.magic.python"
1656 }
1657 }
1658 },
1659 "magic-variable-names": {
1660 "comment": "magic variables which a class/module may have.",
1661 "match": "(?x)\n \\b(\n __(?:\n all | annotations | bases | builtins | class\n | struct\n | trait\n | closure | code | debug | defaults | dict | doc | file | func\n | globals | kwdefaults | match_args | members | metaclass | methods\n | module | mro | mro_entries | name | qualname | post_init | self\n | signature | slots | subclasses | version | weakref | wrapped\n | classcell | spec | path | package | future | traceback\n )__\n )\\b\n",
1662 "captures": {
1663 "1": {
1664 "name": "support.variable.magic.python"
1665 }
1666 }
1667 },
1668 "magic-names": {
1669 "patterns": [
1670 {
1671 "include": "#magic-function-names"
1672 },
1673 {
1674 "include": "#magic-variable-names"
1675 }
1676 ]
1677 },
1678 "illegal-names": {
1679 "match": "(?x)\n \\b(?:\n (\n and | assert | async | await | break | class | struct | trait | continue | def\n | fn\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",
1680 "captures": {
1681 "1": {
1682 "name": "keyword.control.flow.python"
1683 },
1684 "2": {
1685 "name": "keyword.control.import.python"
1686 }
1687 }
1688 },
1689 "special-variables": {
1690 "match": "(?x)\n \\b (?<!\\.) (?:\n (self) | (cls)\n )\\b\n",
1691 "captures": {
1692 "1": {
1693 "name": "variable.language.special.self.python"
1694 },
1695 "2": {
1696 "name": "variable.language.special.cls.python"
1697 }
1698 }
1699 },
1700 "ellipsis": {
1701 "name": "constant.other.ellipsis.python",
1702 "match": "\\.\\.\\."
1703 },
1704 "backticks": {
1705 "name": "string.quoted.single.python",
1706 "begin": "\\`",
1707 "end": "(?:\\`|(?<!\\\\)(\\n))"
1708 },
1709 "illegal-operator": {
1710 "patterns": [
1711 {
1712 "name": "invalid.illegal.operator.python",
1713 "match": "&&|\\|\\||--|\\+\\+"
1714 },
1715 {
1716 "name": "invalid.illegal.operator.python",
1717 "match": "[?$]"
1718 },
1719 {
1720 "name": "invalid.illegal.operator.python",
1721 "comment": "We don't want `!` to flash when we're typing `!=`",
1722 "match": "!\\b"
1723 }
1724 ]
1725 },
1726 "illegal-object-name": {
1727 "comment": "It's illegal to name class or function \"True\"",
1728 "name": "keyword.illegal.name.python",
1729 "match": "\\b(True|False|None)\\b"
1730 },
1731 "illegal-anno": {
1732 "name": "invalid.illegal.annotation.python",
1733 "match": "->"
1734 },
1735 "regexp-base-expression": {
1736 "patterns": [
1737 {
1738 "include": "#regexp-quantifier"
1739 },
1740 {
1741 "include": "#regexp-base-common"
1742 }
1743 ]
1744 },
1745 "fregexp-base-expression": {
1746 "patterns": [
1747 {
1748 "include": "#fregexp-quantifier"
1749 },
1750 {
1751 "include": "#fstring-formatting-braces"
1752 },
1753 {
1754 "match": "\\{.*?\\}"
1755 },
1756 {
1757 "include": "#regexp-base-common"
1758 }
1759 ]
1760 },
1761 "fstring-formatting-braces": {
1762 "patterns": [
1763 {
1764 "comment": "empty braces are illegal",
1765 "match": "({)(\\s*?)(})",
1766 "captures": {
1767 "1": {
1768 "name": "constant.character.format.placeholder.other.python"
1769 },
1770 "2": {
1771 "name": "invalid.illegal.brace.python"
1772 },
1773 "3": {
1774 "name": "constant.character.format.placeholder.other.python"
1775 }
1776 }
1777 },
1778 {
1779 "name": "constant.character.escape.python",
1780 "match": "({{|}})"
1781 }
1782 ]
1783 },
1784 "regexp-base-common": {
1785 "patterns": [
1786 {
1787 "name": "support.other.match.any.regexp",
1788 "match": "\\."
1789 },
1790 {
1791 "name": "support.other.match.begin.regexp",
1792 "match": "\\^"
1793 },
1794 {
1795 "name": "support.other.match.end.regexp",
1796 "match": "\\$"
1797 },
1798 {
1799 "name": "keyword.operator.quantifier.regexp",
1800 "match": "[+*?]\\??"
1801 },
1802 {
1803 "name": "keyword.operator.disjunction.regexp",
1804 "match": "\\|"
1805 },
1806 {
1807 "include": "#regexp-escape-sequence"
1808 }
1809 ]
1810 },
1811 "regexp-quantifier": {
1812 "name": "keyword.operator.quantifier.regexp",
1813 "match": "(?x)\n \\{(\n \\d+ | \\d+,(\\d+)? | ,\\d+\n )\\}\n"
1814 },
1815 "fregexp-quantifier": {
1816 "name": "keyword.operator.quantifier.regexp",
1817 "match": "(?x)\n \\{\\{(\n \\d+ | \\d+,(\\d+)? | ,\\d+\n )\\}\\}\n"
1818 },
1819 "regexp-backreference-number": {
1820 "name": "meta.backreference.regexp",
1821 "match": "(\\\\[1-9]\\d?)",
1822 "captures": {
1823 "1": {
1824 "name": "entity.name.tag.backreference.regexp"
1825 }
1826 }
1827 },
1828 "regexp-backreference": {
1829 "name": "meta.backreference.named.regexp",
1830 "match": "(?x)\n (\\() (\\?P= \\w+(?:\\s+[[:alnum:]]+)?) (\\))\n",
1831 "captures": {
1832 "1": {
1833 "name": "support.other.parenthesis.regexp punctuation.parenthesis.backreference.named.begin.regexp"
1834 },
1835 "2": {
1836 "name": "entity.name.tag.named.backreference.regexp"
1837 },
1838 "3": {
1839 "name": "support.other.parenthesis.regexp punctuation.parenthesis.backreference.named.end.regexp"
1840 }
1841 }
1842 },
1843 "regexp-flags": {
1844 "name": "storage.modifier.flag.regexp",
1845 "match": "\\(\\?[aiLmsux]+\\)"
1846 },
1847 "regexp-escape-special": {
1848 "name": "support.other.escape.special.regexp",
1849 "match": "\\\\([AbBdDsSwWZ])"
1850 },
1851 "regexp-escape-character": {
1852 "name": "constant.character.escape.regexp",
1853 "match": "(?x)\n \\\\ (\n x[0-9A-Fa-f]{2}\n | 0[0-7]{1,2}\n | [0-7]{3}\n )\n"
1854 },
1855 "regexp-escape-unicode": {
1856 "name": "constant.character.unicode.regexp",
1857 "match": "(?x)\n \\\\ (\n u[0-9A-Fa-f]{4}\n | U[0-9A-Fa-f]{8}\n )\n"
1858 },
1859 "regexp-escape-catchall": {
1860 "name": "constant.character.escape.regexp",
1861 "match": "\\\\(.|\\n)"
1862 },
1863 "regexp-escape-sequence": {
1864 "patterns": [
1865 {
1866 "include": "#regexp-escape-special"
1867 },
1868 {
1869 "include": "#regexp-escape-character"
1870 },
1871 {
1872 "include": "#regexp-escape-unicode"
1873 },
1874 {
1875 "include": "#regexp-backreference-number"
1876 },
1877 {
1878 "include": "#regexp-escape-catchall"
1879 }
1880 ]
1881 },
1882 "regexp-charecter-set-escapes": {
1883 "patterns": [
1884 {
1885 "name": "constant.character.escape.regexp",
1886 "match": "\\\\[abfnrtv\\\\]"
1887 },
1888 {
1889 "include": "#regexp-escape-special"
1890 },
1891 {
1892 "name": "constant.character.escape.regexp",
1893 "match": "\\\\([0-7]{1,3})"
1894 },
1895 {
1896 "include": "#regexp-escape-character"
1897 },
1898 {
1899 "include": "#regexp-escape-unicode"
1900 },
1901 {
1902 "include": "#regexp-escape-catchall"
1903 }
1904 ]
1905 },
1906 "codetags": {
1907 "match": "(?:\\b(NOTE|XXX|HACK|FIXME|BUG|TODO)\\b)",
1908 "captures": {
1909 "1": {
1910 "name": "keyword.codetag.notation.python"
1911 }
1912 }
1913 },
1914 "comments-base": {
1915 "name": "comment.line.number-sign.python",
1916 "begin": "(\\#)",
1917 "beginCaptures": {
1918 "1": {
1919 "name": "punctuation.definition.comment.python"
1920 }
1921 },
1922 "end": "($)",
1923 "patterns": [
1924 {
1925 "include": "#codetags"
1926 }
1927 ]
1928 },
1929 "comments-string-single-three": {
1930 "name": "comment.line.number-sign.python",
1931 "begin": "(\\#)",
1932 "beginCaptures": {
1933 "1": {
1934 "name": "punctuation.definition.comment.python"
1935 }
1936 },
1937 "end": "($|(?='''))",
1938 "patterns": [
1939 {
1940 "include": "#codetags"
1941 }
1942 ]
1943 },
1944 "comments-string-double-three": {
1945 "name": "comment.line.number-sign.python",
1946 "begin": "(\\#)",
1947 "beginCaptures": {
1948 "1": {
1949 "name": "punctuation.definition.comment.python"
1950 }
1951 },
1952 "end": "($|(?=\"\"\"))",
1953 "patterns": [
1954 {
1955 "include": "#codetags"
1956 }
1957 ]
1958 },
1959 "single-one-regexp-expression": {
1960 "patterns": [
1961 {
1962 "include": "#regexp-base-expression"
1963 },
1964 {
1965 "include": "#single-one-regexp-character-set"
1966 },
1967 {
1968 "include": "#single-one-regexp-comments"
1969 },
1970 {
1971 "include": "#regexp-flags"
1972 },
1973 {
1974 "include": "#single-one-regexp-named-group"
1975 },
1976 {
1977 "include": "#regexp-backreference"
1978 },
1979 {
1980 "include": "#single-one-regexp-lookahead"
1981 },
1982 {
1983 "include": "#single-one-regexp-lookahead-negative"
1984 },
1985 {
1986 "include": "#single-one-regexp-lookbehind"
1987 },
1988 {
1989 "include": "#single-one-regexp-lookbehind-negative"
1990 },
1991 {
1992 "include": "#single-one-regexp-conditional"
1993 },
1994 {
1995 "include": "#single-one-regexp-parentheses-non-capturing"
1996 },
1997 {
1998 "include": "#single-one-regexp-parentheses"
1999 }
2000 ]
2001 },
2002 "single-one-regexp-character-set": {
2003 "patterns": [
2004 {
2005 "match": "(?x)\n \\[ \\^? \\] (?! .*?\\])\n"
2006 },
2007 {
2008 "name": "meta.character.set.regexp",
2009 "begin": "(\\[)(\\^)?(\\])?",
2010 "end": "(\\]|(?=\\'))|((?=(?<!\\\\)\\n))",
2011 "beginCaptures": {
2012 "1": {
2013 "name": "punctuation.character.set.begin.regexp constant.other.set.regexp"
2014 },
2015 "2": {
2016 "name": "keyword.operator.negation.regexp"
2017 },
2018 "3": {
2019 "name": "constant.character.set.regexp"
2020 }
2021 },
2022 "endCaptures": {
2023 "1": {
2024 "name": "punctuation.character.set.end.regexp constant.other.set.regexp"
2025 },
2026 "2": {
2027 "name": "invalid.illegal.newline.python"
2028 }
2029 },
2030 "patterns": [
2031 {
2032 "include": "#regexp-charecter-set-escapes"
2033 },
2034 {
2035 "name": "constant.character.set.regexp",
2036 "match": "[^\\n]"
2037 }
2038 ]
2039 }
2040 ]
2041 },
2042 "single-one-regexp-named-group": {
2043 "name": "meta.named.regexp",
2044 "begin": "(?x)\n (\\() (\\?P <\\w+(?:\\s+[[:alnum:]]+)?>)\n",
2045 "end": "(\\)|(?=\\'))|((?=(?<!\\\\)\\n))",
2046 "beginCaptures": {
2047 "1": {
2048 "name": "support.other.parenthesis.regexp punctuation.parenthesis.named.begin.regexp"
2049 },
2050 "2": {
2051 "name": "entity.name.tag.named.group.regexp"
2052 }
2053 },
2054 "endCaptures": {
2055 "1": {
2056 "name": "support.other.parenthesis.regexp punctuation.parenthesis.named.end.regexp"
2057 },
2058 "2": {
2059 "name": "invalid.illegal.newline.python"
2060 }
2061 },
2062 "patterns": [
2063 {
2064 "include": "#single-one-regexp-expression"
2065 }
2066 ]
2067 },
2068 "single-one-regexp-comments": {
2069 "name": "comment.regexp",
2070 "begin": "\\(\\?#",
2071 "end": "(\\)|(?=\\'))|((?=(?<!\\\\)\\n))",
2072 "beginCaptures": {
2073 "0": {
2074 "name": "punctuation.comment.begin.regexp"
2075 }
2076 },
2077 "endCaptures": {
2078 "1": {
2079 "name": "punctuation.comment.end.regexp"
2080 },
2081 "2": {
2082 "name": "invalid.illegal.newline.python"
2083 }
2084 },
2085 "patterns": [
2086 {
2087 "include": "#codetags"
2088 }
2089 ]
2090 },
2091 "single-one-regexp-lookahead": {
2092 "begin": "(\\()\\?=",
2093 "end": "(\\)|(?=\\'))|((?=(?<!\\\\)\\n))",
2094 "beginCaptures": {
2095 "0": {
2096 "name": "keyword.operator.lookahead.regexp"
2097 },
2098 "1": {
2099 "name": "punctuation.parenthesis.lookahead.begin.regexp"
2100 }
2101 },
2102 "endCaptures": {
2103 "1": {
2104 "name": "keyword.operator.lookahead.regexp punctuation.parenthesis.lookahead.end.regexp"
2105 },
2106 "2": {
2107 "name": "invalid.illegal.newline.python"
2108 }
2109 },
2110 "patterns": [
2111 {
2112 "include": "#single-one-regexp-expression"
2113 }
2114 ]
2115 },
2116 "single-one-regexp-lookahead-negative": {
2117 "begin": "(\\()\\?!",
2118 "end": "(\\)|(?=\\'))|((?=(?<!\\\\)\\n))",
2119 "beginCaptures": {
2120 "0": {
2121 "name": "keyword.operator.lookahead.negative.regexp"
2122 },
2123 "1": {
2124 "name": "punctuation.parenthesis.lookahead.begin.regexp"
2125 }
2126 },
2127 "endCaptures": {
2128 "1": {
2129 "name": "keyword.operator.lookahead.negative.regexp punctuation.parenthesis.lookahead.end.regexp"
2130 },
2131 "2": {
2132 "name": "invalid.illegal.newline.python"
2133 }
2134 },
2135 "patterns": [
2136 {
2137 "include": "#single-one-regexp-expression"
2138 }
2139 ]
2140 },
2141 "single-one-regexp-lookbehind": {
2142 "begin": "(\\()\\?<=",
2143 "end": "(\\)|(?=\\'))|((?=(?<!\\\\)\\n))",
2144 "beginCaptures": {
2145 "0": {
2146 "name": "keyword.operator.lookbehind.regexp"
2147 },
2148 "1": {
2149 "name": "punctuation.parenthesis.lookbehind.begin.regexp"
2150 }
2151 },
2152 "endCaptures": {
2153 "1": {
2154 "name": "keyword.operator.lookbehind.regexp punctuation.parenthesis.lookbehind.end.regexp"
2155 },
2156 "2": {
2157 "name": "invalid.illegal.newline.python"
2158 }
2159 },
2160 "patterns": [
2161 {
2162 "include": "#single-one-regexp-expression"
2163 }
2164 ]
2165 },
2166 "single-one-regexp-lookbehind-negative": {
2167 "begin": "(\\()\\?<!",
2168 "end": "(\\)|(?=\\'))|((?=(?<!\\\\)\\n))",
2169 "beginCaptures": {
2170 "0": {
2171 "name": "keyword.operator.lookbehind.negative.regexp"
2172 },
2173 "1": {
2174 "name": "punctuation.parenthesis.lookbehind.begin.regexp"
2175 }
2176 },
2177 "endCaptures": {
2178 "1": {
2179 "name": "keyword.operator.lookbehind.negative.regexp punctuation.parenthesis.lookbehind.end.regexp"
2180 },
2181 "2": {
2182 "name": "invalid.illegal.newline.python"
2183 }
2184 },
2185 "patterns": [
2186 {
2187 "include": "#single-one-regexp-expression"
2188 }
2189 ]
2190 },
2191 "single-one-regexp-conditional": {
2192 "begin": "(\\()\\?\\((\\w+(?:\\s+[[:alnum:]]+)?|\\d+)\\)",
2193 "end": "(\\)|(?=\\'))|((?=(?<!\\\\)\\n))",
2194 "beginCaptures": {
2195 "0": {
2196 "name": "keyword.operator.conditional.regexp"
2197 },
2198 "1": {
2199 "name": "punctuation.parenthesis.conditional.begin.regexp"
2200 }
2201 },
2202 "endCaptures": {
2203 "1": {
2204 "name": "keyword.operator.conditional.negative.regexp punctuation.parenthesis.conditional.end.regexp"
2205 },
2206 "2": {
2207 "name": "invalid.illegal.newline.python"
2208 }
2209 },
2210 "patterns": [
2211 {
2212 "include": "#single-one-regexp-expression"
2213 }
2214 ]
2215 },
2216 "single-one-regexp-parentheses-non-capturing": {
2217 "begin": "\\(\\?:",
2218 "end": "(\\)|(?=\\'))|((?=(?<!\\\\)\\n))",
2219 "beginCaptures": {
2220 "0": {
2221 "name": "support.other.parenthesis.regexp punctuation.parenthesis.non-capturing.begin.regexp"
2222 }
2223 },
2224 "endCaptures": {
2225 "1": {
2226 "name": "support.other.parenthesis.regexp punctuation.parenthesis.non-capturing.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-parentheses": {
2239 "begin": "\\(",
2240 "end": "(\\)|(?=\\'))|((?=(?<!\\\\)\\n))",
2241 "beginCaptures": {
2242 "0": {
2243 "name": "support.other.parenthesis.regexp punctuation.parenthesis.begin.regexp"
2244 }
2245 },
2246 "endCaptures": {
2247 "1": {
2248 "name": "support.other.parenthesis.regexp punctuation.parenthesis.end.regexp"
2249 },
2250 "2": {
2251 "name": "invalid.illegal.newline.python"
2252 }
2253 },
2254 "patterns": [
2255 {
2256 "include": "#single-one-regexp-expression"
2257 }
2258 ]
2259 },
2260 "single-three-regexp-expression": {
2261 "patterns": [
2262 {
2263 "include": "#regexp-base-expression"
2264 },
2265 {
2266 "include": "#single-three-regexp-character-set"
2267 },
2268 {
2269 "include": "#single-three-regexp-comments"
2270 },
2271 {
2272 "include": "#regexp-flags"
2273 },
2274 {
2275 "include": "#single-three-regexp-named-group"
2276 },
2277 {
2278 "include": "#regexp-backreference"
2279 },
2280 {
2281 "include": "#single-three-regexp-lookahead"
2282 },
2283 {
2284 "include": "#single-three-regexp-lookahead-negative"
2285 },
2286 {
2287 "include": "#single-three-regexp-lookbehind"
2288 },
2289 {
2290 "include": "#single-three-regexp-lookbehind-negative"
2291 },
2292 {
2293 "include": "#single-three-regexp-conditional"
2294 },
2295 {
2296 "include": "#single-three-regexp-parentheses-non-capturing"
2297 },
2298 {
2299 "include": "#single-three-regexp-parentheses"
2300 },
2301 {
2302 "include": "#comments-string-single-three"
2303 }
2304 ]
2305 },
2306 "single-three-regexp-character-set": {
2307 "patterns": [
2308 {
2309 "match": "(?x)\n \\[ \\^? \\] (?! .*?\\])\n"
2310 },
2311 {
2312 "name": "meta.character.set.regexp",
2313 "begin": "(\\[)(\\^)?(\\])?",
2314 "end": "(\\]|(?=\\'\\'\\'))",
2315 "beginCaptures": {
2316 "1": {
2317 "name": "punctuation.character.set.begin.regexp constant.other.set.regexp"
2318 },
2319 "2": {
2320 "name": "keyword.operator.negation.regexp"
2321 },
2322 "3": {
2323 "name": "constant.character.set.regexp"
2324 }
2325 },
2326 "endCaptures": {
2327 "1": {
2328 "name": "punctuation.character.set.end.regexp constant.other.set.regexp"
2329 },
2330 "2": {
2331 "name": "invalid.illegal.newline.python"
2332 }
2333 },
2334 "patterns": [
2335 {
2336 "include": "#regexp-charecter-set-escapes"
2337 },
2338 {
2339 "name": "constant.character.set.regexp",
2340 "match": "[^\\n]"
2341 }
2342 ]
2343 }
2344 ]
2345 },
2346 "single-three-regexp-named-group": {
2347 "name": "meta.named.regexp",
2348 "begin": "(?x)\n (\\() (\\?P <\\w+(?:\\s+[[:alnum:]]+)?>)\n",
2349 "end": "(\\)|(?=\\'\\'\\'))",
2350 "beginCaptures": {
2351 "1": {
2352 "name": "support.other.parenthesis.regexp punctuation.parenthesis.named.begin.regexp"
2353 },
2354 "2": {
2355 "name": "entity.name.tag.named.group.regexp"
2356 }
2357 },
2358 "endCaptures": {
2359 "1": {
2360 "name": "support.other.parenthesis.regexp punctuation.parenthesis.named.end.regexp"
2361 },
2362 "2": {
2363 "name": "invalid.illegal.newline.python"
2364 }
2365 },
2366 "patterns": [
2367 {
2368 "include": "#single-three-regexp-expression"
2369 },
2370 {
2371 "include": "#comments-string-single-three"
2372 }
2373 ]
2374 },
2375 "single-three-regexp-comments": {
2376 "name": "comment.regexp",
2377 "begin": "\\(\\?#",
2378 "end": "(\\)|(?=\\'\\'\\'))",
2379 "beginCaptures": {
2380 "0": {
2381 "name": "punctuation.comment.begin.regexp"
2382 }
2383 },
2384 "endCaptures": {
2385 "1": {
2386 "name": "punctuation.comment.end.regexp"
2387 },
2388 "2": {
2389 "name": "invalid.illegal.newline.python"
2390 }
2391 },
2392 "patterns": [
2393 {
2394 "include": "#codetags"
2395 }
2396 ]
2397 },
2398 "single-three-regexp-lookahead": {
2399 "begin": "(\\()\\?=",
2400 "end": "(\\)|(?=\\'\\'\\'))",
2401 "beginCaptures": {
2402 "0": {
2403 "name": "keyword.operator.lookahead.regexp"
2404 },
2405 "1": {
2406 "name": "punctuation.parenthesis.lookahead.begin.regexp"
2407 }
2408 },
2409 "endCaptures": {
2410 "1": {
2411 "name": "keyword.operator.lookahead.regexp punctuation.parenthesis.lookahead.end.regexp"
2412 },
2413 "2": {
2414 "name": "invalid.illegal.newline.python"
2415 }
2416 },
2417 "patterns": [
2418 {
2419 "include": "#single-three-regexp-expression"
2420 },
2421 {
2422 "include": "#comments-string-single-three"
2423 }
2424 ]
2425 },
2426 "single-three-regexp-lookahead-negative": {
2427 "begin": "(\\()\\?!",
2428 "end": "(\\)|(?=\\'\\'\\'))",
2429 "beginCaptures": {
2430 "0": {
2431 "name": "keyword.operator.lookahead.negative.regexp"
2432 },
2433 "1": {
2434 "name": "punctuation.parenthesis.lookahead.begin.regexp"
2435 }
2436 },
2437 "endCaptures": {
2438 "1": {
2439 "name": "keyword.operator.lookahead.negative.regexp punctuation.parenthesis.lookahead.end.regexp"
2440 },
2441 "2": {
2442 "name": "invalid.illegal.newline.python"
2443 }
2444 },
2445 "patterns": [
2446 {
2447 "include": "#single-three-regexp-expression"
2448 },
2449 {
2450 "include": "#comments-string-single-three"
2451 }
2452 ]
2453 },
2454 "single-three-regexp-lookbehind": {
2455 "begin": "(\\()\\?<=",
2456 "end": "(\\)|(?=\\'\\'\\'))",
2457 "beginCaptures": {
2458 "0": {
2459 "name": "keyword.operator.lookbehind.regexp"
2460 },
2461 "1": {
2462 "name": "punctuation.parenthesis.lookbehind.begin.regexp"
2463 }
2464 },
2465 "endCaptures": {
2466 "1": {
2467 "name": "keyword.operator.lookbehind.regexp punctuation.parenthesis.lookbehind.end.regexp"
2468 },
2469 "2": {
2470 "name": "invalid.illegal.newline.python"
2471 }
2472 },
2473 "patterns": [
2474 {
2475 "include": "#single-three-regexp-expression"
2476 },
2477 {
2478 "include": "#comments-string-single-three"
2479 }
2480 ]
2481 },
2482 "single-three-regexp-lookbehind-negative": {
2483 "begin": "(\\()\\?<!",
2484 "end": "(\\)|(?=\\'\\'\\'))",
2485 "beginCaptures": {
2486 "0": {
2487 "name": "keyword.operator.lookbehind.negative.regexp"
2488 },
2489 "1": {
2490 "name": "punctuation.parenthesis.lookbehind.begin.regexp"
2491 }
2492 },
2493 "endCaptures": {
2494 "1": {
2495 "name": "keyword.operator.lookbehind.negative.regexp punctuation.parenthesis.lookbehind.end.regexp"
2496 },
2497 "2": {
2498 "name": "invalid.illegal.newline.python"
2499 }
2500 },
2501 "patterns": [
2502 {
2503 "include": "#single-three-regexp-expression"
2504 },
2505 {
2506 "include": "#comments-string-single-three"
2507 }
2508 ]
2509 },
2510 "single-three-regexp-conditional": {
2511 "begin": "(\\()\\?\\((\\w+(?:\\s+[[:alnum:]]+)?|\\d+)\\)",
2512 "end": "(\\)|(?=\\'\\'\\'))",
2513 "beginCaptures": {
2514 "0": {
2515 "name": "keyword.operator.conditional.regexp"
2516 },
2517 "1": {
2518 "name": "punctuation.parenthesis.conditional.begin.regexp"
2519 }
2520 },
2521 "endCaptures": {
2522 "1": {
2523 "name": "keyword.operator.conditional.negative.regexp punctuation.parenthesis.conditional.end.regexp"
2524 },
2525 "2": {
2526 "name": "invalid.illegal.newline.python"
2527 }
2528 },
2529 "patterns": [
2530 {
2531 "include": "#single-three-regexp-expression"
2532 },
2533 {
2534 "include": "#comments-string-single-three"
2535 }
2536 ]
2537 },
2538 "single-three-regexp-parentheses-non-capturing": {
2539 "begin": "\\(\\?:",
2540 "end": "(\\)|(?=\\'\\'\\'))",
2541 "beginCaptures": {
2542 "0": {
2543 "name": "support.other.parenthesis.regexp punctuation.parenthesis.non-capturing.begin.regexp"
2544 }
2545 },
2546 "endCaptures": {
2547 "1": {
2548 "name": "support.other.parenthesis.regexp punctuation.parenthesis.non-capturing.end.regexp"
2549 },
2550 "2": {
2551 "name": "invalid.illegal.newline.python"
2552 }
2553 },
2554 "patterns": [
2555 {
2556 "include": "#single-three-regexp-expression"
2557 },
2558 {
2559 "include": "#comments-string-single-three"
2560 }
2561 ]
2562 },
2563 "single-three-regexp-parentheses": {
2564 "begin": "\\(",
2565 "end": "(\\)|(?=\\'\\'\\'))",
2566 "beginCaptures": {
2567 "0": {
2568 "name": "support.other.parenthesis.regexp punctuation.parenthesis.begin.regexp"
2569 }
2570 },
2571 "endCaptures": {
2572 "1": {
2573 "name": "support.other.parenthesis.regexp punctuation.parenthesis.end.regexp"
2574 },
2575 "2": {
2576 "name": "invalid.illegal.newline.python"
2577 }
2578 },
2579 "patterns": [
2580 {
2581 "include": "#single-three-regexp-expression"
2582 },
2583 {
2584 "include": "#comments-string-single-three"
2585 }
2586 ]
2587 },
2588 "double-one-regexp-expression": {
2589 "patterns": [
2590 {
2591 "include": "#regexp-base-expression"
2592 },
2593 {
2594 "include": "#double-one-regexp-character-set"
2595 },
2596 {
2597 "include": "#double-one-regexp-comments"
2598 },
2599 {
2600 "include": "#regexp-flags"
2601 },
2602 {
2603 "include": "#double-one-regexp-named-group"
2604 },
2605 {
2606 "include": "#regexp-backreference"
2607 },
2608 {
2609 "include": "#double-one-regexp-lookahead"
2610 },
2611 {
2612 "include": "#double-one-regexp-lookahead-negative"
2613 },
2614 {
2615 "include": "#double-one-regexp-lookbehind"
2616 },
2617 {
2618 "include": "#double-one-regexp-lookbehind-negative"
2619 },
2620 {
2621 "include": "#double-one-regexp-conditional"
2622 },
2623 {
2624 "include": "#double-one-regexp-parentheses-non-capturing"
2625 },
2626 {
2627 "include": "#double-one-regexp-parentheses"
2628 }
2629 ]
2630 },
2631 "double-one-regexp-character-set": {
2632 "patterns": [
2633 {
2634 "match": "(?x)\n \\[ \\^? \\] (?! .*?\\])\n"
2635 },
2636 {
2637 "name": "meta.character.set.regexp",
2638 "begin": "(\\[)(\\^)?(\\])?",
2639 "end": "(\\]|(?=\"))|((?=(?<!\\\\)\\n))",
2640 "beginCaptures": {
2641 "1": {
2642 "name": "punctuation.character.set.begin.regexp constant.other.set.regexp"
2643 },
2644 "2": {
2645 "name": "keyword.operator.negation.regexp"
2646 },
2647 "3": {
2648 "name": "constant.character.set.regexp"
2649 }
2650 },
2651 "endCaptures": {
2652 "1": {
2653 "name": "punctuation.character.set.end.regexp constant.other.set.regexp"
2654 },
2655 "2": {
2656 "name": "invalid.illegal.newline.python"
2657 }
2658 },
2659 "patterns": [
2660 {
2661 "include": "#regexp-charecter-set-escapes"
2662 },
2663 {
2664 "name": "constant.character.set.regexp",
2665 "match": "[^\\n]"
2666 }
2667 ]
2668 }
2669 ]
2670 },
2671 "double-one-regexp-named-group": {
2672 "name": "meta.named.regexp",
2673 "begin": "(?x)\n (\\() (\\?P <\\w+(?:\\s+[[:alnum:]]+)?>)\n",
2674 "end": "(\\)|(?=\"))|((?=(?<!\\\\)\\n))",
2675 "beginCaptures": {
2676 "1": {
2677 "name": "support.other.parenthesis.regexp punctuation.parenthesis.named.begin.regexp"
2678 },
2679 "2": {
2680 "name": "entity.name.tag.named.group.regexp"
2681 }
2682 },
2683 "endCaptures": {
2684 "1": {
2685 "name": "support.other.parenthesis.regexp punctuation.parenthesis.named.end.regexp"
2686 },
2687 "2": {
2688 "name": "invalid.illegal.newline.python"
2689 }
2690 },
2691 "patterns": [
2692 {
2693 "include": "#double-one-regexp-expression"
2694 }
2695 ]
2696 },
2697 "double-one-regexp-comments": {
2698 "name": "comment.regexp",
2699 "begin": "\\(\\?#",
2700 "end": "(\\)|(?=\"))|((?=(?<!\\\\)\\n))",
2701 "beginCaptures": {
2702 "0": {
2703 "name": "punctuation.comment.begin.regexp"
2704 }
2705 },
2706 "endCaptures": {
2707 "1": {
2708 "name": "punctuation.comment.end.regexp"
2709 },
2710 "2": {
2711 "name": "invalid.illegal.newline.python"
2712 }
2713 },
2714 "patterns": [
2715 {
2716 "include": "#codetags"
2717 }
2718 ]
2719 },
2720 "double-one-regexp-lookahead": {
2721 "begin": "(\\()\\?=",
2722 "end": "(\\)|(?=\"))|((?=(?<!\\\\)\\n))",
2723 "beginCaptures": {
2724 "0": {
2725 "name": "keyword.operator.lookahead.regexp"
2726 },
2727 "1": {
2728 "name": "punctuation.parenthesis.lookahead.begin.regexp"
2729 }
2730 },
2731 "endCaptures": {
2732 "1": {
2733 "name": "keyword.operator.lookahead.regexp punctuation.parenthesis.lookahead.end.regexp"
2734 },
2735 "2": {
2736 "name": "invalid.illegal.newline.python"
2737 }
2738 },
2739 "patterns": [
2740 {
2741 "include": "#double-one-regexp-expression"
2742 }
2743 ]
2744 },
2745 "double-one-regexp-lookahead-negative": {
2746 "begin": "(\\()\\?!",
2747 "end": "(\\)|(?=\"))|((?=(?<!\\\\)\\n))",
2748 "beginCaptures": {
2749 "0": {
2750 "name": "keyword.operator.lookahead.negative.regexp"
2751 },
2752 "1": {
2753 "name": "punctuation.parenthesis.lookahead.begin.regexp"
2754 }
2755 },
2756 "endCaptures": {
2757 "1": {
2758 "name": "keyword.operator.lookahead.negative.regexp punctuation.parenthesis.lookahead.end.regexp"
2759 },
2760 "2": {
2761 "name": "invalid.illegal.newline.python"
2762 }
2763 },
2764 "patterns": [
2765 {
2766 "include": "#double-one-regexp-expression"
2767 }
2768 ]
2769 },
2770 "double-one-regexp-lookbehind": {
2771 "begin": "(\\()\\?<=",
2772 "end": "(\\)|(?=\"))|((?=(?<!\\\\)\\n))",
2773 "beginCaptures": {
2774 "0": {
2775 "name": "keyword.operator.lookbehind.regexp"
2776 },
2777 "1": {
2778 "name": "punctuation.parenthesis.lookbehind.begin.regexp"
2779 }
2780 },
2781 "endCaptures": {
2782 "1": {
2783 "name": "keyword.operator.lookbehind.regexp punctuation.parenthesis.lookbehind.end.regexp"
2784 },
2785 "2": {
2786 "name": "invalid.illegal.newline.python"
2787 }
2788 },
2789 "patterns": [
2790 {
2791 "include": "#double-one-regexp-expression"
2792 }
2793 ]
2794 },
2795 "double-one-regexp-lookbehind-negative": {
2796 "begin": "(\\()\\?<!",
2797 "end": "(\\)|(?=\"))|((?=(?<!\\\\)\\n))",
2798 "beginCaptures": {
2799 "0": {
2800 "name": "keyword.operator.lookbehind.negative.regexp"
2801 },
2802 "1": {
2803 "name": "punctuation.parenthesis.lookbehind.begin.regexp"
2804 }
2805 },
2806 "endCaptures": {
2807 "1": {
2808 "name": "keyword.operator.lookbehind.negative.regexp punctuation.parenthesis.lookbehind.end.regexp"
2809 },
2810 "2": {
2811 "name": "invalid.illegal.newline.python"
2812 }
2813 },
2814 "patterns": [
2815 {
2816 "include": "#double-one-regexp-expression"
2817 }
2818 ]
2819 },
2820 "double-one-regexp-conditional": {
2821 "begin": "(\\()\\?\\((\\w+(?:\\s+[[:alnum:]]+)?|\\d+)\\)",
2822 "end": "(\\)|(?=\"))|((?=(?<!\\\\)\\n))",
2823 "beginCaptures": {
2824 "0": {
2825 "name": "keyword.operator.conditional.regexp"
2826 },
2827 "1": {
2828 "name": "punctuation.parenthesis.conditional.begin.regexp"
2829 }
2830 },
2831 "endCaptures": {
2832 "1": {
2833 "name": "keyword.operator.conditional.negative.regexp punctuation.parenthesis.conditional.end.regexp"
2834 },
2835 "2": {
2836 "name": "invalid.illegal.newline.python"
2837 }
2838 },
2839 "patterns": [
2840 {
2841 "include": "#double-one-regexp-expression"
2842 }
2843 ]
2844 },
2845 "double-one-regexp-parentheses-non-capturing": {
2846 "begin": "\\(\\?:",
2847 "end": "(\\)|(?=\"))|((?=(?<!\\\\)\\n))",
2848 "beginCaptures": {
2849 "0": {
2850 "name": "support.other.parenthesis.regexp punctuation.parenthesis.non-capturing.begin.regexp"
2851 }
2852 },
2853 "endCaptures": {
2854 "1": {
2855 "name": "support.other.parenthesis.regexp punctuation.parenthesis.non-capturing.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-parentheses": {
2868 "begin": "\\(",
2869 "end": "(\\)|(?=\"))|((?=(?<!\\\\)\\n))",
2870 "beginCaptures": {
2871 "0": {
2872 "name": "support.other.parenthesis.regexp punctuation.parenthesis.begin.regexp"
2873 }
2874 },
2875 "endCaptures": {
2876 "1": {
2877 "name": "support.other.parenthesis.regexp punctuation.parenthesis.end.regexp"
2878 },
2879 "2": {
2880 "name": "invalid.illegal.newline.python"
2881 }
2882 },
2883 "patterns": [
2884 {
2885 "include": "#double-one-regexp-expression"
2886 }
2887 ]
2888 },
2889 "double-three-regexp-expression": {
2890 "patterns": [
2891 {
2892 "include": "#regexp-base-expression"
2893 },
2894 {
2895 "include": "#double-three-regexp-character-set"
2896 },
2897 {
2898 "include": "#double-three-regexp-comments"
2899 },
2900 {
2901 "include": "#regexp-flags"
2902 },
2903 {
2904 "include": "#double-three-regexp-named-group"
2905 },
2906 {
2907 "include": "#regexp-backreference"
2908 },
2909 {
2910 "include": "#double-three-regexp-lookahead"
2911 },
2912 {
2913 "include": "#double-three-regexp-lookahead-negative"
2914 },
2915 {
2916 "include": "#double-three-regexp-lookbehind"
2917 },
2918 {
2919 "include": "#double-three-regexp-lookbehind-negative"
2920 },
2921 {
2922 "include": "#double-three-regexp-conditional"
2923 },
2924 {
2925 "include": "#double-three-regexp-parentheses-non-capturing"
2926 },
2927 {
2928 "include": "#double-three-regexp-parentheses"
2929 },
2930 {
2931 "include": "#comments-string-double-three"
2932 }
2933 ]
2934 },
2935 "double-three-regexp-character-set": {
2936 "patterns": [
2937 {
2938 "match": "(?x)\n \\[ \\^? \\] (?! .*?\\])\n"
2939 },
2940 {
2941 "name": "meta.character.set.regexp",
2942 "begin": "(\\[)(\\^)?(\\])?",
2943 "end": "(\\]|(?=\"\"\"))",
2944 "beginCaptures": {
2945 "1": {
2946 "name": "punctuation.character.set.begin.regexp constant.other.set.regexp"
2947 },
2948 "2": {
2949 "name": "keyword.operator.negation.regexp"
2950 },
2951 "3": {
2952 "name": "constant.character.set.regexp"
2953 }
2954 },
2955 "endCaptures": {
2956 "1": {
2957 "name": "punctuation.character.set.end.regexp constant.other.set.regexp"
2958 },
2959 "2": {
2960 "name": "invalid.illegal.newline.python"
2961 }
2962 },
2963 "patterns": [
2964 {
2965 "include": "#regexp-charecter-set-escapes"
2966 },
2967 {
2968 "name": "constant.character.set.regexp",
2969 "match": "[^\\n]"
2970 }
2971 ]
2972 }
2973 ]
2974 },
2975 "double-three-regexp-named-group": {
2976 "name": "meta.named.regexp",
2977 "begin": "(?x)\n (\\() (\\?P <\\w+(?:\\s+[[:alnum:]]+)?>)\n",
2978 "end": "(\\)|(?=\"\"\"))",
2979 "beginCaptures": {
2980 "1": {
2981 "name": "support.other.parenthesis.regexp punctuation.parenthesis.named.begin.regexp"
2982 },
2983 "2": {
2984 "name": "entity.name.tag.named.group.regexp"
2985 }
2986 },
2987 "endCaptures": {
2988 "1": {
2989 "name": "support.other.parenthesis.regexp punctuation.parenthesis.named.end.regexp"
2990 },
2991 "2": {
2992 "name": "invalid.illegal.newline.python"
2993 }
2994 },
2995 "patterns": [
2996 {
2997 "include": "#double-three-regexp-expression"
2998 },
2999 {
3000 "include": "#comments-string-double-three"
3001 }
3002 ]
3003 },
3004 "double-three-regexp-comments": {
3005 "name": "comment.regexp",
3006 "begin": "\\(\\?#",
3007 "end": "(\\)|(?=\"\"\"))",
3008 "beginCaptures": {
3009 "0": {
3010 "name": "punctuation.comment.begin.regexp"
3011 }
3012 },
3013 "endCaptures": {
3014 "1": {
3015 "name": "punctuation.comment.end.regexp"
3016 },
3017 "2": {
3018 "name": "invalid.illegal.newline.python"
3019 }
3020 },
3021 "patterns": [
3022 {
3023 "include": "#codetags"
3024 }
3025 ]
3026 },
3027 "double-three-regexp-lookahead": {
3028 "begin": "(\\()\\?=",
3029 "end": "(\\)|(?=\"\"\"))",
3030 "beginCaptures": {
3031 "0": {
3032 "name": "keyword.operator.lookahead.regexp"
3033 },
3034 "1": {
3035 "name": "punctuation.parenthesis.lookahead.begin.regexp"
3036 }
3037 },
3038 "endCaptures": {
3039 "1": {
3040 "name": "keyword.operator.lookahead.regexp punctuation.parenthesis.lookahead.end.regexp"
3041 },
3042 "2": {
3043 "name": "invalid.illegal.newline.python"
3044 }
3045 },
3046 "patterns": [
3047 {
3048 "include": "#double-three-regexp-expression"
3049 },
3050 {
3051 "include": "#comments-string-double-three"
3052 }
3053 ]
3054 },
3055 "double-three-regexp-lookahead-negative": {
3056 "begin": "(\\()\\?!",
3057 "end": "(\\)|(?=\"\"\"))",
3058 "beginCaptures": {
3059 "0": {
3060 "name": "keyword.operator.lookahead.negative.regexp"
3061 },
3062 "1": {
3063 "name": "punctuation.parenthesis.lookahead.begin.regexp"
3064 }
3065 },
3066 "endCaptures": {
3067 "1": {
3068 "name": "keyword.operator.lookahead.negative.regexp punctuation.parenthesis.lookahead.end.regexp"
3069 },
3070 "2": {
3071 "name": "invalid.illegal.newline.python"
3072 }
3073 },
3074 "patterns": [
3075 {
3076 "include": "#double-three-regexp-expression"
3077 },
3078 {
3079 "include": "#comments-string-double-three"
3080 }
3081 ]
3082 },
3083 "double-three-regexp-lookbehind": {
3084 "begin": "(\\()\\?<=",
3085 "end": "(\\)|(?=\"\"\"))",
3086 "beginCaptures": {
3087 "0": {
3088 "name": "keyword.operator.lookbehind.regexp"
3089 },
3090 "1": {
3091 "name": "punctuation.parenthesis.lookbehind.begin.regexp"
3092 }
3093 },
3094 "endCaptures": {
3095 "1": {
3096 "name": "keyword.operator.lookbehind.regexp punctuation.parenthesis.lookbehind.end.regexp"
3097 },
3098 "2": {
3099 "name": "invalid.illegal.newline.python"
3100 }
3101 },
3102 "patterns": [
3103 {
3104 "include": "#double-three-regexp-expression"
3105 },
3106 {
3107 "include": "#comments-string-double-three"
3108 }
3109 ]
3110 },
3111 "double-three-regexp-lookbehind-negative": {
3112 "begin": "(\\()\\?<!",
3113 "end": "(\\)|(?=\"\"\"))",
3114 "beginCaptures": {
3115 "0": {
3116 "name": "keyword.operator.lookbehind.negative.regexp"
3117 },
3118 "1": {
3119 "name": "punctuation.parenthesis.lookbehind.begin.regexp"
3120 }
3121 },
3122 "endCaptures": {
3123 "1": {
3124 "name": "keyword.operator.lookbehind.negative.regexp punctuation.parenthesis.lookbehind.end.regexp"
3125 },
3126 "2": {
3127 "name": "invalid.illegal.newline.python"
3128 }
3129 },
3130 "patterns": [
3131 {
3132 "include": "#double-three-regexp-expression"
3133 },
3134 {
3135 "include": "#comments-string-double-three"
3136 }
3137 ]
3138 },
3139 "double-three-regexp-conditional": {
3140 "begin": "(\\()\\?\\((\\w+(?:\\s+[[:alnum:]]+)?|\\d+)\\)",
3141 "end": "(\\)|(?=\"\"\"))",
3142 "beginCaptures": {
3143 "0": {
3144 "name": "keyword.operator.conditional.regexp"
3145 },
3146 "1": {
3147 "name": "punctuation.parenthesis.conditional.begin.regexp"
3148 }
3149 },
3150 "endCaptures": {
3151 "1": {
3152 "name": "keyword.operator.conditional.negative.regexp punctuation.parenthesis.conditional.end.regexp"
3153 },
3154 "2": {
3155 "name": "invalid.illegal.newline.python"
3156 }
3157 },
3158 "patterns": [
3159 {
3160 "include": "#double-three-regexp-expression"
3161 },
3162 {
3163 "include": "#comments-string-double-three"
3164 }
3165 ]
3166 },
3167 "double-three-regexp-parentheses-non-capturing": {
3168 "begin": "\\(\\?:",
3169 "end": "(\\)|(?=\"\"\"))",
3170 "beginCaptures": {
3171 "0": {
3172 "name": "support.other.parenthesis.regexp punctuation.parenthesis.non-capturing.begin.regexp"
3173 }
3174 },
3175 "endCaptures": {
3176 "1": {
3177 "name": "support.other.parenthesis.regexp punctuation.parenthesis.non-capturing.end.regexp"
3178 },
3179 "2": {
3180 "name": "invalid.illegal.newline.python"
3181 }
3182 },
3183 "patterns": [
3184 {
3185 "include": "#double-three-regexp-expression"
3186 },
3187 {
3188 "include": "#comments-string-double-three"
3189 }
3190 ]
3191 },
3192 "double-three-regexp-parentheses": {
3193 "begin": "\\(",
3194 "end": "(\\)|(?=\"\"\"))",
3195 "beginCaptures": {
3196 "0": {
3197 "name": "support.other.parenthesis.regexp punctuation.parenthesis.begin.regexp"
3198 }
3199 },
3200 "endCaptures": {
3201 "1": {
3202 "name": "support.other.parenthesis.regexp punctuation.parenthesis.end.regexp"
3203 },
3204 "2": {
3205 "name": "invalid.illegal.newline.python"
3206 }
3207 },
3208 "patterns": [
3209 {
3210 "include": "#double-three-regexp-expression"
3211 },
3212 {
3213 "include": "#comments-string-double-three"
3214 }
3215 ]
3216 },
3217 "regexp-single-one-line": {
3218 "name": "string.regexp.quoted.single.python",
3219 "begin": "\\b(([uU]r)|([bB]r)|(r[bB]?))(\\')",
3220 "end": "(\\')|(?<!\\\\)(\\n)",
3221 "beginCaptures": {
3222 "2": {
3223 "name": "invalid.deprecated.prefix.python"
3224 },
3225 "3": {
3226 "name": "storage.type.string.python"
3227 },
3228 "4": {
3229 "name": "storage.type.string.python"
3230 },
3231 "5": {
3232 "name": "punctuation.definition.string.begin.python"
3233 }
3234 },
3235 "endCaptures": {
3236 "1": {
3237 "name": "punctuation.definition.string.end.python"
3238 },
3239 "2": {
3240 "name": "invalid.illegal.newline.python"
3241 }
3242 },
3243 "patterns": [
3244 {
3245 "include": "#single-one-regexp-expression"
3246 }
3247 ]
3248 },
3249 "regexp-single-three-line": {
3250 "name": "string.regexp.quoted.multi.python",
3251 "begin": "\\b(([uU]r)|([bB]r)|(r[bB]?))(\\'\\'\\')",
3252 "end": "(\\'\\'\\')",
3253 "beginCaptures": {
3254 "2": {
3255 "name": "invalid.deprecated.prefix.python"
3256 },
3257 "3": {
3258 "name": "storage.type.string.python"
3259 },
3260 "4": {
3261 "name": "storage.type.string.python"
3262 },
3263 "5": {
3264 "name": "punctuation.definition.string.begin.python"
3265 }
3266 },
3267 "endCaptures": {
3268 "1": {
3269 "name": "punctuation.definition.string.end.python"
3270 },
3271 "2": {
3272 "name": "invalid.illegal.newline.python"
3273 }
3274 },
3275 "patterns": [
3276 {
3277 "include": "#single-three-regexp-expression"
3278 }
3279 ]
3280 },
3281 "regexp-double-one-line": {
3282 "name": "string.regexp.quoted.single.python",
3283 "begin": "\\b(([uU]r)|([bB]r)|(r[bB]?))(\")",
3284 "end": "(\")|(?<!\\\\)(\\n)",
3285 "beginCaptures": {
3286 "2": {
3287 "name": "invalid.deprecated.prefix.python"
3288 },
3289 "3": {
3290 "name": "storage.type.string.python"
3291 },
3292 "4": {
3293 "name": "storage.type.string.python"
3294 },
3295 "5": {
3296 "name": "punctuation.definition.string.begin.python"
3297 }
3298 },
3299 "endCaptures": {
3300 "1": {
3301 "name": "punctuation.definition.string.end.python"
3302 },
3303 "2": {
3304 "name": "invalid.illegal.newline.python"
3305 }
3306 },
3307 "patterns": [
3308 {
3309 "include": "#double-one-regexp-expression"
3310 }
3311 ]
3312 },
3313 "regexp-double-three-line": {
3314 "name": "string.regexp.quoted.multi.python",
3315 "begin": "\\b(([uU]r)|([bB]r)|(r[bB]?))(\"\"\")",
3316 "end": "(\"\"\")",
3317 "beginCaptures": {
3318 "2": {
3319 "name": "invalid.deprecated.prefix.python"
3320 },
3321 "3": {
3322 "name": "storage.type.string.python"
3323 },
3324 "4": {
3325 "name": "storage.type.string.python"
3326 },
3327 "5": {
3328 "name": "punctuation.definition.string.begin.python"
3329 }
3330 },
3331 "endCaptures": {
3332 "1": {
3333 "name": "punctuation.definition.string.end.python"
3334 },
3335 "2": {
3336 "name": "invalid.illegal.newline.python"
3337 }
3338 },
3339 "patterns": [
3340 {
3341 "include": "#double-three-regexp-expression"
3342 }
3343 ]
3344 },
3345 "string-raw-quoted-single-line": {
3346 "name": "string.quoted.raw.single.python",
3347 "begin": "\\b(([uU]R)|(R))((['\"]))",
3348 "end": "(\\4)|((?<!\\\\)\\n)",
3349 "beginCaptures": {
3350 "2": {
3351 "name": "invalid.deprecated.prefix.python"
3352 },
3353 "3": {
3354 "name": "storage.type.string.python"
3355 },
3356 "4": {
3357 "name": "punctuation.definition.string.begin.python"
3358 }
3359 },
3360 "endCaptures": {
3361 "1": {
3362 "name": "punctuation.definition.string.end.python"
3363 },
3364 "2": {
3365 "name": "invalid.illegal.newline.python"
3366 }
3367 },
3368 "patterns": [
3369 {
3370 "include": "#string-single-bad-brace1-formatting-raw"
3371 },
3372 {
3373 "include": "#string-single-bad-brace2-formatting-raw"
3374 },
3375 {
3376 "include": "#string-raw-guts"
3377 }
3378 ]
3379 },
3380 "string-bin-quoted-single-line": {
3381 "name": "string.quoted.binary.single.python",
3382 "begin": "(\\b[bB])((['\"]))",
3383 "end": "(\\2)|((?<!\\\\)\\n)",
3384 "beginCaptures": {
3385 "1": {
3386 "name": "storage.type.string.python"
3387 },
3388 "2": {
3389 "name": "punctuation.definition.string.begin.python"
3390 }
3391 },
3392 "endCaptures": {
3393 "1": {
3394 "name": "punctuation.definition.string.end.python"
3395 },
3396 "2": {
3397 "name": "invalid.illegal.newline.python"
3398 }
3399 },
3400 "patterns": [
3401 {
3402 "include": "#string-entity"
3403 }
3404 ]
3405 },
3406 "string-raw-bin-quoted-single-line": {
3407 "name": "string.quoted.raw.binary.single.python",
3408 "begin": "(\\b(?:R[bB]|[bB]R))((['\"]))",
3409 "end": "(\\2)|((?<!\\\\)\\n)",
3410 "beginCaptures": {
3411 "1": {
3412 "name": "storage.type.string.python"
3413 },
3414 "2": {
3415 "name": "punctuation.definition.string.begin.python"
3416 }
3417 },
3418 "endCaptures": {
3419 "1": {
3420 "name": "punctuation.definition.string.end.python"
3421 },
3422 "2": {
3423 "name": "invalid.illegal.newline.python"
3424 }
3425 },
3426 "patterns": [
3427 {
3428 "include": "#string-raw-bin-guts"
3429 }
3430 ]
3431 },
3432 "string-quoted-single-line": {
3433 "name": "string.quoted.single.python",
3434 "begin": "(?:\\b([rR])(?=[uU]))?([uU])?((['\"]))",
3435 "end": "(\\3)|((?<!\\\\)\\n)",
3436 "beginCaptures": {
3437 "1": {
3438 "name": "invalid.illegal.prefix.python"
3439 },
3440 "2": {
3441 "name": "storage.type.string.python"
3442 },
3443 "3": {
3444 "name": "punctuation.definition.string.begin.python"
3445 }
3446 },
3447 "endCaptures": {
3448 "1": {
3449 "name": "punctuation.definition.string.end.python"
3450 },
3451 "2": {
3452 "name": "invalid.illegal.newline.python"
3453 }
3454 },
3455 "patterns": [
3456 {
3457 "include": "#string-single-bad-brace1-formatting-unicode"
3458 },
3459 {
3460 "include": "#string-single-bad-brace2-formatting-unicode"
3461 },
3462 {
3463 "include": "#string-unicode-guts"
3464 }
3465 ]
3466 },
3467 "string-single-bad-brace1-formatting-unicode": {
3468 "comment": "template using {% ... %}",
3469 "begin": "(?x)\n (?= \\{%\n ( .*? (?!(['\"])|((?<!\\\\)\\n)) )\n %\\}\n )\n",
3470 "end": "(?=(['\"])|((?<!\\\\)\\n))",
3471 "patterns": [
3472 {
3473 "include": "#escape-sequence-unicode"
3474 },
3475 {
3476 "include": "#escape-sequence"
3477 },
3478 {
3479 "include": "#string-line-continuation"
3480 }
3481 ]
3482 },
3483 "string-single-bad-brace1-formatting-raw": {
3484 "comment": "template using {% ... %}",
3485 "begin": "(?x)\n (?= \\{%\n ( .*? (?!(['\"])|((?<!\\\\)\\n)) )\n %\\}\n )\n",
3486 "end": "(?=(['\"])|((?<!\\\\)\\n))",
3487 "patterns": [
3488 {
3489 "include": "#string-consume-escape"
3490 }
3491 ]
3492 },
3493 "string-single-bad-brace2-formatting-unicode": {
3494 "comment": "odd format or format-like syntax",
3495 "begin": "(?x)\n (?!\\{\\{)\n (?= \\{ (\n \\w*? (?!(['\"])|((?<!\\\\)\\n)) [^!:\\.\\[}\\w]\n )\n .*?(?!(['\"])|((?<!\\\\)\\n))\n \\}\n )\n",
3496 "end": "(?=(['\"])|((?<!\\\\)\\n))",
3497 "patterns": [
3498 {
3499 "include": "#escape-sequence-unicode"
3500 },
3501 {
3502 "include": "#string-entity"
3503 }
3504 ]
3505 },
3506 "string-single-bad-brace2-formatting-raw": {
3507 "comment": "odd format or format-like syntax",
3508 "begin": "(?x)\n (?!\\{\\{)\n (?= \\{ (\n \\w*? (?!(['\"])|((?<!\\\\)\\n)) [^!:\\.\\[}\\w]\n )\n .*?(?!(['\"])|((?<!\\\\)\\n))\n \\}\n )\n",
3509 "end": "(?=(['\"])|((?<!\\\\)\\n))",
3510 "patterns": [
3511 {
3512 "include": "#string-consume-escape"
3513 },
3514 {
3515 "include": "#string-formatting"
3516 }
3517 ]
3518 },
3519 "string-raw-quoted-multi-line": {
3520 "name": "string.quoted.raw.multi.python",
3521 "begin": "\\b(([uU]R)|(R))('''|\"\"\")",
3522 "end": "(\\4)",
3523 "beginCaptures": {
3524 "2": {
3525 "name": "invalid.deprecated.prefix.python"
3526 },
3527 "3": {
3528 "name": "storage.type.string.python"
3529 },
3530 "4": {
3531 "name": "punctuation.definition.string.begin.python"
3532 }
3533 },
3534 "endCaptures": {
3535 "1": {
3536 "name": "punctuation.definition.string.end.python"
3537 },
3538 "2": {
3539 "name": "invalid.illegal.newline.python"
3540 }
3541 },
3542 "patterns": [
3543 {
3544 "include": "#string-multi-bad-brace1-formatting-raw"
3545 },
3546 {
3547 "include": "#string-multi-bad-brace2-formatting-raw"
3548 },
3549 {
3550 "include": "#string-raw-guts"
3551 }
3552 ]
3553 },
3554 "string-bin-quoted-multi-line": {
3555 "name": "string.quoted.binary.multi.python",
3556 "begin": "(\\b[bB])('''|\"\"\")",
3557 "end": "(\\2)",
3558 "beginCaptures": {
3559 "1": {
3560 "name": "storage.type.string.python"
3561 },
3562 "2": {
3563 "name": "punctuation.definition.string.begin.python"
3564 }
3565 },
3566 "endCaptures": {
3567 "1": {
3568 "name": "punctuation.definition.string.end.python"
3569 },
3570 "2": {
3571 "name": "invalid.illegal.newline.python"
3572 }
3573 },
3574 "patterns": [
3575 {
3576 "include": "#string-entity"
3577 }
3578 ]
3579 },
3580 "string-raw-bin-quoted-multi-line": {
3581 "name": "string.quoted.raw.binary.multi.python",
3582 "begin": "(\\b(?:R[bB]|[bB]R))('''|\"\"\")",
3583 "end": "(\\2)",
3584 "beginCaptures": {
3585 "1": {
3586 "name": "storage.type.string.python"
3587 },
3588 "2": {
3589 "name": "punctuation.definition.string.begin.python"
3590 }
3591 },
3592 "endCaptures": {
3593 "1": {
3594 "name": "punctuation.definition.string.end.python"
3595 },
3596 "2": {
3597 "name": "invalid.illegal.newline.python"
3598 }
3599 },
3600 "patterns": [
3601 {
3602 "include": "#string-raw-bin-guts"
3603 }
3604 ]
3605 },
3606 "string-quoted-multi-line": {
3607 "name": "string.quoted.multi.python",
3608 "begin": "(?:\\b([rR])(?=[uU]))?([uU])?('''|\"\"\")",
3609 "end": "(\\3)",
3610 "beginCaptures": {
3611 "1": {
3612 "name": "invalid.illegal.prefix.python"
3613 },
3614 "2": {
3615 "name": "storage.type.string.python"
3616 },
3617 "3": {
3618 "name": "punctuation.definition.string.begin.python"
3619 }
3620 },
3621 "endCaptures": {
3622 "1": {
3623 "name": "punctuation.definition.string.end.python"
3624 },
3625 "2": {
3626 "name": "invalid.illegal.newline.python"
3627 }
3628 },
3629 "patterns": [
3630 {
3631 "include": "#string-multi-bad-brace1-formatting-unicode"
3632 },
3633 {
3634 "include": "#string-multi-bad-brace2-formatting-unicode"
3635 },
3636 {
3637 "include": "#string-unicode-guts"
3638 }
3639 ]
3640 },
3641 "string-mojo-code-block": {
3642 "name": "meta.embedded.block.mojo",
3643 "begin": "^(\\s*\\`{3,})(mojo)$",
3644 "end": "^(\\1)$",
3645 "contentName": "source.mojo",
3646 "beginCaptures": {
3647 "1": {
3648 "name": "string.quoted.single.python"
3649 },
3650 "2": {
3651 "name": "string.quoted.single.python"
3652 }
3653 },
3654 "endCaptures": {
3655 "1": {
3656 "name": "string.quoted.single.python"
3657 }
3658 },
3659 "patterns": [
3660 {
3661 "include": "source.mojo"
3662 }
3663 ]
3664 },
3665 "string-multi-bad-brace1-formatting-unicode": {
3666 "comment": "template using {% ... %}",
3667 "begin": "(?x)\n (?= \\{%\n ( .*? (?!'''|\"\"\") )\n %\\}\n )\n",
3668 "end": "(?='''|\"\"\")",
3669 "patterns": [
3670 {
3671 "include": "#escape-sequence-unicode"
3672 },
3673 {
3674 "include": "#escape-sequence"
3675 },
3676 {
3677 "include": "#string-line-continuation"
3678 }
3679 ]
3680 },
3681 "string-multi-bad-brace1-formatting-raw": {
3682 "comment": "template using {% ... %}",
3683 "begin": "(?x)\n (?= \\{%\n ( .*? (?!'''|\"\"\") )\n %\\}\n )\n",
3684 "end": "(?='''|\"\"\")",
3685 "patterns": [
3686 {
3687 "include": "#string-consume-escape"
3688 }
3689 ]
3690 },
3691 "string-multi-bad-brace2-formatting-unicode": {
3692 "comment": "odd format or format-like syntax",
3693 "begin": "(?x)\n (?!\\{\\{)\n (?= \\{ (\n \\w*? (?!'''|\"\"\") [^!:\\.\\[}\\w]\n )\n .*?(?!'''|\"\"\")\n \\}\n )\n",
3694 "end": "(?='''|\"\"\")",
3695 "patterns": [
3696 {
3697 "include": "#escape-sequence-unicode"
3698 },
3699 {
3700 "include": "#string-entity"
3701 }
3702 ]
3703 },
3704 "string-multi-bad-brace2-formatting-raw": {
3705 "comment": "odd format or format-like syntax",
3706 "begin": "(?x)\n (?!\\{\\{)\n (?= \\{ (\n \\w*? (?!'''|\"\"\") [^!:\\.\\[}\\w]\n )\n .*?(?!'''|\"\"\")\n \\}\n )\n",
3707 "end": "(?='''|\"\"\")",
3708 "patterns": [
3709 {
3710 "include": "#string-consume-escape"
3711 },
3712 {
3713 "include": "#string-formatting"
3714 }
3715 ]
3716 },
3717 "fstring-fnorm-quoted-single-line": {
3718 "name": "meta.fstring.python",
3719 "begin": "(\\b[fF])([bBuU])?((['\"]))",
3720 "end": "(\\3)|((?<!\\\\)\\n)",
3721 "beginCaptures": {
3722 "1": {
3723 "name": "string.interpolated.python string.quoted.single.python storage.type.string.python"
3724 },
3725 "2": {
3726 "name": "invalid.illegal.prefix.python"
3727 },
3728 "3": {
3729 "name": "punctuation.definition.string.begin.python string.interpolated.python string.quoted.single.python"
3730 }
3731 },
3732 "endCaptures": {
3733 "1": {
3734 "name": "punctuation.definition.string.end.python string.interpolated.python string.quoted.single.python"
3735 },
3736 "2": {
3737 "name": "invalid.illegal.newline.python"
3738 }
3739 },
3740 "patterns": [
3741 {
3742 "include": "#fstring-guts"
3743 },
3744 {
3745 "include": "#fstring-illegal-single-brace"
3746 },
3747 {
3748 "include": "#fstring-single-brace"
3749 },
3750 {
3751 "include": "#fstring-single-core"
3752 }
3753 ]
3754 },
3755 "fstring-normf-quoted-single-line": {
3756 "name": "meta.fstring.python",
3757 "begin": "(\\b[bBuU])([fF])((['\"]))",
3758 "end": "(\\3)|((?<!\\\\)\\n)",
3759 "beginCaptures": {
3760 "1": {
3761 "name": "invalid.illegal.prefix.python"
3762 },
3763 "2": {
3764 "name": "string.interpolated.python string.quoted.single.python storage.type.string.python"
3765 },
3766 "3": {
3767 "name": "punctuation.definition.string.begin.python string.quoted.single.python"
3768 }
3769 },
3770 "endCaptures": {
3771 "1": {
3772 "name": "punctuation.definition.string.end.python string.interpolated.python string.quoted.single.python"
3773 },
3774 "2": {
3775 "name": "invalid.illegal.newline.python"
3776 }
3777 },
3778 "patterns": [
3779 {
3780 "include": "#fstring-guts"
3781 },
3782 {
3783 "include": "#fstring-illegal-single-brace"
3784 },
3785 {
3786 "include": "#fstring-single-brace"
3787 },
3788 {
3789 "include": "#fstring-single-core"
3790 }
3791 ]
3792 },
3793 "fstring-raw-quoted-single-line": {
3794 "name": "meta.fstring.python",
3795 "begin": "(\\b(?:[rR][fF]|[fF][rR]))((['\"]))",
3796 "end": "(\\2)|((?<!\\\\)\\n)",
3797 "beginCaptures": {
3798 "1": {
3799 "name": "string.interpolated.python string.quoted.raw.single.python storage.type.string.python"
3800 },
3801 "2": {
3802 "name": "punctuation.definition.string.begin.python string.quoted.raw.single.python"
3803 }
3804 },
3805 "endCaptures": {
3806 "1": {
3807 "name": "punctuation.definition.string.end.python string.interpolated.python string.quoted.raw.single.python"
3808 },
3809 "2": {
3810 "name": "invalid.illegal.newline.python"
3811 }
3812 },
3813 "patterns": [
3814 {
3815 "include": "#fstring-raw-guts"
3816 },
3817 {
3818 "include": "#fstring-illegal-single-brace"
3819 },
3820 {
3821 "include": "#fstring-single-brace"
3822 },
3823 {
3824 "include": "#fstring-raw-single-core"
3825 }
3826 ]
3827 },
3828 "fstring-single-core": {
3829 "name": "string.interpolated.python string.quoted.single.python",
3830 "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"
3831 },
3832 "fstring-raw-single-core": {
3833 "name": "string.interpolated.python string.quoted.raw.single.python",
3834 "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"
3835 },
3836 "fstring-single-brace": {
3837 "comment": "value interpolation using { ... }",
3838 "begin": "(\\{)",
3839 "end": "(?x)\n (\\})|(?=\\n)\n",
3840 "beginCaptures": {
3841 "1": {
3842 "name": "constant.character.format.placeholder.other.python"
3843 }
3844 },
3845 "endCaptures": {
3846 "1": {
3847 "name": "constant.character.format.placeholder.other.python"
3848 }
3849 },
3850 "patterns": [
3851 {
3852 "include": "#fstring-terminator-single"
3853 },
3854 {
3855 "include": "#f-expression"
3856 }
3857 ]
3858 },
3859 "fstring-terminator-single": {
3860 "patterns": [
3861 {
3862 "name": "storage.type.format.python",
3863 "match": "(=(![rsa])?)(?=})"
3864 },
3865 {
3866 "name": "storage.type.format.python",
3867 "match": "(=?![rsa])(?=})"
3868 },
3869 {
3870 "match": "(?x)\n ( (?: =?) (?: ![rsa])? )\n ( : \\w? [<>=^]? [-+ ]? \\#?\n \\d* ,? (\\.\\d+)? [bcdeEfFgGnosxX%]? )(?=})\n",
3871 "captures": {
3872 "1": {
3873 "name": "storage.type.format.python"
3874 },
3875 "2": {
3876 "name": "storage.type.format.python"
3877 }
3878 }
3879 },
3880 {
3881 "include": "#fstring-terminator-single-tail"
3882 }
3883 ]
3884 },
3885 "fstring-terminator-single-tail": {
3886 "begin": "((?:=?)(?:![rsa])?)(:)(?=.*?{)",
3887 "end": "(?=})|(?=\\n)",
3888 "beginCaptures": {
3889 "1": {
3890 "name": "storage.type.format.python"
3891 },
3892 "2": {
3893 "name": "storage.type.format.python"
3894 }
3895 },
3896 "patterns": [
3897 {
3898 "include": "#fstring-illegal-single-brace"
3899 },
3900 {
3901 "include": "#fstring-single-brace"
3902 },
3903 {
3904 "name": "storage.type.format.python",
3905 "match": "([bcdeEfFgGnosxX%])(?=})"
3906 },
3907 {
3908 "name": "storage.type.format.python",
3909 "match": "(\\.\\d+)"
3910 },
3911 {
3912 "name": "storage.type.format.python",
3913 "match": "(,)"
3914 },
3915 {
3916 "name": "storage.type.format.python",
3917 "match": "(\\d+)"
3918 },
3919 {
3920 "name": "storage.type.format.python",
3921 "match": "(\\#)"
3922 },
3923 {
3924 "name": "storage.type.format.python",
3925 "match": "([-+ ])"
3926 },
3927 {
3928 "name": "storage.type.format.python",
3929 "match": "([<>=^])"
3930 },
3931 {
3932 "name": "storage.type.format.python",
3933 "match": "(\\w)"
3934 }
3935 ]
3936 },
3937 "fstring-fnorm-quoted-multi-line": {
3938 "name": "meta.fstring.python",
3939 "begin": "(\\b[fF])([bBuU])?('''|\"\"\")",
3940 "end": "(\\3)",
3941 "beginCaptures": {
3942 "1": {
3943 "name": "string.interpolated.python string.quoted.multi.python storage.type.string.python"
3944 },
3945 "2": {
3946 "name": "invalid.illegal.prefix.python"
3947 },
3948 "3": {
3949 "name": "punctuation.definition.string.begin.python string.interpolated.python string.quoted.multi.python"
3950 }
3951 },
3952 "endCaptures": {
3953 "1": {
3954 "name": "punctuation.definition.string.end.python string.interpolated.python string.quoted.multi.python"
3955 },
3956 "2": {
3957 "name": "invalid.illegal.newline.python"
3958 }
3959 },
3960 "patterns": [
3961 {
3962 "include": "#fstring-guts"
3963 },
3964 {
3965 "include": "#fstring-illegal-multi-brace"
3966 },
3967 {
3968 "include": "#fstring-multi-brace"
3969 },
3970 {
3971 "include": "#fstring-multi-core"
3972 }
3973 ]
3974 },
3975 "fstring-normf-quoted-multi-line": {
3976 "name": "meta.fstring.python",
3977 "begin": "(\\b[bBuU])([fF])('''|\"\"\")",
3978 "end": "(\\3)",
3979 "beginCaptures": {
3980 "1": {
3981 "name": "invalid.illegal.prefix.python"
3982 },
3983 "2": {
3984 "name": "string.interpolated.python string.quoted.multi.python storage.type.string.python"
3985 },
3986 "3": {
3987 "name": "punctuation.definition.string.begin.python string.quoted.multi.python"
3988 }
3989 },
3990 "endCaptures": {
3991 "1": {
3992 "name": "punctuation.definition.string.end.python string.interpolated.python string.quoted.multi.python"
3993 },
3994 "2": {
3995 "name": "invalid.illegal.newline.python"
3996 }
3997 },
3998 "patterns": [
3999 {
4000 "include": "#fstring-guts"
4001 },
4002 {
4003 "include": "#fstring-illegal-multi-brace"
4004 },
4005 {
4006 "include": "#fstring-multi-brace"
4007 },
4008 {
4009 "include": "#fstring-multi-core"
4010 }
4011 ]
4012 },
4013 "fstring-raw-quoted-multi-line": {
4014 "name": "meta.fstring.python",
4015 "begin": "(\\b(?:[rR][fF]|[fF][rR]))('''|\"\"\")",
4016 "end": "(\\2)",
4017 "beginCaptures": {
4018 "1": {
4019 "name": "string.interpolated.python string.quoted.raw.multi.python storage.type.string.python"
4020 },
4021 "2": {
4022 "name": "punctuation.definition.string.begin.python string.quoted.raw.multi.python"
4023 }
4024 },
4025 "endCaptures": {
4026 "1": {
4027 "name": "punctuation.definition.string.end.python string.interpolated.python string.quoted.raw.multi.python"
4028 },
4029 "2": {
4030 "name": "invalid.illegal.newline.python"
4031 }
4032 },
4033 "patterns": [
4034 {
4035 "include": "#fstring-raw-guts"
4036 },
4037 {
4038 "include": "#fstring-illegal-multi-brace"
4039 },
4040 {
4041 "include": "#fstring-multi-brace"
4042 },
4043 {
4044 "include": "#fstring-raw-multi-core"
4045 }
4046 ]
4047 },
4048 "fstring-multi-core": {
4049 "name": "string.interpolated.python string.quoted.multi.python",
4050 "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"
4051 },
4052 "fstring-raw-multi-core": {
4053 "name": "string.interpolated.python string.quoted.raw.multi.python",
4054 "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"
4055 },
4056 "fstring-multi-brace": {
4057 "comment": "value interpolation using { ... }",
4058 "begin": "(\\{)",
4059 "end": "(?x)\n (\\})\n",
4060 "beginCaptures": {
4061 "1": {
4062 "name": "constant.character.format.placeholder.other.python"
4063 }
4064 },
4065 "endCaptures": {
4066 "1": {
4067 "name": "constant.character.format.placeholder.other.python"
4068 }
4069 },
4070 "patterns": [
4071 {
4072 "include": "#fstring-terminator-multi"
4073 },
4074 {
4075 "include": "#f-expression"
4076 }
4077 ]
4078 },
4079 "fstring-terminator-multi": {
4080 "patterns": [
4081 {
4082 "name": "storage.type.format.python",
4083 "match": "(=(![rsa])?)(?=})"
4084 },
4085 {
4086 "name": "storage.type.format.python",
4087 "match": "(=?![rsa])(?=})"
4088 },
4089 {
4090 "match": "(?x)\n ( (?: =?) (?: ![rsa])? )\n ( : \\w? [<>=^]? [-+ ]? \\#?\n \\d* ,? (\\.\\d+)? [bcdeEfFgGnosxX%]? )(?=})\n",
4091 "captures": {
4092 "1": {
4093 "name": "storage.type.format.python"
4094 },
4095 "2": {
4096 "name": "storage.type.format.python"
4097 }
4098 }
4099 },
4100 {
4101 "include": "#fstring-terminator-multi-tail"
4102 }
4103 ]
4104 },
4105 "fstring-terminator-multi-tail": {
4106 "begin": "((?:=?)(?:![rsa])?)(:)(?=.*?{)",
4107 "end": "(?=})",
4108 "beginCaptures": {
4109 "1": {
4110 "name": "storage.type.format.python"
4111 },
4112 "2": {
4113 "name": "storage.type.format.python"
4114 }
4115 },
4116 "patterns": [
4117 {
4118 "include": "#fstring-illegal-multi-brace"
4119 },
4120 {
4121 "include": "#fstring-multi-brace"
4122 },
4123 {
4124 "name": "storage.type.format.python",
4125 "match": "([bcdeEfFgGnosxX%])(?=})"
4126 },
4127 {
4128 "name": "storage.type.format.python",
4129 "match": "(\\.\\d+)"
4130 },
4131 {
4132 "name": "storage.type.format.python",
4133 "match": "(,)"
4134 },
4135 {
4136 "name": "storage.type.format.python",
4137 "match": "(\\d+)"
4138 },
4139 {
4140 "name": "storage.type.format.python",
4141 "match": "(\\#)"
4142 },
4143 {
4144 "name": "storage.type.format.python",
4145 "match": "([-+ ])"
4146 },
4147 {
4148 "name": "storage.type.format.python",
4149 "match": "([<>=^])"
4150 },
4151 {
4152 "name": "storage.type.format.python",
4153 "match": "(\\w)"
4154 }
4155 ]
4156 }
4157 }
4158 }
4159