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