github-linguist 4.8.18 → 5.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (45) hide show
  1. checksums.yaml +4 -4
  2. data/grammars/hint.haskell.json +11 -8
  3. data/grammars/hint.message.haskell.json +11 -8
  4. data/grammars/hint.type.haskell.json +11 -8
  5. data/grammars/source.abnf.json +20 -9
  6. data/grammars/source.ahk.json +1 -1
  7. data/grammars/source.bsl.json +1 -1
  8. data/grammars/source.c.json +0 -4
  9. data/grammars/source.c.platform.json +93 -14
  10. data/grammars/source.coffee.json +2 -2
  11. data/grammars/source.cs.json +29 -5
  12. data/grammars/source.csound-score.json +57 -30
  13. data/grammars/source.csound.json +44 -4
  14. data/grammars/source.dm.json +1 -1
  15. data/grammars/source.haskell.json +11 -8
  16. data/grammars/source.js.json +116 -62
  17. data/grammars/source.lean.json +1 -1
  18. data/grammars/source.llvm.json +2 -2
  19. data/grammars/source.mask.json +27 -1
  20. data/grammars/source.objc.platform.json +57 -14
  21. data/grammars/source.perl.json +1 -1
  22. data/grammars/source.perl6fe.json +165 -54
  23. data/grammars/source.pony.json +1 -1
  24. data/grammars/source.python.json +2061 -289
  25. data/grammars/source.rascal.json +3 -4
  26. data/grammars/source.regexp.python.json +34 -4
  27. data/grammars/source.sdbl.json +6 -2
  28. data/grammars/source.swift.json +182 -58
  29. data/grammars/source.viml.json +1 -1
  30. data/grammars/source.yaml.json +2 -0
  31. data/grammars/text.html.handlebars.json +3 -3
  32. data/grammars/text.html.php.json +2 -2
  33. data/grammars/text.html.vue.json +42 -1
  34. data/grammars/text.tex.latex.haskell.json +11 -8
  35. data/lib/linguist.rb +2 -1
  36. data/lib/linguist/language.rb +20 -69
  37. data/lib/linguist/languages.json +1 -1
  38. data/lib/linguist/languages.yml +95 -119
  39. data/lib/linguist/popular.yml +1 -1
  40. data/lib/linguist/samples.json +2330 -2330
  41. data/lib/linguist/strategy/extension.rb +10 -0
  42. data/lib/linguist/strategy/filename.rb +3 -2
  43. data/lib/linguist/version.rb +1 -1
  44. metadata +3 -3
  45. data/grammars/source.js.embedded.html.json +0 -10
@@ -143,7 +143,7 @@
143
143
  "name": "keyword.control.jump.pony"
144
144
  },
145
145
  {
146
- "match": "\\b(if|ifdef|then|elseif|else|end|match|where|try|with|as|recover|consume|object|lambda|digestof)\\b",
146
+ "match": "\\b(if|ifdef|then|elseif|else|end|match|where|try|with|as|recover|consume|object|digestof)\\b",
147
147
  "name": "keyword.control.pony"
148
148
  },
149
149
  {
@@ -7,6 +7,7 @@
7
7
  "rpy",
8
8
  "pyw",
9
9
  "cpy",
10
+ "pyi",
10
11
  "SConstruct",
11
12
  "Sconstruct",
12
13
  "sconstruct",
@@ -273,8 +274,8 @@
273
274
  }
274
275
  ]
275
276
  },
276
- "expression-base": {
277
- "comment": "All valid Python expressions",
277
+ "expression-bare": {
278
+ "comment": "valid Python expressions w/o comments and line continuation",
278
279
  "patterns": [
279
280
  {
280
281
  "include": "#backticks"
@@ -282,9 +283,6 @@
282
283
  {
283
284
  "include": "#illegal-anno"
284
285
  },
285
- {
286
- "include": "#comments"
287
- },
288
286
  {
289
287
  "include": "#literal"
290
288
  },
@@ -339,11 +337,28 @@
339
337
  {
340
338
  "include": "#special-variables"
341
339
  },
340
+ {
341
+ "include": "#ellipsis"
342
+ },
343
+ {
344
+ "include": "#punctuation"
345
+ },
342
346
  {
343
347
  "include": "#line-continuation"
348
+ }
349
+ ]
350
+ },
351
+ "expression-base": {
352
+ "comment": "valid Python expressions with comments and line continuation",
353
+ "patterns": [
354
+ {
355
+ "include": "#comments"
344
356
  },
345
357
  {
346
- "include": "#ellipsis"
358
+ "include": "#expression-bare"
359
+ },
360
+ {
361
+ "include": "#line-continuation"
347
362
  }
348
363
  ]
349
364
  },
@@ -414,6 +429,10 @@
414
429
  }
415
430
  },
416
431
  "patterns": [
432
+ {
433
+ "name": "punctuation.separator.dict.python",
434
+ "match": ":"
435
+ },
417
436
  {
418
437
  "include": "#expression"
419
438
  }
@@ -463,7 +482,7 @@
463
482
  "match": "(\\\\)\\s*(\\S.*$\\n?)",
464
483
  "captures": {
465
484
  "1": {
466
- "name": "separator.continuation.line.python"
485
+ "name": "punctuation.separator.continuation.line.python"
467
486
  },
468
487
  "2": {
469
488
  "name": "invalid.illegal.line.continuation.python"
@@ -475,7 +494,7 @@
475
494
  "end": "(?x)\n (?=^\\s*$)\n |\n (?! (\\s* [rR]? (\\'\\'\\'|\\\"\\\"\\\"|\\'|\\\"))\n |\n (\\G $) (?# '\\G' is necessary for ST)\n )\n",
476
495
  "beginCaptures": {
477
496
  "1": {
478
- "name": "separator.continuation.line.python"
497
+ "name": "punctuation.separator.continuation.line.python"
479
498
  }
480
499
  },
481
500
  "patterns": [
@@ -513,6 +532,18 @@
513
532
  }
514
533
  }
515
534
  },
535
+ "punctuation": {
536
+ "patterns": [
537
+ {
538
+ "name": "punctuation.separator.block.begin.python",
539
+ "match": ":"
540
+ },
541
+ {
542
+ "name": "punctuation.separator.element.python",
543
+ "match": ","
544
+ }
545
+ ]
546
+ },
516
547
  "literal": {
517
548
  "patterns": [
518
549
  {
@@ -615,138 +646,28 @@
615
646
  "regexp": {
616
647
  "patterns": [
617
648
  {
618
- "include": "#regexp-single-quoted-multi-line"
649
+ "include": "#regexp-single-three-line"
619
650
  },
620
651
  {
621
- "include": "#regexp-double-quoted-multi-line"
652
+ "include": "#regexp-double-three-line"
622
653
  },
623
654
  {
624
- "include": "#regexp-single-quoted-single-line"
655
+ "include": "#regexp-single-one-line"
625
656
  },
626
657
  {
627
- "include": "#regexp-double-quoted-single-line"
628
- }
629
- ]
630
- },
631
- "regexp-single-quoted-single-line": {
632
- "name": "string.regexp.quoted.single.python",
633
- "begin": "\\b(([uU]r)|([bB]r)|(r[bB]?))(\\')",
634
- "end": "(\\')|(?<!\\\\)(\\n)",
635
- "beginCaptures": {
636
- "2": {
637
- "name": "invalid.deprecated.prefix.python"
638
- },
639
- "3": {
640
- "name": "storage.type.string.python"
641
- },
642
- "4": {
643
- "name": "storage.type.string.python"
644
- },
645
- "5": {
646
- "name": "punctuation.definition.string.begin.python"
647
- }
648
- },
649
- "endCaptures": {
650
- "1": {
651
- "name": "punctuation.definition.string.end.python"
658
+ "include": "#regexp-double-one-line"
652
659
  },
653
- "2": {
654
- "name": "invalid.illegal.newline.python"
655
- }
656
- },
657
- "patterns": [
658
660
  {
659
- "include": "#single-one-regexp-expression"
660
- }
661
- ]
662
- },
663
- "regexp-double-quoted-single-line": {
664
- "name": "string.regexp.quoted.single.python",
665
- "begin": "\\b(([uU]r)|([bB]r)|(r[bB]?))(\\\")",
666
- "end": "(\\\")|(?<!\\\\)(\\n)",
667
- "beginCaptures": {
668
- "2": {
669
- "name": "invalid.deprecated.prefix.python"
670
- },
671
- "3": {
672
- "name": "storage.type.string.python"
673
- },
674
- "4": {
675
- "name": "storage.type.string.python"
676
- },
677
- "5": {
678
- "name": "punctuation.definition.string.begin.python"
679
- }
680
- },
681
- "endCaptures": {
682
- "1": {
683
- "name": "punctuation.definition.string.end.python"
661
+ "include": "#fregexp-single-three-line"
684
662
  },
685
- "2": {
686
- "name": "invalid.illegal.newline.python"
687
- }
688
- },
689
- "patterns": [
690
663
  {
691
- "include": "#double-one-regexp-expression"
692
- }
693
- ]
694
- },
695
- "regexp-single-quoted-multi-line": {
696
- "name": "string.regexp.quoted.multi.python",
697
- "begin": "\\b(([uU]r)|([bB]r)|(r[bB]?))(\\'\\'\\')",
698
- "end": "\\'\\'\\'",
699
- "beginCaptures": {
700
- "2": {
701
- "name": "invalid.deprecated.prefix.python"
702
- },
703
- "3": {
704
- "name": "storage.type.string.python"
705
- },
706
- "4": {
707
- "name": "storage.type.string.python"
664
+ "include": "#fregexp-double-three-line"
708
665
  },
709
- "5": {
710
- "name": "punctuation.definition.string.begin.python"
711
- }
712
- },
713
- "endCaptures": {
714
- "0": {
715
- "name": "punctuation.definition.string.end.python"
716
- }
717
- },
718
- "patterns": [
719
666
  {
720
- "include": "#single-three-regexp-expression"
721
- }
722
- ]
723
- },
724
- "regexp-double-quoted-multi-line": {
725
- "name": "string.regexp.quoted.multi.python",
726
- "begin": "\\b(([uU]r)|([bB]r)|(r[bB]?))(\\\"\\\"\\\")",
727
- "end": "\\\"\\\"\\\"",
728
- "beginCaptures": {
729
- "2": {
730
- "name": "invalid.deprecated.prefix.python"
731
- },
732
- "3": {
733
- "name": "storage.type.string.python"
734
- },
735
- "4": {
736
- "name": "storage.type.string.python"
667
+ "include": "#fregexp-single-one-line"
737
668
  },
738
- "5": {
739
- "name": "punctuation.definition.string.begin.python"
740
- }
741
- },
742
- "endCaptures": {
743
- "0": {
744
- "name": "punctuation.definition.string.end.python"
745
- }
746
- },
747
- "patterns": [
748
669
  {
749
- "include": "#double-three-regexp-expression"
670
+ "include": "#fregexp-double-one-line"
750
671
  }
751
672
  ]
752
673
  },
@@ -775,6 +696,24 @@
775
696
  },
776
697
  {
777
698
  "include": "#string-raw-bin-quoted-single-line"
699
+ },
700
+ {
701
+ "include": "#fstring-fnorm-quoted-multi-line"
702
+ },
703
+ {
704
+ "include": "#fstring-fnorm-quoted-single-line"
705
+ },
706
+ {
707
+ "include": "#fstring-normf-quoted-multi-line"
708
+ },
709
+ {
710
+ "include": "#fstring-normf-quoted-single-line"
711
+ },
712
+ {
713
+ "include": "#fstring-raw-quoted-multi-line"
714
+ },
715
+ {
716
+ "include": "#fstring-raw-quoted-single-line"
778
717
  }
779
718
  ]
780
719
  },
@@ -830,6 +769,70 @@
830
769
  }
831
770
  ]
832
771
  },
772
+ "fstring-guts": {
773
+ "patterns": [
774
+ {
775
+ "include": "#escape-sequence-unicode"
776
+ },
777
+ {
778
+ "include": "#escape-sequence"
779
+ },
780
+ {
781
+ "include": "#string-line-continuation"
782
+ },
783
+ {
784
+ "include": "#fstring-formatting"
785
+ }
786
+ ]
787
+ },
788
+ "fstring-raw-guts": {
789
+ "patterns": [
790
+ {
791
+ "include": "#string-consume-escape"
792
+ },
793
+ {
794
+ "include": "#fstring-formatting"
795
+ }
796
+ ]
797
+ },
798
+ "fstring-illegal-single-brace": {
799
+ "comment": "it is illegal to have a multiline brace inside a single-line string",
800
+ "begin": "(\\{)(?=[^\\n}]*$\\n?)",
801
+ "end": "(\\})|(?=\\n)",
802
+ "beginCaptures": {
803
+ "1": {
804
+ "name": "constant.character.format.placeholder.other.python"
805
+ }
806
+ },
807
+ "endCaptures": {
808
+ "1": {
809
+ "name": "constant.character.format.placeholder.other.python"
810
+ }
811
+ },
812
+ "patterns": [
813
+ {
814
+ "include": "#fstring-terminator-single"
815
+ },
816
+ {
817
+ "include": "#f-expression"
818
+ }
819
+ ]
820
+ },
821
+ "f-expression": {
822
+ "comment": "All valid Python expressions, except comments and line cont",
823
+ "patterns": [
824
+ {
825
+ "include": "#expression-bare"
826
+ },
827
+ {
828
+ "include": "#member-access"
829
+ },
830
+ {
831
+ "comment": "Tokenize identifiers to help linters",
832
+ "match": "(?x) \\b ([[:alpha:]_]\\w*) \\b"
833
+ }
834
+ ]
835
+ },
833
836
  "escape-sequence-unicode": {
834
837
  "patterns": [
835
838
  {
@@ -884,6 +887,43 @@
884
887
  }
885
888
  ]
886
889
  },
890
+ "fstring-formatting": {
891
+ "patterns": [
892
+ {
893
+ "include": "#fstring-formatting-braces"
894
+ },
895
+ {
896
+ "include": "#fstring-formatting-singe-brace"
897
+ }
898
+ ]
899
+ },
900
+ "fstring-formatting-braces": {
901
+ "patterns": [
902
+ {
903
+ "comment": "empty braces are illegal",
904
+ "match": "({)(\\s*?)(})",
905
+ "captures": {
906
+ "1": {
907
+ "name": "constant.character.format.placeholder.other.python"
908
+ },
909
+ "2": {
910
+ "name": "invalid.illegal.brace.python"
911
+ },
912
+ "3": {
913
+ "name": "constant.character.format.placeholder.other.python"
914
+ }
915
+ }
916
+ },
917
+ {
918
+ "name": "constant.character.escape.python",
919
+ "match": "({{|}})"
920
+ }
921
+ ]
922
+ },
923
+ "fstring-formatting-singe-brace": {
924
+ "name": "invalid.illegal.brace.python",
925
+ "match": "(}(?!}))"
926
+ },
887
927
  "import": {
888
928
  "comment": "Import statements\n",
889
929
  "patterns": [
@@ -1031,7 +1071,7 @@
1031
1071
  }
1032
1072
  },
1033
1073
  {
1034
- "match": "\\b(lambda)\\s*?([,\\n]|$)",
1074
+ "match": "\\b(lambda)\\s*?(?=[,\\n]|$)",
1035
1075
  "captures": {
1036
1076
  "1": {
1037
1077
  "name": "storage.type.function.lambda.python"
@@ -1059,7 +1099,7 @@
1059
1099
  "match": "(\\*\\*|\\*)"
1060
1100
  },
1061
1101
  {
1062
- "include": "#lambda-incomplete"
1102
+ "include": "#lambda-nested-incomplete"
1063
1103
  },
1064
1104
  {
1065
1105
  "include": "#illegal-names"
@@ -1098,6 +1138,10 @@
1098
1138
  ]
1099
1139
  },
1100
1140
  "lambda-incomplete": {
1141
+ "name": "storage.type.function.lambda.python",
1142
+ "match": "\\blambda(?=\\s*[,)])"
1143
+ },
1144
+ "lambda-nested-incomplete": {
1101
1145
  "name": "storage.type.function.lambda.python",
1102
1146
  "match": "\\blambda(?=\\s*[:,)])"
1103
1147
  },
@@ -1349,6 +1393,10 @@
1349
1393
  },
1350
1394
  "contentName": "meta.item-access.arguments.python",
1351
1395
  "patterns": [
1396
+ {
1397
+ "name": "punctuation.separator.slice.python",
1398
+ "match": ":"
1399
+ },
1352
1400
  {
1353
1401
  "include": "#expression"
1354
1402
  }
@@ -1357,7 +1405,7 @@
1357
1405
  "decorator": {
1358
1406
  "name": "meta.function.decorator.python",
1359
1407
  "begin": "(?x)\n ^\\s*\n (@) \\s* (?=[[:alpha:]_]\\w*)\n",
1360
- "end": "(?x)\n ( \\) ) (?: (?=\\s*\\#|$) | (.*$) )\n | (?=\\n|\\#)\n",
1408
+ "end": "(?x)\n ( \\) )\n # trailing whitespace and comments are legal\n (?: (.*?) (?=\\s*(?:\\#|$)) )\n | (?=\\n|\\#)\n",
1361
1409
  "beginCaptures": {
1362
1410
  "1": {
1363
1411
  "name": "entity.name.function.decorator.python"
@@ -1665,6 +1713,32 @@
1665
1713
  "match": "->"
1666
1714
  },
1667
1715
  "regexp-base-expression": {
1716
+ "patterns": [
1717
+ {
1718
+ "include": "#regexp-quantifier"
1719
+ },
1720
+ {
1721
+ "include": "#regexp-base-common"
1722
+ }
1723
+ ]
1724
+ },
1725
+ "fregexp-base-expression": {
1726
+ "patterns": [
1727
+ {
1728
+ "include": "#fregexp-quantifier"
1729
+ },
1730
+ {
1731
+ "include": "#fstring-formatting-braces"
1732
+ },
1733
+ {
1734
+ "match": "\\{.*?\\}"
1735
+ },
1736
+ {
1737
+ "include": "#regexp-base-common"
1738
+ }
1739
+ ]
1740
+ },
1741
+ "regexp-base-common": {
1668
1742
  "patterns": [
1669
1743
  {
1670
1744
  "name": "support.other.match.any.regexp",
@@ -1686,15 +1760,19 @@
1686
1760
  "name": "keyword.operator.disjunction.regexp",
1687
1761
  "match": "\\|"
1688
1762
  },
1689
- {
1690
- "name": "keyword.operator.quantifier.regexp",
1691
- "match": "(?x)\n \\{(\n \\d+ | \\d+,(\\d+)? | ,\\d+\n )\\}\n"
1692
- },
1693
1763
  {
1694
1764
  "include": "#regexp-escape-sequence"
1695
1765
  }
1696
1766
  ]
1697
1767
  },
1768
+ "regexp-quantifier": {
1769
+ "name": "keyword.operator.quantifier.regexp",
1770
+ "match": "(?x)\n \\{(\n \\d+ | \\d+,(\\d+)? | ,\\d+\n )\\}\n"
1771
+ },
1772
+ "fregexp-quantifier": {
1773
+ "name": "keyword.operator.quantifier.regexp",
1774
+ "match": "(?x)\n \\{\\{(\n \\d+ | \\d+,(\\d+)? | ,\\d+\n )\\}\\}\n"
1775
+ },
1698
1776
  "regexp-backreference-number": {
1699
1777
  "name": "meta.backreference.regexp",
1700
1778
  "match": "(\\\\[1-9]\\d?)",
@@ -3085,10 +3163,10 @@
3085
3163
  }
3086
3164
  ]
3087
3165
  },
3088
- "string-raw-quoted-single-line": {
3089
- "name": "string.quoted.raw.single.python",
3090
- "begin": "\\b(([uU]R)|(R))((['\"]))",
3091
- "end": "(\\4)|((?<!\\\\)\\n)",
3166
+ "regexp-single-one-line": {
3167
+ "name": "string.regexp.quoted.single.python",
3168
+ "begin": "\\b(([uU]r)|([bB]r)|(r[bB]?))(\\')",
3169
+ "end": "(\\')|(?<!\\\\)(\\n)",
3092
3170
  "beginCaptures": {
3093
3171
  "2": {
3094
3172
  "name": "invalid.deprecated.prefix.python"
@@ -3097,12 +3175,1622 @@
3097
3175
  "name": "storage.type.string.python"
3098
3176
  },
3099
3177
  "4": {
3100
- "name": "punctuation.definition.string.begin.python"
3178
+ "name": "storage.type.string.python"
3179
+ },
3180
+ "5": {
3181
+ "name": "punctuation.definition.string.begin.python"
3182
+ }
3183
+ },
3184
+ "endCaptures": {
3185
+ "1": {
3186
+ "name": "punctuation.definition.string.end.python"
3187
+ },
3188
+ "2": {
3189
+ "name": "invalid.illegal.newline.python"
3190
+ }
3191
+ },
3192
+ "patterns": [
3193
+ {
3194
+ "include": "#single-one-regexp-expression"
3195
+ }
3196
+ ]
3197
+ },
3198
+ "regexp-single-three-line": {
3199
+ "name": "string.regexp.quoted.multi.python",
3200
+ "begin": "\\b(([uU]r)|([bB]r)|(r[bB]?))(\\'\\'\\')",
3201
+ "end": "(\\'\\'\\')",
3202
+ "beginCaptures": {
3203
+ "2": {
3204
+ "name": "invalid.deprecated.prefix.python"
3205
+ },
3206
+ "3": {
3207
+ "name": "storage.type.string.python"
3208
+ },
3209
+ "4": {
3210
+ "name": "storage.type.string.python"
3211
+ },
3212
+ "5": {
3213
+ "name": "punctuation.definition.string.begin.python"
3214
+ }
3215
+ },
3216
+ "endCaptures": {
3217
+ "1": {
3218
+ "name": "punctuation.definition.string.end.python"
3219
+ },
3220
+ "2": {
3221
+ "name": "invalid.illegal.newline.python"
3222
+ }
3223
+ },
3224
+ "patterns": [
3225
+ {
3226
+ "include": "#single-three-regexp-expression"
3227
+ }
3228
+ ]
3229
+ },
3230
+ "regexp-double-one-line": {
3231
+ "name": "string.regexp.quoted.single.python",
3232
+ "begin": "\\b(([uU]r)|([bB]r)|(r[bB]?))(\")",
3233
+ "end": "(\")|(?<!\\\\)(\\n)",
3234
+ "beginCaptures": {
3235
+ "2": {
3236
+ "name": "invalid.deprecated.prefix.python"
3237
+ },
3238
+ "3": {
3239
+ "name": "storage.type.string.python"
3240
+ },
3241
+ "4": {
3242
+ "name": "storage.type.string.python"
3243
+ },
3244
+ "5": {
3245
+ "name": "punctuation.definition.string.begin.python"
3246
+ }
3247
+ },
3248
+ "endCaptures": {
3249
+ "1": {
3250
+ "name": "punctuation.definition.string.end.python"
3251
+ },
3252
+ "2": {
3253
+ "name": "invalid.illegal.newline.python"
3254
+ }
3255
+ },
3256
+ "patterns": [
3257
+ {
3258
+ "include": "#double-one-regexp-expression"
3259
+ }
3260
+ ]
3261
+ },
3262
+ "regexp-double-three-line": {
3263
+ "name": "string.regexp.quoted.multi.python",
3264
+ "begin": "\\b(([uU]r)|([bB]r)|(r[bB]?))(\"\"\")",
3265
+ "end": "(\"\"\")",
3266
+ "beginCaptures": {
3267
+ "2": {
3268
+ "name": "invalid.deprecated.prefix.python"
3269
+ },
3270
+ "3": {
3271
+ "name": "storage.type.string.python"
3272
+ },
3273
+ "4": {
3274
+ "name": "storage.type.string.python"
3275
+ },
3276
+ "5": {
3277
+ "name": "punctuation.definition.string.begin.python"
3278
+ }
3279
+ },
3280
+ "endCaptures": {
3281
+ "1": {
3282
+ "name": "punctuation.definition.string.end.python"
3283
+ },
3284
+ "2": {
3285
+ "name": "invalid.illegal.newline.python"
3286
+ }
3287
+ },
3288
+ "patterns": [
3289
+ {
3290
+ "include": "#double-three-regexp-expression"
3291
+ }
3292
+ ]
3293
+ },
3294
+ "single-one-fregexp-expression": {
3295
+ "patterns": [
3296
+ {
3297
+ "include": "#fregexp-base-expression"
3298
+ },
3299
+ {
3300
+ "include": "#single-one-regexp-character-set"
3301
+ },
3302
+ {
3303
+ "include": "#single-one-regexp-comments"
3304
+ },
3305
+ {
3306
+ "include": "#regexp-flags"
3307
+ },
3308
+ {
3309
+ "include": "#single-one-regexp-named-group"
3310
+ },
3311
+ {
3312
+ "include": "#regexp-backreference"
3313
+ },
3314
+ {
3315
+ "include": "#single-one-fregexp-lookahead"
3316
+ },
3317
+ {
3318
+ "include": "#single-one-fregexp-lookahead-negative"
3319
+ },
3320
+ {
3321
+ "include": "#single-one-fregexp-lookbehind"
3322
+ },
3323
+ {
3324
+ "include": "#single-one-fregexp-lookbehind-negative"
3325
+ },
3326
+ {
3327
+ "include": "#single-one-fregexp-conditional"
3328
+ },
3329
+ {
3330
+ "include": "#single-one-fregexp-parentheses-non-capturing"
3331
+ },
3332
+ {
3333
+ "include": "#single-one-fregexp-parentheses"
3334
+ }
3335
+ ]
3336
+ },
3337
+ "single-one-fregexp-named-group": {
3338
+ "name": "meta.named.regexp",
3339
+ "begin": "(?x)\n (\\() (\\?P <\\w+(?:\\s+[[:alnum:]]+)?>)\n",
3340
+ "end": "(\\)|(?=\\'))|((?=(?<!\\\\)\\n))",
3341
+ "beginCaptures": {
3342
+ "1": {
3343
+ "name": "punctuation.parenthesis.named.begin.regexp support.other.parenthesis.regexp"
3344
+ },
3345
+ "2": {
3346
+ "name": "entity.name.tag.named.group.regexp"
3347
+ }
3348
+ },
3349
+ "endCaptures": {
3350
+ "1": {
3351
+ "name": "punctuation.parenthesis.named.end.regexp support.other.parenthesis.regexp"
3352
+ },
3353
+ "2": {
3354
+ "name": "invalid.illegal.newline.python"
3355
+ }
3356
+ },
3357
+ "patterns": [
3358
+ {
3359
+ "include": "#single-one-fregexp-expression"
3360
+ }
3361
+ ]
3362
+ },
3363
+ "single-one-fregexp-lookahead": {
3364
+ "begin": "(\\()\\?=",
3365
+ "end": "(\\)|(?=\\'))|((?=(?<!\\\\)\\n))",
3366
+ "beginCaptures": {
3367
+ "0": {
3368
+ "name": "keyword.operator.lookahead.regexp"
3369
+ },
3370
+ "1": {
3371
+ "name": "punctuation.parenthesis.lookahead.begin.regexp"
3372
+ }
3373
+ },
3374
+ "endCaptures": {
3375
+ "1": {
3376
+ "name": "punctuation.parenthesis.lookahead.end.regexp keyword.operator.lookahead.regexp"
3377
+ },
3378
+ "2": {
3379
+ "name": "invalid.illegal.newline.python"
3380
+ }
3381
+ },
3382
+ "patterns": [
3383
+ {
3384
+ "include": "#single-one-fregexp-expression"
3385
+ }
3386
+ ]
3387
+ },
3388
+ "single-one-fregexp-lookahead-negative": {
3389
+ "begin": "(\\()\\?!",
3390
+ "end": "(\\)|(?=\\'))|((?=(?<!\\\\)\\n))",
3391
+ "beginCaptures": {
3392
+ "0": {
3393
+ "name": "keyword.operator.lookahead.negative.regexp"
3394
+ },
3395
+ "1": {
3396
+ "name": "punctuation.parenthesis.lookahead.begin.regexp"
3397
+ }
3398
+ },
3399
+ "endCaptures": {
3400
+ "1": {
3401
+ "name": "punctuation.parenthesis.lookahead.end.regexp keyword.operator.lookahead.negative.regexp"
3402
+ },
3403
+ "2": {
3404
+ "name": "invalid.illegal.newline.python"
3405
+ }
3406
+ },
3407
+ "patterns": [
3408
+ {
3409
+ "include": "#single-one-fregexp-expression"
3410
+ }
3411
+ ]
3412
+ },
3413
+ "single-one-fregexp-lookbehind": {
3414
+ "begin": "(\\()\\?<=",
3415
+ "end": "(\\)|(?=\\'))|((?=(?<!\\\\)\\n))",
3416
+ "beginCaptures": {
3417
+ "0": {
3418
+ "name": "keyword.operator.lookbehind.regexp"
3419
+ },
3420
+ "1": {
3421
+ "name": "punctuation.parenthesis.lookbehind.begin.regexp"
3422
+ }
3423
+ },
3424
+ "endCaptures": {
3425
+ "1": {
3426
+ "name": "punctuation.parenthesis.lookbehind.end.regexp keyword.operator.lookbehind.regexp"
3427
+ },
3428
+ "2": {
3429
+ "name": "invalid.illegal.newline.python"
3430
+ }
3431
+ },
3432
+ "patterns": [
3433
+ {
3434
+ "include": "#single-one-fregexp-expression"
3435
+ }
3436
+ ]
3437
+ },
3438
+ "single-one-fregexp-lookbehind-negative": {
3439
+ "begin": "(\\()\\?<!",
3440
+ "end": "(\\)|(?=\\'))|((?=(?<!\\\\)\\n))",
3441
+ "beginCaptures": {
3442
+ "0": {
3443
+ "name": "keyword.operator.lookbehind.negative.regexp"
3444
+ },
3445
+ "1": {
3446
+ "name": "punctuation.parenthesis.lookbehind.begin.regexp"
3447
+ }
3448
+ },
3449
+ "endCaptures": {
3450
+ "1": {
3451
+ "name": "punctuation.parenthesis.lookbehind.end.regexp keyword.operator.lookbehind.negative.regexp"
3452
+ },
3453
+ "2": {
3454
+ "name": "invalid.illegal.newline.python"
3455
+ }
3456
+ },
3457
+ "patterns": [
3458
+ {
3459
+ "include": "#single-one-fregexp-expression"
3460
+ }
3461
+ ]
3462
+ },
3463
+ "single-one-fregexp-conditional": {
3464
+ "begin": "(\\()\\?\\((\\w+(?:\\s+[[:alnum:]]+)?|\\d+)\\)",
3465
+ "end": "(\\)|(?=\\'))|((?=(?<!\\\\)\\n))",
3466
+ "beginCaptures": {
3467
+ "0": {
3468
+ "name": "keyword.operator.conditional.regexp"
3469
+ },
3470
+ "1": {
3471
+ "name": "punctuation.parenthesis.conditional.begin.regexp"
3472
+ }
3473
+ },
3474
+ "endCaptures": {
3475
+ "1": {
3476
+ "name": "punctuation.parenthesis.conditional.end.regexp keyword.operator.conditional.negative.regexp"
3477
+ },
3478
+ "2": {
3479
+ "name": "invalid.illegal.newline.python"
3480
+ }
3481
+ },
3482
+ "patterns": [
3483
+ {
3484
+ "include": "#single-one-fregexp-expression"
3485
+ }
3486
+ ]
3487
+ },
3488
+ "single-one-fregexp-parentheses-non-capturing": {
3489
+ "begin": "\\(\\?:",
3490
+ "end": "(\\)|(?=\\'))|((?=(?<!\\\\)\\n))",
3491
+ "beginCaptures": {
3492
+ "0": {
3493
+ "name": "punctuation.parenthesis.non-capturing.begin.regexp support.other.parenthesis.regexp"
3494
+ }
3495
+ },
3496
+ "endCaptures": {
3497
+ "1": {
3498
+ "name": "punctuation.parenthesis.non-capturing.end.regexp support.other.parenthesis.regexp"
3499
+ },
3500
+ "2": {
3501
+ "name": "invalid.illegal.newline.python"
3502
+ }
3503
+ },
3504
+ "patterns": [
3505
+ {
3506
+ "include": "#single-one-fregexp-expression"
3507
+ }
3508
+ ]
3509
+ },
3510
+ "single-one-fregexp-parentheses": {
3511
+ "begin": "\\(",
3512
+ "end": "(\\)|(?=\\'))|((?=(?<!\\\\)\\n))",
3513
+ "beginCaptures": {
3514
+ "0": {
3515
+ "name": "punctuation.parenthesis.begin.regexp support.other.parenthesis.regexp"
3516
+ }
3517
+ },
3518
+ "endCaptures": {
3519
+ "1": {
3520
+ "name": "punctuation.parenthesis.end.regexp support.other.parenthesis.regexp"
3521
+ },
3522
+ "2": {
3523
+ "name": "invalid.illegal.newline.python"
3524
+ }
3525
+ },
3526
+ "patterns": [
3527
+ {
3528
+ "include": "#single-one-fregexp-expression"
3529
+ }
3530
+ ]
3531
+ },
3532
+ "single-three-fregexp-expression": {
3533
+ "patterns": [
3534
+ {
3535
+ "include": "#fregexp-base-expression"
3536
+ },
3537
+ {
3538
+ "include": "#single-three-regexp-character-set"
3539
+ },
3540
+ {
3541
+ "include": "#single-three-regexp-comments"
3542
+ },
3543
+ {
3544
+ "include": "#regexp-flags"
3545
+ },
3546
+ {
3547
+ "include": "#single-three-regexp-named-group"
3548
+ },
3549
+ {
3550
+ "include": "#regexp-backreference"
3551
+ },
3552
+ {
3553
+ "include": "#single-three-fregexp-lookahead"
3554
+ },
3555
+ {
3556
+ "include": "#single-three-fregexp-lookahead-negative"
3557
+ },
3558
+ {
3559
+ "include": "#single-three-fregexp-lookbehind"
3560
+ },
3561
+ {
3562
+ "include": "#single-three-fregexp-lookbehind-negative"
3563
+ },
3564
+ {
3565
+ "include": "#single-three-fregexp-conditional"
3566
+ },
3567
+ {
3568
+ "include": "#single-three-fregexp-parentheses-non-capturing"
3569
+ },
3570
+ {
3571
+ "include": "#single-three-fregexp-parentheses"
3572
+ },
3573
+ {
3574
+ "include": "#comments-string-single-three"
3575
+ }
3576
+ ]
3577
+ },
3578
+ "single-three-fregexp-named-group": {
3579
+ "name": "meta.named.regexp",
3580
+ "begin": "(?x)\n (\\() (\\?P <\\w+(?:\\s+[[:alnum:]]+)?>)\n",
3581
+ "end": "(\\)|(?=\\'\\'\\'))",
3582
+ "beginCaptures": {
3583
+ "1": {
3584
+ "name": "punctuation.parenthesis.named.begin.regexp support.other.parenthesis.regexp"
3585
+ },
3586
+ "2": {
3587
+ "name": "entity.name.tag.named.group.regexp"
3588
+ }
3589
+ },
3590
+ "endCaptures": {
3591
+ "1": {
3592
+ "name": "punctuation.parenthesis.named.end.regexp support.other.parenthesis.regexp"
3593
+ },
3594
+ "2": {
3595
+ "name": "invalid.illegal.newline.python"
3596
+ }
3597
+ },
3598
+ "patterns": [
3599
+ {
3600
+ "include": "#single-three-fregexp-expression"
3601
+ },
3602
+ {
3603
+ "include": "#comments-string-single-three"
3604
+ }
3605
+ ]
3606
+ },
3607
+ "single-three-fregexp-lookahead": {
3608
+ "begin": "(\\()\\?=",
3609
+ "end": "(\\)|(?=\\'\\'\\'))",
3610
+ "beginCaptures": {
3611
+ "0": {
3612
+ "name": "keyword.operator.lookahead.regexp"
3613
+ },
3614
+ "1": {
3615
+ "name": "punctuation.parenthesis.lookahead.begin.regexp"
3616
+ }
3617
+ },
3618
+ "endCaptures": {
3619
+ "1": {
3620
+ "name": "punctuation.parenthesis.lookahead.end.regexp keyword.operator.lookahead.regexp"
3621
+ },
3622
+ "2": {
3623
+ "name": "invalid.illegal.newline.python"
3624
+ }
3625
+ },
3626
+ "patterns": [
3627
+ {
3628
+ "include": "#single-three-fregexp-expression"
3629
+ },
3630
+ {
3631
+ "include": "#comments-string-single-three"
3632
+ }
3633
+ ]
3634
+ },
3635
+ "single-three-fregexp-lookahead-negative": {
3636
+ "begin": "(\\()\\?!",
3637
+ "end": "(\\)|(?=\\'\\'\\'))",
3638
+ "beginCaptures": {
3639
+ "0": {
3640
+ "name": "keyword.operator.lookahead.negative.regexp"
3641
+ },
3642
+ "1": {
3643
+ "name": "punctuation.parenthesis.lookahead.begin.regexp"
3644
+ }
3645
+ },
3646
+ "endCaptures": {
3647
+ "1": {
3648
+ "name": "punctuation.parenthesis.lookahead.end.regexp keyword.operator.lookahead.negative.regexp"
3649
+ },
3650
+ "2": {
3651
+ "name": "invalid.illegal.newline.python"
3652
+ }
3653
+ },
3654
+ "patterns": [
3655
+ {
3656
+ "include": "#single-three-fregexp-expression"
3657
+ },
3658
+ {
3659
+ "include": "#comments-string-single-three"
3660
+ }
3661
+ ]
3662
+ },
3663
+ "single-three-fregexp-lookbehind": {
3664
+ "begin": "(\\()\\?<=",
3665
+ "end": "(\\)|(?=\\'\\'\\'))",
3666
+ "beginCaptures": {
3667
+ "0": {
3668
+ "name": "keyword.operator.lookbehind.regexp"
3669
+ },
3670
+ "1": {
3671
+ "name": "punctuation.parenthesis.lookbehind.begin.regexp"
3672
+ }
3673
+ },
3674
+ "endCaptures": {
3675
+ "1": {
3676
+ "name": "punctuation.parenthesis.lookbehind.end.regexp keyword.operator.lookbehind.regexp"
3677
+ },
3678
+ "2": {
3679
+ "name": "invalid.illegal.newline.python"
3680
+ }
3681
+ },
3682
+ "patterns": [
3683
+ {
3684
+ "include": "#single-three-fregexp-expression"
3685
+ },
3686
+ {
3687
+ "include": "#comments-string-single-three"
3688
+ }
3689
+ ]
3690
+ },
3691
+ "single-three-fregexp-lookbehind-negative": {
3692
+ "begin": "(\\()\\?<!",
3693
+ "end": "(\\)|(?=\\'\\'\\'))",
3694
+ "beginCaptures": {
3695
+ "0": {
3696
+ "name": "keyword.operator.lookbehind.negative.regexp"
3697
+ },
3698
+ "1": {
3699
+ "name": "punctuation.parenthesis.lookbehind.begin.regexp"
3700
+ }
3701
+ },
3702
+ "endCaptures": {
3703
+ "1": {
3704
+ "name": "punctuation.parenthesis.lookbehind.end.regexp keyword.operator.lookbehind.negative.regexp"
3705
+ },
3706
+ "2": {
3707
+ "name": "invalid.illegal.newline.python"
3708
+ }
3709
+ },
3710
+ "patterns": [
3711
+ {
3712
+ "include": "#single-three-fregexp-expression"
3713
+ },
3714
+ {
3715
+ "include": "#comments-string-single-three"
3716
+ }
3717
+ ]
3718
+ },
3719
+ "single-three-fregexp-conditional": {
3720
+ "begin": "(\\()\\?\\((\\w+(?:\\s+[[:alnum:]]+)?|\\d+)\\)",
3721
+ "end": "(\\)|(?=\\'\\'\\'))",
3722
+ "beginCaptures": {
3723
+ "0": {
3724
+ "name": "keyword.operator.conditional.regexp"
3725
+ },
3726
+ "1": {
3727
+ "name": "punctuation.parenthesis.conditional.begin.regexp"
3728
+ }
3729
+ },
3730
+ "endCaptures": {
3731
+ "1": {
3732
+ "name": "punctuation.parenthesis.conditional.end.regexp keyword.operator.conditional.negative.regexp"
3733
+ },
3734
+ "2": {
3735
+ "name": "invalid.illegal.newline.python"
3736
+ }
3737
+ },
3738
+ "patterns": [
3739
+ {
3740
+ "include": "#single-three-fregexp-expression"
3741
+ },
3742
+ {
3743
+ "include": "#comments-string-single-three"
3744
+ }
3745
+ ]
3746
+ },
3747
+ "single-three-fregexp-parentheses-non-capturing": {
3748
+ "begin": "\\(\\?:",
3749
+ "end": "(\\)|(?=\\'\\'\\'))",
3750
+ "beginCaptures": {
3751
+ "0": {
3752
+ "name": "punctuation.parenthesis.non-capturing.begin.regexp support.other.parenthesis.regexp"
3753
+ }
3754
+ },
3755
+ "endCaptures": {
3756
+ "1": {
3757
+ "name": "punctuation.parenthesis.non-capturing.end.regexp support.other.parenthesis.regexp"
3758
+ },
3759
+ "2": {
3760
+ "name": "invalid.illegal.newline.python"
3761
+ }
3762
+ },
3763
+ "patterns": [
3764
+ {
3765
+ "include": "#single-three-fregexp-expression"
3766
+ },
3767
+ {
3768
+ "include": "#comments-string-single-three"
3769
+ }
3770
+ ]
3771
+ },
3772
+ "single-three-fregexp-parentheses": {
3773
+ "begin": "\\(",
3774
+ "end": "(\\)|(?=\\'\\'\\'))",
3775
+ "beginCaptures": {
3776
+ "0": {
3777
+ "name": "punctuation.parenthesis.begin.regexp support.other.parenthesis.regexp"
3778
+ }
3779
+ },
3780
+ "endCaptures": {
3781
+ "1": {
3782
+ "name": "punctuation.parenthesis.end.regexp support.other.parenthesis.regexp"
3783
+ },
3784
+ "2": {
3785
+ "name": "invalid.illegal.newline.python"
3786
+ }
3787
+ },
3788
+ "patterns": [
3789
+ {
3790
+ "include": "#single-three-fregexp-expression"
3791
+ },
3792
+ {
3793
+ "include": "#comments-string-single-three"
3794
+ }
3795
+ ]
3796
+ },
3797
+ "double-one-fregexp-expression": {
3798
+ "patterns": [
3799
+ {
3800
+ "include": "#fregexp-base-expression"
3801
+ },
3802
+ {
3803
+ "include": "#double-one-regexp-character-set"
3804
+ },
3805
+ {
3806
+ "include": "#double-one-regexp-comments"
3807
+ },
3808
+ {
3809
+ "include": "#regexp-flags"
3810
+ },
3811
+ {
3812
+ "include": "#double-one-regexp-named-group"
3813
+ },
3814
+ {
3815
+ "include": "#regexp-backreference"
3816
+ },
3817
+ {
3818
+ "include": "#double-one-fregexp-lookahead"
3819
+ },
3820
+ {
3821
+ "include": "#double-one-fregexp-lookahead-negative"
3822
+ },
3823
+ {
3824
+ "include": "#double-one-fregexp-lookbehind"
3825
+ },
3826
+ {
3827
+ "include": "#double-one-fregexp-lookbehind-negative"
3828
+ },
3829
+ {
3830
+ "include": "#double-one-fregexp-conditional"
3831
+ },
3832
+ {
3833
+ "include": "#double-one-fregexp-parentheses-non-capturing"
3834
+ },
3835
+ {
3836
+ "include": "#double-one-fregexp-parentheses"
3837
+ }
3838
+ ]
3839
+ },
3840
+ "double-one-fregexp-named-group": {
3841
+ "name": "meta.named.regexp",
3842
+ "begin": "(?x)\n (\\() (\\?P <\\w+(?:\\s+[[:alnum:]]+)?>)\n",
3843
+ "end": "(\\)|(?=\"))|((?=(?<!\\\\)\\n))",
3844
+ "beginCaptures": {
3845
+ "1": {
3846
+ "name": "punctuation.parenthesis.named.begin.regexp support.other.parenthesis.regexp"
3847
+ },
3848
+ "2": {
3849
+ "name": "entity.name.tag.named.group.regexp"
3850
+ }
3851
+ },
3852
+ "endCaptures": {
3853
+ "1": {
3854
+ "name": "punctuation.parenthesis.named.end.regexp support.other.parenthesis.regexp"
3855
+ },
3856
+ "2": {
3857
+ "name": "invalid.illegal.newline.python"
3858
+ }
3859
+ },
3860
+ "patterns": [
3861
+ {
3862
+ "include": "#double-one-fregexp-expression"
3863
+ }
3864
+ ]
3865
+ },
3866
+ "double-one-fregexp-lookahead": {
3867
+ "begin": "(\\()\\?=",
3868
+ "end": "(\\)|(?=\"))|((?=(?<!\\\\)\\n))",
3869
+ "beginCaptures": {
3870
+ "0": {
3871
+ "name": "keyword.operator.lookahead.regexp"
3872
+ },
3873
+ "1": {
3874
+ "name": "punctuation.parenthesis.lookahead.begin.regexp"
3875
+ }
3876
+ },
3877
+ "endCaptures": {
3878
+ "1": {
3879
+ "name": "punctuation.parenthesis.lookahead.end.regexp keyword.operator.lookahead.regexp"
3880
+ },
3881
+ "2": {
3882
+ "name": "invalid.illegal.newline.python"
3883
+ }
3884
+ },
3885
+ "patterns": [
3886
+ {
3887
+ "include": "#double-one-fregexp-expression"
3888
+ }
3889
+ ]
3890
+ },
3891
+ "double-one-fregexp-lookahead-negative": {
3892
+ "begin": "(\\()\\?!",
3893
+ "end": "(\\)|(?=\"))|((?=(?<!\\\\)\\n))",
3894
+ "beginCaptures": {
3895
+ "0": {
3896
+ "name": "keyword.operator.lookahead.negative.regexp"
3897
+ },
3898
+ "1": {
3899
+ "name": "punctuation.parenthesis.lookahead.begin.regexp"
3900
+ }
3901
+ },
3902
+ "endCaptures": {
3903
+ "1": {
3904
+ "name": "punctuation.parenthesis.lookahead.end.regexp keyword.operator.lookahead.negative.regexp"
3905
+ },
3906
+ "2": {
3907
+ "name": "invalid.illegal.newline.python"
3908
+ }
3909
+ },
3910
+ "patterns": [
3911
+ {
3912
+ "include": "#double-one-fregexp-expression"
3913
+ }
3914
+ ]
3915
+ },
3916
+ "double-one-fregexp-lookbehind": {
3917
+ "begin": "(\\()\\?<=",
3918
+ "end": "(\\)|(?=\"))|((?=(?<!\\\\)\\n))",
3919
+ "beginCaptures": {
3920
+ "0": {
3921
+ "name": "keyword.operator.lookbehind.regexp"
3922
+ },
3923
+ "1": {
3924
+ "name": "punctuation.parenthesis.lookbehind.begin.regexp"
3925
+ }
3926
+ },
3927
+ "endCaptures": {
3928
+ "1": {
3929
+ "name": "punctuation.parenthesis.lookbehind.end.regexp keyword.operator.lookbehind.regexp"
3930
+ },
3931
+ "2": {
3932
+ "name": "invalid.illegal.newline.python"
3933
+ }
3934
+ },
3935
+ "patterns": [
3936
+ {
3937
+ "include": "#double-one-fregexp-expression"
3938
+ }
3939
+ ]
3940
+ },
3941
+ "double-one-fregexp-lookbehind-negative": {
3942
+ "begin": "(\\()\\?<!",
3943
+ "end": "(\\)|(?=\"))|((?=(?<!\\\\)\\n))",
3944
+ "beginCaptures": {
3945
+ "0": {
3946
+ "name": "keyword.operator.lookbehind.negative.regexp"
3947
+ },
3948
+ "1": {
3949
+ "name": "punctuation.parenthesis.lookbehind.begin.regexp"
3950
+ }
3951
+ },
3952
+ "endCaptures": {
3953
+ "1": {
3954
+ "name": "punctuation.parenthesis.lookbehind.end.regexp keyword.operator.lookbehind.negative.regexp"
3955
+ },
3956
+ "2": {
3957
+ "name": "invalid.illegal.newline.python"
3958
+ }
3959
+ },
3960
+ "patterns": [
3961
+ {
3962
+ "include": "#double-one-fregexp-expression"
3963
+ }
3964
+ ]
3965
+ },
3966
+ "double-one-fregexp-conditional": {
3967
+ "begin": "(\\()\\?\\((\\w+(?:\\s+[[:alnum:]]+)?|\\d+)\\)",
3968
+ "end": "(\\)|(?=\"))|((?=(?<!\\\\)\\n))",
3969
+ "beginCaptures": {
3970
+ "0": {
3971
+ "name": "keyword.operator.conditional.regexp"
3972
+ },
3973
+ "1": {
3974
+ "name": "punctuation.parenthesis.conditional.begin.regexp"
3975
+ }
3976
+ },
3977
+ "endCaptures": {
3978
+ "1": {
3979
+ "name": "punctuation.parenthesis.conditional.end.regexp keyword.operator.conditional.negative.regexp"
3980
+ },
3981
+ "2": {
3982
+ "name": "invalid.illegal.newline.python"
3983
+ }
3984
+ },
3985
+ "patterns": [
3986
+ {
3987
+ "include": "#double-one-fregexp-expression"
3988
+ }
3989
+ ]
3990
+ },
3991
+ "double-one-fregexp-parentheses-non-capturing": {
3992
+ "begin": "\\(\\?:",
3993
+ "end": "(\\)|(?=\"))|((?=(?<!\\\\)\\n))",
3994
+ "beginCaptures": {
3995
+ "0": {
3996
+ "name": "punctuation.parenthesis.non-capturing.begin.regexp support.other.parenthesis.regexp"
3997
+ }
3998
+ },
3999
+ "endCaptures": {
4000
+ "1": {
4001
+ "name": "punctuation.parenthesis.non-capturing.end.regexp support.other.parenthesis.regexp"
4002
+ },
4003
+ "2": {
4004
+ "name": "invalid.illegal.newline.python"
4005
+ }
4006
+ },
4007
+ "patterns": [
4008
+ {
4009
+ "include": "#double-one-fregexp-expression"
4010
+ }
4011
+ ]
4012
+ },
4013
+ "double-one-fregexp-parentheses": {
4014
+ "begin": "\\(",
4015
+ "end": "(\\)|(?=\"))|((?=(?<!\\\\)\\n))",
4016
+ "beginCaptures": {
4017
+ "0": {
4018
+ "name": "punctuation.parenthesis.begin.regexp support.other.parenthesis.regexp"
4019
+ }
4020
+ },
4021
+ "endCaptures": {
4022
+ "1": {
4023
+ "name": "punctuation.parenthesis.end.regexp support.other.parenthesis.regexp"
4024
+ },
4025
+ "2": {
4026
+ "name": "invalid.illegal.newline.python"
4027
+ }
4028
+ },
4029
+ "patterns": [
4030
+ {
4031
+ "include": "#double-one-fregexp-expression"
4032
+ }
4033
+ ]
4034
+ },
4035
+ "double-three-fregexp-expression": {
4036
+ "patterns": [
4037
+ {
4038
+ "include": "#fregexp-base-expression"
4039
+ },
4040
+ {
4041
+ "include": "#double-three-regexp-character-set"
4042
+ },
4043
+ {
4044
+ "include": "#double-three-regexp-comments"
4045
+ },
4046
+ {
4047
+ "include": "#regexp-flags"
4048
+ },
4049
+ {
4050
+ "include": "#double-three-regexp-named-group"
4051
+ },
4052
+ {
4053
+ "include": "#regexp-backreference"
4054
+ },
4055
+ {
4056
+ "include": "#double-three-fregexp-lookahead"
4057
+ },
4058
+ {
4059
+ "include": "#double-three-fregexp-lookahead-negative"
4060
+ },
4061
+ {
4062
+ "include": "#double-three-fregexp-lookbehind"
4063
+ },
4064
+ {
4065
+ "include": "#double-three-fregexp-lookbehind-negative"
4066
+ },
4067
+ {
4068
+ "include": "#double-three-fregexp-conditional"
4069
+ },
4070
+ {
4071
+ "include": "#double-three-fregexp-parentheses-non-capturing"
4072
+ },
4073
+ {
4074
+ "include": "#double-three-fregexp-parentheses"
4075
+ },
4076
+ {
4077
+ "include": "#comments-string-double-three"
4078
+ }
4079
+ ]
4080
+ },
4081
+ "double-three-fregexp-named-group": {
4082
+ "name": "meta.named.regexp",
4083
+ "begin": "(?x)\n (\\() (\\?P <\\w+(?:\\s+[[:alnum:]]+)?>)\n",
4084
+ "end": "(\\)|(?=\"\"\"))",
4085
+ "beginCaptures": {
4086
+ "1": {
4087
+ "name": "punctuation.parenthesis.named.begin.regexp support.other.parenthesis.regexp"
4088
+ },
4089
+ "2": {
4090
+ "name": "entity.name.tag.named.group.regexp"
4091
+ }
4092
+ },
4093
+ "endCaptures": {
4094
+ "1": {
4095
+ "name": "punctuation.parenthesis.named.end.regexp support.other.parenthesis.regexp"
4096
+ },
4097
+ "2": {
4098
+ "name": "invalid.illegal.newline.python"
4099
+ }
4100
+ },
4101
+ "patterns": [
4102
+ {
4103
+ "include": "#double-three-fregexp-expression"
4104
+ },
4105
+ {
4106
+ "include": "#comments-string-double-three"
4107
+ }
4108
+ ]
4109
+ },
4110
+ "double-three-fregexp-lookahead": {
4111
+ "begin": "(\\()\\?=",
4112
+ "end": "(\\)|(?=\"\"\"))",
4113
+ "beginCaptures": {
4114
+ "0": {
4115
+ "name": "keyword.operator.lookahead.regexp"
4116
+ },
4117
+ "1": {
4118
+ "name": "punctuation.parenthesis.lookahead.begin.regexp"
4119
+ }
4120
+ },
4121
+ "endCaptures": {
4122
+ "1": {
4123
+ "name": "punctuation.parenthesis.lookahead.end.regexp keyword.operator.lookahead.regexp"
4124
+ },
4125
+ "2": {
4126
+ "name": "invalid.illegal.newline.python"
4127
+ }
4128
+ },
4129
+ "patterns": [
4130
+ {
4131
+ "include": "#double-three-fregexp-expression"
4132
+ },
4133
+ {
4134
+ "include": "#comments-string-double-three"
4135
+ }
4136
+ ]
4137
+ },
4138
+ "double-three-fregexp-lookahead-negative": {
4139
+ "begin": "(\\()\\?!",
4140
+ "end": "(\\)|(?=\"\"\"))",
4141
+ "beginCaptures": {
4142
+ "0": {
4143
+ "name": "keyword.operator.lookahead.negative.regexp"
4144
+ },
4145
+ "1": {
4146
+ "name": "punctuation.parenthesis.lookahead.begin.regexp"
4147
+ }
4148
+ },
4149
+ "endCaptures": {
4150
+ "1": {
4151
+ "name": "punctuation.parenthesis.lookahead.end.regexp keyword.operator.lookahead.negative.regexp"
4152
+ },
4153
+ "2": {
4154
+ "name": "invalid.illegal.newline.python"
4155
+ }
4156
+ },
4157
+ "patterns": [
4158
+ {
4159
+ "include": "#double-three-fregexp-expression"
4160
+ },
4161
+ {
4162
+ "include": "#comments-string-double-three"
4163
+ }
4164
+ ]
4165
+ },
4166
+ "double-three-fregexp-lookbehind": {
4167
+ "begin": "(\\()\\?<=",
4168
+ "end": "(\\)|(?=\"\"\"))",
4169
+ "beginCaptures": {
4170
+ "0": {
4171
+ "name": "keyword.operator.lookbehind.regexp"
4172
+ },
4173
+ "1": {
4174
+ "name": "punctuation.parenthesis.lookbehind.begin.regexp"
4175
+ }
4176
+ },
4177
+ "endCaptures": {
4178
+ "1": {
4179
+ "name": "punctuation.parenthesis.lookbehind.end.regexp keyword.operator.lookbehind.regexp"
4180
+ },
4181
+ "2": {
4182
+ "name": "invalid.illegal.newline.python"
4183
+ }
4184
+ },
4185
+ "patterns": [
4186
+ {
4187
+ "include": "#double-three-fregexp-expression"
4188
+ },
4189
+ {
4190
+ "include": "#comments-string-double-three"
4191
+ }
4192
+ ]
4193
+ },
4194
+ "double-three-fregexp-lookbehind-negative": {
4195
+ "begin": "(\\()\\?<!",
4196
+ "end": "(\\)|(?=\"\"\"))",
4197
+ "beginCaptures": {
4198
+ "0": {
4199
+ "name": "keyword.operator.lookbehind.negative.regexp"
4200
+ },
4201
+ "1": {
4202
+ "name": "punctuation.parenthesis.lookbehind.begin.regexp"
4203
+ }
4204
+ },
4205
+ "endCaptures": {
4206
+ "1": {
4207
+ "name": "punctuation.parenthesis.lookbehind.end.regexp keyword.operator.lookbehind.negative.regexp"
4208
+ },
4209
+ "2": {
4210
+ "name": "invalid.illegal.newline.python"
4211
+ }
4212
+ },
4213
+ "patterns": [
4214
+ {
4215
+ "include": "#double-three-fregexp-expression"
4216
+ },
4217
+ {
4218
+ "include": "#comments-string-double-three"
4219
+ }
4220
+ ]
4221
+ },
4222
+ "double-three-fregexp-conditional": {
4223
+ "begin": "(\\()\\?\\((\\w+(?:\\s+[[:alnum:]]+)?|\\d+)\\)",
4224
+ "end": "(\\)|(?=\"\"\"))",
4225
+ "beginCaptures": {
4226
+ "0": {
4227
+ "name": "keyword.operator.conditional.regexp"
4228
+ },
4229
+ "1": {
4230
+ "name": "punctuation.parenthesis.conditional.begin.regexp"
4231
+ }
4232
+ },
4233
+ "endCaptures": {
4234
+ "1": {
4235
+ "name": "punctuation.parenthesis.conditional.end.regexp keyword.operator.conditional.negative.regexp"
4236
+ },
4237
+ "2": {
4238
+ "name": "invalid.illegal.newline.python"
4239
+ }
4240
+ },
4241
+ "patterns": [
4242
+ {
4243
+ "include": "#double-three-fregexp-expression"
4244
+ },
4245
+ {
4246
+ "include": "#comments-string-double-three"
4247
+ }
4248
+ ]
4249
+ },
4250
+ "double-three-fregexp-parentheses-non-capturing": {
4251
+ "begin": "\\(\\?:",
4252
+ "end": "(\\)|(?=\"\"\"))",
4253
+ "beginCaptures": {
4254
+ "0": {
4255
+ "name": "punctuation.parenthesis.non-capturing.begin.regexp support.other.parenthesis.regexp"
4256
+ }
4257
+ },
4258
+ "endCaptures": {
4259
+ "1": {
4260
+ "name": "punctuation.parenthesis.non-capturing.end.regexp support.other.parenthesis.regexp"
4261
+ },
4262
+ "2": {
4263
+ "name": "invalid.illegal.newline.python"
4264
+ }
4265
+ },
4266
+ "patterns": [
4267
+ {
4268
+ "include": "#double-three-fregexp-expression"
4269
+ },
4270
+ {
4271
+ "include": "#comments-string-double-three"
4272
+ }
4273
+ ]
4274
+ },
4275
+ "double-three-fregexp-parentheses": {
4276
+ "begin": "\\(",
4277
+ "end": "(\\)|(?=\"\"\"))",
4278
+ "beginCaptures": {
4279
+ "0": {
4280
+ "name": "punctuation.parenthesis.begin.regexp support.other.parenthesis.regexp"
4281
+ }
4282
+ },
4283
+ "endCaptures": {
4284
+ "1": {
4285
+ "name": "punctuation.parenthesis.end.regexp support.other.parenthesis.regexp"
4286
+ },
4287
+ "2": {
4288
+ "name": "invalid.illegal.newline.python"
4289
+ }
4290
+ },
4291
+ "patterns": [
4292
+ {
4293
+ "include": "#double-three-fregexp-expression"
4294
+ },
4295
+ {
4296
+ "include": "#comments-string-double-three"
4297
+ }
4298
+ ]
4299
+ },
4300
+ "fregexp-single-one-line": {
4301
+ "name": "string.regexp.quoted.single.python string.interpolated.python",
4302
+ "begin": "\\b(([uU]r)|([fF]r)|(r[fF]?))(\\')",
4303
+ "end": "(\\')|(?<!\\\\)(\\n)",
4304
+ "beginCaptures": {
4305
+ "2": {
4306
+ "name": "invalid.deprecated.prefix.python"
4307
+ },
4308
+ "3": {
4309
+ "name": "storage.type.string.python"
4310
+ },
4311
+ "4": {
4312
+ "name": "storage.type.string.python"
4313
+ },
4314
+ "5": {
4315
+ "name": "punctuation.definition.string.begin.python"
4316
+ }
4317
+ },
4318
+ "endCaptures": {
4319
+ "1": {
4320
+ "name": "punctuation.definition.string.end.python"
4321
+ },
4322
+ "2": {
4323
+ "name": "invalid.illegal.newline.python"
4324
+ }
4325
+ },
4326
+ "patterns": [
4327
+ {
4328
+ "include": "#single-one-fregexp-expression"
4329
+ }
4330
+ ]
4331
+ },
4332
+ "fregexp-single-three-line": {
4333
+ "name": "string.regexp.quoted.multi.python string.interpolated.python",
4334
+ "begin": "\\b(([uU]r)|([fF]r)|(r[fF]?))(\\'\\'\\')",
4335
+ "end": "(\\'\\'\\')",
4336
+ "beginCaptures": {
4337
+ "2": {
4338
+ "name": "invalid.deprecated.prefix.python"
4339
+ },
4340
+ "3": {
4341
+ "name": "storage.type.string.python"
4342
+ },
4343
+ "4": {
4344
+ "name": "storage.type.string.python"
4345
+ },
4346
+ "5": {
4347
+ "name": "punctuation.definition.string.begin.python"
4348
+ }
4349
+ },
4350
+ "endCaptures": {
4351
+ "1": {
4352
+ "name": "punctuation.definition.string.end.python"
4353
+ },
4354
+ "2": {
4355
+ "name": "invalid.illegal.newline.python"
4356
+ }
4357
+ },
4358
+ "patterns": [
4359
+ {
4360
+ "include": "#single-three-fregexp-expression"
4361
+ }
4362
+ ]
4363
+ },
4364
+ "fregexp-double-one-line": {
4365
+ "name": "string.regexp.quoted.single.python string.interpolated.python",
4366
+ "begin": "\\b(([uU]r)|([fF]r)|(r[fF]?))(\")",
4367
+ "end": "(\")|(?<!\\\\)(\\n)",
4368
+ "beginCaptures": {
4369
+ "2": {
4370
+ "name": "invalid.deprecated.prefix.python"
4371
+ },
4372
+ "3": {
4373
+ "name": "storage.type.string.python"
4374
+ },
4375
+ "4": {
4376
+ "name": "storage.type.string.python"
4377
+ },
4378
+ "5": {
4379
+ "name": "punctuation.definition.string.begin.python"
4380
+ }
4381
+ },
4382
+ "endCaptures": {
4383
+ "1": {
4384
+ "name": "punctuation.definition.string.end.python"
4385
+ },
4386
+ "2": {
4387
+ "name": "invalid.illegal.newline.python"
4388
+ }
4389
+ },
4390
+ "patterns": [
4391
+ {
4392
+ "include": "#double-one-fregexp-expression"
4393
+ }
4394
+ ]
4395
+ },
4396
+ "fregexp-double-three-line": {
4397
+ "name": "string.regexp.quoted.multi.python string.interpolated.python",
4398
+ "begin": "\\b(([uU]r)|([fF]r)|(r[fF]?))(\"\"\")",
4399
+ "end": "(\"\"\")",
4400
+ "beginCaptures": {
4401
+ "2": {
4402
+ "name": "invalid.deprecated.prefix.python"
4403
+ },
4404
+ "3": {
4405
+ "name": "storage.type.string.python"
4406
+ },
4407
+ "4": {
4408
+ "name": "storage.type.string.python"
4409
+ },
4410
+ "5": {
4411
+ "name": "punctuation.definition.string.begin.python"
4412
+ }
4413
+ },
4414
+ "endCaptures": {
4415
+ "1": {
4416
+ "name": "punctuation.definition.string.end.python"
4417
+ },
4418
+ "2": {
4419
+ "name": "invalid.illegal.newline.python"
4420
+ }
4421
+ },
4422
+ "patterns": [
4423
+ {
4424
+ "include": "#double-three-fregexp-expression"
4425
+ }
4426
+ ]
4427
+ },
4428
+ "string-raw-quoted-single-line": {
4429
+ "name": "string.quoted.raw.single.python",
4430
+ "begin": "\\b(([uU]R)|(R))((['\"]))",
4431
+ "end": "(\\4)|((?<!\\\\)\\n)",
4432
+ "beginCaptures": {
4433
+ "2": {
4434
+ "name": "invalid.deprecated.prefix.python"
4435
+ },
4436
+ "3": {
4437
+ "name": "storage.type.string.python"
4438
+ },
4439
+ "4": {
4440
+ "name": "punctuation.definition.string.begin.python"
4441
+ }
4442
+ },
4443
+ "endCaptures": {
4444
+ "1": {
4445
+ "name": "punctuation.definition.string.end.python"
4446
+ },
4447
+ "2": {
4448
+ "name": "invalid.illegal.newline.python"
4449
+ }
4450
+ },
4451
+ "patterns": [
4452
+ {
4453
+ "include": "#string-single-bad-brace1-formatting-raw"
4454
+ },
4455
+ {
4456
+ "include": "#string-single-bad-brace2-formatting-raw"
4457
+ },
4458
+ {
4459
+ "include": "#string-raw-guts"
4460
+ }
4461
+ ]
4462
+ },
4463
+ "string-bin-quoted-single-line": {
4464
+ "name": "string.quoted.binary.single.python",
4465
+ "begin": "(\\b[bB])((['\"]))",
4466
+ "end": "(\\2)|((?<!\\\\)\\n)",
4467
+ "beginCaptures": {
4468
+ "1": {
4469
+ "name": "storage.type.string.python"
4470
+ },
4471
+ "2": {
4472
+ "name": "punctuation.definition.string.begin.python"
4473
+ }
4474
+ },
4475
+ "endCaptures": {
4476
+ "1": {
4477
+ "name": "punctuation.definition.string.end.python"
4478
+ },
4479
+ "2": {
4480
+ "name": "invalid.illegal.newline.python"
4481
+ }
4482
+ },
4483
+ "patterns": [
4484
+ {
4485
+ "include": "#string-entity"
4486
+ }
4487
+ ]
4488
+ },
4489
+ "string-raw-bin-quoted-single-line": {
4490
+ "name": "string.quoted.raw.binary.single.python",
4491
+ "begin": "(\\b(?:R[bB]|[bB]R))((['\"]))",
4492
+ "end": "(\\2)|((?<!\\\\)\\n)",
4493
+ "beginCaptures": {
4494
+ "1": {
4495
+ "name": "storage.type.string.python"
4496
+ },
4497
+ "2": {
4498
+ "name": "punctuation.definition.string.begin.python"
4499
+ }
4500
+ },
4501
+ "endCaptures": {
4502
+ "1": {
4503
+ "name": "punctuation.definition.string.end.python"
4504
+ },
4505
+ "2": {
4506
+ "name": "invalid.illegal.newline.python"
4507
+ }
4508
+ },
4509
+ "patterns": [
4510
+ {
4511
+ "include": "#string-raw-bin-guts"
4512
+ }
4513
+ ]
4514
+ },
4515
+ "string-quoted-single-line": {
4516
+ "name": "string.quoted.single.python",
4517
+ "begin": "(\\b[rR](?=[uU]))?([uU])?((['\"]))",
4518
+ "end": "(\\3)|((?<!\\\\)\\n)",
4519
+ "beginCaptures": {
4520
+ "1": {
4521
+ "name": "invalid.illegal.prefix.python"
4522
+ },
4523
+ "2": {
4524
+ "name": "storage.type.string.python"
4525
+ },
4526
+ "3": {
4527
+ "name": "punctuation.definition.string.begin.python"
4528
+ }
4529
+ },
4530
+ "endCaptures": {
4531
+ "1": {
4532
+ "name": "punctuation.definition.string.end.python"
4533
+ },
4534
+ "2": {
4535
+ "name": "invalid.illegal.newline.python"
4536
+ }
4537
+ },
4538
+ "patterns": [
4539
+ {
4540
+ "include": "#string-single-bad-brace1-formatting-unicode"
4541
+ },
4542
+ {
4543
+ "include": "#string-single-bad-brace2-formatting-unicode"
4544
+ },
4545
+ {
4546
+ "include": "#string-unicode-guts"
4547
+ }
4548
+ ]
4549
+ },
4550
+ "string-single-bad-brace1-formatting-unicode": {
4551
+ "comment": "template using {% ... %}",
4552
+ "begin": "(?x)\n (?= \\{%\n ( .*? (?!(['\"])|((?<!\\\\)\\n)) )\n %\\}\n )\n",
4553
+ "end": "(?=(['\"])|((?<!\\\\)\\n))",
4554
+ "patterns": [
4555
+ {
4556
+ "include": "#escape-sequence-unicode"
4557
+ },
4558
+ {
4559
+ "include": "#escape-sequence"
4560
+ },
4561
+ {
4562
+ "include": "#string-line-continuation"
4563
+ }
4564
+ ]
4565
+ },
4566
+ "string-single-bad-brace1-formatting-raw": {
4567
+ "comment": "template using {% ... %}",
4568
+ "begin": "(?x)\n (?= \\{%\n ( .*? (?!(['\"])|((?<!\\\\)\\n)) )\n %\\}\n )\n",
4569
+ "end": "(?=(['\"])|((?<!\\\\)\\n))",
4570
+ "patterns": [
4571
+ {
4572
+ "include": "#string-consume-escape"
4573
+ }
4574
+ ]
4575
+ },
4576
+ "string-single-bad-brace2-formatting-unicode": {
4577
+ "comment": "odd format or format-like syntax",
4578
+ "begin": "(?x)\n (?!\\{\\{)\n (?= \\{ (\n \\w*? (?!(['\"])|((?<!\\\\)\\n)) [^!:\\.\\[}\\w]\n )\n .*?(?!(['\"])|((?<!\\\\)\\n))\n \\}\n )\n",
4579
+ "end": "(?=(['\"])|((?<!\\\\)\\n))",
4580
+ "patterns": [
4581
+ {
4582
+ "include": "#escape-sequence-unicode"
4583
+ },
4584
+ {
4585
+ "include": "#string-entity"
4586
+ }
4587
+ ]
4588
+ },
4589
+ "string-single-bad-brace2-formatting-raw": {
4590
+ "comment": "odd format or format-like syntax",
4591
+ "begin": "(?x)\n (?!\\{\\{)\n (?= \\{ (\n \\w*? (?!(['\"])|((?<!\\\\)\\n)) [^!:\\.\\[}\\w]\n )\n .*?(?!(['\"])|((?<!\\\\)\\n))\n \\}\n )\n",
4592
+ "end": "(?=(['\"])|((?<!\\\\)\\n))",
4593
+ "patterns": [
4594
+ {
4595
+ "include": "#string-consume-escape"
4596
+ },
4597
+ {
4598
+ "include": "#string-formatting"
4599
+ }
4600
+ ]
4601
+ },
4602
+ "string-raw-quoted-multi-line": {
4603
+ "name": "string.quoted.raw.multi.python",
4604
+ "begin": "\\b(([uU]R)|(R))('''|\"\"\")",
4605
+ "end": "(\\4)",
4606
+ "beginCaptures": {
4607
+ "2": {
4608
+ "name": "invalid.deprecated.prefix.python"
4609
+ },
4610
+ "3": {
4611
+ "name": "storage.type.string.python"
4612
+ },
4613
+ "4": {
4614
+ "name": "punctuation.definition.string.begin.python"
4615
+ }
4616
+ },
4617
+ "endCaptures": {
4618
+ "1": {
4619
+ "name": "punctuation.definition.string.end.python"
4620
+ },
4621
+ "2": {
4622
+ "name": "invalid.illegal.newline.python"
4623
+ }
4624
+ },
4625
+ "patterns": [
4626
+ {
4627
+ "include": "#string-multi-bad-brace1-formatting-raw"
4628
+ },
4629
+ {
4630
+ "include": "#string-multi-bad-brace2-formatting-raw"
4631
+ },
4632
+ {
4633
+ "include": "#string-raw-guts"
4634
+ }
4635
+ ]
4636
+ },
4637
+ "string-bin-quoted-multi-line": {
4638
+ "name": "string.quoted.binary.multi.python",
4639
+ "begin": "(\\b[bB])('''|\"\"\")",
4640
+ "end": "(\\2)",
4641
+ "beginCaptures": {
4642
+ "1": {
4643
+ "name": "storage.type.string.python"
4644
+ },
4645
+ "2": {
4646
+ "name": "punctuation.definition.string.begin.python"
4647
+ }
4648
+ },
4649
+ "endCaptures": {
4650
+ "1": {
4651
+ "name": "punctuation.definition.string.end.python"
4652
+ },
4653
+ "2": {
4654
+ "name": "invalid.illegal.newline.python"
4655
+ }
4656
+ },
4657
+ "patterns": [
4658
+ {
4659
+ "include": "#string-entity"
4660
+ }
4661
+ ]
4662
+ },
4663
+ "string-raw-bin-quoted-multi-line": {
4664
+ "name": "string.quoted.raw.binary.multi.python",
4665
+ "begin": "(\\b(?:R[bB]|[bB]R))('''|\"\"\")",
4666
+ "end": "(\\2)",
4667
+ "beginCaptures": {
4668
+ "1": {
4669
+ "name": "storage.type.string.python"
4670
+ },
4671
+ "2": {
4672
+ "name": "punctuation.definition.string.begin.python"
4673
+ }
4674
+ },
4675
+ "endCaptures": {
4676
+ "1": {
4677
+ "name": "punctuation.definition.string.end.python"
4678
+ },
4679
+ "2": {
4680
+ "name": "invalid.illegal.newline.python"
4681
+ }
4682
+ },
4683
+ "patterns": [
4684
+ {
4685
+ "include": "#string-raw-bin-guts"
4686
+ }
4687
+ ]
4688
+ },
4689
+ "string-quoted-multi-line": {
4690
+ "name": "string.quoted.multi.python",
4691
+ "begin": "(\\b[rR](?=[uU]))?([uU])?('''|\"\"\")",
4692
+ "end": "(\\3)",
4693
+ "beginCaptures": {
4694
+ "1": {
4695
+ "name": "invalid.illegal.prefix.python"
4696
+ },
4697
+ "2": {
4698
+ "name": "storage.type.string.python"
4699
+ },
4700
+ "3": {
4701
+ "name": "punctuation.definition.string.begin.python"
4702
+ }
4703
+ },
4704
+ "endCaptures": {
4705
+ "1": {
4706
+ "name": "punctuation.definition.string.end.python"
4707
+ },
4708
+ "2": {
4709
+ "name": "invalid.illegal.newline.python"
4710
+ }
4711
+ },
4712
+ "patterns": [
4713
+ {
4714
+ "include": "#string-multi-bad-brace1-formatting-unicode"
4715
+ },
4716
+ {
4717
+ "include": "#string-multi-bad-brace2-formatting-unicode"
4718
+ },
4719
+ {
4720
+ "include": "#string-unicode-guts"
4721
+ }
4722
+ ]
4723
+ },
4724
+ "string-multi-bad-brace1-formatting-unicode": {
4725
+ "comment": "template using {% ... %}",
4726
+ "begin": "(?x)\n (?= \\{%\n ( .*? (?!'''|\"\"\") )\n %\\}\n )\n",
4727
+ "end": "(?='''|\"\"\")",
4728
+ "patterns": [
4729
+ {
4730
+ "include": "#escape-sequence-unicode"
4731
+ },
4732
+ {
4733
+ "include": "#escape-sequence"
4734
+ },
4735
+ {
4736
+ "include": "#string-line-continuation"
4737
+ }
4738
+ ]
4739
+ },
4740
+ "string-multi-bad-brace1-formatting-raw": {
4741
+ "comment": "template using {% ... %}",
4742
+ "begin": "(?x)\n (?= \\{%\n ( .*? (?!'''|\"\"\") )\n %\\}\n )\n",
4743
+ "end": "(?='''|\"\"\")",
4744
+ "patterns": [
4745
+ {
4746
+ "include": "#string-consume-escape"
4747
+ }
4748
+ ]
4749
+ },
4750
+ "string-multi-bad-brace2-formatting-unicode": {
4751
+ "comment": "odd format or format-like syntax",
4752
+ "begin": "(?x)\n (?!\\{\\{)\n (?= \\{ (\n \\w*? (?!'''|\"\"\") [^!:\\.\\[}\\w]\n )\n .*?(?!'''|\"\"\")\n \\}\n )\n",
4753
+ "end": "(?='''|\"\"\")",
4754
+ "patterns": [
4755
+ {
4756
+ "include": "#escape-sequence-unicode"
4757
+ },
4758
+ {
4759
+ "include": "#string-entity"
4760
+ }
4761
+ ]
4762
+ },
4763
+ "string-multi-bad-brace2-formatting-raw": {
4764
+ "comment": "odd format or format-like syntax",
4765
+ "begin": "(?x)\n (?!\\{\\{)\n (?= \\{ (\n \\w*? (?!'''|\"\"\") [^!:\\.\\[}\\w]\n )\n .*?(?!'''|\"\"\")\n \\}\n )\n",
4766
+ "end": "(?='''|\"\"\")",
4767
+ "patterns": [
4768
+ {
4769
+ "include": "#string-consume-escape"
4770
+ },
4771
+ {
4772
+ "include": "#string-formatting"
4773
+ }
4774
+ ]
4775
+ },
4776
+ "fstring-fnorm-quoted-single-line": {
4777
+ "name": "meta.fstring.python",
4778
+ "begin": "(\\b[fF])([bBuU])?((['\"]))",
4779
+ "end": "(\\3)|((?<!\\\\)\\n)",
4780
+ "beginCaptures": {
4781
+ "1": {
4782
+ "name": "string.quoted.single.python string.interpolated.python storage.type.string.python"
4783
+ },
4784
+ "2": {
4785
+ "name": "invalid.illegal.prefix.python"
4786
+ },
4787
+ "3": {
4788
+ "name": "string.quoted.single.python string.interpolated.python punctuation.definition.string.begin.python"
3101
4789
  }
3102
4790
  },
3103
4791
  "endCaptures": {
3104
4792
  "1": {
3105
- "name": "punctuation.definition.string.end.python"
4793
+ "name": "string.quoted.single.python string.interpolated.python punctuation.definition.string.end.python"
3106
4794
  },
3107
4795
  "2": {
3108
4796
  "name": "invalid.illegal.newline.python"
@@ -3110,31 +4798,37 @@
3110
4798
  },
3111
4799
  "patterns": [
3112
4800
  {
3113
- "include": "#string-single-bad-brace1-formatting-raw"
4801
+ "include": "#fstring-guts"
3114
4802
  },
3115
4803
  {
3116
- "include": "#string-single-bad-brace2-formatting-raw"
4804
+ "include": "#fstring-illegal-single-brace"
3117
4805
  },
3118
4806
  {
3119
- "include": "#string-raw-guts"
4807
+ "include": "#fstring-single-brace"
4808
+ },
4809
+ {
4810
+ "include": "#fstring-single-core"
3120
4811
  }
3121
4812
  ]
3122
4813
  },
3123
- "string-bin-quoted-single-line": {
3124
- "name": "string.quoted.binary.single.python",
3125
- "begin": "(\\b[bB])((['\"]))",
3126
- "end": "(\\2)|((?<!\\\\)\\n)",
4814
+ "fstring-normf-quoted-single-line": {
4815
+ "name": "meta.fstring.python",
4816
+ "begin": "(\\b[bBuU])([fF])((['\"]))",
4817
+ "end": "(\\3)|((?<!\\\\)\\n)",
3127
4818
  "beginCaptures": {
3128
4819
  "1": {
3129
- "name": "storage.type.string.python"
4820
+ "name": "invalid.illegal.prefix.python"
3130
4821
  },
3131
4822
  "2": {
3132
- "name": "punctuation.definition.string.begin.python"
4823
+ "name": "string.quoted.single.python string.interpolated.python storage.type.string.python"
4824
+ },
4825
+ "3": {
4826
+ "name": "string.quoted.single.python punctuation.definition.string.begin.python"
3133
4827
  }
3134
4828
  },
3135
4829
  "endCaptures": {
3136
4830
  "1": {
3137
- "name": "punctuation.definition.string.end.python"
4831
+ "name": "string.quoted.single.python string.interpolated.python punctuation.definition.string.end.python"
3138
4832
  },
3139
4833
  "2": {
3140
4834
  "name": "invalid.illegal.newline.python"
@@ -3142,25 +4836,34 @@
3142
4836
  },
3143
4837
  "patterns": [
3144
4838
  {
3145
- "include": "#string-entity"
4839
+ "include": "#fstring-guts"
4840
+ },
4841
+ {
4842
+ "include": "#fstring-illegal-single-brace"
4843
+ },
4844
+ {
4845
+ "include": "#fstring-single-brace"
4846
+ },
4847
+ {
4848
+ "include": "#fstring-single-core"
3146
4849
  }
3147
4850
  ]
3148
4851
  },
3149
- "string-raw-bin-quoted-single-line": {
3150
- "name": "string.quoted.raw.binary.single.python",
3151
- "begin": "(\\b(?:R[bB]|[bB]R))((['\"]))",
4852
+ "fstring-raw-quoted-single-line": {
4853
+ "name": "meta.fstring.python",
4854
+ "begin": "(\\b(?:[R][fF]|[fF][R]))((['\"]))",
3152
4855
  "end": "(\\2)|((?<!\\\\)\\n)",
3153
4856
  "beginCaptures": {
3154
4857
  "1": {
3155
- "name": "storage.type.string.python"
4858
+ "name": "string.quoted.raw.single.python string.interpolated.python storage.type.string.python"
3156
4859
  },
3157
4860
  "2": {
3158
- "name": "punctuation.definition.string.begin.python"
4861
+ "name": "string.quoted.raw.single.python punctuation.definition.string.begin.python"
3159
4862
  }
3160
4863
  },
3161
4864
  "endCaptures": {
3162
4865
  "1": {
3163
- "name": "punctuation.definition.string.end.python"
4866
+ "name": "string.quoted.raw.single.python string.interpolated.python punctuation.definition.string.end.python"
3164
4867
  },
3165
4868
  "2": {
3166
4869
  "name": "invalid.illegal.newline.python"
@@ -3168,115 +4871,142 @@
3168
4871
  },
3169
4872
  "patterns": [
3170
4873
  {
3171
- "include": "#string-raw-bin-guts"
4874
+ "include": "#fstring-raw-guts"
4875
+ },
4876
+ {
4877
+ "include": "#fstring-illegal-single-brace"
4878
+ },
4879
+ {
4880
+ "include": "#fstring-single-brace"
4881
+ },
4882
+ {
4883
+ "include": "#fstring-raw-single-core"
3172
4884
  }
3173
4885
  ]
3174
4886
  },
3175
- "string-quoted-single-line": {
3176
- "name": "string.quoted.single.python",
3177
- "begin": "(\\b[rR](?=[uU]))?([uU])?((['\"]))",
3178
- "end": "(\\3)|((?<!\\\\)\\n)",
4887
+ "fstring-single-core": {
4888
+ "name": "string.quoted.single.python string.interpolated.python",
4889
+ "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"
4890
+ },
4891
+ "fstring-raw-single-core": {
4892
+ "name": "string.quoted.raw.single.python string.interpolated.python",
4893
+ "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"
4894
+ },
4895
+ "fstring-single-brace": {
4896
+ "comment": "value interpolation using { ... }",
4897
+ "begin": "(\\{)",
4898
+ "end": "(?x)\n (\\})|(?=\\n)\n",
3179
4899
  "beginCaptures": {
3180
4900
  "1": {
3181
- "name": "invalid.illegal.prefix.python"
3182
- },
3183
- "2": {
3184
- "name": "storage.type.string.python"
3185
- },
3186
- "3": {
3187
- "name": "punctuation.definition.string.begin.python"
4901
+ "name": "constant.character.format.placeholder.other.python"
3188
4902
  }
3189
4903
  },
3190
4904
  "endCaptures": {
3191
4905
  "1": {
3192
- "name": "punctuation.definition.string.end.python"
3193
- },
3194
- "2": {
3195
- "name": "invalid.illegal.newline.python"
4906
+ "name": "constant.character.format.placeholder.other.python"
3196
4907
  }
3197
4908
  },
3198
4909
  "patterns": [
3199
4910
  {
3200
- "include": "#string-single-bad-brace1-formatting-unicode"
3201
- },
3202
- {
3203
- "include": "#string-single-bad-brace2-formatting-unicode"
4911
+ "include": "#fstring-terminator-single"
3204
4912
  },
3205
4913
  {
3206
- "include": "#string-unicode-guts"
4914
+ "include": "#f-expression"
3207
4915
  }
3208
4916
  ]
3209
4917
  },
3210
- "string-single-bad-brace1-formatting-unicode": {
3211
- "comment": "template using {% ... %}",
3212
- "begin": "(?x)\n (?= \\{%\n ( .*? (?!(['\"])|((?<!\\\\)\\n)) )\n %\\}\n )\n",
3213
- "end": "(?=(['\"])|((?<!\\\\)\\n))",
4918
+ "fstring-terminator-single": {
3214
4919
  "patterns": [
3215
4920
  {
3216
- "include": "#escape-sequence-unicode"
4921
+ "name": "storage.type.format.python",
4922
+ "match": "(![rsa])(?=})"
3217
4923
  },
3218
4924
  {
3219
- "include": "#escape-sequence"
4925
+ "match": "(?x)\n (![rsa])?\n ( : \\w? [<>=^]? [-+ ]? \\#?\n \\d* ,? (\\.\\d+)? [bcdeEfFgGnosxX%]? )(?=})\n",
4926
+ "captures": {
4927
+ "1": {
4928
+ "name": "storage.type.format.python"
4929
+ },
4930
+ "2": {
4931
+ "name": "support.other.format.python"
4932
+ }
4933
+ }
3220
4934
  },
3221
4935
  {
3222
- "include": "#string-line-continuation"
4936
+ "include": "#fstring-terminator-single-tail"
3223
4937
  }
3224
4938
  ]
3225
4939
  },
3226
- "string-single-bad-brace1-formatting-raw": {
3227
- "comment": "template using {% ... %}",
3228
- "begin": "(?x)\n (?= \\{%\n ( .*? (?!(['\"])|((?<!\\\\)\\n)) )\n %\\}\n )\n",
3229
- "end": "(?=(['\"])|((?<!\\\\)\\n))",
3230
- "patterns": [
3231
- {
3232
- "include": "#string-consume-escape"
4940
+ "fstring-terminator-single-tail": {
4941
+ "begin": "(![rsa])?(:)(?=.*?{)",
4942
+ "end": "(?=})|(?=\\n)",
4943
+ "beginCaptures": {
4944
+ "1": {
4945
+ "name": "storage.type.format.python"
4946
+ },
4947
+ "2": {
4948
+ "name": "support.other.format.python"
3233
4949
  }
3234
- ]
3235
- },
3236
- "string-single-bad-brace2-formatting-unicode": {
3237
- "comment": "odd format or format-like syntax",
3238
- "begin": "(?x)\n (?!\\{\\{)\n (?= \\{ (\n \\w*? (?!(['\"])|((?<!\\\\)\\n)) [^!:\\.\\[}\\w]\n )\n .*?(?!(['\"])|((?<!\\\\)\\n))\n \\}\n )\n",
3239
- "end": "(?=(['\"])|((?<!\\\\)\\n))",
4950
+ },
3240
4951
  "patterns": [
3241
4952
  {
3242
- "include": "#escape-sequence-unicode"
4953
+ "include": "#fstring-illegal-single-brace"
3243
4954
  },
3244
4955
  {
3245
- "include": "#string-entity"
3246
- }
3247
- ]
3248
- },
3249
- "string-single-bad-brace2-formatting-raw": {
3250
- "comment": "odd format or format-like syntax",
3251
- "begin": "(?x)\n (?!\\{\\{)\n (?= \\{ (\n \\w*? (?!(['\"])|((?<!\\\\)\\n)) [^!:\\.\\[}\\w]\n )\n .*?(?!(['\"])|((?<!\\\\)\\n))\n \\}\n )\n",
3252
- "end": "(?=(['\"])|((?<!\\\\)\\n))",
3253
- "patterns": [
4956
+ "include": "#fstring-single-brace"
4957
+ },
3254
4958
  {
3255
- "include": "#string-consume-escape"
4959
+ "name": "support.other.format.python",
4960
+ "match": "([bcdeEfFgGnosxX%])(?=})"
3256
4961
  },
3257
4962
  {
3258
- "include": "#string-formatting"
4963
+ "name": "support.other.format.python",
4964
+ "match": "(\\.\\d+)"
4965
+ },
4966
+ {
4967
+ "name": "support.other.format.python",
4968
+ "match": "(,)"
4969
+ },
4970
+ {
4971
+ "name": "support.other.format.python",
4972
+ "match": "(\\d+)"
4973
+ },
4974
+ {
4975
+ "name": "support.other.format.python",
4976
+ "match": "(\\#)"
4977
+ },
4978
+ {
4979
+ "name": "support.other.format.python",
4980
+ "match": "([-+ ])"
4981
+ },
4982
+ {
4983
+ "name": "support.other.format.python",
4984
+ "match": "([<>=^])"
4985
+ },
4986
+ {
4987
+ "name": "support.other.format.python",
4988
+ "match": "(\\w)"
3259
4989
  }
3260
4990
  ]
3261
4991
  },
3262
- "string-raw-quoted-multi-line": {
3263
- "name": "string.quoted.raw.multi.python",
3264
- "begin": "\\b(([uU]R)|(R))('''|\"\"\")",
3265
- "end": "(\\4)",
4992
+ "fstring-fnorm-quoted-multi-line": {
4993
+ "name": "meta.fstring.python",
4994
+ "begin": "(\\b[fF])([bBuU])?('''|\"\"\")",
4995
+ "end": "(\\3)",
3266
4996
  "beginCaptures": {
4997
+ "1": {
4998
+ "name": "string.quoted.multi.python string.interpolated.python storage.type.string.python"
4999
+ },
3267
5000
  "2": {
3268
- "name": "invalid.deprecated.prefix.python"
5001
+ "name": "invalid.illegal.prefix.python"
3269
5002
  },
3270
5003
  "3": {
3271
- "name": "storage.type.string.python"
3272
- },
3273
- "4": {
3274
- "name": "punctuation.definition.string.begin.python"
5004
+ "name": "string.quoted.multi.python string.interpolated.python punctuation.definition.string.begin.python"
3275
5005
  }
3276
5006
  },
3277
5007
  "endCaptures": {
3278
5008
  "1": {
3279
- "name": "punctuation.definition.string.end.python"
5009
+ "name": "string.quoted.multi.python string.interpolated.python punctuation.definition.string.end.python"
3280
5010
  },
3281
5011
  "2": {
3282
5012
  "name": "invalid.illegal.newline.python"
@@ -3284,31 +5014,37 @@
3284
5014
  },
3285
5015
  "patterns": [
3286
5016
  {
3287
- "include": "#string-multi-bad-brace1-formatting-raw"
5017
+ "include": "#fstring-guts"
3288
5018
  },
3289
5019
  {
3290
- "include": "#string-multi-bad-brace2-formatting-raw"
5020
+ "include": "#fstring-illegal-multi-brace"
3291
5021
  },
3292
5022
  {
3293
- "include": "#string-raw-guts"
5023
+ "include": "#fstring-multi-brace"
5024
+ },
5025
+ {
5026
+ "include": "#fstring-multi-core"
3294
5027
  }
3295
5028
  ]
3296
5029
  },
3297
- "string-bin-quoted-multi-line": {
3298
- "name": "string.quoted.binary.multi.python",
3299
- "begin": "(\\b[bB])('''|\"\"\")",
3300
- "end": "(\\2)",
5030
+ "fstring-normf-quoted-multi-line": {
5031
+ "name": "meta.fstring.python",
5032
+ "begin": "(\\b[bBuU])([fF])('''|\"\"\")",
5033
+ "end": "(\\3)",
3301
5034
  "beginCaptures": {
3302
5035
  "1": {
3303
- "name": "storage.type.string.python"
5036
+ "name": "invalid.illegal.prefix.python"
3304
5037
  },
3305
5038
  "2": {
3306
- "name": "punctuation.definition.string.begin.python"
5039
+ "name": "string.quoted.multi.python string.interpolated.python storage.type.string.python"
5040
+ },
5041
+ "3": {
5042
+ "name": "string.quoted.multi.python punctuation.definition.string.begin.python"
3307
5043
  }
3308
5044
  },
3309
5045
  "endCaptures": {
3310
5046
  "1": {
3311
- "name": "punctuation.definition.string.end.python"
5047
+ "name": "string.quoted.multi.python string.interpolated.python punctuation.definition.string.end.python"
3312
5048
  },
3313
5049
  "2": {
3314
5050
  "name": "invalid.illegal.newline.python"
@@ -3316,25 +5052,34 @@
3316
5052
  },
3317
5053
  "patterns": [
3318
5054
  {
3319
- "include": "#string-entity"
5055
+ "include": "#fstring-guts"
5056
+ },
5057
+ {
5058
+ "include": "#fstring-illegal-multi-brace"
5059
+ },
5060
+ {
5061
+ "include": "#fstring-multi-brace"
5062
+ },
5063
+ {
5064
+ "include": "#fstring-multi-core"
3320
5065
  }
3321
5066
  ]
3322
5067
  },
3323
- "string-raw-bin-quoted-multi-line": {
3324
- "name": "string.quoted.raw.binary.multi.python",
3325
- "begin": "(\\b(?:R[bB]|[bB]R))('''|\"\"\")",
5068
+ "fstring-raw-quoted-multi-line": {
5069
+ "name": "meta.fstring.python",
5070
+ "begin": "(\\b(?:[R][fF]|[fF][R]))('''|\"\"\")",
3326
5071
  "end": "(\\2)",
3327
5072
  "beginCaptures": {
3328
5073
  "1": {
3329
- "name": "storage.type.string.python"
5074
+ "name": "string.quoted.raw.multi.python string.interpolated.python storage.type.string.python"
3330
5075
  },
3331
5076
  "2": {
3332
- "name": "punctuation.definition.string.begin.python"
5077
+ "name": "string.quoted.raw.multi.python punctuation.definition.string.begin.python"
3333
5078
  }
3334
5079
  },
3335
5080
  "endCaptures": {
3336
5081
  "1": {
3337
- "name": "punctuation.definition.string.end.python"
5082
+ "name": "string.quoted.raw.multi.python string.interpolated.python punctuation.definition.string.end.python"
3338
5083
  },
3339
5084
  "2": {
3340
5085
  "name": "invalid.illegal.newline.python"
@@ -3342,94 +5087,121 @@
3342
5087
  },
3343
5088
  "patterns": [
3344
5089
  {
3345
- "include": "#string-raw-bin-guts"
5090
+ "include": "#fstring-raw-guts"
5091
+ },
5092
+ {
5093
+ "include": "#fstring-illegal-multi-brace"
5094
+ },
5095
+ {
5096
+ "include": "#fstring-multi-brace"
5097
+ },
5098
+ {
5099
+ "include": "#fstring-raw-multi-core"
3346
5100
  }
3347
5101
  ]
3348
5102
  },
3349
- "string-quoted-multi-line": {
3350
- "name": "string.quoted.multi.python",
3351
- "begin": "(\\b[rR](?=[uU]))?([uU])?('''|\"\"\")",
3352
- "end": "(\\3)",
5103
+ "fstring-multi-core": {
5104
+ "name": "string.quoted.multi.python string.interpolated.python",
5105
+ "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"
5106
+ },
5107
+ "fstring-raw-multi-core": {
5108
+ "name": "string.quoted.raw.multi.python string.interpolated.python",
5109
+ "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"
5110
+ },
5111
+ "fstring-multi-brace": {
5112
+ "comment": "value interpolation using { ... }",
5113
+ "begin": "(\\{)",
5114
+ "end": "(?x)\n (\\})\n",
3353
5115
  "beginCaptures": {
3354
5116
  "1": {
3355
- "name": "invalid.illegal.prefix.python"
3356
- },
3357
- "2": {
3358
- "name": "storage.type.string.python"
3359
- },
3360
- "3": {
3361
- "name": "punctuation.definition.string.begin.python"
5117
+ "name": "constant.character.format.placeholder.other.python"
3362
5118
  }
3363
5119
  },
3364
5120
  "endCaptures": {
3365
5121
  "1": {
3366
- "name": "punctuation.definition.string.end.python"
3367
- },
3368
- "2": {
3369
- "name": "invalid.illegal.newline.python"
5122
+ "name": "constant.character.format.placeholder.other.python"
3370
5123
  }
3371
5124
  },
3372
5125
  "patterns": [
3373
5126
  {
3374
- "include": "#string-multi-bad-brace1-formatting-unicode"
3375
- },
3376
- {
3377
- "include": "#string-multi-bad-brace2-formatting-unicode"
5127
+ "include": "#fstring-terminator-multi"
3378
5128
  },
3379
5129
  {
3380
- "include": "#string-unicode-guts"
5130
+ "include": "#f-expression"
3381
5131
  }
3382
5132
  ]
3383
5133
  },
3384
- "string-multi-bad-brace1-formatting-unicode": {
3385
- "comment": "template using {% ... %}",
3386
- "begin": "(?x)\n (?= \\{%\n ( .*? (?!'''|\"\"\") )\n %\\}\n )\n",
3387
- "end": "(?='''|\"\"\")",
5134
+ "fstring-terminator-multi": {
3388
5135
  "patterns": [
3389
5136
  {
3390
- "include": "#escape-sequence-unicode"
5137
+ "name": "storage.type.format.python",
5138
+ "match": "(![rsa])(?=})"
3391
5139
  },
3392
5140
  {
3393
- "include": "#escape-sequence"
5141
+ "match": "(?x)\n (![rsa])?\n ( : \\w? [<>=^]? [-+ ]? \\#?\n \\d* ,? (\\.\\d+)? [bcdeEfFgGnosxX%]? )(?=})\n",
5142
+ "captures": {
5143
+ "1": {
5144
+ "name": "storage.type.format.python"
5145
+ },
5146
+ "2": {
5147
+ "name": "support.other.format.python"
5148
+ }
5149
+ }
3394
5150
  },
3395
5151
  {
3396
- "include": "#string-line-continuation"
5152
+ "include": "#fstring-terminator-multi-tail"
3397
5153
  }
3398
5154
  ]
3399
5155
  },
3400
- "string-multi-bad-brace1-formatting-raw": {
3401
- "comment": "template using {% ... %}",
3402
- "begin": "(?x)\n (?= \\{%\n ( .*? (?!'''|\"\"\") )\n %\\}\n )\n",
3403
- "end": "(?='''|\"\"\")",
3404
- "patterns": [
3405
- {
3406
- "include": "#string-consume-escape"
5156
+ "fstring-terminator-multi-tail": {
5157
+ "begin": "(![rsa])?(:)(?=.*?{)",
5158
+ "end": "(?=})",
5159
+ "beginCaptures": {
5160
+ "1": {
5161
+ "name": "storage.type.format.python"
5162
+ },
5163
+ "2": {
5164
+ "name": "support.other.format.python"
3407
5165
  }
3408
- ]
3409
- },
3410
- "string-multi-bad-brace2-formatting-unicode": {
3411
- "comment": "odd format or format-like syntax",
3412
- "begin": "(?x)\n (?!\\{\\{)\n (?= \\{ (\n \\w*? (?!'''|\"\"\") [^!:\\.\\[}\\w]\n )\n .*?(?!'''|\"\"\")\n \\}\n )\n",
3413
- "end": "(?='''|\"\"\")",
5166
+ },
3414
5167
  "patterns": [
3415
5168
  {
3416
- "include": "#escape-sequence-unicode"
5169
+ "include": "#fstring-illegal-multi-brace"
3417
5170
  },
3418
5171
  {
3419
- "include": "#string-entity"
3420
- }
3421
- ]
3422
- },
3423
- "string-multi-bad-brace2-formatting-raw": {
3424
- "comment": "odd format or format-like syntax",
3425
- "begin": "(?x)\n (?!\\{\\{)\n (?= \\{ (\n \\w*? (?!'''|\"\"\") [^!:\\.\\[}\\w]\n )\n .*?(?!'''|\"\"\")\n \\}\n )\n",
3426
- "end": "(?='''|\"\"\")",
3427
- "patterns": [
5172
+ "include": "#fstring-multi-brace"
5173
+ },
3428
5174
  {
3429
- "include": "#string-consume-escape"
5175
+ "name": "support.other.format.python",
5176
+ "match": "([bcdeEfFgGnosxX%])(?=})"
3430
5177
  },
3431
5178
  {
3432
- "include": "#string-formatting"
5179
+ "name": "support.other.format.python",
5180
+ "match": "(\\.\\d+)"
5181
+ },
5182
+ {
5183
+ "name": "support.other.format.python",
5184
+ "match": "(,)"
5185
+ },
5186
+ {
5187
+ "name": "support.other.format.python",
5188
+ "match": "(\\d+)"
5189
+ },
5190
+ {
5191
+ "name": "support.other.format.python",
5192
+ "match": "(\\#)"
5193
+ },
5194
+ {
5195
+ "name": "support.other.format.python",
5196
+ "match": "([-+ ])"
5197
+ },
5198
+ {
5199
+ "name": "support.other.format.python",
5200
+ "match": "([<>=^])"
5201
+ },
5202
+ {
5203
+ "name": "support.other.format.python",
5204
+ "match": "(\\w)"
3433
5205
  }
3434
5206
  ]
3435
5207
  }