chamba 0.7.0 → 0.9.0

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