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