Răsfoiți Sursa

Introduce higher-fidelity TextMate grammar+theme loader.

Michael Bolin 4 ani în urmă
părinte
comite
ffc44ca5a4

+ 2 - 2
README.md

@@ -10,5 +10,5 @@ https://github.com/microsoft/monaco-editor/issues/1915.
 - `yarn demo`
 - open http://localhost:8084/
 
-This shows off the Hack grammar working by default, as it is a language for
-which a TextMate grammar exists, but no Monarch grammar.
+Currently, only the Python grammar and VS Code Dark+ themes are included in the
+demo.

+ 135 - 0
configurations/python.json

@@ -0,0 +1,135 @@
+{
+  "comments": {
+    "lineComment": "#",
+    "blockComment": ["\"\"\"", "\"\"\""]
+  },
+  "brackets": [
+    ["{", "}"],
+    ["[", "]"],
+    ["(", ")"]
+  ],
+  "autoClosingPairs": [
+    {
+      "open": "{",
+      "close": "}"
+    },
+    {
+      "open": "[",
+      "close": "]"
+    },
+    {
+      "open": "(",
+      "close": ")"
+    },
+    {
+      "open": "\"",
+      "close": "\"",
+      "notIn": ["string"]
+    },
+    {
+      "open": "r\"",
+      "close": "\"",
+      "notIn": ["string", "comment"]
+    },
+    {
+      "open": "R\"",
+      "close": "\"",
+      "notIn": ["string", "comment"]
+    },
+    {
+      "open": "u\"",
+      "close": "\"",
+      "notIn": ["string", "comment"]
+    },
+    {
+      "open": "U\"",
+      "close": "\"",
+      "notIn": ["string", "comment"]
+    },
+    {
+      "open": "f\"",
+      "close": "\"",
+      "notIn": ["string", "comment"]
+    },
+    {
+      "open": "F\"",
+      "close": "\"",
+      "notIn": ["string", "comment"]
+    },
+    {
+      "open": "b\"",
+      "close": "\"",
+      "notIn": ["string", "comment"]
+    },
+    {
+      "open": "B\"",
+      "close": "\"",
+      "notIn": ["string", "comment"]
+    },
+    {
+      "open": "'",
+      "close": "'",
+      "notIn": ["string", "comment"]
+    },
+    {
+      "open": "r'",
+      "close": "'",
+      "notIn": ["string", "comment"]
+    },
+    {
+      "open": "R'",
+      "close": "'",
+      "notIn": ["string", "comment"]
+    },
+    {
+      "open": "u'",
+      "close": "'",
+      "notIn": ["string", "comment"]
+    },
+    {
+      "open": "U'",
+      "close": "'",
+      "notIn": ["string", "comment"]
+    },
+    {
+      "open": "f'",
+      "close": "'",
+      "notIn": ["string", "comment"]
+    },
+    {
+      "open": "F'",
+      "close": "'",
+      "notIn": ["string", "comment"]
+    },
+    {
+      "open": "b'",
+      "close": "'",
+      "notIn": ["string", "comment"]
+    },
+    {
+      "open": "B'",
+      "close": "'",
+      "notIn": ["string", "comment"]
+    },
+    {
+      "open": "`",
+      "close": "`",
+      "notIn": ["string"]
+    }
+  ],
+  "surroundingPairs": [
+    ["{", "}"],
+    ["[", "]"],
+    ["(", ")"],
+    ["\"", "\""],
+    ["'", "'"],
+    ["`", "`"]
+  ],
+  "folding": {
+    "offSide": true,
+    "markers": {
+      "start": "^\\s*#\\s*region\\b",
+      "end": "^\\s*#\\s*endregion\\b"
+    }
+  }
+}

Fișier diff suprimat deoarece este prea mare
+ 0 - 2145
grammars/JavaScript.tmLanguage.json


+ 5334 - 3437
grammars/MagicPython.tmLanguage.json

@@ -1,3438 +1,5335 @@
 {
-	"name": "MagicPython",
-	"scopeName": "source.python",
-	"fileTypes": [
-		"py",
-		"py3",
-		"rpy",
-		"pyw",
-		"cpy",
-		"SConstruct",
-		"Sconstruct",
-		"sconstruct",
-		"SConscript",
-		"gyp",
-		"gypi"
-	],
-	"first_line_match": "^#!/.*\\bpython[\\d\\.]*\\b",
-	"firstLineMatch": "^#!/.*\\bpython[\\d\\.]*\\b",
-	"uuid": "742deb57-6e38-4192-bed6-410746efd85d",
-	"patterns": [
-		{
-			"include": "#statement"
-		},
-		{
-			"include": "#expression"
-		}
-	],
-	"repository": {
-		"statement": {
-			"patterns": [
-				{
-					"include": "#import"
-				},
-				{
-					"include": "#class-declaration"
-				},
-				{
-					"include": "#function-declaration"
-				},
-				{
-					"include": "#statement-keyword"
-				},
-				{
-					"include": "#assignment-operator"
-				},
-				{
-					"include": "#decorator"
-				},
-				{
-					"include": "#docstring-statement"
-				},
-				{
-					"include": "#semicolon"
-				}
-			]
-		},
-		"semicolon": {
-			"patterns": [
-				{
-					"name": "invalid.deprecated.semicolon.python",
-					"match": "\\;$"
-				}
-			]
-		},
-		"comments": {
-			"patterns": [
-				{
-					"name": "comment.line.number-sign.python",
-					"contentName": "meta.typehint.comment.python",
-					"begin": "(?x)\n  (?:\n    \\# \\s* (type:)\n    \\s*+ (?# we want `\\s*+` which is possessive quantifier since\n             we do not actually want to backtrack when matching\n             whitespace here)\n    (?! $ | \\#)\n  )\n",
-					"end": "(?:$|(?=\\#))",
-					"beginCaptures": {
-						"0": {
-							"name": "meta.typehint.comment.python"
-						},
-						"1": {
-							"name": "comment.typehint.directive.notation.python"
-						}
-					},
-					"patterns": [
-						{
-							"name": "comment.typehint.ignore.notation.python",
-							"match": "(?x)\n  \\G ignore\n  (?= \\s* (?: $ | \\#))\n"
-						},
-						{
-							"name": "comment.typehint.type.notation.python",
-							"match": "(?x)\n  (?<!\\.)\\b(\n    bool | bytes | float | int | object | str\n    | List | Dict | Iterable | Sequence | Set\n    | FrozenSet | Callable | Union | Tuple\n    | Any | None\n  )\\b\n"
-						},
-						{
-							"name": "comment.typehint.punctuation.notation.python",
-							"match": "([\\[\\]\\(\\),\\.\\=\\*]|(->))"
-						},
-						{
-							"name": "comment.typehint.variable.notation.python",
-							"match": "([[:alpha:]_]\\w*)"
-						}
-					]
-				},
-				{
-					"include": "#comments-base"
-				}
-			]
-		},
-		"docstring-statement": {
-			"begin": "^(?=\\s*[rR]?(\\'\\'\\'|\\\"\\\"\\\"|\\'|\\\"))",
-			"end": "(?<=\\'\\'\\'|\\\"\\\"\\\"|\\'|\\\")",
-			"patterns": [
-				{
-					"include": "#docstring"
-				}
-			]
-		},
-		"docstring": {
-			"patterns": [
-				{
-					"name": "string.quoted.docstring.multi.python",
-					"begin": "(\\'\\'\\'|\\\"\\\"\\\")",
-					"end": "(\\1)",
-					"beginCaptures": {
-						"1": {
-							"name": "punctuation.definition.string.begin.python"
-						}
-					},
-					"endCaptures": {
-						"1": {
-							"name": "punctuation.definition.string.end.python"
-						}
-					},
-					"patterns": [
-						{
-							"include": "#docstring-prompt"
-						},
-						{
-							"include": "#codetags"
-						},
-						{
-							"include": "#docstring-guts-unicode"
-						}
-					]
-				},
-				{
-					"name": "string.quoted.docstring.raw.multi.python",
-					"begin": "([rR])(\\'\\'\\'|\\\"\\\"\\\")",
-					"end": "(\\2)",
-					"beginCaptures": {
-						"1": {
-							"name": "storage.type.string.python"
-						},
-						"2": {
-							"name": "punctuation.definition.string.begin.python"
-						}
-					},
-					"endCaptures": {
-						"1": {
-							"name": "punctuation.definition.string.end.python"
-						}
-					},
-					"patterns": [
-						{
-							"include": "#string-consume-escape"
-						},
-						{
-							"include": "#docstring-prompt"
-						},
-						{
-							"include": "#codetags"
-						}
-					]
-				},
-				{
-					"name": "string.quoted.docstring.single.python",
-					"begin": "(\\'|\\\")",
-					"end": "(\\1)|((?<!\\\\)\\n)",
-					"beginCaptures": {
-						"1": {
-							"name": "punctuation.definition.string.begin.python"
-						}
-					},
-					"endCaptures": {
-						"1": {
-							"name": "punctuation.definition.string.end.python"
-						},
-						"2": {
-							"name": "invalid.illegal.newline.python"
-						}
-					},
-					"patterns": [
-						{
-							"include": "#codetags"
-						},
-						{
-							"include": "#docstring-guts-unicode"
-						}
-					]
-				},
-				{
-					"name": "string.quoted.docstring.raw.single.python",
-					"begin": "([rR])(\\'|\\\")",
-					"end": "(\\2)|((?<!\\\\)\\n)",
-					"beginCaptures": {
-						"1": {
-							"name": "storage.type.string.python"
-						},
-						"2": {
-							"name": "punctuation.definition.string.begin.python"
-						}
-					},
-					"endCaptures": {
-						"1": {
-							"name": "punctuation.definition.string.end.python"
-						},
-						"2": {
-							"name": "invalid.illegal.newline.python"
-						}
-					},
-					"patterns": [
-						{
-							"include": "#string-consume-escape"
-						},
-						{
-							"include": "#codetags"
-						}
-					]
-				}
-			]
-		},
-		"docstring-guts-unicode": {
-			"patterns": [
-				{
-					"include": "#escape-sequence-unicode"
-				},
-				{
-					"include": "#escape-sequence"
-				},
-				{
-					"include": "#string-line-continuation"
-				}
-			]
-		},
-		"docstring-prompt": {
-			"match": "(?x)\n  (?:\n    (?:^|\\G) \\s* (?# '\\G' is necessary for ST)\n    ((?:>>>|\\.\\.\\.) \\s) (?=\\s*\\S)\n  )\n",
-			"captures": {
-				"1": {
-					"name": "keyword.control.flow.python"
-				}
-			}
-		},
-		"codetags": {
-			"match": "(?:\\b(NOTE|XXX|HACK|FIXME|BUG|TODO)\\b)",
-			"captures": {
-				"1": {
-					"name": "keyword.codetag.notation.python"
-				}
-			}
-		},
-		"statement-keyword": {
-			"patterns": [
-				{
-					"name": "storage.type.function.python",
-					"match": "\\b((async\\s+)?\\s*def)\\b"
-				},
-				{
-					"name": "keyword.control.flow.python",
-					"match": "(?x)\n  \\b(?<!\\.)(\n    as | async | continue | del | assert | break | finally | for\n    | from | elif | else | if | except | pass | raise\n    | return | try | while | with\n  )\\b\n"
-				},
-				{
-					"name": "storage.modifier.declaration.python",
-					"match": "(?x)\n  \\b(?<!\\.)(\n    global | nonlocal\n  )\\b\n"
-				},
-				{
-					"name": "storage.type.class.python",
-					"match": "\\b(?<!\\.)(class)\\b"
-				}
-			]
-		},
-		"expression-base": {
-			"comment": "All valid Python expressions",
-			"patterns": [
-				{
-					"include": "#backticks"
-				},
-				{
-					"include": "#illegal-anno"
-				},
-				{
-					"include": "#comments"
-				},
-				{
-					"include": "#literal"
-				},
-				{
-					"include": "#regexp"
-				},
-				{
-					"include": "#string"
-				},
-				{
-					"include": "#lambda"
-				},
-				{
-					"include": "#illegal-operator"
-				},
-				{
-					"include": "#operator"
-				},
-				{
-					"include": "#curly-braces"
-				},
-				{
-					"include": "#item-access"
-				},
-				{
-					"include": "#list"
-				},
-				{
-					"include": "#round-braces"
-				},
-				{
-					"include": "#function-call"
-				},
-				{
-					"include": "#builtin-functions"
-				},
-				{
-					"include": "#builtin-types"
-				},
-				{
-					"include": "#builtin-exceptions"
-				},
-				{
-					"include": "#magic-names"
-				},
-				{
-					"include": "#special-names"
-				},
-				{
-					"include": "#illegal-names"
-				},
-				{
-					"include": "#special-variables"
-				},
-				{
-					"include": "#line-continuation"
-				},
-				{
-					"include": "#ellipsis"
-				}
-			]
-		},
-		"expression": {
-			"comment": "All valid Python expressions",
-			"patterns": [
-				{
-					"include": "#expression-base"
-				},
-				{
-					"include": "#member-access"
-				},
-				{
-					"comment": "Tokenize identifiers to help linters",
-					"match": "(?x) \\b ([[:alpha:]_]\\w*) \\b"
-				}
-			]
-		},
-		"member-access": {
-			"begin": "\\.\\s*(?!\\.)",
-			"end": "(?x)\n  # stop when you've just read non-whitespace followed by non-word\n  # i.e. when finished reading an identifier or function call\n  (?<=\\S)(?=\\W) |\n  # stop when seeing the start of something that's not a word,\n  # i.e. when seeing a non-identifier\n  (^|(?<=\\s))(?=[^\\\\\\w\\s]) |\n  $\n",
-			"patterns": [
-				{
-					"include": "#function-call"
-				},
-				{
-					"include": "#member-access-base"
-				}
-			]
-		},
-		"member-access-base": {
-			"patterns": [
-				{
-					"include": "#magic-names"
-				},
-				{
-					"include": "#illegal-names"
-				},
-				{
-					"include": "#illegal-object-name"
-				},
-				{
-					"include": "#special-names"
-				},
-				{
-					"include": "#line-continuation"
-				},
-				{
-					"include": "#item-access"
-				}
-			]
-		},
-		"special-names": {
-			"name": "constant.other.caps.python",
-			"match": "(?x)\n  \\b\n    (\n      _* [[:upper:]]\n    )\n    [[:upper:]\\d]* (_\\w*)?\n  \\b\n"
-		},
-		"curly-braces": {
-			"begin": "\\{",
-			"end": "\\}",
-			"beginCaptures": {
-				"0": {
-					"name": "punctuation.definition.dict.begin.python"
-				}
-			},
-			"endCaptures": {
-				"0": {
-					"name": "punctuation.definition.dict.end.python"
-				}
-			},
-			"patterns": [
-				{
-					"include": "#expression"
-				}
-			]
-		},
-		"list": {
-			"begin": "\\[",
-			"end": "\\]",
-			"beginCaptures": {
-				"0": {
-					"name": "punctuation.definition.list.begin.python"
-				}
-			},
-			"endCaptures": {
-				"0": {
-					"name": "punctuation.definition.list.end.python"
-				}
-			},
-			"patterns": [
-				{
-					"include": "#expression"
-				}
-			]
-		},
-		"round-braces": {
-			"begin": "\\(",
-			"end": "\\)",
-			"beginCaptures": {
-				"0": {
-					"name": "punctuation.parenthesis.begin.python"
-				}
-			},
-			"endCaptures": {
-				"0": {
-					"name": "punctuation.parenthesis.end.python"
-				}
-			},
-			"patterns": [
-				{
-					"include": "#expression"
-				}
-			]
-		},
-		"line-continuation": {
-			"patterns": [
-				{
-					"match": "(\\\\)\\s*(\\S.*$\\n?)",
-					"captures": {
-						"1": {
-							"name": "separator.continuation.line.python"
-						},
-						"2": {
-							"name": "invalid.illegal.line.continuation.python"
-						}
-					}
-				},
-				{
-					"begin": "(\\\\)\\s*$\\n?",
-					"end": "(?x)\n  (?=^\\s*$)\n  |\n  (?! (\\s* [rR]? (\\'\\'\\'|\\\"\\\"\\\"|\\'|\\\"))\n      |\n      (\\G $)  (?# '\\G' is necessary for ST)\n  )\n",
-					"beginCaptures": {
-						"1": {
-							"name": "separator.continuation.line.python"
-						}
-					},
-					"patterns": [
-						{
-							"include": "#regexp"
-						},
-						{
-							"include": "#string"
-						}
-					]
-				}
-			]
-		},
-		"assignment-operator": {
-			"name": "keyword.operator.assignment.python",
-			"match": "(?x)\n     <<= | >>= | //= | \\*\\*=\n    | \\+= | -= | /= | @=\n    | \\*= | %= | ~= | \\^= | &= | \\|=\n    | =(?!=)\n"
-		},
-		"operator": {
-			"match": "(?x)\n    \\b(?<!\\.)\n      (?:\n        (and | or | not | in | is)                         (?# 1)\n        |\n        (for | if | else | await | (?:yield(?:\\s+from)?))  (?# 2)\n      )\n    (?!\\s*:)\\b\n\n    | (<< | >> | & | \\| | \\^ | ~)                          (?# 3)\n\n    | (\\*\\* | \\* | \\+ | - | % | // | / | @)                (?# 4)\n\n    | (!= | == | >= | <= | < | >)                          (?# 5)\n",
-			"captures": {
-				"1": {
-					"name": "keyword.operator.logical.python"
-				},
-				"2": {
-					"name": "keyword.control.flow.python"
-				},
-				"3": {
-					"name": "keyword.operator.bitwise.python"
-				},
-				"4": {
-					"name": "keyword.operator.arithmetic.python"
-				},
-				"5": {
-					"name": "keyword.operator.comparison.python"
-				}
-			}
-		},
-		"literal": {
-			"patterns": [
-				{
-					"name": "constant.language.python",
-					"match": "\\b(True|False|None|NotImplemented|Ellipsis)\\b"
-				},
-				{
-					"include": "#number"
-				}
-			]
-		},
-		"number": {
-			"name": "constant.numeric.python",
-			"patterns": [
-				{
-					"include": "#number-float"
-				},
-				{
-					"include": "#number-dec"
-				},
-				{
-					"include": "#number-hex"
-				},
-				{
-					"include": "#number-oct"
-				},
-				{
-					"include": "#number-bin"
-				},
-				{
-					"include": "#number-long"
-				},
-				{
-					"name": "invalid.illegal.name.python",
-					"match": "\\b[0-9]+\\w+"
-				}
-			]
-		},
-		"number-float": {
-			"name": "constant.numeric.float.python",
-			"match": "(?x)\n  (?<! \\w)(?:\n    [0-9]*\\.[0-9]+ ([eE][+-]?[0-9]+)?\n    | [0-9]+\\. ([eE][+-]?[0-9]+)?\n    | [0-9]+ ([eE][+-]?[0-9]+)\n  )([jJ])?\\b\n",
-			"captures": {
-				"4": {
-					"name": "storage.type.imaginary.number.python"
-				}
-			}
-		},
-		"number-dec": {
-			"name": "constant.numeric.dec.python",
-			"match": "(?x)\n  (?<![\\w\\.])(?:\n      [1-9][0-9]*\n      |\n      0+\n      |\n      [0-9]+ ([jJ])\n      |\n      0 ([0-9]+)(?![eE\\.])\n  )\\b\n",
-			"captures": {
-				"1": {
-					"name": "storage.type.imaginary.number.python"
-				},
-				"2": {
-					"name": "invalid.illegal.dec.python"
-				},
-				"3": {
-					"name": "invalid.illegal.dec.python"
-				}
-			}
-		},
-		"number-hex": {
-			"name": "constant.numeric.hex.python",
-			"match": "(?x)\n  (?<![\\w\\.])\n    (0[xX]) [0-9a-fA-F]+\n  \\b\n",
-			"captures": {
-				"1": {
-					"name": "storage.type.number.python"
-				}
-			}
-		},
-		"number-oct": {
-			"name": "constant.numeric.oct.python",
-			"match": "(?x)\n  (?<![\\w\\.])\n    (0[oO]) [0-7]+\n  \\b\n",
-			"captures": {
-				"1": {
-					"name": "storage.type.number.python"
-				}
-			}
-		},
-		"number-bin": {
-			"name": "constant.numeric.bin.python",
-			"match": "(?x)\n  (?<![\\w\\.])\n    (0[bB]) [01]+\n  \\b\n",
-			"captures": {
-				"1": {
-					"name": "storage.type.number.python"
-				}
-			}
-		},
-		"number-long": {
-			"name": "constant.numeric.bin.python",
-			"comment": "this is to support python2 syntax for long ints",
-			"match": "(?x)\n  (?<![\\w\\.])\n    ([1-9][0-9]* | 0) ([lL])\n  \\b\n",
-			"captures": {
-				"2": {
-					"name": "storage.type.number.python"
-				}
-			}
-		},
-		"regexp": {
-			"patterns": [
-				{
-					"include": "#regexp-single-quoted-multi-line"
-				},
-				{
-					"include": "#regexp-double-quoted-multi-line"
-				},
-				{
-					"include": "#regexp-single-quoted-single-line"
-				},
-				{
-					"include": "#regexp-double-quoted-single-line"
-				}
-			]
-		},
-		"regexp-single-quoted-single-line": {
-			"name": "string.regexp.quoted.single.python",
-			"begin": "\\b(([uU]r)|([bB]r)|(r[bB]?))(\\')",
-			"end": "(\\')|(?<!\\\\)(\\n)",
-			"beginCaptures": {
-				"2": {
-					"name": "invalid.deprecated.prefix.python"
-				},
-				"3": {
-					"name": "storage.type.string.python"
-				},
-				"4": {
-					"name": "storage.type.string.python"
-				},
-				"5": {
-					"name": "punctuation.definition.string.begin.python"
-				}
-			},
-			"endCaptures": {
-				"1": {
-					"name": "punctuation.definition.string.end.python"
-				},
-				"2": {
-					"name": "invalid.illegal.newline.python"
-				}
-			},
-			"patterns": [
-				{
-					"include": "#single-one-regexp-expression"
-				}
-			]
-		},
-		"regexp-double-quoted-single-line": {
-			"name": "string.regexp.quoted.single.python",
-			"begin": "\\b(([uU]r)|([bB]r)|(r[bB]?))(\\\")",
-			"end": "(\\\")|(?<!\\\\)(\\n)",
-			"beginCaptures": {
-				"2": {
-					"name": "invalid.deprecated.prefix.python"
-				},
-				"3": {
-					"name": "storage.type.string.python"
-				},
-				"4": {
-					"name": "storage.type.string.python"
-				},
-				"5": {
-					"name": "punctuation.definition.string.begin.python"
-				}
-			},
-			"endCaptures": {
-				"1": {
-					"name": "punctuation.definition.string.end.python"
-				},
-				"2": {
-					"name": "invalid.illegal.newline.python"
-				}
-			},
-			"patterns": [
-				{
-					"include": "#double-one-regexp-expression"
-				}
-			]
-		},
-		"regexp-single-quoted-multi-line": {
-			"name": "string.regexp.quoted.multi.python",
-			"begin": "\\b(([uU]r)|([bB]r)|(r[bB]?))(\\'\\'\\')",
-			"end": "\\'\\'\\'",
-			"beginCaptures": {
-				"2": {
-					"name": "invalid.deprecated.prefix.python"
-				},
-				"3": {
-					"name": "storage.type.string.python"
-				},
-				"4": {
-					"name": "storage.type.string.python"
-				},
-				"5": {
-					"name": "punctuation.definition.string.begin.python"
-				}
-			},
-			"endCaptures": {
-				"0": {
-					"name": "punctuation.definition.string.end.python"
-				}
-			},
-			"patterns": [
-				{
-					"include": "#single-three-regexp-expression"
-				}
-			]
-		},
-		"regexp-double-quoted-multi-line": {
-			"name": "string.regexp.quoted.multi.python",
-			"begin": "\\b(([uU]r)|([bB]r)|(r[bB]?))(\\\"\\\"\\\")",
-			"end": "\\\"\\\"\\\"",
-			"beginCaptures": {
-				"2": {
-					"name": "invalid.deprecated.prefix.python"
-				},
-				"3": {
-					"name": "storage.type.string.python"
-				},
-				"4": {
-					"name": "storage.type.string.python"
-				},
-				"5": {
-					"name": "punctuation.definition.string.begin.python"
-				}
-			},
-			"endCaptures": {
-				"0": {
-					"name": "punctuation.definition.string.end.python"
-				}
-			},
-			"patterns": [
-				{
-					"include": "#double-three-regexp-expression"
-				}
-			]
-		},
-		"string": {
-			"patterns": [
-				{
-					"include": "#string-quoted-multi-line"
-				},
-				{
-					"include": "#string-quoted-single-line"
-				},
-				{
-					"include": "#string-bin-quoted-multi-line"
-				},
-				{
-					"include": "#string-bin-quoted-single-line"
-				},
-				{
-					"include": "#string-raw-quoted-multi-line"
-				},
-				{
-					"include": "#string-raw-quoted-single-line"
-				},
-				{
-					"include": "#string-raw-bin-quoted-multi-line"
-				},
-				{
-					"include": "#string-raw-bin-quoted-single-line"
-				}
-			]
-		},
-		"string-unicode-guts": {
-			"patterns": [
-				{
-					"include": "#escape-sequence-unicode"
-				},
-				{
-					"include": "#string-entity"
-				},
-				{
-					"include": "#string-brace-formatting"
-				}
-			]
-		},
-		"string-consume-escape": {
-			"match": "\\\\['\"\\n\\\\]"
-		},
-		"string-raw-guts": {
-			"patterns": [
-				{
-					"include": "#string-consume-escape"
-				},
-				{
-					"include": "#string-formatting"
-				},
-				{
-					"include": "#string-brace-formatting"
-				}
-			]
-		},
-		"string-raw-bin-guts": {
-			"patterns": [
-				{
-					"include": "#string-consume-escape"
-				},
-				{
-					"include": "#string-formatting"
-				}
-			]
-		},
-		"string-entity": {
-			"patterns": [
-				{
-					"include": "#escape-sequence"
-				},
-				{
-					"include": "#string-line-continuation"
-				},
-				{
-					"include": "#string-formatting"
-				}
-			]
-		},
-		"escape-sequence-unicode": {
-			"patterns": [
-				{
-					"name": "constant.character.escape.python",
-					"match": "(?x)\n  \\\\ (\n        u[0-9A-Fa-f]{4}\n        | U[0-9A-Fa-f]{8}\n        | N\\{[\\w\\s]+?\\}\n     )\n"
-				}
-			]
-		},
-		"escape-sequence": {
-			"name": "constant.character.escape.python",
-			"match": "(?x)\n  \\\\ (\n        x[0-9A-Fa-f]{2}\n        | [0-7]{1,3}\n        | [\\\\\"'abfnrtv]\n     )\n"
-		},
-		"string-line-continuation": {
-			"name": "constant.language.python",
-			"match": "\\\\$"
-		},
-		"string-formatting": {
-			"name": "constant.character.format.placeholder.other.python",
-			"match": "(?x)\n  % (\\([\\w\\s]*\\))?\n    [-+#0 ]*\n    (\\d+|\\*)? (\\.(\\d+|\\*))?\n    ([hlL])?\n    [diouxXeEfFgGcrsa%]\n"
-		},
-		"string-brace-formatting": {
-			"patterns": [
-				{
-					"name": "constant.character.format.placeholder.other.python",
-					"match": "(?x)\n  (?:\n    {{ | }}\n    | (?:\n      {\n        \\w*? (\\.[[:alpha:]_]\\w*? | \\[[^\\]'\"]+\\])*?\n        (![rsa])?\n        ( : \\w? [<>=^]? [-+ ]? \\#?\n          \\d* ,? (\\.\\d+)? [bcdeEfFgGnosxX%]? )?\n      })\n  )\n",
-					"captures": {
-						"2": {
-							"name": "storage.type.format.python"
-						},
-						"3": {
-							"name": "support.other.format.python"
-						}
-					}
-				},
-				{
-					"name": "constant.character.format.placeholder.other.python",
-					"begin": "(?x)\n    \\{\n      \\w*? (\\.[[:alpha:]_]\\w*? | \\[[^\\]'\"]+\\])*?\n      (![rsa])?\n      (:)\n        (?=[^'\"}\\n]*\\})\n",
-					"end": "\\}",
-					"beginCaptures": {
-						"2": {
-							"name": "storage.type.format.python"
-						},
-						"3": {
-							"name": "support.other.format.python"
-						}
-					},
-					"patterns": [
-						{
-							"match": "(?x) \\{ [^'\"}\\n]*? \\} (?=.*?\\})\n"
-						}
-					]
-				}
-			]
-		},
-		"import": {
-			"comment": "Import statements\n",
-			"patterns": [
-				{
-					"match": "(?x)\n  \\s* \\b(from)\\b (\\s*\\.+\\s*) (import)?\n",
-					"captures": {
-						"1": {
-							"name": "keyword.control.import.python"
-						},
-						"3": {
-							"name": "keyword.control.import.python"
-						}
-					}
-				},
-				{
-					"name": "keyword.control.import.python",
-					"match": "\\b(?<!\\.)import\\b"
-				}
-			]
-		},
-		"class-declaration": {
-			"patterns": [
-				{
-					"name": "meta.class.python",
-					"begin": "(?x)\n  \\s*(class)\\s+\n    (?=\n      [[:alpha:]_]\\w* \\s* (:|\\()\n    )\n",
-					"end": "(:)",
-					"beginCaptures": {
-						"1": {
-							"name": "storage.type.class.python"
-						}
-					},
-					"endCaptures": {
-						"1": {
-							"name": "punctuation.section.class.begin.python"
-						}
-					},
-					"patterns": [
-						{
-							"include": "#class-name"
-						},
-						{
-							"include": "#class-inheritance"
-						}
-					]
-				}
-			]
-		},
-		"class-name": {
-			"patterns": [
-				{
-					"include": "#illegal-object-name"
-				},
-				{
-					"include": "#builtin-possible-callables"
-				},
-				{
-					"name": "entity.name.type.class.python",
-					"match": "(?x)\n  \\b ([[:alpha:]_]\\w*) \\b\n"
-				}
-			]
-		},
-		"class-inheritance": {
-			"name": "meta.class.inheritance.python",
-			"begin": "(\\()",
-			"end": "(\\))",
-			"beginCaptures": {
-				"1": {
-					"name": "punctuation.definition.inheritance.begin.python"
-				}
-			},
-			"endCaptures": {
-				"1": {
-					"name": "punctuation.definition.inheritance.end.python"
-				}
-			},
-			"patterns": [
-				{
-					"name": "keyword.operator.unpacking.arguments.python",
-					"match": "(\\*\\*|\\*)"
-				},
-				{
-					"name": "punctuation.separator.inheritance.python",
-					"match": ","
-				},
-				{
-					"name": "keyword.operator.assignment.python",
-					"match": "=(?!=)"
-				},
-				{
-					"include": "#expression-class"
-				},
-				{
-					"name": "support.type.metaclass.python",
-					"match": "\\bmetaclass\\b"
-				},
-				{
-					"include": "#inheritance-identifier"
-				}
-			]
-		},
-		"inheritance-identifier": {
-			"match": "(?x)\n  \\b ([[:alpha:]_]\\w*) \\b\n",
-			"captures": {
-				"1": {
-					"name": "entity.other.inherited-class.python"
-				}
-			}
-		},
-		"expression-class": {
-			"patterns": [
-				{
-					"include": "#call-wrapper-inheritance"
-				},
-				{
-					"include": "#expression-base"
-				},
-				{
-					"include": "#member-access-class"
-				}
-			]
-		},
-		"member-access-class": {
-			"begin": "\\.\\s*(?!\\.)",
-			"end": "(?<=\\S)(?=\\W)|$",
-			"patterns": [
-				{
-					"include": "#call-wrapper-inheritance"
-				},
-				{
-					"include": "#member-access-base"
-				},
-				{
-					"include": "#inheritance-identifier"
-				}
-			]
-		},
-		"lambda": {
-			"patterns": [
-				{
-					"match": "((?<=\\.)lambda|lambda(?=\\s*[\\.=]))",
-					"captures": {
-						"1": {
-							"name": "keyword.control.flow.python"
-						}
-					}
-				},
-				{
-					"match": "\\b(lambda)\\s*?([,\\n]|$)",
-					"captures": {
-						"1": {
-							"name": "storage.type.function.lambda.python"
-						}
-					}
-				},
-				{
-					"name": "meta.lambda-function.python",
-					"begin": "(?x)\n  \\b (lambda) \\b\n",
-					"end": "(:)|(\\n)",
-					"beginCaptures": {
-						"1": {
-							"name": "storage.type.function.lambda.python"
-						}
-					},
-					"endCaptures": {
-						"1": {
-							"name": "punctuation.section.function.lambda.begin.python"
-						}
-					},
-					"contentName": "meta.function.lambda.parameters.python",
-					"patterns": [
-						{
-							"name": "keyword.operator.unpacking.parameter.python",
-							"match": "(\\*\\*|\\*)"
-						},
-						{
-							"include": "#lambda-incomplete"
-						},
-						{
-							"include": "#illegal-names"
-						},
-						{
-							"match": "([[:alpha:]_]\\w*)\\s*(?:(,)|(?=:|$))",
-							"captures": {
-								"1": {
-									"name": "variable.parameter.function.language.python"
-								},
-								"2": {
-									"name": "punctuation.separator.parameters.python"
-								}
-							}
-						},
-						{
-							"include": "#comments"
-						},
-						{
-							"include": "#backticks"
-						},
-						{
-							"include": "#illegal-anno"
-						},
-						{
-							"include": "#lambda-parameter-with-default"
-						},
-						{
-							"include": "#line-continuation"
-						},
-						{
-							"include": "#illegal-operator"
-						}
-					]
-				}
-			]
-		},
-		"lambda-incomplete": {
-			"name": "storage.type.function.lambda.python",
-			"match": "\\blambda(?=\\s*[:,)])"
-		},
-		"lambda-parameter-with-default": {
-			"begin": "(?x)\n  \\b\n  ([[:alpha:]_]\\w*) \\s* (=)\n",
-			"end": "(,)|(?=:|$)",
-			"beginCaptures": {
-				"1": {
-					"name": "variable.parameter.function.language.python"
-				},
-				"2": {
-					"name": "keyword.operator.python"
-				}
-			},
-			"endCaptures": {
-				"1": {
-					"name": "punctuation.separator.parameters.python"
-				}
-			},
-			"patterns": [
-				{
-					"include": "#expression"
-				}
-			]
-		},
-		"function-declaration": {
-			"name": "meta.function.python",
-			"begin": "(?x)\n  \\s*\n  (?:\\b(async) \\s+)? \\b(def)\\s+\n    (?=\n      [[:alpha:]_][[:word:]]* \\s* \\(\n    )\n",
-			"end": "(:|(?=[#'\"\\n]))",
-			"beginCaptures": {
-				"1": {
-					"name": "storage.type.function.async.python"
-				},
-				"2": {
-					"name": "storage.type.function.python"
-				}
-			},
-			"endCaptures": {
-				"1": {
-					"name": "punctuation.section.function.begin.python"
-				}
-			},
-			"patterns": [
-				{
-					"include": "#function-def-name"
-				},
-				{
-					"include": "#parameters"
-				},
-				{
-					"include": "#line-continuation"
-				},
-				{
-					"include": "#return-annotation"
-				}
-			]
-		},
-		"function-def-name": {
-			"patterns": [
-				{
-					"include": "#illegal-object-name"
-				},
-				{
-					"include": "#builtin-possible-callables"
-				},
-				{
-					"name": "entity.name.function.python",
-					"match": "(?x)\n  \\b ([[:alpha:]_]\\w*) \\b\n"
-				}
-			]
-		},
-		"parameters": {
-			"name": "meta.function.parameters.python",
-			"begin": "(\\()",
-			"end": "(\\))",
-			"beginCaptures": {
-				"1": {
-					"name": "punctuation.definition.parameters.begin.python"
-				}
-			},
-			"endCaptures": {
-				"1": {
-					"name": "punctuation.definition.parameters.end.python"
-				}
-			},
-			"patterns": [
-				{
-					"name": "keyword.operator.unpacking.parameter.python",
-					"match": "(\\*\\*|\\*)"
-				},
-				{
-					"include": "#lambda-incomplete"
-				},
-				{
-					"include": "#illegal-names"
-				},
-				{
-					"include": "#illegal-object-name"
-				},
-				{
-					"include": "#parameter-special"
-				},
-				{
-					"match": "(?x)\n  ([[:alpha:]_]\\w*)\n    \\s* (?: (,) | (?=[)#\\n=]))\n",
-					"captures": {
-						"1": {
-							"name": "variable.parameter.function.language.python"
-						},
-						"2": {
-							"name": "punctuation.separator.parameters.python"
-						}
-					}
-				},
-				{
-					"include": "#comments"
-				},
-				{
-					"include": "#loose-default"
-				},
-				{
-					"include": "#annotated-parameter"
-				}
-			]
-		},
-		"parameter-special": {
-			"match": "(?x)\n  \\b ((self)|(cls)) \\b \\s*(?:(,)|(?=\\)))\n",
-			"captures": {
-				"1": {
-					"name": "variable.parameter.function.language.python"
-				},
-				"2": {
-					"name": "variable.parameter.function.language.special.self.python"
-				},
-				"3": {
-					"name": "variable.parameter.function.language.special.cls.python"
-				},
-				"4": {
-					"name": "punctuation.separator.parameters.python"
-				}
-			}
-		},
-		"loose-default": {
-			"begin": "(=)",
-			"end": "(,)|(?=\\))",
-			"beginCaptures": {
-				"1": {
-					"name": "keyword.operator.python"
-				}
-			},
-			"endCaptures": {
-				"1": {
-					"name": "punctuation.separator.parameters.python"
-				}
-			},
-			"patterns": [
-				{
-					"include": "#expression"
-				}
-			]
-		},
-		"annotated-parameter": {
-			"begin": "(?x)\n  \\b\n  ([[:alpha:]_]\\w*) \\s* (:)\n",
-			"end": "(,)|(?=\\))",
-			"beginCaptures": {
-				"1": {
-					"name": "variable.parameter.function.language.python"
-				},
-				"2": {
-					"name": "punctuation.separator.annotation.python"
-				}
-			},
-			"endCaptures": {
-				"1": {
-					"name": "punctuation.separator.parameters.python"
-				}
-			},
-			"patterns": [
-				{
-					"include": "#expression"
-				},
-				{
-					"name": "keyword.operator.assignment.python",
-					"match": "=(?!=)"
-				}
-			]
-		},
-		"return-annotation": {
-			"begin": "(->)",
-			"end": "(?=:)",
-			"beginCaptures": {
-				"1": {
-					"name": "punctuation.separator.annotation.result.python"
-				}
-			},
-			"patterns": [
-				{
-					"include": "#expression"
-				}
-			]
-		},
-		"item-access": {
-			"patterns": [
-				{
-					"name": "meta.item-access.python",
-					"begin": "(?x)\n  \\b(?=\n    [[:alpha:]_]\\w* \\s* \\[\n  )\n",
-					"end": "(\\])",
-					"endCaptures": {
-						"1": {
-							"name": "punctuation.definition.arguments.end.python"
-						}
-					},
-					"patterns": [
-						{
-							"include": "#item-name"
-						},
-						{
-							"include": "#item-index"
-						},
-						{
-							"include": "#expression"
-						}
-					]
-				}
-			]
-		},
-		"item-name": {
-			"patterns": [
-				{
-					"include": "#special-variables"
-				},
-				{
-					"include": "#builtin-functions"
-				},
-				{
-					"include": "#special-names"
-				},
-				{
-					"match": "(?x)\n  \\b ([[:alpha:]_]\\w*) \\b\n"
-				}
-			]
-		},
-		"item-index": {
-			"begin": "(\\[)",
-			"end": "(?=\\])",
-			"beginCaptures": {
-				"1": {
-					"name": "punctuation.definition.arguments.begin.python"
-				}
-			},
-			"contentName": "meta.item-access.arguments.python",
-			"patterns": [
-				{
-					"include": "#expression"
-				}
-			]
-		},
-		"decorator": {
-			"name": "meta.function.decorator.python",
-			"begin": "(?x)\n  ^\\s*\n  (@) \\s* (?=[[:alpha:]_]\\w*)\n",
-			"end": "(?x)\n  ( \\) ) (?: (?=\\s*\\#|$) | (.*$) )\n  | (?=\\n|\\#)\n",
-			"beginCaptures": {
-				"1": {
-					"name": "entity.name.function.decorator.python"
-				}
-			},
-			"endCaptures": {
-				"1": {
-					"name": "punctuation.definition.arguments.end.python"
-				},
-				"2": {
-					"name": "invalid.illegal.decorator.python"
-				}
-			},
-			"patterns": [
-				{
-					"include": "#decorator-name"
-				},
-				{
-					"include": "#function-arguments"
-				}
-			]
-		},
-		"decorator-name": {
-			"patterns": [
-				{
-					"include": "#builtin-callables"
-				},
-				{
-					"include": "#illegal-object-name"
-				},
-				{
-					"name": "entity.name.function.decorator.python",
-					"match": "(?x)\n  ([[:alpha:]_]\\w*) | \\.\n"
-				},
-				{
-					"include": "#line-continuation"
-				},
-				{
-					"name": "invalid.illegal.decorator.python",
-					"match": "(?x)\n  \\s* ([^([:alpha:]\\s_\\.#\\\\] .*?) (?=\\#|$)\n",
-					"captures": {
-						"1": {
-							"name": "invalid.illegal.decorator.python"
-						}
-					}
-				}
-			]
-		},
-		"call-wrapper-inheritance": {
-			"comment": "same as a funciton call, but in inheritance context",
-			"name": "meta.function-call.python",
-			"begin": "(?x)\n  \\b(?=\n    ([[:alpha:]_]\\w*) \\s* (\\()\n  )\n",
-			"end": "(\\))",
-			"endCaptures": {
-				"1": {
-					"name": "punctuation.definition.arguments.end.python"
-				}
-			},
-			"patterns": [
-				{
-					"include": "#inheritance-name"
-				},
-				{
-					"include": "#function-arguments"
-				}
-			]
-		},
-		"inheritance-name": {
-			"patterns": [
-				{
-					"include": "#lambda-incomplete"
-				},
-				{
-					"include": "#builtin-possible-callables"
-				},
-				{
-					"include": "#inheritance-identifier"
-				}
-			]
-		},
-		"function-call": {
-			"name": "meta.function-call.python",
-			"begin": "(?x)\n  \\b(?=\n    ([[:alpha:]_]\\w*) \\s* (\\()\n  )\n",
-			"end": "(\\))",
-			"endCaptures": {
-				"1": {
-					"name": "punctuation.definition.arguments.end.python"
-				}
-			},
-			"patterns": [
-				{
-					"include": "#special-variables"
-				},
-				{
-					"include": "#function-name"
-				},
-				{
-					"include": "#function-arguments"
-				}
-			]
-		},
-		"function-name": {
-			"patterns": [
-				{
-					"include": "#builtin-possible-callables"
-				},
-				{
-					"comment": "Some color schemas support meta.function-call.generic scope",
-					"name": "meta.function-call.generic.python",
-					"match": "(?x)\n  \\b ([[:alpha:]_]\\w*) \\b\n"
-				}
-			]
-		},
-		"function-arguments": {
-			"begin": "(?x)\n  (?:\n    (\\()\n    (?:\\s*(\\*\\*|\\*))?\n  )\n",
-			"end": "(?=\\))(?!\\)\\s*\\()",
-			"beginCaptures": {
-				"1": {
-					"name": "punctuation.definition.arguments.begin.python"
-				},
-				"2": {
-					"name": "keyword.operator.unpacking.arguments.python"
-				}
-			},
-			"contentName": "meta.function-call.arguments.python",
-			"patterns": [
-				{
-					"match": "(?x)\n  (?:\n    (,)\n    (?:\\s*(\\*\\*|\\*))?\n  )\n",
-					"captures": {
-						"1": {
-							"name": "punctuation.separator.arguments.python"
-						},
-						"2": {
-							"name": "keyword.operator.unpacking.arguments.python"
-						}
-					}
-				},
-				{
-					"include": "#lambda-incomplete"
-				},
-				{
-					"include": "#illegal-names"
-				},
-				{
-					"match": "\\b([[:alpha:]_]\\w*)\\s*(=)(?!=)",
-					"captures": {
-						"1": {
-							"name": "variable.parameter.function-call.python"
-						},
-						"2": {
-							"name": "keyword.operator.assignment.python"
-						}
-					}
-				},
-				{
-					"name": "keyword.operator.assignment.python",
-					"match": "=(?!=)"
-				},
-				{
-					"include": "#expression"
-				},
-				{
-					"match": "\\s*(\\))\\s*(\\()",
-					"captures": {
-						"1": {
-							"name": "punctuation.definition.arguments.end.python"
-						},
-						"2": {
-							"name": "punctuation.definition.arguments.begin.python"
-						}
-					}
-				}
-			]
-		},
-		"builtin-callables": {
-			"patterns": [
-				{
-					"include": "#illegal-names"
-				},
-				{
-					"include": "#illegal-object-name"
-				},
-				{
-					"include": "#builtin-exceptions"
-				},
-				{
-					"include": "#builtin-functions"
-				},
-				{
-					"include": "#builtin-types"
-				}
-			]
-		},
-		"builtin-possible-callables": {
-			"patterns": [
-				{
-					"include": "#builtin-callables"
-				},
-				{
-					"include": "#magic-names"
-				}
-			]
-		},
-		"builtin-exceptions": {
-			"name": "support.type.exception.python",
-			"match": "(?x) (?<!\\.) \\b(\n  (\n    Arithmetic | Assertion | Attribute | Buffer | BlockingIO\n    | BrokenPipe | ChildProcess\n    | (Connection (Aborted | Refused | Reset)?)\n    | EOF | Environment | FileExists | FileNotFound\n    | FloatingPoint | IO | Import | Indentation | Index | Interrupted\n    | IsADirectory | NotADirectory | Permission | ProcessLookup\n    | Timeout\n    | Key | Lookup | Memory | Name | NotImplemented | OS | Overflow\n    | Reference | Runtime | Recursion | Syntax | System\n    | Tab | Type | UnboundLocal | Unicode(Encode|Decode|Translate)?\n    | Value | Windows | ZeroDivision\n  ) Error\n|\n  ((Pending)?Deprecation | Runtime | Syntax | User | Future | Import\n    | Unicode | Bytes | Resource\n  )? Warning\n|\n  SystemExit | Stop(Async)?Iteration\n  | KeyboardInterrupt\n  | GeneratorExit | (Base)?Exception\n)\\b\n"
-		},
-		"builtin-functions": {
-			"patterns": [
-				{
-					"name": "support.function.builtin.python",
-					"match": "(?x)\n  (?<!\\.) \\b(\n    __import__ | abs | all | any | ascii | bin | callable\n    | chr | compile | copyright | credits | delattr | dir | divmod\n    | enumerate | eval | exec | exit | filter | format | getattr\n    | globals | hasattr | hash | help | hex | id | input\n    | isinstance | issubclass | iter | len | license | locals | map\n    | max | memoryview | min | next | oct | open | ord | pow | print\n    | quit | range | reload | repr | reversed | round\n    | setattr | sorted | sum | vars | zip\n  )\\b\n"
-				},
-				{
-					"name": "variable.legacy.builtin.python",
-					"match": "(?x)\n  (?<!\\.) \\b(\n    file | reduce | intern | raw_input | unicode | cmp | basestring\n    | execfile | long | xrange\n  )\\b\n"
-				}
-			]
-		},
-		"builtin-types": {
-			"name": "support.type.python",
-			"match": "(?x)\n  (?<!\\.) \\b(\n    bool | bytearray | bytes | classmethod | complex | dict\n    | float | frozenset | int | list | object | property\n    | set | slice | staticmethod | str | tuple | type\n\n    (?# Although 'super' is not a type, it's related to types,\n        and is special enough to be highlighted differently from\n        other built-ins)\n    | super\n  )\\b\n"
-		},
-		"magic-function-names": {
-			"comment": "these methods have magic interpretation by python and are generally called\nindirectly through syntactic constructs\n",
-			"match": "(?x)\n  \\b(\n    __(?:\n      abs | add | aenter | aexit | aiter | and | anext | await\n      | bool | call | ceil | cmp | coerce | complex | contains\n      | copy | deepcopy | del | delattr | delete | delitem\n      | delslice | dir | div | divmod | enter | eq | exit | float\n      | floor | floordiv | format | ge | get | getattr\n      | getattribute | getinitargs | getitem | getnewargs\n      | getslice | getstate | gt | hash | hex | iadd | iand | idiv\n      | ifloordiv | ilshift | imod | imul | index | init\n      | instancecheck | int | invert | ior | ipow | irshift | isub\n      | iter | itruediv | ixor | le | len | long | lshift | lt\n      | missing | mod | mul | ne | neg | new | next | nonzero | oct | or\n      | pos | pow | radd | rand | rdiv | rdivmod | reduce\n      | reduce_ex | repr | reversed | rfloordiv | rlshift | rmod\n      | rmul | ror | round | rpow | rrshift | rshift | rsub\n      | rtruediv | rxor | set | setattr | setitem | setslice\n      | setstate | sizeof | str | sub | subclasscheck | truediv\n      | trunc | unicode | xor\n    )__\n  )\\b\n",
-			"captures": {
-				"1": {
-					"name": "support.function.magic.python"
-				}
-			}
-		},
-		"magic-variable-names": {
-			"comment": "magic variables which a class/module may have.",
-			"match": "(?x)\n  \\b(\n    __(?:\n      all | bases | builtins | class | code | debug | defaults | dict\n      | doc | file | func | kwdefaults | members\n      | metaclass | methods | module | mro | name\n      | qualname | self | signature | slots | subclasses\n      | version | weakref | wrapped\n    )__\n  )\\b\n",
-			"captures": {
-				"1": {
-					"name": "support.variable.magic.python"
-				}
-			}
-		},
-		"magic-names": {
-			"patterns": [
-				{
-					"include": "#magic-function-names"
-				},
-				{
-					"include": "#magic-variable-names"
-				}
-			]
-		},
-		"illegal-names": {
-			"name": "keyword.control.flow.python",
-			"match": "(?x)\n  \\b(\n    and | as | assert | async | await | break | class | continue | def\n    | del | elif | else | except | exec | finally | for | from | global\n    | if | import | in | is | (?<=\\.)lambda | lambda(?=\\s*[\\.=])\n    | nonlocal | not | or | pass | raise | return | try | while | with\n    | yield\n  )\\b\n"
-		},
-		"special-variables": {
-			"match": "(?x)\n  \\b (?<!\\.) (?:\n    (self) | (cls)\n  )\\b\n",
-			"captures": {
-				"1": {
-					"name": "variable.language.special.self.python"
-				},
-				"2": {
-					"name": "variable.language.special.cls.python"
-				}
-			}
-		},
-		"ellipsis": {
-			"name": "constant.other.ellipsis.python",
-			"match": "\\.\\.\\."
-		},
-		"backticks": {
-			"name": "invalid.deprecated.backtick.python",
-			"begin": "\\`",
-			"end": "(?:\\`|(?<!\\\\)(\\n))",
-			"patterns": [
-				{
-					"include": "#expression"
-				}
-			]
-		},
-		"illegal-operator": {
-			"patterns": [
-				{
-					"name": "invalid.illegal.operator.python",
-					"match": "&&|\\|\\||--|\\+\\+"
-				},
-				{
-					"name": "invalid.illegal.operator.python",
-					"match": "[?$]"
-				},
-				{
-					"name": "invalid.illegal.operator.python",
-					"comment": "We don't want `!` to flash when we're typing `!=`",
-					"match": "!\\b"
-				}
-			]
-		},
-		"illegal-object-name": {
-			"comment": "It's illegal to name class or function \"True\"",
-			"name": "keyword.illegal.name.python",
-			"match": "\\b(True|False|None)\\b"
-		},
-		"illegal-anno": {
-			"name": "invalid.illegal.annotation.python",
-			"match": "->"
-		},
-		"regexp-base-expression": {
-			"patterns": [
-				{
-					"name": "support.other.match.any.regexp",
-					"match": "\\."
-				},
-				{
-					"name": "support.other.match.begin.regexp",
-					"match": "\\^"
-				},
-				{
-					"name": "support.other.match.end.regexp",
-					"match": "\\$"
-				},
-				{
-					"name": "keyword.operator.quantifier.regexp",
-					"match": "[+*?]\\??"
-				},
-				{
-					"name": "keyword.operator.disjunction.regexp",
-					"match": "\\|"
-				},
-				{
-					"name": "keyword.operator.quantifier.regexp",
-					"match": "(?x)\n  \\{(\n    \\d+ | \\d+,(\\d+)? | ,\\d+\n  )\\}\n"
-				},
-				{
-					"include": "#regexp-escape-sequence"
-				}
-			]
-		},
-		"regexp-backreference-number": {
-			"name": "meta.backreference.regexp",
-			"match": "(\\\\[1-9]\\d?)",
-			"captures": {
-				"1": {
-					"name": "entity.name.tag.backreference.regexp"
-				}
-			}
-		},
-		"regexp-backreference": {
-			"name": "meta.backreference.named.regexp",
-			"match": "(?x)\n  (\\()  (\\?P= \\w+(?:\\s+[[:alnum:]]+)?)  (\\))\n",
-			"captures": {
-				"1": {
-					"name": "punctuation.parenthesis.backreference.named.begin.regexp support.other.parenthesis.regexp"
-				},
-				"2": {
-					"name": "entity.name.tag.named.backreference.regexp"
-				},
-				"3": {
-					"name": "punctuation.parenthesis.backreference.named.end.regexp support.other.parenthesis.regexp"
-				}
-			}
-		},
-		"regexp-flags": {
-			"name": "storage.modifier.flag.regexp",
-			"match": "\\(\\?[aiLmsux]+\\)"
-		},
-		"regexp-escape-special": {
-			"name": "support.other.escape.special.regexp",
-			"match": "\\\\([AbBdDsSwWZ])"
-		},
-		"regexp-escape-character": {
-			"name": "constant.character.escape.regexp",
-			"match": "(?x)\n  \\\\ (\n        x[0-9A-Fa-f]{2}\n        | 0[0-7]{1,2}\n        | [0-7]{3}\n     )\n"
-		},
-		"regexp-escape-unicode": {
-			"name": "constant.character.unicode.regexp",
-			"match": "(?x)\n  \\\\ (\n        u[0-9A-Fa-f]{4}\n        | U[0-9A-Fa-f]{8}\n     )\n"
-		},
-		"regexp-escape-catchall": {
-			"name": "constant.character.escape.regexp",
-			"match": "\\\\(.|\\n)"
-		},
-		"regexp-escape-sequence": {
-			"patterns": [
-				{
-					"include": "#regexp-escape-special"
-				},
-				{
-					"include": "#regexp-escape-character"
-				},
-				{
-					"include": "#regexp-escape-unicode"
-				},
-				{
-					"include": "#regexp-backreference-number"
-				},
-				{
-					"include": "#regexp-escape-catchall"
-				}
-			]
-		},
-		"regexp-charecter-set-escapes": {
-			"patterns": [
-				{
-					"name": "constant.character.escape.regexp",
-					"match": "\\\\[abfnrtv\\\\]"
-				},
-				{
-					"include": "#regexp-escape-special"
-				},
-				{
-					"name": "constant.character.escape.regexp",
-					"match": "\\\\([0-7]{1,3})"
-				},
-				{
-					"include": "#regexp-escape-character"
-				},
-				{
-					"include": "#regexp-escape-unicode"
-				},
-				{
-					"include": "#regexp-escape-catchall"
-				}
-			]
-		},
-		"comments-base": {
-			"name": "comment.line.number-sign.python",
-			"begin": "(\\#)",
-			"beginCaptures": {
-				"1": {
-					"name": "punctuation.definition.comment.python"
-				}
-			},
-			"end": "($)",
-			"patterns": [
-				{
-					"include": "#codetags"
-				}
-			]
-		},
-		"comments-string-single-three": {
-			"name": "comment.line.number-sign.python",
-			"begin": "(\\#)",
-			"beginCaptures": {
-				"1": {
-					"name": "punctuation.definition.comment.python"
-				}
-			},
-			"end": "($|(?='''))",
-			"patterns": [
-				{
-					"include": "#codetags"
-				}
-			]
-		},
-		"comments-string-double-three": {
-			"name": "comment.line.number-sign.python",
-			"begin": "(\\#)",
-			"beginCaptures": {
-				"1": {
-					"name": "punctuation.definition.comment.python"
-				}
-			},
-			"end": "($|(?=\"\"\"))",
-			"patterns": [
-				{
-					"include": "#codetags"
-				}
-			]
-		},
-		"single-one-regexp-expression": {
-			"patterns": [
-				{
-					"include": "#regexp-base-expression"
-				},
-				{
-					"include": "#single-one-regexp-character-set"
-				},
-				{
-					"include": "#single-one-regexp-comments"
-				},
-				{
-					"include": "#regexp-flags"
-				},
-				{
-					"include": "#single-one-regexp-named-group"
-				},
-				{
-					"include": "#regexp-backreference"
-				},
-				{
-					"include": "#single-one-regexp-lookahead"
-				},
-				{
-					"include": "#single-one-regexp-lookahead-negative"
-				},
-				{
-					"include": "#single-one-regexp-lookbehind"
-				},
-				{
-					"include": "#single-one-regexp-lookbehind-negative"
-				},
-				{
-					"include": "#single-one-regexp-conditional"
-				},
-				{
-					"include": "#single-one-regexp-parentheses-non-capturing"
-				},
-				{
-					"include": "#single-one-regexp-parentheses"
-				}
-			]
-		},
-		"single-one-regexp-character-set": {
-			"patterns": [
-				{
-					"match": "(?x)\n  \\[ \\^? \\] (?! .*?\\])\n"
-				},
-				{
-					"name": "meta.character.set.regexp",
-					"begin": "(\\[)(\\^)?(\\])?",
-					"end": "(\\]|(?=\\'))|((?=(?<!\\\\)\\n))",
-					"beginCaptures": {
-						"1": {
-							"name": "constant.other.set.regexp punctuation.character.set.begin.regexp"
-						},
-						"2": {
-							"name": "keyword.operator.negation.regexp"
-						},
-						"3": {
-							"name": "constant.character.set.regexp"
-						}
-					},
-					"endCaptures": {
-						"1": {
-							"name": "constant.other.set.regexp punctuation.character.set.end.regexp"
-						},
-						"2": {
-							"name": "invalid.illegal.newline.python"
-						}
-					},
-					"patterns": [
-						{
-							"include": "#regexp-charecter-set-escapes"
-						},
-						{
-							"name": "constant.character.set.regexp",
-							"match": "[^\\n]"
-						}
-					]
-				}
-			]
-		},
-		"single-one-regexp-named-group": {
-			"name": "meta.named.regexp",
-			"begin": "(?x)\n  (\\()  (\\?P <\\w+(?:\\s+[[:alnum:]]+)?>)\n",
-			"end": "(\\)|(?=\\'))|((?=(?<!\\\\)\\n))",
-			"beginCaptures": {
-				"1": {
-					"name": "punctuation.parenthesis.named.begin.regexp support.other.parenthesis.regexp"
-				},
-				"2": {
-					"name": "entity.name.tag.named.group.regexp"
-				}
-			},
-			"endCaptures": {
-				"1": {
-					"name": "punctuation.parenthesis.named.end.regexp support.other.parenthesis.regexp"
-				},
-				"2": {
-					"name": "invalid.illegal.newline.python"
-				}
-			},
-			"patterns": [
-				{
-					"include": "#single-one-regexp-expression"
-				}
-			]
-		},
-		"single-one-regexp-comments": {
-			"name": "comment.regexp",
-			"begin": "\\(\\?#",
-			"end": "(\\)|(?=\\'))|((?=(?<!\\\\)\\n))",
-			"beginCaptures": {
-				"0": {
-					"name": "punctuation.comment.begin.regexp"
-				}
-			},
-			"endCaptures": {
-				"1": {
-					"name": "punctuation.comment.end.regexp"
-				},
-				"2": {
-					"name": "invalid.illegal.newline.python"
-				}
-			},
-			"patterns": [
-				{
-					"include": "#codetags"
-				}
-			]
-		},
-		"single-one-regexp-lookahead": {
-			"begin": "(\\()\\?=",
-			"end": "(\\)|(?=\\'))|((?=(?<!\\\\)\\n))",
-			"beginCaptures": {
-				"0": {
-					"name": "keyword.operator.lookahead.regexp"
-				},
-				"1": {
-					"name": "punctuation.parenthesis.lookahead.begin.regexp"
-				}
-			},
-			"endCaptures": {
-				"1": {
-					"name": "punctuation.parenthesis.lookahead.end.regexp keyword.operator.lookahead.regexp"
-				},
-				"2": {
-					"name": "invalid.illegal.newline.python"
-				}
-			},
-			"patterns": [
-				{
-					"include": "#single-one-regexp-expression"
-				}
-			]
-		},
-		"single-one-regexp-lookahead-negative": {
-			"begin": "(\\()\\?!",
-			"end": "(\\)|(?=\\'))|((?=(?<!\\\\)\\n))",
-			"beginCaptures": {
-				"0": {
-					"name": "keyword.operator.lookahead.negative.regexp"
-				},
-				"1": {
-					"name": "punctuation.parenthesis.lookahead.begin.regexp"
-				}
-			},
-			"endCaptures": {
-				"1": {
-					"name": "punctuation.parenthesis.lookahead.end.regexp keyword.operator.lookahead.negative.regexp"
-				},
-				"2": {
-					"name": "invalid.illegal.newline.python"
-				}
-			},
-			"patterns": [
-				{
-					"include": "#single-one-regexp-expression"
-				}
-			]
-		},
-		"single-one-regexp-lookbehind": {
-			"begin": "(\\()\\?<=",
-			"end": "(\\)|(?=\\'))|((?=(?<!\\\\)\\n))",
-			"beginCaptures": {
-				"0": {
-					"name": "keyword.operator.lookbehind.regexp"
-				},
-				"1": {
-					"name": "punctuation.parenthesis.lookbehind.begin.regexp"
-				}
-			},
-			"endCaptures": {
-				"1": {
-					"name": "punctuation.parenthesis.lookbehind.end.regexp keyword.operator.lookbehind.regexp"
-				},
-				"2": {
-					"name": "invalid.illegal.newline.python"
-				}
-			},
-			"patterns": [
-				{
-					"include": "#single-one-regexp-expression"
-				}
-			]
-		},
-		"single-one-regexp-lookbehind-negative": {
-			"begin": "(\\()\\?<!",
-			"end": "(\\)|(?=\\'))|((?=(?<!\\\\)\\n))",
-			"beginCaptures": {
-				"0": {
-					"name": "keyword.operator.lookbehind.negative.regexp"
-				},
-				"1": {
-					"name": "punctuation.parenthesis.lookbehind.begin.regexp"
-				}
-			},
-			"endCaptures": {
-				"1": {
-					"name": "punctuation.parenthesis.lookbehind.end.regexp keyword.operator.lookbehind.negative.regexp"
-				},
-				"2": {
-					"name": "invalid.illegal.newline.python"
-				}
-			},
-			"patterns": [
-				{
-					"include": "#single-one-regexp-expression"
-				}
-			]
-		},
-		"single-one-regexp-conditional": {
-			"begin": "(\\()\\?\\((\\w+(?:\\s+[[:alnum:]]+)?|\\d+)\\)",
-			"end": "(\\)|(?=\\'))|((?=(?<!\\\\)\\n))",
-			"beginCaptures": {
-				"0": {
-					"name": "keyword.operator.conditional.regexp"
-				},
-				"1": {
-					"name": "punctuation.parenthesis.conditional.begin.regexp"
-				}
-			},
-			"endCaptures": {
-				"1": {
-					"name": "punctuation.parenthesis.conditional.end.regexp keyword.operator.conditional.negative.regexp"
-				},
-				"2": {
-					"name": "invalid.illegal.newline.python"
-				}
-			},
-			"patterns": [
-				{
-					"include": "#single-one-regexp-expression"
-				}
-			]
-		},
-		"single-one-regexp-parentheses-non-capturing": {
-			"begin": "\\(\\?:",
-			"end": "(\\)|(?=\\'))|((?=(?<!\\\\)\\n))",
-			"beginCaptures": {
-				"0": {
-					"name": "punctuation.parenthesis.non-capturing.begin.regexp support.other.parenthesis.regexp"
-				}
-			},
-			"endCaptures": {
-				"1": {
-					"name": "punctuation.parenthesis.non-capturing.end.regexp support.other.parenthesis.regexp"
-				},
-				"2": {
-					"name": "invalid.illegal.newline.python"
-				}
-			},
-			"patterns": [
-				{
-					"include": "#single-one-regexp-expression"
-				}
-			]
-		},
-		"single-one-regexp-parentheses": {
-			"begin": "\\(",
-			"end": "(\\)|(?=\\'))|((?=(?<!\\\\)\\n))",
-			"beginCaptures": {
-				"0": {
-					"name": "punctuation.parenthesis.begin.regexp support.other.parenthesis.regexp"
-				}
-			},
-			"endCaptures": {
-				"1": {
-					"name": "punctuation.parenthesis.end.regexp support.other.parenthesis.regexp"
-				},
-				"2": {
-					"name": "invalid.illegal.newline.python"
-				}
-			},
-			"patterns": [
-				{
-					"include": "#single-one-regexp-expression"
-				}
-			]
-		},
-		"single-three-regexp-expression": {
-			"patterns": [
-				{
-					"include": "#regexp-base-expression"
-				},
-				{
-					"include": "#single-three-regexp-character-set"
-				},
-				{
-					"include": "#single-three-regexp-comments"
-				},
-				{
-					"include": "#regexp-flags"
-				},
-				{
-					"include": "#single-three-regexp-named-group"
-				},
-				{
-					"include": "#regexp-backreference"
-				},
-				{
-					"include": "#single-three-regexp-lookahead"
-				},
-				{
-					"include": "#single-three-regexp-lookahead-negative"
-				},
-				{
-					"include": "#single-three-regexp-lookbehind"
-				},
-				{
-					"include": "#single-three-regexp-lookbehind-negative"
-				},
-				{
-					"include": "#single-three-regexp-conditional"
-				},
-				{
-					"include": "#single-three-regexp-parentheses-non-capturing"
-				},
-				{
-					"include": "#single-three-regexp-parentheses"
-				},
-				{
-					"include": "#comments-string-single-three"
-				}
-			]
-		},
-		"single-three-regexp-character-set": {
-			"patterns": [
-				{
-					"match": "(?x)\n  \\[ \\^? \\] (?! .*?\\])\n"
-				},
-				{
-					"name": "meta.character.set.regexp",
-					"begin": "(\\[)(\\^)?(\\])?",
-					"end": "(\\]|(?=\\'\\'\\'))",
-					"beginCaptures": {
-						"1": {
-							"name": "constant.other.set.regexp punctuation.character.set.begin.regexp"
-						},
-						"2": {
-							"name": "keyword.operator.negation.regexp"
-						},
-						"3": {
-							"name": "constant.character.set.regexp"
-						}
-					},
-					"endCaptures": {
-						"1": {
-							"name": "constant.other.set.regexp punctuation.character.set.end.regexp"
-						},
-						"2": {
-							"name": "invalid.illegal.newline.python"
-						}
-					},
-					"patterns": [
-						{
-							"include": "#regexp-charecter-set-escapes"
-						},
-						{
-							"name": "constant.character.set.regexp",
-							"match": "[^\\n]"
-						}
-					]
-				}
-			]
-		},
-		"single-three-regexp-named-group": {
-			"name": "meta.named.regexp",
-			"begin": "(?x)\n  (\\()  (\\?P <\\w+(?:\\s+[[:alnum:]]+)?>)\n",
-			"end": "(\\)|(?=\\'\\'\\'))",
-			"beginCaptures": {
-				"1": {
-					"name": "punctuation.parenthesis.named.begin.regexp support.other.parenthesis.regexp"
-				},
-				"2": {
-					"name": "entity.name.tag.named.group.regexp"
-				}
-			},
-			"endCaptures": {
-				"1": {
-					"name": "punctuation.parenthesis.named.end.regexp support.other.parenthesis.regexp"
-				},
-				"2": {
-					"name": "invalid.illegal.newline.python"
-				}
-			},
-			"patterns": [
-				{
-					"include": "#single-three-regexp-expression"
-				},
-				{
-					"include": "#comments-string-single-three"
-				}
-			]
-		},
-		"single-three-regexp-comments": {
-			"name": "comment.regexp",
-			"begin": "\\(\\?#",
-			"end": "(\\)|(?=\\'\\'\\'))",
-			"beginCaptures": {
-				"0": {
-					"name": "punctuation.comment.begin.regexp"
-				}
-			},
-			"endCaptures": {
-				"1": {
-					"name": "punctuation.comment.end.regexp"
-				},
-				"2": {
-					"name": "invalid.illegal.newline.python"
-				}
-			},
-			"patterns": [
-				{
-					"include": "#codetags"
-				}
-			]
-		},
-		"single-three-regexp-lookahead": {
-			"begin": "(\\()\\?=",
-			"end": "(\\)|(?=\\'\\'\\'))",
-			"beginCaptures": {
-				"0": {
-					"name": "keyword.operator.lookahead.regexp"
-				},
-				"1": {
-					"name": "punctuation.parenthesis.lookahead.begin.regexp"
-				}
-			},
-			"endCaptures": {
-				"1": {
-					"name": "punctuation.parenthesis.lookahead.end.regexp keyword.operator.lookahead.regexp"
-				},
-				"2": {
-					"name": "invalid.illegal.newline.python"
-				}
-			},
-			"patterns": [
-				{
-					"include": "#single-three-regexp-expression"
-				},
-				{
-					"include": "#comments-string-single-three"
-				}
-			]
-		},
-		"single-three-regexp-lookahead-negative": {
-			"begin": "(\\()\\?!",
-			"end": "(\\)|(?=\\'\\'\\'))",
-			"beginCaptures": {
-				"0": {
-					"name": "keyword.operator.lookahead.negative.regexp"
-				},
-				"1": {
-					"name": "punctuation.parenthesis.lookahead.begin.regexp"
-				}
-			},
-			"endCaptures": {
-				"1": {
-					"name": "punctuation.parenthesis.lookahead.end.regexp keyword.operator.lookahead.negative.regexp"
-				},
-				"2": {
-					"name": "invalid.illegal.newline.python"
-				}
-			},
-			"patterns": [
-				{
-					"include": "#single-three-regexp-expression"
-				},
-				{
-					"include": "#comments-string-single-three"
-				}
-			]
-		},
-		"single-three-regexp-lookbehind": {
-			"begin": "(\\()\\?<=",
-			"end": "(\\)|(?=\\'\\'\\'))",
-			"beginCaptures": {
-				"0": {
-					"name": "keyword.operator.lookbehind.regexp"
-				},
-				"1": {
-					"name": "punctuation.parenthesis.lookbehind.begin.regexp"
-				}
-			},
-			"endCaptures": {
-				"1": {
-					"name": "punctuation.parenthesis.lookbehind.end.regexp keyword.operator.lookbehind.regexp"
-				},
-				"2": {
-					"name": "invalid.illegal.newline.python"
-				}
-			},
-			"patterns": [
-				{
-					"include": "#single-three-regexp-expression"
-				},
-				{
-					"include": "#comments-string-single-three"
-				}
-			]
-		},
-		"single-three-regexp-lookbehind-negative": {
-			"begin": "(\\()\\?<!",
-			"end": "(\\)|(?=\\'\\'\\'))",
-			"beginCaptures": {
-				"0": {
-					"name": "keyword.operator.lookbehind.negative.regexp"
-				},
-				"1": {
-					"name": "punctuation.parenthesis.lookbehind.begin.regexp"
-				}
-			},
-			"endCaptures": {
-				"1": {
-					"name": "punctuation.parenthesis.lookbehind.end.regexp keyword.operator.lookbehind.negative.regexp"
-				},
-				"2": {
-					"name": "invalid.illegal.newline.python"
-				}
-			},
-			"patterns": [
-				{
-					"include": "#single-three-regexp-expression"
-				},
-				{
-					"include": "#comments-string-single-three"
-				}
-			]
-		},
-		"single-three-regexp-conditional": {
-			"begin": "(\\()\\?\\((\\w+(?:\\s+[[:alnum:]]+)?|\\d+)\\)",
-			"end": "(\\)|(?=\\'\\'\\'))",
-			"beginCaptures": {
-				"0": {
-					"name": "keyword.operator.conditional.regexp"
-				},
-				"1": {
-					"name": "punctuation.parenthesis.conditional.begin.regexp"
-				}
-			},
-			"endCaptures": {
-				"1": {
-					"name": "punctuation.parenthesis.conditional.end.regexp keyword.operator.conditional.negative.regexp"
-				},
-				"2": {
-					"name": "invalid.illegal.newline.python"
-				}
-			},
-			"patterns": [
-				{
-					"include": "#single-three-regexp-expression"
-				},
-				{
-					"include": "#comments-string-single-three"
-				}
-			]
-		},
-		"single-three-regexp-parentheses-non-capturing": {
-			"begin": "\\(\\?:",
-			"end": "(\\)|(?=\\'\\'\\'))",
-			"beginCaptures": {
-				"0": {
-					"name": "punctuation.parenthesis.non-capturing.begin.regexp support.other.parenthesis.regexp"
-				}
-			},
-			"endCaptures": {
-				"1": {
-					"name": "punctuation.parenthesis.non-capturing.end.regexp support.other.parenthesis.regexp"
-				},
-				"2": {
-					"name": "invalid.illegal.newline.python"
-				}
-			},
-			"patterns": [
-				{
-					"include": "#single-three-regexp-expression"
-				},
-				{
-					"include": "#comments-string-single-three"
-				}
-			]
-		},
-		"single-three-regexp-parentheses": {
-			"begin": "\\(",
-			"end": "(\\)|(?=\\'\\'\\'))",
-			"beginCaptures": {
-				"0": {
-					"name": "punctuation.parenthesis.begin.regexp support.other.parenthesis.regexp"
-				}
-			},
-			"endCaptures": {
-				"1": {
-					"name": "punctuation.parenthesis.end.regexp support.other.parenthesis.regexp"
-				},
-				"2": {
-					"name": "invalid.illegal.newline.python"
-				}
-			},
-			"patterns": [
-				{
-					"include": "#single-three-regexp-expression"
-				},
-				{
-					"include": "#comments-string-single-three"
-				}
-			]
-		},
-		"double-one-regexp-expression": {
-			"patterns": [
-				{
-					"include": "#regexp-base-expression"
-				},
-				{
-					"include": "#double-one-regexp-character-set"
-				},
-				{
-					"include": "#double-one-regexp-comments"
-				},
-				{
-					"include": "#regexp-flags"
-				},
-				{
-					"include": "#double-one-regexp-named-group"
-				},
-				{
-					"include": "#regexp-backreference"
-				},
-				{
-					"include": "#double-one-regexp-lookahead"
-				},
-				{
-					"include": "#double-one-regexp-lookahead-negative"
-				},
-				{
-					"include": "#double-one-regexp-lookbehind"
-				},
-				{
-					"include": "#double-one-regexp-lookbehind-negative"
-				},
-				{
-					"include": "#double-one-regexp-conditional"
-				},
-				{
-					"include": "#double-one-regexp-parentheses-non-capturing"
-				},
-				{
-					"include": "#double-one-regexp-parentheses"
-				}
-			]
-		},
-		"double-one-regexp-character-set": {
-			"patterns": [
-				{
-					"match": "(?x)\n  \\[ \\^? \\] (?! .*?\\])\n"
-				},
-				{
-					"name": "meta.character.set.regexp",
-					"begin": "(\\[)(\\^)?(\\])?",
-					"end": "(\\]|(?=\"))|((?=(?<!\\\\)\\n))",
-					"beginCaptures": {
-						"1": {
-							"name": "constant.other.set.regexp punctuation.character.set.begin.regexp"
-						},
-						"2": {
-							"name": "keyword.operator.negation.regexp"
-						},
-						"3": {
-							"name": "constant.character.set.regexp"
-						}
-					},
-					"endCaptures": {
-						"1": {
-							"name": "constant.other.set.regexp punctuation.character.set.end.regexp"
-						},
-						"2": {
-							"name": "invalid.illegal.newline.python"
-						}
-					},
-					"patterns": [
-						{
-							"include": "#regexp-charecter-set-escapes"
-						},
-						{
-							"name": "constant.character.set.regexp",
-							"match": "[^\\n]"
-						}
-					]
-				}
-			]
-		},
-		"double-one-regexp-named-group": {
-			"name": "meta.named.regexp",
-			"begin": "(?x)\n  (\\()  (\\?P <\\w+(?:\\s+[[:alnum:]]+)?>)\n",
-			"end": "(\\)|(?=\"))|((?=(?<!\\\\)\\n))",
-			"beginCaptures": {
-				"1": {
-					"name": "punctuation.parenthesis.named.begin.regexp support.other.parenthesis.regexp"
-				},
-				"2": {
-					"name": "entity.name.tag.named.group.regexp"
-				}
-			},
-			"endCaptures": {
-				"1": {
-					"name": "punctuation.parenthesis.named.end.regexp support.other.parenthesis.regexp"
-				},
-				"2": {
-					"name": "invalid.illegal.newline.python"
-				}
-			},
-			"patterns": [
-				{
-					"include": "#double-one-regexp-expression"
-				}
-			]
-		},
-		"double-one-regexp-comments": {
-			"name": "comment.regexp",
-			"begin": "\\(\\?#",
-			"end": "(\\)|(?=\"))|((?=(?<!\\\\)\\n))",
-			"beginCaptures": {
-				"0": {
-					"name": "punctuation.comment.begin.regexp"
-				}
-			},
-			"endCaptures": {
-				"1": {
-					"name": "punctuation.comment.end.regexp"
-				},
-				"2": {
-					"name": "invalid.illegal.newline.python"
-				}
-			},
-			"patterns": [
-				{
-					"include": "#codetags"
-				}
-			]
-		},
-		"double-one-regexp-lookahead": {
-			"begin": "(\\()\\?=",
-			"end": "(\\)|(?=\"))|((?=(?<!\\\\)\\n))",
-			"beginCaptures": {
-				"0": {
-					"name": "keyword.operator.lookahead.regexp"
-				},
-				"1": {
-					"name": "punctuation.parenthesis.lookahead.begin.regexp"
-				}
-			},
-			"endCaptures": {
-				"1": {
-					"name": "punctuation.parenthesis.lookahead.end.regexp keyword.operator.lookahead.regexp"
-				},
-				"2": {
-					"name": "invalid.illegal.newline.python"
-				}
-			},
-			"patterns": [
-				{
-					"include": "#double-one-regexp-expression"
-				}
-			]
-		},
-		"double-one-regexp-lookahead-negative": {
-			"begin": "(\\()\\?!",
-			"end": "(\\)|(?=\"))|((?=(?<!\\\\)\\n))",
-			"beginCaptures": {
-				"0": {
-					"name": "keyword.operator.lookahead.negative.regexp"
-				},
-				"1": {
-					"name": "punctuation.parenthesis.lookahead.begin.regexp"
-				}
-			},
-			"endCaptures": {
-				"1": {
-					"name": "punctuation.parenthesis.lookahead.end.regexp keyword.operator.lookahead.negative.regexp"
-				},
-				"2": {
-					"name": "invalid.illegal.newline.python"
-				}
-			},
-			"patterns": [
-				{
-					"include": "#double-one-regexp-expression"
-				}
-			]
-		},
-		"double-one-regexp-lookbehind": {
-			"begin": "(\\()\\?<=",
-			"end": "(\\)|(?=\"))|((?=(?<!\\\\)\\n))",
-			"beginCaptures": {
-				"0": {
-					"name": "keyword.operator.lookbehind.regexp"
-				},
-				"1": {
-					"name": "punctuation.parenthesis.lookbehind.begin.regexp"
-				}
-			},
-			"endCaptures": {
-				"1": {
-					"name": "punctuation.parenthesis.lookbehind.end.regexp keyword.operator.lookbehind.regexp"
-				},
-				"2": {
-					"name": "invalid.illegal.newline.python"
-				}
-			},
-			"patterns": [
-				{
-					"include": "#double-one-regexp-expression"
-				}
-			]
-		},
-		"double-one-regexp-lookbehind-negative": {
-			"begin": "(\\()\\?<!",
-			"end": "(\\)|(?=\"))|((?=(?<!\\\\)\\n))",
-			"beginCaptures": {
-				"0": {
-					"name": "keyword.operator.lookbehind.negative.regexp"
-				},
-				"1": {
-					"name": "punctuation.parenthesis.lookbehind.begin.regexp"
-				}
-			},
-			"endCaptures": {
-				"1": {
-					"name": "punctuation.parenthesis.lookbehind.end.regexp keyword.operator.lookbehind.negative.regexp"
-				},
-				"2": {
-					"name": "invalid.illegal.newline.python"
-				}
-			},
-			"patterns": [
-				{
-					"include": "#double-one-regexp-expression"
-				}
-			]
-		},
-		"double-one-regexp-conditional": {
-			"begin": "(\\()\\?\\((\\w+(?:\\s+[[:alnum:]]+)?|\\d+)\\)",
-			"end": "(\\)|(?=\"))|((?=(?<!\\\\)\\n))",
-			"beginCaptures": {
-				"0": {
-					"name": "keyword.operator.conditional.regexp"
-				},
-				"1": {
-					"name": "punctuation.parenthesis.conditional.begin.regexp"
-				}
-			},
-			"endCaptures": {
-				"1": {
-					"name": "punctuation.parenthesis.conditional.end.regexp keyword.operator.conditional.negative.regexp"
-				},
-				"2": {
-					"name": "invalid.illegal.newline.python"
-				}
-			},
-			"patterns": [
-				{
-					"include": "#double-one-regexp-expression"
-				}
-			]
-		},
-		"double-one-regexp-parentheses-non-capturing": {
-			"begin": "\\(\\?:",
-			"end": "(\\)|(?=\"))|((?=(?<!\\\\)\\n))",
-			"beginCaptures": {
-				"0": {
-					"name": "punctuation.parenthesis.non-capturing.begin.regexp support.other.parenthesis.regexp"
-				}
-			},
-			"endCaptures": {
-				"1": {
-					"name": "punctuation.parenthesis.non-capturing.end.regexp support.other.parenthesis.regexp"
-				},
-				"2": {
-					"name": "invalid.illegal.newline.python"
-				}
-			},
-			"patterns": [
-				{
-					"include": "#double-one-regexp-expression"
-				}
-			]
-		},
-		"double-one-regexp-parentheses": {
-			"begin": "\\(",
-			"end": "(\\)|(?=\"))|((?=(?<!\\\\)\\n))",
-			"beginCaptures": {
-				"0": {
-					"name": "punctuation.parenthesis.begin.regexp support.other.parenthesis.regexp"
-				}
-			},
-			"endCaptures": {
-				"1": {
-					"name": "punctuation.parenthesis.end.regexp support.other.parenthesis.regexp"
-				},
-				"2": {
-					"name": "invalid.illegal.newline.python"
-				}
-			},
-			"patterns": [
-				{
-					"include": "#double-one-regexp-expression"
-				}
-			]
-		},
-		"double-three-regexp-expression": {
-			"patterns": [
-				{
-					"include": "#regexp-base-expression"
-				},
-				{
-					"include": "#double-three-regexp-character-set"
-				},
-				{
-					"include": "#double-three-regexp-comments"
-				},
-				{
-					"include": "#regexp-flags"
-				},
-				{
-					"include": "#double-three-regexp-named-group"
-				},
-				{
-					"include": "#regexp-backreference"
-				},
-				{
-					"include": "#double-three-regexp-lookahead"
-				},
-				{
-					"include": "#double-three-regexp-lookahead-negative"
-				},
-				{
-					"include": "#double-three-regexp-lookbehind"
-				},
-				{
-					"include": "#double-three-regexp-lookbehind-negative"
-				},
-				{
-					"include": "#double-three-regexp-conditional"
-				},
-				{
-					"include": "#double-three-regexp-parentheses-non-capturing"
-				},
-				{
-					"include": "#double-three-regexp-parentheses"
-				},
-				{
-					"include": "#comments-string-double-three"
-				}
-			]
-		},
-		"double-three-regexp-character-set": {
-			"patterns": [
-				{
-					"match": "(?x)\n  \\[ \\^? \\] (?! .*?\\])\n"
-				},
-				{
-					"name": "meta.character.set.regexp",
-					"begin": "(\\[)(\\^)?(\\])?",
-					"end": "(\\]|(?=\"\"\"))",
-					"beginCaptures": {
-						"1": {
-							"name": "constant.other.set.regexp punctuation.character.set.begin.regexp"
-						},
-						"2": {
-							"name": "keyword.operator.negation.regexp"
-						},
-						"3": {
-							"name": "constant.character.set.regexp"
-						}
-					},
-					"endCaptures": {
-						"1": {
-							"name": "constant.other.set.regexp punctuation.character.set.end.regexp"
-						},
-						"2": {
-							"name": "invalid.illegal.newline.python"
-						}
-					},
-					"patterns": [
-						{
-							"include": "#regexp-charecter-set-escapes"
-						},
-						{
-							"name": "constant.character.set.regexp",
-							"match": "[^\\n]"
-						}
-					]
-				}
-			]
-		},
-		"double-three-regexp-named-group": {
-			"name": "meta.named.regexp",
-			"begin": "(?x)\n  (\\()  (\\?P <\\w+(?:\\s+[[:alnum:]]+)?>)\n",
-			"end": "(\\)|(?=\"\"\"))",
-			"beginCaptures": {
-				"1": {
-					"name": "punctuation.parenthesis.named.begin.regexp support.other.parenthesis.regexp"
-				},
-				"2": {
-					"name": "entity.name.tag.named.group.regexp"
-				}
-			},
-			"endCaptures": {
-				"1": {
-					"name": "punctuation.parenthesis.named.end.regexp support.other.parenthesis.regexp"
-				},
-				"2": {
-					"name": "invalid.illegal.newline.python"
-				}
-			},
-			"patterns": [
-				{
-					"include": "#double-three-regexp-expression"
-				},
-				{
-					"include": "#comments-string-double-three"
-				}
-			]
-		},
-		"double-three-regexp-comments": {
-			"name": "comment.regexp",
-			"begin": "\\(\\?#",
-			"end": "(\\)|(?=\"\"\"))",
-			"beginCaptures": {
-				"0": {
-					"name": "punctuation.comment.begin.regexp"
-				}
-			},
-			"endCaptures": {
-				"1": {
-					"name": "punctuation.comment.end.regexp"
-				},
-				"2": {
-					"name": "invalid.illegal.newline.python"
-				}
-			},
-			"patterns": [
-				{
-					"include": "#codetags"
-				}
-			]
-		},
-		"double-three-regexp-lookahead": {
-			"begin": "(\\()\\?=",
-			"end": "(\\)|(?=\"\"\"))",
-			"beginCaptures": {
-				"0": {
-					"name": "keyword.operator.lookahead.regexp"
-				},
-				"1": {
-					"name": "punctuation.parenthesis.lookahead.begin.regexp"
-				}
-			},
-			"endCaptures": {
-				"1": {
-					"name": "punctuation.parenthesis.lookahead.end.regexp keyword.operator.lookahead.regexp"
-				},
-				"2": {
-					"name": "invalid.illegal.newline.python"
-				}
-			},
-			"patterns": [
-				{
-					"include": "#double-three-regexp-expression"
-				},
-				{
-					"include": "#comments-string-double-three"
-				}
-			]
-		},
-		"double-three-regexp-lookahead-negative": {
-			"begin": "(\\()\\?!",
-			"end": "(\\)|(?=\"\"\"))",
-			"beginCaptures": {
-				"0": {
-					"name": "keyword.operator.lookahead.negative.regexp"
-				},
-				"1": {
-					"name": "punctuation.parenthesis.lookahead.begin.regexp"
-				}
-			},
-			"endCaptures": {
-				"1": {
-					"name": "punctuation.parenthesis.lookahead.end.regexp keyword.operator.lookahead.negative.regexp"
-				},
-				"2": {
-					"name": "invalid.illegal.newline.python"
-				}
-			},
-			"patterns": [
-				{
-					"include": "#double-three-regexp-expression"
-				},
-				{
-					"include": "#comments-string-double-three"
-				}
-			]
-		},
-		"double-three-regexp-lookbehind": {
-			"begin": "(\\()\\?<=",
-			"end": "(\\)|(?=\"\"\"))",
-			"beginCaptures": {
-				"0": {
-					"name": "keyword.operator.lookbehind.regexp"
-				},
-				"1": {
-					"name": "punctuation.parenthesis.lookbehind.begin.regexp"
-				}
-			},
-			"endCaptures": {
-				"1": {
-					"name": "punctuation.parenthesis.lookbehind.end.regexp keyword.operator.lookbehind.regexp"
-				},
-				"2": {
-					"name": "invalid.illegal.newline.python"
-				}
-			},
-			"patterns": [
-				{
-					"include": "#double-three-regexp-expression"
-				},
-				{
-					"include": "#comments-string-double-three"
-				}
-			]
-		},
-		"double-three-regexp-lookbehind-negative": {
-			"begin": "(\\()\\?<!",
-			"end": "(\\)|(?=\"\"\"))",
-			"beginCaptures": {
-				"0": {
-					"name": "keyword.operator.lookbehind.negative.regexp"
-				},
-				"1": {
-					"name": "punctuation.parenthesis.lookbehind.begin.regexp"
-				}
-			},
-			"endCaptures": {
-				"1": {
-					"name": "punctuation.parenthesis.lookbehind.end.regexp keyword.operator.lookbehind.negative.regexp"
-				},
-				"2": {
-					"name": "invalid.illegal.newline.python"
-				}
-			},
-			"patterns": [
-				{
-					"include": "#double-three-regexp-expression"
-				},
-				{
-					"include": "#comments-string-double-three"
-				}
-			]
-		},
-		"double-three-regexp-conditional": {
-			"begin": "(\\()\\?\\((\\w+(?:\\s+[[:alnum:]]+)?|\\d+)\\)",
-			"end": "(\\)|(?=\"\"\"))",
-			"beginCaptures": {
-				"0": {
-					"name": "keyword.operator.conditional.regexp"
-				},
-				"1": {
-					"name": "punctuation.parenthesis.conditional.begin.regexp"
-				}
-			},
-			"endCaptures": {
-				"1": {
-					"name": "punctuation.parenthesis.conditional.end.regexp keyword.operator.conditional.negative.regexp"
-				},
-				"2": {
-					"name": "invalid.illegal.newline.python"
-				}
-			},
-			"patterns": [
-				{
-					"include": "#double-three-regexp-expression"
-				},
-				{
-					"include": "#comments-string-double-three"
-				}
-			]
-		},
-		"double-three-regexp-parentheses-non-capturing": {
-			"begin": "\\(\\?:",
-			"end": "(\\)|(?=\"\"\"))",
-			"beginCaptures": {
-				"0": {
-					"name": "punctuation.parenthesis.non-capturing.begin.regexp support.other.parenthesis.regexp"
-				}
-			},
-			"endCaptures": {
-				"1": {
-					"name": "punctuation.parenthesis.non-capturing.end.regexp support.other.parenthesis.regexp"
-				},
-				"2": {
-					"name": "invalid.illegal.newline.python"
-				}
-			},
-			"patterns": [
-				{
-					"include": "#double-three-regexp-expression"
-				},
-				{
-					"include": "#comments-string-double-three"
-				}
-			]
-		},
-		"double-three-regexp-parentheses": {
-			"begin": "\\(",
-			"end": "(\\)|(?=\"\"\"))",
-			"beginCaptures": {
-				"0": {
-					"name": "punctuation.parenthesis.begin.regexp support.other.parenthesis.regexp"
-				}
-			},
-			"endCaptures": {
-				"1": {
-					"name": "punctuation.parenthesis.end.regexp support.other.parenthesis.regexp"
-				},
-				"2": {
-					"name": "invalid.illegal.newline.python"
-				}
-			},
-			"patterns": [
-				{
-					"include": "#double-three-regexp-expression"
-				},
-				{
-					"include": "#comments-string-double-three"
-				}
-			]
-		},
-		"string-raw-quoted-single-line": {
-			"name": "string.quoted.raw.single.python",
-			"begin": "\\b(([uU]R)|(R))((['\"]))",
-			"end": "(\\4)|((?<!\\\\)\\n)",
-			"beginCaptures": {
-				"2": {
-					"name": "invalid.deprecated.prefix.python"
-				},
-				"3": {
-					"name": "storage.type.string.python"
-				},
-				"4": {
-					"name": "punctuation.definition.string.begin.python"
-				}
-			},
-			"endCaptures": {
-				"1": {
-					"name": "punctuation.definition.string.end.python"
-				},
-				"2": {
-					"name": "invalid.illegal.newline.python"
-				}
-			},
-			"patterns": [
-				{
-					"include": "#string-single-bad-brace1-formatting-raw"
-				},
-				{
-					"include": "#string-single-bad-brace2-formatting-raw"
-				},
-				{
-					"include": "#string-raw-guts"
-				}
-			]
-		},
-		"string-bin-quoted-single-line": {
-			"name": "string.quoted.binary.single.python",
-			"begin": "(\\b[bB])((['\"]))",
-			"end": "(\\2)|((?<!\\\\)\\n)",
-			"beginCaptures": {
-				"1": {
-					"name": "storage.type.string.python"
-				},
-				"2": {
-					"name": "punctuation.definition.string.begin.python"
-				}
-			},
-			"endCaptures": {
-				"1": {
-					"name": "punctuation.definition.string.end.python"
-				},
-				"2": {
-					"name": "invalid.illegal.newline.python"
-				}
-			},
-			"patterns": [
-				{
-					"include": "#string-entity"
-				}
-			]
-		},
-		"string-raw-bin-quoted-single-line": {
-			"name": "string.quoted.raw.binary.single.python",
-			"begin": "(\\b(?:R[bB]|[bB]R))((['\"]))",
-			"end": "(\\2)|((?<!\\\\)\\n)",
-			"beginCaptures": {
-				"1": {
-					"name": "storage.type.string.python"
-				},
-				"2": {
-					"name": "punctuation.definition.string.begin.python"
-				}
-			},
-			"endCaptures": {
-				"1": {
-					"name": "punctuation.definition.string.end.python"
-				},
-				"2": {
-					"name": "invalid.illegal.newline.python"
-				}
-			},
-			"patterns": [
-				{
-					"include": "#string-raw-bin-guts"
-				}
-			]
-		},
-		"string-quoted-single-line": {
-			"name": "string.quoted.single.python",
-			"begin": "(\\b[rR](?=[uU]))?([uU])?((['\"]))",
-			"end": "(\\3)|((?<!\\\\)\\n)",
-			"beginCaptures": {
-				"1": {
-					"name": "invalid.illegal.prefix.python"
-				},
-				"2": {
-					"name": "storage.type.string.python"
-				},
-				"3": {
-					"name": "punctuation.definition.string.begin.python"
-				}
-			},
-			"endCaptures": {
-				"1": {
-					"name": "punctuation.definition.string.end.python"
-				},
-				"2": {
-					"name": "invalid.illegal.newline.python"
-				}
-			},
-			"patterns": [
-				{
-					"include": "#string-single-bad-brace1-formatting-unicode"
-				},
-				{
-					"include": "#string-single-bad-brace2-formatting-unicode"
-				},
-				{
-					"include": "#string-unicode-guts"
-				}
-			]
-		},
-		"string-single-bad-brace1-formatting-unicode": {
-			"comment": "template using {% ... %}",
-			"begin": "(?x)\n    (?= \\{%\n          ( .*? (?!(['\"])|((?<!\\\\)\\n)) )\n        %\\}\n    )\n",
-			"end": "(?=(['\"])|((?<!\\\\)\\n))",
-			"patterns": [
-				{
-					"include": "#escape-sequence-unicode"
-				},
-				{
-					"include": "#escape-sequence"
-				},
-				{
-					"include": "#string-line-continuation"
-				}
-			]
-		},
-		"string-single-bad-brace1-formatting-raw": {
-			"comment": "template using {% ... %}",
-			"begin": "(?x)\n    (?= \\{%\n          ( .*? (?!(['\"])|((?<!\\\\)\\n)) )\n        %\\}\n    )\n",
-			"end": "(?=(['\"])|((?<!\\\\)\\n))",
-			"patterns": [
-				{
-					"include": "#string-consume-escape"
-				}
-			]
-		},
-		"string-single-bad-brace2-formatting-unicode": {
-			"comment": "odd format or format-like syntax",
-			"begin": "(?x)\n    (?!\\{\\{)\n    (?= \\{ (\n              \\w*? (?!(['\"])|((?<!\\\\)\\n)) [^!:\\.\\[}\\w]\n           )\n        .*?(?!(['\"])|((?<!\\\\)\\n))\n        \\}\n    )\n",
-			"end": "(?=(['\"])|((?<!\\\\)\\n))",
-			"patterns": [
-				{
-					"include": "#escape-sequence-unicode"
-				},
-				{
-					"include": "#string-entity"
-				}
-			]
-		},
-		"string-single-bad-brace2-formatting-raw": {
-			"comment": "odd format or format-like syntax",
-			"begin": "(?x)\n    (?!\\{\\{)\n    (?= \\{ (\n              \\w*? (?!(['\"])|((?<!\\\\)\\n)) [^!:\\.\\[}\\w]\n           )\n        .*?(?!(['\"])|((?<!\\\\)\\n))\n        \\}\n    )\n",
-			"end": "(?=(['\"])|((?<!\\\\)\\n))",
-			"patterns": [
-				{
-					"include": "#string-consume-escape"
-				},
-				{
-					"include": "#string-formatting"
-				}
-			]
-		},
-		"string-raw-quoted-multi-line": {
-			"name": "string.quoted.raw.multi.python",
-			"begin": "\\b(([uU]R)|(R))('''|\"\"\")",
-			"end": "(\\4)",
-			"beginCaptures": {
-				"2": {
-					"name": "invalid.deprecated.prefix.python"
-				},
-				"3": {
-					"name": "storage.type.string.python"
-				},
-				"4": {
-					"name": "punctuation.definition.string.begin.python"
-				}
-			},
-			"endCaptures": {
-				"1": {
-					"name": "punctuation.definition.string.end.python"
-				},
-				"2": {
-					"name": "invalid.illegal.newline.python"
-				}
-			},
-			"patterns": [
-				{
-					"include": "#string-multi-bad-brace1-formatting-raw"
-				},
-				{
-					"include": "#string-multi-bad-brace2-formatting-raw"
-				},
-				{
-					"include": "#string-raw-guts"
-				}
-			]
-		},
-		"string-bin-quoted-multi-line": {
-			"name": "string.quoted.binary.multi.python",
-			"begin": "(\\b[bB])('''|\"\"\")",
-			"end": "(\\2)",
-			"beginCaptures": {
-				"1": {
-					"name": "storage.type.string.python"
-				},
-				"2": {
-					"name": "punctuation.definition.string.begin.python"
-				}
-			},
-			"endCaptures": {
-				"1": {
-					"name": "punctuation.definition.string.end.python"
-				},
-				"2": {
-					"name": "invalid.illegal.newline.python"
-				}
-			},
-			"patterns": [
-				{
-					"include": "#string-entity"
-				}
-			]
-		},
-		"string-raw-bin-quoted-multi-line": {
-			"name": "string.quoted.raw.binary.multi.python",
-			"begin": "(\\b(?:R[bB]|[bB]R))('''|\"\"\")",
-			"end": "(\\2)",
-			"beginCaptures": {
-				"1": {
-					"name": "storage.type.string.python"
-				},
-				"2": {
-					"name": "punctuation.definition.string.begin.python"
-				}
-			},
-			"endCaptures": {
-				"1": {
-					"name": "punctuation.definition.string.end.python"
-				},
-				"2": {
-					"name": "invalid.illegal.newline.python"
-				}
-			},
-			"patterns": [
-				{
-					"include": "#string-raw-bin-guts"
-				}
-			]
-		},
-		"string-quoted-multi-line": {
-			"name": "string.quoted.multi.python",
-			"begin": "(\\b[rR](?=[uU]))?([uU])?('''|\"\"\")",
-			"end": "(\\3)",
-			"beginCaptures": {
-				"1": {
-					"name": "invalid.illegal.prefix.python"
-				},
-				"2": {
-					"name": "storage.type.string.python"
-				},
-				"3": {
-					"name": "punctuation.definition.string.begin.python"
-				}
-			},
-			"endCaptures": {
-				"1": {
-					"name": "punctuation.definition.string.end.python"
-				},
-				"2": {
-					"name": "invalid.illegal.newline.python"
-				}
-			},
-			"patterns": [
-				{
-					"include": "#string-multi-bad-brace1-formatting-unicode"
-				},
-				{
-					"include": "#string-multi-bad-brace2-formatting-unicode"
-				},
-				{
-					"include": "#string-unicode-guts"
-				}
-			]
-		},
-		"string-multi-bad-brace1-formatting-unicode": {
-			"comment": "template using {% ... %}",
-			"begin": "(?x)\n    (?= \\{%\n          ( .*? (?!'''|\"\"\") )\n        %\\}\n    )\n",
-			"end": "(?='''|\"\"\")",
-			"patterns": [
-				{
-					"include": "#escape-sequence-unicode"
-				},
-				{
-					"include": "#escape-sequence"
-				},
-				{
-					"include": "#string-line-continuation"
-				}
-			]
-		},
-		"string-multi-bad-brace1-formatting-raw": {
-			"comment": "template using {% ... %}",
-			"begin": "(?x)\n    (?= \\{%\n          ( .*? (?!'''|\"\"\") )\n        %\\}\n    )\n",
-			"end": "(?='''|\"\"\")",
-			"patterns": [
-				{
-					"include": "#string-consume-escape"
-				}
-			]
-		},
-		"string-multi-bad-brace2-formatting-unicode": {
-			"comment": "odd format or format-like syntax",
-			"begin": "(?x)\n    (?!\\{\\{)\n    (?= \\{ (\n              \\w*? (?!'''|\"\"\") [^!:\\.\\[}\\w]\n           )\n        .*?(?!'''|\"\"\")\n        \\}\n    )\n",
-			"end": "(?='''|\"\"\")",
-			"patterns": [
-				{
-					"include": "#escape-sequence-unicode"
-				},
-				{
-					"include": "#string-entity"
-				}
-			]
-		},
-		"string-multi-bad-brace2-formatting-raw": {
-			"comment": "odd format or format-like syntax",
-			"begin": "(?x)\n    (?!\\{\\{)\n    (?= \\{ (\n              \\w*? (?!'''|\"\"\") [^!:\\.\\[}\\w]\n           )\n        .*?(?!'''|\"\"\")\n        \\}\n    )\n",
-			"end": "(?='''|\"\"\")",
-			"patterns": [
-				{
-					"include": "#string-consume-escape"
-				},
-				{
-					"include": "#string-formatting"
-				}
-			]
-		}
-	},
-	"version": "https://github.com/MagicStack/MagicPython/commit/37b660d0490d69ffd8cb4eabc0dd768e6cdaae7a"
-}
+  "information_for_contributors": [
+    "This file has been converted from https://github.com/MagicStack/MagicPython/blob/master/grammars/MagicPython.tmLanguage",
+    "If you want to provide a fix or improvement, please create a pull request against the original repository.",
+    "Once accepted there, we are happy to receive an update request."
+  ],
+  "version": "https://github.com/MagicStack/MagicPython/commit/b4b2e6eb16fee36aea0788bf0aa1853c25f7d276",
+  "name": "MagicPython",
+  "scopeName": "source.python",
+  "patterns": [
+    {
+      "include": "#statement"
+    },
+    {
+      "include": "#expression"
+    }
+  ],
+  "repository": {
+    "impossible": {
+      "comment": "This is a special rule that should be used where no match is desired. It is not a good idea to match something like '1{0}' because in some cases that can result in infinite loops in token generation. So the rule instead matches and impossible expression to allow a match to fail and move to the next token.",
+      "match": "$.^"
+    },
+    "statement": {
+      "patterns": [
+        {
+          "include": "#import"
+        },
+        {
+          "include": "#class-declaration"
+        },
+        {
+          "include": "#function-declaration"
+        },
+        {
+          "include": "#generator"
+        },
+        {
+          "include": "#statement-keyword"
+        },
+        {
+          "include": "#assignment-operator"
+        },
+        {
+          "include": "#decorator"
+        },
+        {
+          "include": "#docstring-statement"
+        },
+        {
+          "include": "#semicolon"
+        }
+      ]
+    },
+    "semicolon": {
+      "patterns": [
+        {
+          "name": "invalid.deprecated.semicolon.python",
+          "match": "\\;$"
+        }
+      ]
+    },
+    "comments": {
+      "patterns": [
+        {
+          "name": "comment.line.number-sign.python",
+          "contentName": "meta.typehint.comment.python",
+          "begin": "(?x)\n  (?:\n    \\# \\s* (type:)\n    \\s*+ (?# we want `\\s*+` which is possessive quantifier since\n             we do not actually want to backtrack when matching\n             whitespace here)\n    (?! $ | \\#)\n  )\n",
+          "end": "(?:$|(?=\\#))",
+          "beginCaptures": {
+            "0": {
+              "name": "meta.typehint.comment.python"
+            },
+            "1": {
+              "name": "comment.typehint.directive.notation.python"
+            }
+          },
+          "patterns": [
+            {
+              "name": "comment.typehint.ignore.notation.python",
+              "match": "(?x)\n  \\G ignore\n  (?= \\s* (?: $ | \\#))\n"
+            },
+            {
+              "name": "comment.typehint.type.notation.python",
+              "match": "(?x)\n  (?<!\\.)\\b(\n    bool | bytes | float | int | object | str\n    | List | Dict | Iterable | Sequence | Set\n    | FrozenSet | Callable | Union | Tuple\n    | Any | None\n  )\\b\n"
+            },
+            {
+              "name": "comment.typehint.punctuation.notation.python",
+              "match": "([\\[\\]\\(\\),\\.\\=\\*]|(->))"
+            },
+            {
+              "name": "comment.typehint.variable.notation.python",
+              "match": "([[:alpha:]_]\\w*)"
+            }
+          ]
+        },
+        {
+          "include": "#comments-base"
+        }
+      ]
+    },
+    "docstring-statement": {
+      "begin": "^(?=\\s*[rR]?(\\'\\'\\'|\\\"\\\"\\\"|\\'|\\\"))",
+      "comment": "the string either terminates correctly or by the beginning of a new line (this is for single line docstrings that aren't terminated) AND it's not followed by another docstring",
+      "end": "((?<=\\1)|^)(?!\\s*[rR]?(\\'\\'\\'|\\\"\\\"\\\"|\\'|\\\"))",
+      "patterns": [
+        {
+          "include": "#docstring"
+        }
+      ]
+    },
+    "docstring": {
+      "patterns": [
+        {
+          "name": "string.quoted.docstring.multi.python",
+          "begin": "(\\'\\'\\'|\\\"\\\"\\\")",
+          "end": "(\\1)",
+          "beginCaptures": {
+            "1": {
+              "name": "punctuation.definition.string.begin.python"
+            }
+          },
+          "endCaptures": {
+            "1": {
+              "name": "punctuation.definition.string.end.python"
+            }
+          },
+          "patterns": [
+            {
+              "include": "#docstring-prompt"
+            },
+            {
+              "include": "#codetags"
+            },
+            {
+              "include": "#docstring-guts-unicode"
+            }
+          ]
+        },
+        {
+          "name": "string.quoted.docstring.raw.multi.python",
+          "begin": "([rR])(\\'\\'\\'|\\\"\\\"\\\")",
+          "end": "(\\2)",
+          "beginCaptures": {
+            "1": {
+              "name": "storage.type.string.python"
+            },
+            "2": {
+              "name": "punctuation.definition.string.begin.python"
+            }
+          },
+          "endCaptures": {
+            "1": {
+              "name": "punctuation.definition.string.end.python"
+            }
+          },
+          "patterns": [
+            {
+              "include": "#string-consume-escape"
+            },
+            {
+              "include": "#docstring-prompt"
+            },
+            {
+              "include": "#codetags"
+            }
+          ]
+        },
+        {
+          "name": "string.quoted.docstring.single.python",
+          "begin": "(\\'|\\\")",
+          "end": "(\\1)|(\\n)",
+          "beginCaptures": {
+            "1": {
+              "name": "punctuation.definition.string.begin.python"
+            }
+          },
+          "endCaptures": {
+            "1": {
+              "name": "punctuation.definition.string.end.python"
+            },
+            "2": {
+              "name": "invalid.illegal.newline.python"
+            }
+          },
+          "patterns": [
+            {
+              "include": "#codetags"
+            },
+            {
+              "include": "#docstring-guts-unicode"
+            }
+          ]
+        },
+        {
+          "name": "string.quoted.docstring.raw.single.python",
+          "begin": "([rR])(\\'|\\\")",
+          "end": "(\\2)|(\\n)",
+          "beginCaptures": {
+            "1": {
+              "name": "storage.type.string.python"
+            },
+            "2": {
+              "name": "punctuation.definition.string.begin.python"
+            }
+          },
+          "endCaptures": {
+            "1": {
+              "name": "punctuation.definition.string.end.python"
+            },
+            "2": {
+              "name": "invalid.illegal.newline.python"
+            }
+          },
+          "patterns": [
+            {
+              "include": "#string-consume-escape"
+            },
+            {
+              "include": "#codetags"
+            }
+          ]
+        }
+      ]
+    },
+    "docstring-guts-unicode": {
+      "patterns": [
+        {
+          "include": "#escape-sequence-unicode"
+        },
+        {
+          "include": "#escape-sequence"
+        },
+        {
+          "include": "#string-line-continuation"
+        }
+      ]
+    },
+    "docstring-prompt": {
+      "match": "(?x)\n  (?:\n    (?:^|\\G) \\s* (?# '\\G' is necessary for ST)\n    ((?:>>>|\\.\\.\\.) \\s) (?=\\s*\\S)\n  )\n",
+      "captures": {
+        "1": {
+          "name": "keyword.control.flow.python"
+        }
+      }
+    },
+    "statement-keyword": {
+      "patterns": [
+        {
+          "name": "storage.type.function.python",
+          "match": "\\b((async\\s+)?\\s*def)\\b"
+        },
+        {
+          "name": "keyword.control.flow.python",
+          "comment": "if `as` is eventually followed by `:` or line continuation\nit's probably control flow like:\n    with foo as bar, \\\n         Foo as Bar:\n      try:\n        do_stuff()\n      except Exception as e:\n        pass\n",
+          "match": "\\b(?<!\\.)as\\b(?=.*[:\\\\])"
+        },
+        {
+          "name": "keyword.control.import.python",
+          "comment": "other legal use of `as` is in an import",
+          "match": "\\b(?<!\\.)as\\b"
+        },
+        {
+          "name": "keyword.control.flow.python",
+          "match": "(?x)\n  \\b(?<!\\.)(\n    async | continue | del | assert | break | finally | for\n    | from | elif | else | if | except | pass | raise\n    | return | try | while | with\n  )\\b\n"
+        },
+        {
+          "name": "storage.modifier.declaration.python",
+          "match": "(?x)\n  \\b(?<!\\.)(\n    global | nonlocal\n  )\\b\n"
+        },
+        {
+          "name": "storage.type.class.python",
+          "match": "\\b(?<!\\.)(class)\\b"
+        }
+      ]
+    },
+    "expression-bare": {
+      "comment": "valid Python expressions w/o comments and line continuation",
+      "patterns": [
+        {
+          "include": "#backticks"
+        },
+        {
+          "include": "#illegal-anno"
+        },
+        {
+          "include": "#literal"
+        },
+        {
+          "include": "#regexp"
+        },
+        {
+          "include": "#string"
+        },
+        {
+          "include": "#lambda"
+        },
+        {
+          "include": "#generator"
+        },
+        {
+          "include": "#illegal-operator"
+        },
+        {
+          "include": "#operator"
+        },
+        {
+          "include": "#curly-braces"
+        },
+        {
+          "include": "#item-access"
+        },
+        {
+          "include": "#list"
+        },
+        {
+          "include": "#odd-function-call"
+        },
+        {
+          "include": "#round-braces"
+        },
+        {
+          "include": "#function-call"
+        },
+        {
+          "include": "#builtin-functions"
+        },
+        {
+          "include": "#builtin-types"
+        },
+        {
+          "include": "#builtin-exceptions"
+        },
+        {
+          "include": "#magic-names"
+        },
+        {
+          "include": "#special-names"
+        },
+        {
+          "include": "#illegal-names"
+        },
+        {
+          "include": "#special-variables"
+        },
+        {
+          "include": "#ellipsis"
+        },
+        {
+          "include": "#punctuation"
+        },
+        {
+          "include": "#line-continuation"
+        }
+      ]
+    },
+    "expression-base": {
+      "comment": "valid Python expressions with comments and line continuation",
+      "patterns": [
+        {
+          "include": "#comments"
+        },
+        {
+          "include": "#expression-bare"
+        },
+        {
+          "include": "#line-continuation"
+        }
+      ]
+    },
+    "expression": {
+      "comment": "All valid Python expressions",
+      "patterns": [
+        {
+          "include": "#expression-base"
+        },
+        {
+          "include": "#member-access"
+        },
+        {
+          "comment": "Tokenize identifiers to help linters",
+          "match": "(?x) \\b ([[:alpha:]_]\\w*) \\b"
+        }
+      ]
+    },
+    "member-access": {
+      "name": "meta.member.access.python",
+      "begin": "(\\.)\\s*(?!\\.)",
+      "end": "(?x)\n  # stop when you've just read non-whitespace followed by non-word\n  # i.e. when finished reading an identifier or function call\n  (?<=\\S)(?=\\W) |\n  # stop when seeing the start of something that's not a word,\n  # i.e. when seeing a non-identifier\n  (^|(?<=\\s))(?=[^\\\\\\w\\s]) |\n  $\n",
+      "beginCaptures": {
+        "1": {
+          "name": "punctuation.separator.period.python"
+        }
+      },
+      "patterns": [
+        {
+          "include": "#function-call"
+        },
+        {
+          "include": "#member-access-base"
+        },
+        {
+          "include": "#member-access-attribute"
+        }
+      ]
+    },
+    "member-access-base": {
+      "patterns": [
+        {
+          "include": "#magic-names"
+        },
+        {
+          "include": "#illegal-names"
+        },
+        {
+          "include": "#illegal-object-name"
+        },
+        {
+          "include": "#special-names"
+        },
+        {
+          "include": "#line-continuation"
+        },
+        {
+          "include": "#item-access"
+        }
+      ]
+    },
+    "member-access-attribute": {
+      "comment": "Highlight attribute access in otherwise non-specialized cases.",
+      "name": "meta.attribute.python",
+      "match": "(?x)\n  \\b ([[:alpha:]_]\\w*) \\b\n"
+    },
+    "special-names": {
+      "name": "constant.other.caps.python",
+      "match": "(?x)\n  \\b\n    # we want to see \"enough\", meaning 2 or more upper-case\n    # letters in the beginning of the constant\n    #\n    # for more details refer to:\n    #   https://github.com/MagicStack/MagicPython/issues/42\n    (\n      _* [[:upper:]] [_\\d]* [[:upper:]]\n    )\n    [[:upper:]\\d]* (_\\w*)?\n  \\b\n"
+    },
+    "curly-braces": {
+      "begin": "\\{",
+      "end": "\\}",
+      "beginCaptures": {
+        "0": {
+          "name": "punctuation.definition.dict.begin.python"
+        }
+      },
+      "endCaptures": {
+        "0": {
+          "name": "punctuation.definition.dict.end.python"
+        }
+      },
+      "patterns": [
+        {
+          "name": "punctuation.separator.dict.python",
+          "match": ":"
+        },
+        {
+          "include": "#expression"
+        }
+      ]
+    },
+    "list": {
+      "begin": "\\[",
+      "end": "\\]",
+      "beginCaptures": {
+        "0": {
+          "name": "punctuation.definition.list.begin.python"
+        }
+      },
+      "endCaptures": {
+        "0": {
+          "name": "punctuation.definition.list.end.python"
+        }
+      },
+      "patterns": [
+        {
+          "include": "#expression"
+        }
+      ]
+    },
+    "odd-function-call": {
+      "comment": "A bit obscured function call where there may have been an\narbitrary number of other operations to get the function.\nE.g. \"arr[idx](args)\"\n",
+      "begin": "(?x)\n  (?<= \\] | \\) ) \\s*\n  (?=\\()\n",
+      "end": "(\\))",
+      "endCaptures": {
+        "1": {
+          "name": "punctuation.definition.arguments.end.python"
+        }
+      },
+      "patterns": [
+        {
+          "include": "#function-arguments"
+        }
+      ]
+    },
+    "round-braces": {
+      "begin": "\\(",
+      "end": "\\)",
+      "beginCaptures": {
+        "0": {
+          "name": "punctuation.parenthesis.begin.python"
+        }
+      },
+      "endCaptures": {
+        "0": {
+          "name": "punctuation.parenthesis.end.python"
+        }
+      },
+      "patterns": [
+        {
+          "include": "#expression"
+        }
+      ]
+    },
+    "line-continuation": {
+      "patterns": [
+        {
+          "match": "(\\\\)\\s*(\\S.*$\\n?)",
+          "captures": {
+            "1": {
+              "name": "punctuation.separator.continuation.line.python"
+            },
+            "2": {
+              "name": "invalid.illegal.line.continuation.python"
+            }
+          }
+        },
+        {
+          "begin": "(\\\\)\\s*$\\n?",
+          "end": "(?x)\n  (?=^\\s*$)\n  |\n  (?! (\\s* [rR]? (\\'\\'\\'|\\\"\\\"\\\"|\\'|\\\"))\n      |\n      (\\G $)  (?# '\\G' is necessary for ST)\n  )\n",
+          "beginCaptures": {
+            "1": {
+              "name": "punctuation.separator.continuation.line.python"
+            }
+          },
+          "patterns": [
+            {
+              "include": "#regexp"
+            },
+            {
+              "include": "#string"
+            }
+          ]
+        }
+      ]
+    },
+    "assignment-operator": {
+      "name": "keyword.operator.assignment.python",
+      "match": "(?x)\n     <<= | >>= | //= | \\*\\*=\n    | \\+= | -= | /= | @=\n    | \\*= | %= | ~= | \\^= | &= | \\|=\n    | =(?!=)\n"
+    },
+    "operator": {
+      "match": "(?x)\n    \\b(?<!\\.)\n      (?:\n        (and | or | not | in | is)                         (?# 1)\n        |\n        (for | if | else | await | (?:yield(?:\\s+from)?))  (?# 2)\n      )\n    (?!\\s*:)\\b\n\n    | (<< | >> | & | \\| | \\^ | ~)                          (?# 3)\n\n    | (\\*\\* | \\* | \\+ | - | % | // | / | @)                (?# 4)\n\n    | (!= | == | >= | <= | < | >)                          (?# 5)\n",
+      "captures": {
+        "1": {
+          "name": "keyword.operator.logical.python"
+        },
+        "2": {
+          "name": "keyword.control.flow.python"
+        },
+        "3": {
+          "name": "keyword.operator.bitwise.python"
+        },
+        "4": {
+          "name": "keyword.operator.arithmetic.python"
+        },
+        "5": {
+          "name": "keyword.operator.comparison.python"
+        }
+      }
+    },
+    "punctuation": {
+      "patterns": [
+        {
+          "name": "punctuation.separator.colon.python",
+          "match": ":"
+        },
+        {
+          "name": "punctuation.separator.element.python",
+          "match": ","
+        }
+      ]
+    },
+    "literal": {
+      "patterns": [
+        {
+          "name": "constant.language.python",
+          "match": "\\b(True|False|None|NotImplemented|Ellipsis)\\b"
+        },
+        {
+          "include": "#number"
+        }
+      ]
+    },
+    "number": {
+      "name": "constant.numeric.python",
+      "patterns": [
+        {
+          "include": "#number-float"
+        },
+        {
+          "include": "#number-dec"
+        },
+        {
+          "include": "#number-hex"
+        },
+        {
+          "include": "#number-oct"
+        },
+        {
+          "include": "#number-bin"
+        },
+        {
+          "include": "#number-long"
+        },
+        {
+          "name": "invalid.illegal.name.python",
+          "match": "\\b[0-9]+\\w+"
+        }
+      ]
+    },
+    "number-float": {
+      "name": "constant.numeric.float.python",
+      "match": "(?x)\n  (?<! \\w)(?:\n    (?:\n      \\.[0-9](?: _?[0-9] )*\n      |\n      [0-9](?: _?[0-9] )* \\. [0-9](?: _?[0-9] )*\n      |\n      [0-9](?: _?[0-9] )* \\.\n    ) (?: [eE][+-]?[0-9](?: _?[0-9] )* )?\n    |\n    [0-9](?: _?[0-9] )* (?: [eE][+-]?[0-9](?: _?[0-9] )* )\n  )([jJ])?\\b\n",
+      "captures": {
+        "1": {
+          "name": "storage.type.imaginary.number.python"
+        }
+      }
+    },
+    "number-dec": {
+      "name": "constant.numeric.dec.python",
+      "match": "(?x)\n  (?<![\\w\\.])(?:\n      [1-9](?: _?[0-9] )*\n      |\n      0+\n      |\n      [0-9](?: _?[0-9] )* ([jJ])\n      |\n      0 ([0-9]+)(?![eE\\.])\n  )\\b\n",
+      "captures": {
+        "1": {
+          "name": "storage.type.imaginary.number.python"
+        },
+        "2": {
+          "name": "invalid.illegal.dec.python"
+        },
+        "3": {
+          "name": "invalid.illegal.dec.python"
+        }
+      }
+    },
+    "number-hex": {
+      "name": "constant.numeric.hex.python",
+      "match": "(?x)\n  (?<![\\w\\.])\n    (0[xX]) (_?[0-9a-fA-F])+\n  \\b\n",
+      "captures": {
+        "1": {
+          "name": "storage.type.number.python"
+        }
+      }
+    },
+    "number-oct": {
+      "name": "constant.numeric.oct.python",
+      "match": "(?x)\n  (?<![\\w\\.])\n    (0[oO]) (_?[0-7])+\n  \\b\n",
+      "captures": {
+        "1": {
+          "name": "storage.type.number.python"
+        }
+      }
+    },
+    "number-bin": {
+      "name": "constant.numeric.bin.python",
+      "match": "(?x)\n  (?<![\\w\\.])\n    (0[bB]) (_?[01])+\n  \\b\n",
+      "captures": {
+        "1": {
+          "name": "storage.type.number.python"
+        }
+      }
+    },
+    "number-long": {
+      "name": "constant.numeric.bin.python",
+      "comment": "this is to support python2 syntax for long ints",
+      "match": "(?x)\n  (?<![\\w\\.])\n    ([1-9][0-9]* | 0) ([lL])\n  \\b\n",
+      "captures": {
+        "2": {
+          "name": "storage.type.number.python"
+        }
+      }
+    },
+    "regexp": {
+      "patterns": [
+        {
+          "include": "#regexp-single-three-line"
+        },
+        {
+          "include": "#regexp-double-three-line"
+        },
+        {
+          "include": "#regexp-single-one-line"
+        },
+        {
+          "include": "#regexp-double-one-line"
+        },
+        {
+          "include": "#fregexp-single-three-line"
+        },
+        {
+          "include": "#fregexp-double-three-line"
+        },
+        {
+          "include": "#fregexp-single-one-line"
+        },
+        {
+          "include": "#fregexp-double-one-line"
+        }
+      ]
+    },
+    "string": {
+      "patterns": [
+        {
+          "include": "#string-quoted-multi-line"
+        },
+        {
+          "include": "#string-quoted-single-line"
+        },
+        {
+          "include": "#string-bin-quoted-multi-line"
+        },
+        {
+          "include": "#string-bin-quoted-single-line"
+        },
+        {
+          "include": "#string-raw-quoted-multi-line"
+        },
+        {
+          "include": "#string-raw-quoted-single-line"
+        },
+        {
+          "include": "#string-raw-bin-quoted-multi-line"
+        },
+        {
+          "include": "#string-raw-bin-quoted-single-line"
+        },
+        {
+          "include": "#fstring-fnorm-quoted-multi-line"
+        },
+        {
+          "include": "#fstring-fnorm-quoted-single-line"
+        },
+        {
+          "include": "#fstring-normf-quoted-multi-line"
+        },
+        {
+          "include": "#fstring-normf-quoted-single-line"
+        },
+        {
+          "include": "#fstring-raw-quoted-multi-line"
+        },
+        {
+          "include": "#fstring-raw-quoted-single-line"
+        }
+      ]
+    },
+    "string-unicode-guts": {
+      "patterns": [
+        {
+          "include": "#escape-sequence-unicode"
+        },
+        {
+          "include": "#string-entity"
+        },
+        {
+          "include": "#string-brace-formatting"
+        }
+      ]
+    },
+    "string-consume-escape": {
+      "match": "\\\\['\"\\n\\\\]"
+    },
+    "string-raw-guts": {
+      "patterns": [
+        {
+          "include": "#string-consume-escape"
+        },
+        {
+          "include": "#string-formatting"
+        },
+        {
+          "include": "#string-brace-formatting"
+        }
+      ]
+    },
+    "string-raw-bin-guts": {
+      "patterns": [
+        {
+          "include": "#string-consume-escape"
+        },
+        {
+          "include": "#string-formatting"
+        }
+      ]
+    },
+    "string-entity": {
+      "patterns": [
+        {
+          "include": "#escape-sequence"
+        },
+        {
+          "include": "#string-line-continuation"
+        },
+        {
+          "include": "#string-formatting"
+        }
+      ]
+    },
+    "fstring-guts": {
+      "patterns": [
+        {
+          "include": "#escape-sequence-unicode"
+        },
+        {
+          "include": "#escape-sequence"
+        },
+        {
+          "include": "#string-line-continuation"
+        },
+        {
+          "include": "#fstring-formatting"
+        }
+      ]
+    },
+    "fstring-raw-guts": {
+      "patterns": [
+        {
+          "include": "#string-consume-escape"
+        },
+        {
+          "include": "#fstring-formatting"
+        }
+      ]
+    },
+    "fstring-illegal-single-brace": {
+      "comment": "it is illegal to have a multiline brace inside a single-line string",
+      "begin": "(\\{)(?=[^\\n}]*$\\n?)",
+      "end": "(\\})|(?=\\n)",
+      "beginCaptures": {
+        "1": {
+          "name": "constant.character.format.placeholder.other.python"
+        }
+      },
+      "endCaptures": {
+        "1": {
+          "name": "constant.character.format.placeholder.other.python"
+        }
+      },
+      "patterns": [
+        {
+          "include": "#fstring-terminator-single"
+        },
+        {
+          "include": "#f-expression"
+        }
+      ]
+    },
+    "fstring-illegal-multi-brace": {
+      "patterns": [
+        {
+          "include": "#impossible"
+        }
+      ]
+    },
+    "f-expression": {
+      "comment": "All valid Python expressions, except comments and line continuation",
+      "patterns": [
+        {
+          "include": "#expression-bare"
+        },
+        {
+          "include": "#member-access"
+        },
+        {
+          "comment": "Tokenize identifiers to help linters",
+          "match": "(?x) \\b ([[:alpha:]_]\\w*) \\b"
+        }
+      ]
+    },
+    "escape-sequence-unicode": {
+      "patterns": [
+        {
+          "name": "constant.character.escape.python",
+          "match": "(?x)\n  \\\\ (\n        u[0-9A-Fa-f]{4}\n        | U[0-9A-Fa-f]{8}\n        | N\\{[\\w\\s]+?\\}\n     )\n"
+        }
+      ]
+    },
+    "escape-sequence": {
+      "name": "constant.character.escape.python",
+      "match": "(?x)\n  \\\\ (\n        x[0-9A-Fa-f]{2}\n        | [0-7]{1,3}\n        | [\\\\\"'abfnrtv]\n     )\n"
+    },
+    "string-line-continuation": {
+      "name": "constant.language.python",
+      "match": "\\\\$"
+    },
+    "string-formatting": {
+      "name": "meta.format.percent.python",
+      "match": "(?x)\n  (\n    % (\\([\\w\\s]*\\))?\n      [-+#0 ]*\n      (\\d+|\\*)? (\\.(\\d+|\\*))?\n      ([hlL])?\n      [diouxXeEfFgGcrsab%]\n  )\n",
+      "captures": {
+        "1": {
+          "name": "constant.character.format.placeholder.other.python"
+        }
+      }
+    },
+    "string-brace-formatting": {
+      "patterns": [
+        {
+          "name": "meta.format.brace.python",
+          "match": "(?x)\n  (\n    {{ | }}\n    | (?:\n      {\n        \\w* (\\.[[:alpha:]_]\\w* | \\[[^\\]'\"]+\\])*\n        (![rsa])?\n        ( : \\w? [<>=^]? [-+ ]? \\#?\n          \\d* ,? (\\.\\d+)? [bcdeEfFgGnosxX%]? )?\n      })\n  )\n",
+          "captures": {
+            "1": {
+              "name": "constant.character.format.placeholder.other.python"
+            },
+            "3": {
+              "name": "storage.type.format.python"
+            },
+            "4": {
+              "name": "storage.type.format.python"
+            }
+          }
+        },
+        {
+          "name": "meta.format.brace.python",
+          "match": "(?x)\n  (\n    {\n      \\w* (\\.[[:alpha:]_]\\w* | \\[[^\\]'\"]+\\])*\n      (![rsa])?\n      (:)\n        [^'\"{}\\n]* (?:\n          \\{ [^'\"}\\n]*? \\} [^'\"{}\\n]*\n        )*\n    }\n  )\n",
+          "captures": {
+            "1": {
+              "name": "constant.character.format.placeholder.other.python"
+            },
+            "3": {
+              "name": "storage.type.format.python"
+            },
+            "4": {
+              "name": "storage.type.format.python"
+            }
+          }
+        }
+      ]
+    },
+    "fstring-formatting": {
+      "patterns": [
+        {
+          "include": "#fstring-formatting-braces"
+        },
+        {
+          "include": "#fstring-formatting-singe-brace"
+        }
+      ]
+    },
+    "fstring-formatting-singe-brace": {
+      "name": "invalid.illegal.brace.python",
+      "match": "(}(?!}))"
+    },
+    "import": {
+      "comment": "Import statements used to correctly mark `from`, `import`, and `as`\n",
+      "patterns": [
+        {
+          "begin": "\\b(?<!\\.)(from)\\b(?=.+import)",
+          "end": "$|(?=import)",
+          "beginCaptures": {
+            "1": {
+              "name": "keyword.control.import.python"
+            }
+          },
+          "patterns": [
+            {
+              "name": "punctuation.separator.period.python",
+              "match": "\\.+"
+            },
+            {
+              "include": "#expression"
+            }
+          ]
+        },
+        {
+          "begin": "\\b(?<!\\.)(import)\\b",
+          "end": "$",
+          "beginCaptures": {
+            "1": {
+              "name": "keyword.control.import.python"
+            }
+          },
+          "patterns": [
+            {
+              "name": "keyword.control.import.python",
+              "match": "\\b(?<!\\.)as\\b"
+            },
+            {
+              "include": "#expression"
+            }
+          ]
+        }
+      ]
+    },
+    "class-declaration": {
+      "patterns": [
+        {
+          "name": "meta.class.python",
+          "begin": "(?x)\n  \\s*(class)\\s+\n    (?=\n      [[:alpha:]_]\\w* \\s* (:|\\()\n    )\n",
+          "end": "(:)",
+          "beginCaptures": {
+            "1": {
+              "name": "storage.type.class.python"
+            }
+          },
+          "endCaptures": {
+            "1": {
+              "name": "punctuation.section.class.begin.python"
+            }
+          },
+          "patterns": [
+            {
+              "include": "#class-name"
+            },
+            {
+              "include": "#class-inheritance"
+            }
+          ]
+        }
+      ]
+    },
+    "class-name": {
+      "patterns": [
+        {
+          "include": "#illegal-object-name"
+        },
+        {
+          "include": "#builtin-possible-callables"
+        },
+        {
+          "name": "entity.name.type.class.python",
+          "match": "(?x)\n  \\b ([[:alpha:]_]\\w*) \\b\n"
+        }
+      ]
+    },
+    "class-inheritance": {
+      "name": "meta.class.inheritance.python",
+      "begin": "(\\()",
+      "end": "(\\))",
+      "beginCaptures": {
+        "1": {
+          "name": "punctuation.definition.inheritance.begin.python"
+        }
+      },
+      "endCaptures": {
+        "1": {
+          "name": "punctuation.definition.inheritance.end.python"
+        }
+      },
+      "patterns": [
+        {
+          "name": "keyword.operator.unpacking.arguments.python",
+          "match": "(\\*\\*|\\*)"
+        },
+        {
+          "name": "punctuation.separator.inheritance.python",
+          "match": ","
+        },
+        {
+          "name": "keyword.operator.assignment.python",
+          "match": "=(?!=)"
+        },
+        {
+          "name": "support.type.metaclass.python",
+          "match": "\\bmetaclass\\b"
+        },
+        {
+          "include": "#illegal-names"
+        },
+        {
+          "include": "#class-kwarg"
+        },
+        {
+          "include": "#call-wrapper-inheritance"
+        },
+        {
+          "include": "#expression-base"
+        },
+        {
+          "include": "#member-access-class"
+        },
+        {
+          "include": "#inheritance-identifier"
+        }
+      ]
+    },
+    "class-kwarg": {
+      "match": "(?x)\n  \\b ([[:alpha:]_]\\w*) \\s*(=)(?!=)\n",
+      "captures": {
+        "1": {
+          "name": "entity.other.inherited-class.python variable.parameter.class.python"
+        },
+        "2": {
+          "name": "keyword.operator.assignment.python"
+        }
+      }
+    },
+    "inheritance-identifier": {
+      "match": "(?x)\n  \\b ([[:alpha:]_]\\w*) \\b\n",
+      "captures": {
+        "1": {
+          "name": "entity.other.inherited-class.python"
+        }
+      }
+    },
+    "member-access-class": {
+      "name": "meta.member.access.python",
+      "begin": "(\\.)\\s*(?!\\.)",
+      "end": "(?<=\\S)(?=\\W)|$",
+      "beginCaptures": {
+        "1": {
+          "name": "punctuation.separator.period.python"
+        }
+      },
+      "patterns": [
+        {
+          "include": "#call-wrapper-inheritance"
+        },
+        {
+          "include": "#member-access-base"
+        },
+        {
+          "include": "#inheritance-identifier"
+        }
+      ]
+    },
+    "lambda": {
+      "patterns": [
+        {
+          "match": "((?<=\\.)lambda|lambda(?=\\s*[\\.=]))",
+          "captures": {
+            "1": {
+              "name": "keyword.control.flow.python"
+            }
+          }
+        },
+        {
+          "match": "\\b(lambda)\\s*?(?=[,\\n]|$)",
+          "captures": {
+            "1": {
+              "name": "storage.type.function.lambda.python"
+            }
+          }
+        },
+        {
+          "name": "meta.lambda-function.python",
+          "begin": "(?x)\n  \\b (lambda) \\b\n",
+          "end": "(:)|(\\n)",
+          "beginCaptures": {
+            "1": {
+              "name": "storage.type.function.lambda.python"
+            }
+          },
+          "endCaptures": {
+            "1": {
+              "name": "punctuation.section.function.lambda.begin.python"
+            }
+          },
+          "contentName": "meta.function.lambda.parameters.python",
+          "patterns": [
+            {
+              "name": "keyword.operator.unpacking.parameter.python",
+              "match": "(\\*\\*|\\*)"
+            },
+            {
+              "include": "#lambda-nested-incomplete"
+            },
+            {
+              "include": "#illegal-names"
+            },
+            {
+              "match": "([[:alpha:]_]\\w*)\\s*(?:(,)|(?=:|$))",
+              "captures": {
+                "1": {
+                  "name": "variable.parameter.function.language.python"
+                },
+                "2": {
+                  "name": "punctuation.separator.parameters.python"
+                }
+              }
+            },
+            {
+              "include": "#comments"
+            },
+            {
+              "include": "#backticks"
+            },
+            {
+              "include": "#illegal-anno"
+            },
+            {
+              "include": "#lambda-parameter-with-default"
+            },
+            {
+              "include": "#line-continuation"
+            },
+            {
+              "include": "#illegal-operator"
+            }
+          ]
+        }
+      ]
+    },
+    "lambda-incomplete": {
+      "name": "storage.type.function.lambda.python",
+      "match": "\\blambda(?=\\s*[,)])"
+    },
+    "lambda-nested-incomplete": {
+      "name": "storage.type.function.lambda.python",
+      "match": "\\blambda(?=\\s*[:,)])"
+    },
+    "lambda-parameter-with-default": {
+      "begin": "(?x)\n  \\b\n  ([[:alpha:]_]\\w*) \\s* (=)\n",
+      "end": "(,)|(?=:|$)",
+      "beginCaptures": {
+        "1": {
+          "name": "variable.parameter.function.language.python"
+        },
+        "2": {
+          "name": "keyword.operator.python"
+        }
+      },
+      "endCaptures": {
+        "1": {
+          "name": "punctuation.separator.parameters.python"
+        }
+      },
+      "patterns": [
+        {
+          "include": "#expression"
+        }
+      ]
+    },
+    "generator": {
+      "comment": "Match \"for ... in\" construct used in generators and for loops to\ncorrectly identify the \"in\" as a control flow keyword.\n",
+      "begin": "\\bfor\\b",
+      "beginCaptures": {
+        "0": {
+          "name": "keyword.control.flow.python"
+        }
+      },
+      "end": "\\bin\\b",
+      "endCaptures": {
+        "0": {
+          "name": "keyword.control.flow.python"
+        }
+      },
+      "patterns": [
+        {
+          "include": "#expression"
+        }
+      ]
+    },
+    "function-declaration": {
+      "name": "meta.function.python",
+      "begin": "(?x)\n  \\s*\n  (?:\\b(async) \\s+)? \\b(def)\\s+\n    (?=\n      [[:alpha:]_][[:word:]]* \\s* \\(\n    )\n",
+      "end": "(:|(?=[#'\"\\n]))",
+      "beginCaptures": {
+        "1": {
+          "name": "storage.type.function.async.python"
+        },
+        "2": {
+          "name": "storage.type.function.python"
+        }
+      },
+      "endCaptures": {
+        "1": {
+          "name": "punctuation.section.function.begin.python"
+        }
+      },
+      "patterns": [
+        {
+          "include": "#function-def-name"
+        },
+        {
+          "include": "#parameters"
+        },
+        {
+          "include": "#line-continuation"
+        },
+        {
+          "include": "#return-annotation"
+        }
+      ]
+    },
+    "function-def-name": {
+      "patterns": [
+        {
+          "include": "#illegal-object-name"
+        },
+        {
+          "include": "#builtin-possible-callables"
+        },
+        {
+          "name": "entity.name.function.python",
+          "match": "(?x)\n  \\b ([[:alpha:]_]\\w*) \\b\n"
+        }
+      ]
+    },
+    "parameters": {
+      "name": "meta.function.parameters.python",
+      "begin": "(\\()",
+      "end": "(\\))",
+      "beginCaptures": {
+        "1": {
+          "name": "punctuation.definition.parameters.begin.python"
+        }
+      },
+      "endCaptures": {
+        "1": {
+          "name": "punctuation.definition.parameters.end.python"
+        }
+      },
+      "patterns": [
+        {
+          "name": "keyword.operator.unpacking.parameter.python",
+          "match": "(\\*\\*|\\*)"
+        },
+        {
+          "include": "#lambda-incomplete"
+        },
+        {
+          "include": "#illegal-names"
+        },
+        {
+          "include": "#illegal-object-name"
+        },
+        {
+          "include": "#parameter-special"
+        },
+        {
+          "match": "(?x)\n  ([[:alpha:]_]\\w*)\n    \\s* (?: (,) | (?=[)#\\n=]))\n",
+          "captures": {
+            "1": {
+              "name": "variable.parameter.function.language.python"
+            },
+            "2": {
+              "name": "punctuation.separator.parameters.python"
+            }
+          }
+        },
+        {
+          "include": "#comments"
+        },
+        {
+          "include": "#loose-default"
+        },
+        {
+          "include": "#annotated-parameter"
+        }
+      ]
+    },
+    "parameter-special": {
+      "match": "(?x)\n  \\b ((self)|(cls)) \\b \\s*(?:(,)|(?=\\)))\n",
+      "captures": {
+        "1": {
+          "name": "variable.parameter.function.language.python"
+        },
+        "2": {
+          "name": "variable.parameter.function.language.special.self.python"
+        },
+        "3": {
+          "name": "variable.parameter.function.language.special.cls.python"
+        },
+        "4": {
+          "name": "punctuation.separator.parameters.python"
+        }
+      }
+    },
+    "loose-default": {
+      "begin": "(=)",
+      "end": "(,)|(?=\\))",
+      "beginCaptures": {
+        "1": {
+          "name": "keyword.operator.python"
+        }
+      },
+      "endCaptures": {
+        "1": {
+          "name": "punctuation.separator.parameters.python"
+        }
+      },
+      "patterns": [
+        {
+          "include": "#expression"
+        }
+      ]
+    },
+    "annotated-parameter": {
+      "begin": "(?x)\n  \\b\n  ([[:alpha:]_]\\w*) \\s* (:)\n",
+      "end": "(,)|(?=\\))",
+      "beginCaptures": {
+        "1": {
+          "name": "variable.parameter.function.language.python"
+        },
+        "2": {
+          "name": "punctuation.separator.annotation.python"
+        }
+      },
+      "endCaptures": {
+        "1": {
+          "name": "punctuation.separator.parameters.python"
+        }
+      },
+      "patterns": [
+        {
+          "include": "#expression"
+        },
+        {
+          "name": "keyword.operator.assignment.python",
+          "match": "=(?!=)"
+        }
+      ]
+    },
+    "return-annotation": {
+      "begin": "(->)",
+      "end": "(?=:)",
+      "beginCaptures": {
+        "1": {
+          "name": "punctuation.separator.annotation.result.python"
+        }
+      },
+      "patterns": [
+        {
+          "include": "#expression"
+        }
+      ]
+    },
+    "item-access": {
+      "patterns": [
+        {
+          "name": "meta.item-access.python",
+          "begin": "(?x)\n  \\b(?=\n    [[:alpha:]_]\\w* \\s* \\[\n  )\n",
+          "end": "(\\])",
+          "endCaptures": {
+            "1": {
+              "name": "punctuation.definition.arguments.end.python"
+            }
+          },
+          "patterns": [
+            {
+              "include": "#item-name"
+            },
+            {
+              "include": "#item-index"
+            },
+            {
+              "include": "#expression"
+            }
+          ]
+        }
+      ]
+    },
+    "item-name": {
+      "patterns": [
+        {
+          "include": "#special-variables"
+        },
+        {
+          "include": "#builtin-functions"
+        },
+        {
+          "include": "#special-names"
+        },
+        {
+          "name": "meta.indexed-name.python",
+          "match": "(?x)\n  \\b ([[:alpha:]_]\\w*) \\b\n"
+        }
+      ]
+    },
+    "item-index": {
+      "begin": "(\\[)",
+      "end": "(?=\\])",
+      "beginCaptures": {
+        "1": {
+          "name": "punctuation.definition.arguments.begin.python"
+        }
+      },
+      "contentName": "meta.item-access.arguments.python",
+      "patterns": [
+        {
+          "name": "punctuation.separator.slice.python",
+          "match": ":"
+        },
+        {
+          "include": "#expression"
+        }
+      ]
+    },
+    "decorator": {
+      "name": "meta.function.decorator.python",
+      "begin": "(?x)\n  ^\\s*\n  ((@)) \\s* (?=[[:alpha:]_]\\w*)\n",
+      "end": "(?x)\n  ( \\) )\n    # trailing whitespace and comments are legal\n    (?: (.*?) (?=\\s*(?:\\#|$)) )\n  | (?=\\n|\\#)\n",
+      "beginCaptures": {
+        "1": {
+          "name": "entity.name.function.decorator.python"
+        },
+        "2": {
+          "name": "punctuation.definition.decorator.python"
+        }
+      },
+      "endCaptures": {
+        "1": {
+          "name": "punctuation.definition.arguments.end.python"
+        },
+        "2": {
+          "name": "invalid.illegal.decorator.python"
+        }
+      },
+      "patterns": [
+        {
+          "include": "#decorator-name"
+        },
+        {
+          "include": "#function-arguments"
+        }
+      ]
+    },
+    "decorator-name": {
+      "patterns": [
+        {
+          "include": "#builtin-callables"
+        },
+        {
+          "include": "#illegal-object-name"
+        },
+        {
+          "name": "entity.name.function.decorator.python",
+          "match": "(?x)\n  ([[:alpha:]_]\\w*) | (\\.)\n",
+          "captures": {
+            "2": {
+              "name": "punctuation.separator.period.python"
+            }
+          }
+        },
+        {
+          "include": "#line-continuation"
+        },
+        {
+          "name": "invalid.illegal.decorator.python",
+          "match": "(?x)\n  \\s* ([^([:alpha:]\\s_\\.#\\\\] .*?) (?=\\#|$)\n",
+          "captures": {
+            "1": {
+              "name": "invalid.illegal.decorator.python"
+            }
+          }
+        }
+      ]
+    },
+    "call-wrapper-inheritance": {
+      "comment": "same as a function call, but in inheritance context",
+      "name": "meta.function-call.python",
+      "begin": "(?x)\n  \\b(?=\n    ([[:alpha:]_]\\w*) \\s* (\\()\n  )\n",
+      "end": "(\\))",
+      "endCaptures": {
+        "1": {
+          "name": "punctuation.definition.arguments.end.python"
+        }
+      },
+      "patterns": [
+        {
+          "include": "#inheritance-name"
+        },
+        {
+          "include": "#function-arguments"
+        }
+      ]
+    },
+    "inheritance-name": {
+      "patterns": [
+        {
+          "include": "#lambda-incomplete"
+        },
+        {
+          "include": "#builtin-possible-callables"
+        },
+        {
+          "include": "#inheritance-identifier"
+        }
+      ]
+    },
+    "function-call": {
+      "name": "meta.function-call.python",
+      "comment": "Regular function call of the type \"name(args)\"",
+      "begin": "(?x)\n  \\b(?=\n    ([[:alpha:]_]\\w*) \\s* (\\()\n  )\n",
+      "end": "(\\))",
+      "endCaptures": {
+        "1": {
+          "name": "punctuation.definition.arguments.end.python"
+        }
+      },
+      "patterns": [
+        {
+          "include": "#special-variables"
+        },
+        {
+          "include": "#function-name"
+        },
+        {
+          "include": "#function-arguments"
+        }
+      ]
+    },
+    "function-name": {
+      "patterns": [
+        {
+          "include": "#builtin-possible-callables"
+        },
+        {
+          "comment": "Some color schemas support meta.function-call.generic scope",
+          "name": "meta.function-call.generic.python",
+          "match": "(?x)\n  \\b ([[:alpha:]_]\\w*) \\b\n"
+        }
+      ]
+    },
+    "function-arguments": {
+      "begin": "(\\()",
+      "end": "(?=\\))(?!\\)\\s*\\()",
+      "beginCaptures": {
+        "1": {
+          "name": "punctuation.definition.arguments.begin.python"
+        }
+      },
+      "contentName": "meta.function-call.arguments.python",
+      "patterns": [
+        {
+          "name": "punctuation.separator.arguments.python",
+          "match": "(,)"
+        },
+        {
+          "match": "(?x)\n  (?:(?<=[,(])|^) \\s* (\\*{1,2})\n",
+          "captures": {
+            "1": {
+              "name": "keyword.operator.unpacking.arguments.python"
+            }
+          }
+        },
+        {
+          "include": "#lambda-incomplete"
+        },
+        {
+          "include": "#illegal-names"
+        },
+        {
+          "match": "\\b([[:alpha:]_]\\w*)\\s*(=)(?!=)",
+          "captures": {
+            "1": {
+              "name": "variable.parameter.function-call.python"
+            },
+            "2": {
+              "name": "keyword.operator.assignment.python"
+            }
+          }
+        },
+        {
+          "name": "keyword.operator.assignment.python",
+          "match": "=(?!=)"
+        },
+        {
+          "include": "#expression"
+        },
+        {
+          "match": "\\s*(\\))\\s*(\\()",
+          "captures": {
+            "1": {
+              "name": "punctuation.definition.arguments.end.python"
+            },
+            "2": {
+              "name": "punctuation.definition.arguments.begin.python"
+            }
+          }
+        }
+      ]
+    },
+    "builtin-callables": {
+      "patterns": [
+        {
+          "include": "#illegal-names"
+        },
+        {
+          "include": "#illegal-object-name"
+        },
+        {
+          "include": "#builtin-exceptions"
+        },
+        {
+          "include": "#builtin-functions"
+        },
+        {
+          "include": "#builtin-types"
+        }
+      ]
+    },
+    "builtin-possible-callables": {
+      "patterns": [
+        {
+          "include": "#builtin-callables"
+        },
+        {
+          "include": "#magic-names"
+        }
+      ]
+    },
+    "builtin-exceptions": {
+      "name": "support.type.exception.python",
+      "match": "(?x) (?<!\\.) \\b(\n  (\n    Arithmetic | Assertion | Attribute | Buffer | BlockingIO\n    | BrokenPipe | ChildProcess\n    | (Connection (Aborted | Refused | Reset)?)\n    | EOF | Environment | FileExists | FileNotFound\n    | FloatingPoint | IO | Import | Indentation | Index | Interrupted\n    | IsADirectory | NotADirectory | Permission | ProcessLookup\n    | Timeout\n    | Key | Lookup | Memory | Name | NotImplemented | OS | Overflow\n    | Reference | Runtime | Recursion | Syntax | System\n    | Tab | Type | UnboundLocal | Unicode(Encode|Decode|Translate)?\n    | Value | Windows | ZeroDivision | ModuleNotFound\n  ) Error\n|\n  ((Pending)?Deprecation | Runtime | Syntax | User | Future | Import\n    | Unicode | Bytes | Resource\n  )? Warning\n|\n  SystemExit | Stop(Async)?Iteration\n  | KeyboardInterrupt\n  | GeneratorExit | (Base)?Exception\n)\\b\n"
+    },
+    "builtin-functions": {
+      "patterns": [
+        {
+          "name": "support.function.builtin.python",
+          "match": "(?x)\n  (?<!\\.) \\b(\n    __import__ | abs | all | any | ascii | bin | breakpoint | callable\n    | chr | compile | copyright | credits | delattr | dir | divmod\n    | enumerate | eval | exec | exit | filter | format | getattr\n    | globals | hasattr | hash | help | hex | id | input\n    | isinstance | issubclass | iter | len | license | locals | map\n    | max | memoryview | min | next | oct | open | ord | pow | print\n    | quit | range | reload | repr | reversed | round\n    | setattr | sorted | sum | vars | zip\n  )\\b\n"
+        },
+        {
+          "name": "variable.legacy.builtin.python",
+          "match": "(?x)\n  (?<!\\.) \\b(\n    file | reduce | intern | raw_input | unicode | cmp | basestring\n    | execfile | long | xrange\n  )\\b\n"
+        }
+      ]
+    },
+    "builtin-types": {
+      "name": "support.type.python",
+      "match": "(?x)\n  (?<!\\.) \\b(\n    bool | bytearray | bytes | classmethod | complex | dict\n    | float | frozenset | int | list | object | property\n    | set | slice | staticmethod | str | tuple | type\n\n    (?# Although 'super' is not a type, it's related to types,\n        and is special enough to be highlighted differently from\n        other built-ins)\n    | super\n  )\\b\n"
+    },
+    "magic-function-names": {
+      "comment": "these methods have magic interpretation by python and are generally called\nindirectly through syntactic constructs\n",
+      "match": "(?x)\n  \\b(\n    __(?:\n      abs | add | aenter | aexit | aiter | and | anext | await\n      | bool | call | ceil | cmp | coerce | complex | contains\n      | copy | deepcopy | del | delattr | delete | delitem\n      | delslice | dir | div | divmod | enter | eq | exit | float\n      | floor | floordiv | format | ge | get | getattr\n      | getattribute | getinitargs | getitem | getnewargs\n      | getslice | getstate | gt | hash | hex | iadd | iand | idiv\n      | ifloordiv | ilshift | imod | imul | index | init\n      | instancecheck | int | invert | ior | ipow | irshift | isub\n      | iter | itruediv | ixor | le | len | long | lshift | lt\n      | missing | mod | mul | ne | neg | new | next | nonzero | oct | or\n      | pos | pow | radd | rand | rdiv | rdivmod | reduce\n      | reduce_ex | repr | reversed | rfloordiv | rlshift | rmod\n      | rmul | ror | round | rpow | rrshift | rshift | rsub\n      | rtruediv | rxor | set | setattr | setitem | setslice\n      | setstate | sizeof | str | sub | subclasscheck | truediv\n      | trunc | unicode | xor | matmul | rmatmul | imatmul\n      | init_subclass | set_name | fspath | bytes | prepare\n    )__\n  )\\b\n",
+      "captures": {
+        "1": {
+          "name": "support.function.magic.python"
+        }
+      }
+    },
+    "magic-variable-names": {
+      "comment": "magic variables which a class/module may have.",
+      "match": "(?x)\n  \\b(\n    __(?:\n      all | bases | builtins | class | class_getitem | code | debug\n      | defaults | dict | doc | file | func | kwdefaults | members\n      | metaclass | methods | module | mro | mro_entries | name\n      | qualname | post_init | self | signature | slots | subclasses\n      | version | weakref | wrapped | annotations | classcell\n      | spec | path | package | future | traceback\n    )__\n  )\\b\n",
+      "captures": {
+        "1": {
+          "name": "support.variable.magic.python"
+        }
+      }
+    },
+    "magic-names": {
+      "patterns": [
+        {
+          "include": "#magic-function-names"
+        },
+        {
+          "include": "#magic-variable-names"
+        }
+      ]
+    },
+    "illegal-names": {
+      "match": "(?x)\n  \\b(?:\n    (\n      and | assert | async | await | break | class | continue | def\n      | del | elif | else | except | finally | for | from | global\n      | if | in | is | (?<=\\.)lambda | lambda(?=\\s*[\\.=])\n      | nonlocal | not | or | pass | raise | return | try | while | with\n      | yield\n    ) | (\n      as | import\n    )\n  )\\b\n",
+      "captures": {
+        "1": {
+          "name": "keyword.control.flow.python"
+        },
+        "2": {
+          "name": "keyword.control.import.python"
+        }
+      }
+    },
+    "special-variables": {
+      "match": "(?x)\n  \\b (?<!\\.) (?:\n    (self) | (cls)\n  )\\b\n",
+      "captures": {
+        "1": {
+          "name": "variable.language.special.self.python"
+        },
+        "2": {
+          "name": "variable.language.special.cls.python"
+        }
+      }
+    },
+    "ellipsis": {
+      "name": "constant.other.ellipsis.python",
+      "match": "\\.\\.\\."
+    },
+    "backticks": {
+      "name": "invalid.deprecated.backtick.python",
+      "begin": "\\`",
+      "end": "(?:\\`|(?<!\\\\)(\\n))",
+      "patterns": [
+        {
+          "include": "#expression"
+        }
+      ]
+    },
+    "illegal-operator": {
+      "patterns": [
+        {
+          "name": "invalid.illegal.operator.python",
+          "match": "&&|\\|\\||--|\\+\\+"
+        },
+        {
+          "name": "invalid.illegal.operator.python",
+          "match": "[?$]"
+        },
+        {
+          "name": "invalid.illegal.operator.python",
+          "comment": "We don't want `!` to flash when we're typing `!=`",
+          "match": "!\\b"
+        }
+      ]
+    },
+    "illegal-object-name": {
+      "comment": "It's illegal to name class or function \"True\"",
+      "name": "keyword.illegal.name.python",
+      "match": "\\b(True|False|None)\\b"
+    },
+    "illegal-anno": {
+      "name": "invalid.illegal.annotation.python",
+      "match": "->"
+    },
+    "regexp-base-expression": {
+      "patterns": [
+        {
+          "include": "#regexp-quantifier"
+        },
+        {
+          "include": "#regexp-base-common"
+        }
+      ]
+    },
+    "fregexp-base-expression": {
+      "patterns": [
+        {
+          "include": "#fregexp-quantifier"
+        },
+        {
+          "include": "#fstring-formatting-braces"
+        },
+        {
+          "match": "\\{.*?\\}"
+        },
+        {
+          "include": "#regexp-base-common"
+        }
+      ]
+    },
+    "fstring-formatting-braces": {
+      "patterns": [
+        {
+          "comment": "empty braces are illegal",
+          "match": "({)(\\s*?)(})",
+          "captures": {
+            "1": {
+              "name": "constant.character.format.placeholder.other.python"
+            },
+            "2": {
+              "name": "invalid.illegal.brace.python"
+            },
+            "3": {
+              "name": "constant.character.format.placeholder.other.python"
+            }
+          }
+        },
+        {
+          "name": "constant.character.escape.python",
+          "match": "({{|}})"
+        }
+      ]
+    },
+    "regexp-base-common": {
+      "patterns": [
+        {
+          "name": "support.other.match.any.regexp",
+          "match": "\\."
+        },
+        {
+          "name": "support.other.match.begin.regexp",
+          "match": "\\^"
+        },
+        {
+          "name": "support.other.match.end.regexp",
+          "match": "\\$"
+        },
+        {
+          "name": "keyword.operator.quantifier.regexp",
+          "match": "[+*?]\\??"
+        },
+        {
+          "name": "keyword.operator.disjunction.regexp",
+          "match": "\\|"
+        },
+        {
+          "include": "#regexp-escape-sequence"
+        }
+      ]
+    },
+    "regexp-quantifier": {
+      "name": "keyword.operator.quantifier.regexp",
+      "match": "(?x)\n  \\{(\n    \\d+ | \\d+,(\\d+)? | ,\\d+\n  )\\}\n"
+    },
+    "fregexp-quantifier": {
+      "name": "keyword.operator.quantifier.regexp",
+      "match": "(?x)\n  \\{\\{(\n    \\d+ | \\d+,(\\d+)? | ,\\d+\n  )\\}\\}\n"
+    },
+    "regexp-backreference-number": {
+      "name": "meta.backreference.regexp",
+      "match": "(\\\\[1-9]\\d?)",
+      "captures": {
+        "1": {
+          "name": "entity.name.tag.backreference.regexp"
+        }
+      }
+    },
+    "regexp-backreference": {
+      "name": "meta.backreference.named.regexp",
+      "match": "(?x)\n  (\\()  (\\?P= \\w+(?:\\s+[[:alnum:]]+)?)  (\\))\n",
+      "captures": {
+        "1": {
+          "name": "support.other.parenthesis.regexp punctuation.parenthesis.backreference.named.begin.regexp"
+        },
+        "2": {
+          "name": "entity.name.tag.named.backreference.regexp"
+        },
+        "3": {
+          "name": "support.other.parenthesis.regexp punctuation.parenthesis.backreference.named.end.regexp"
+        }
+      }
+    },
+    "regexp-flags": {
+      "name": "storage.modifier.flag.regexp",
+      "match": "\\(\\?[aiLmsux]+\\)"
+    },
+    "regexp-escape-special": {
+      "name": "support.other.escape.special.regexp",
+      "match": "\\\\([AbBdDsSwWZ])"
+    },
+    "regexp-escape-character": {
+      "name": "constant.character.escape.regexp",
+      "match": "(?x)\n  \\\\ (\n        x[0-9A-Fa-f]{2}\n        | 0[0-7]{1,2}\n        | [0-7]{3}\n     )\n"
+    },
+    "regexp-escape-unicode": {
+      "name": "constant.character.unicode.regexp",
+      "match": "(?x)\n  \\\\ (\n        u[0-9A-Fa-f]{4}\n        | U[0-9A-Fa-f]{8}\n     )\n"
+    },
+    "regexp-escape-catchall": {
+      "name": "constant.character.escape.regexp",
+      "match": "\\\\(.|\\n)"
+    },
+    "regexp-escape-sequence": {
+      "patterns": [
+        {
+          "include": "#regexp-escape-special"
+        },
+        {
+          "include": "#regexp-escape-character"
+        },
+        {
+          "include": "#regexp-escape-unicode"
+        },
+        {
+          "include": "#regexp-backreference-number"
+        },
+        {
+          "include": "#regexp-escape-catchall"
+        }
+      ]
+    },
+    "regexp-charecter-set-escapes": {
+      "patterns": [
+        {
+          "name": "constant.character.escape.regexp",
+          "match": "\\\\[abfnrtv\\\\]"
+        },
+        {
+          "include": "#regexp-escape-special"
+        },
+        {
+          "name": "constant.character.escape.regexp",
+          "match": "\\\\([0-7]{1,3})"
+        },
+        {
+          "include": "#regexp-escape-character"
+        },
+        {
+          "include": "#regexp-escape-unicode"
+        },
+        {
+          "include": "#regexp-escape-catchall"
+        }
+      ]
+    },
+    "codetags": {
+      "match": "(?:\\b(NOTE|XXX|HACK|FIXME|BUG|TODO)\\b)",
+      "captures": {
+        "1": {
+          "name": "keyword.codetag.notation.python"
+        }
+      }
+    },
+    "comments-base": {
+      "name": "comment.line.number-sign.python",
+      "begin": "(\\#)",
+      "beginCaptures": {
+        "1": {
+          "name": "punctuation.definition.comment.python"
+        }
+      },
+      "end": "($)",
+      "patterns": [
+        {
+          "include": "#codetags"
+        }
+      ]
+    },
+    "comments-string-single-three": {
+      "name": "comment.line.number-sign.python",
+      "begin": "(\\#)",
+      "beginCaptures": {
+        "1": {
+          "name": "punctuation.definition.comment.python"
+        }
+      },
+      "end": "($|(?='''))",
+      "patterns": [
+        {
+          "include": "#codetags"
+        }
+      ]
+    },
+    "comments-string-double-three": {
+      "name": "comment.line.number-sign.python",
+      "begin": "(\\#)",
+      "beginCaptures": {
+        "1": {
+          "name": "punctuation.definition.comment.python"
+        }
+      },
+      "end": "($|(?=\"\"\"))",
+      "patterns": [
+        {
+          "include": "#codetags"
+        }
+      ]
+    },
+    "single-one-regexp-expression": {
+      "patterns": [
+        {
+          "include": "#regexp-base-expression"
+        },
+        {
+          "include": "#single-one-regexp-character-set"
+        },
+        {
+          "include": "#single-one-regexp-comments"
+        },
+        {
+          "include": "#regexp-flags"
+        },
+        {
+          "include": "#single-one-regexp-named-group"
+        },
+        {
+          "include": "#regexp-backreference"
+        },
+        {
+          "include": "#single-one-regexp-lookahead"
+        },
+        {
+          "include": "#single-one-regexp-lookahead-negative"
+        },
+        {
+          "include": "#single-one-regexp-lookbehind"
+        },
+        {
+          "include": "#single-one-regexp-lookbehind-negative"
+        },
+        {
+          "include": "#single-one-regexp-conditional"
+        },
+        {
+          "include": "#single-one-regexp-parentheses-non-capturing"
+        },
+        {
+          "include": "#single-one-regexp-parentheses"
+        }
+      ]
+    },
+    "single-one-regexp-character-set": {
+      "patterns": [
+        {
+          "match": "(?x)\n  \\[ \\^? \\] (?! .*?\\])\n"
+        },
+        {
+          "name": "meta.character.set.regexp",
+          "begin": "(\\[)(\\^)?(\\])?",
+          "end": "(\\]|(?=\\'))|((?=(?<!\\\\)\\n))",
+          "beginCaptures": {
+            "1": {
+              "name": "punctuation.character.set.begin.regexp constant.other.set.regexp"
+            },
+            "2": {
+              "name": "keyword.operator.negation.regexp"
+            },
+            "3": {
+              "name": "constant.character.set.regexp"
+            }
+          },
+          "endCaptures": {
+            "1": {
+              "name": "punctuation.character.set.end.regexp constant.other.set.regexp"
+            },
+            "2": {
+              "name": "invalid.illegal.newline.python"
+            }
+          },
+          "patterns": [
+            {
+              "include": "#regexp-charecter-set-escapes"
+            },
+            {
+              "name": "constant.character.set.regexp",
+              "match": "[^\\n]"
+            }
+          ]
+        }
+      ]
+    },
+    "single-one-regexp-named-group": {
+      "name": "meta.named.regexp",
+      "begin": "(?x)\n  (\\()  (\\?P <\\w+(?:\\s+[[:alnum:]]+)?>)\n",
+      "end": "(\\)|(?=\\'))|((?=(?<!\\\\)\\n))",
+      "beginCaptures": {
+        "1": {
+          "name": "support.other.parenthesis.regexp punctuation.parenthesis.named.begin.regexp"
+        },
+        "2": {
+          "name": "entity.name.tag.named.group.regexp"
+        }
+      },
+      "endCaptures": {
+        "1": {
+          "name": "support.other.parenthesis.regexp punctuation.parenthesis.named.end.regexp"
+        },
+        "2": {
+          "name": "invalid.illegal.newline.python"
+        }
+      },
+      "patterns": [
+        {
+          "include": "#single-one-regexp-expression"
+        }
+      ]
+    },
+    "single-one-regexp-comments": {
+      "name": "comment.regexp",
+      "begin": "\\(\\?#",
+      "end": "(\\)|(?=\\'))|((?=(?<!\\\\)\\n))",
+      "beginCaptures": {
+        "0": {
+          "name": "punctuation.comment.begin.regexp"
+        }
+      },
+      "endCaptures": {
+        "1": {
+          "name": "punctuation.comment.end.regexp"
+        },
+        "2": {
+          "name": "invalid.illegal.newline.python"
+        }
+      },
+      "patterns": [
+        {
+          "include": "#codetags"
+        }
+      ]
+    },
+    "single-one-regexp-lookahead": {
+      "begin": "(\\()\\?=",
+      "end": "(\\)|(?=\\'))|((?=(?<!\\\\)\\n))",
+      "beginCaptures": {
+        "0": {
+          "name": "keyword.operator.lookahead.regexp"
+        },
+        "1": {
+          "name": "punctuation.parenthesis.lookahead.begin.regexp"
+        }
+      },
+      "endCaptures": {
+        "1": {
+          "name": "keyword.operator.lookahead.regexp punctuation.parenthesis.lookahead.end.regexp"
+        },
+        "2": {
+          "name": "invalid.illegal.newline.python"
+        }
+      },
+      "patterns": [
+        {
+          "include": "#single-one-regexp-expression"
+        }
+      ]
+    },
+    "single-one-regexp-lookahead-negative": {
+      "begin": "(\\()\\?!",
+      "end": "(\\)|(?=\\'))|((?=(?<!\\\\)\\n))",
+      "beginCaptures": {
+        "0": {
+          "name": "keyword.operator.lookahead.negative.regexp"
+        },
+        "1": {
+          "name": "punctuation.parenthesis.lookahead.begin.regexp"
+        }
+      },
+      "endCaptures": {
+        "1": {
+          "name": "keyword.operator.lookahead.negative.regexp punctuation.parenthesis.lookahead.end.regexp"
+        },
+        "2": {
+          "name": "invalid.illegal.newline.python"
+        }
+      },
+      "patterns": [
+        {
+          "include": "#single-one-regexp-expression"
+        }
+      ]
+    },
+    "single-one-regexp-lookbehind": {
+      "begin": "(\\()\\?<=",
+      "end": "(\\)|(?=\\'))|((?=(?<!\\\\)\\n))",
+      "beginCaptures": {
+        "0": {
+          "name": "keyword.operator.lookbehind.regexp"
+        },
+        "1": {
+          "name": "punctuation.parenthesis.lookbehind.begin.regexp"
+        }
+      },
+      "endCaptures": {
+        "1": {
+          "name": "keyword.operator.lookbehind.regexp punctuation.parenthesis.lookbehind.end.regexp"
+        },
+        "2": {
+          "name": "invalid.illegal.newline.python"
+        }
+      },
+      "patterns": [
+        {
+          "include": "#single-one-regexp-expression"
+        }
+      ]
+    },
+    "single-one-regexp-lookbehind-negative": {
+      "begin": "(\\()\\?<!",
+      "end": "(\\)|(?=\\'))|((?=(?<!\\\\)\\n))",
+      "beginCaptures": {
+        "0": {
+          "name": "keyword.operator.lookbehind.negative.regexp"
+        },
+        "1": {
+          "name": "punctuation.parenthesis.lookbehind.begin.regexp"
+        }
+      },
+      "endCaptures": {
+        "1": {
+          "name": "keyword.operator.lookbehind.negative.regexp punctuation.parenthesis.lookbehind.end.regexp"
+        },
+        "2": {
+          "name": "invalid.illegal.newline.python"
+        }
+      },
+      "patterns": [
+        {
+          "include": "#single-one-regexp-expression"
+        }
+      ]
+    },
+    "single-one-regexp-conditional": {
+      "begin": "(\\()\\?\\((\\w+(?:\\s+[[:alnum:]]+)?|\\d+)\\)",
+      "end": "(\\)|(?=\\'))|((?=(?<!\\\\)\\n))",
+      "beginCaptures": {
+        "0": {
+          "name": "keyword.operator.conditional.regexp"
+        },
+        "1": {
+          "name": "punctuation.parenthesis.conditional.begin.regexp"
+        }
+      },
+      "endCaptures": {
+        "1": {
+          "name": "keyword.operator.conditional.negative.regexp punctuation.parenthesis.conditional.end.regexp"
+        },
+        "2": {
+          "name": "invalid.illegal.newline.python"
+        }
+      },
+      "patterns": [
+        {
+          "include": "#single-one-regexp-expression"
+        }
+      ]
+    },
+    "single-one-regexp-parentheses-non-capturing": {
+      "begin": "\\(\\?:",
+      "end": "(\\)|(?=\\'))|((?=(?<!\\\\)\\n))",
+      "beginCaptures": {
+        "0": {
+          "name": "support.other.parenthesis.regexp punctuation.parenthesis.non-capturing.begin.regexp"
+        }
+      },
+      "endCaptures": {
+        "1": {
+          "name": "support.other.parenthesis.regexp punctuation.parenthesis.non-capturing.end.regexp"
+        },
+        "2": {
+          "name": "invalid.illegal.newline.python"
+        }
+      },
+      "patterns": [
+        {
+          "include": "#single-one-regexp-expression"
+        }
+      ]
+    },
+    "single-one-regexp-parentheses": {
+      "begin": "\\(",
+      "end": "(\\)|(?=\\'))|((?=(?<!\\\\)\\n))",
+      "beginCaptures": {
+        "0": {
+          "name": "support.other.parenthesis.regexp punctuation.parenthesis.begin.regexp"
+        }
+      },
+      "endCaptures": {
+        "1": {
+          "name": "support.other.parenthesis.regexp punctuation.parenthesis.end.regexp"
+        },
+        "2": {
+          "name": "invalid.illegal.newline.python"
+        }
+      },
+      "patterns": [
+        {
+          "include": "#single-one-regexp-expression"
+        }
+      ]
+    },
+    "single-three-regexp-expression": {
+      "patterns": [
+        {
+          "include": "#regexp-base-expression"
+        },
+        {
+          "include": "#single-three-regexp-character-set"
+        },
+        {
+          "include": "#single-three-regexp-comments"
+        },
+        {
+          "include": "#regexp-flags"
+        },
+        {
+          "include": "#single-three-regexp-named-group"
+        },
+        {
+          "include": "#regexp-backreference"
+        },
+        {
+          "include": "#single-three-regexp-lookahead"
+        },
+        {
+          "include": "#single-three-regexp-lookahead-negative"
+        },
+        {
+          "include": "#single-three-regexp-lookbehind"
+        },
+        {
+          "include": "#single-three-regexp-lookbehind-negative"
+        },
+        {
+          "include": "#single-three-regexp-conditional"
+        },
+        {
+          "include": "#single-three-regexp-parentheses-non-capturing"
+        },
+        {
+          "include": "#single-three-regexp-parentheses"
+        },
+        {
+          "include": "#comments-string-single-three"
+        }
+      ]
+    },
+    "single-three-regexp-character-set": {
+      "patterns": [
+        {
+          "match": "(?x)\n  \\[ \\^? \\] (?! .*?\\])\n"
+        },
+        {
+          "name": "meta.character.set.regexp",
+          "begin": "(\\[)(\\^)?(\\])?",
+          "end": "(\\]|(?=\\'\\'\\'))",
+          "beginCaptures": {
+            "1": {
+              "name": "punctuation.character.set.begin.regexp constant.other.set.regexp"
+            },
+            "2": {
+              "name": "keyword.operator.negation.regexp"
+            },
+            "3": {
+              "name": "constant.character.set.regexp"
+            }
+          },
+          "endCaptures": {
+            "1": {
+              "name": "punctuation.character.set.end.regexp constant.other.set.regexp"
+            },
+            "2": {
+              "name": "invalid.illegal.newline.python"
+            }
+          },
+          "patterns": [
+            {
+              "include": "#regexp-charecter-set-escapes"
+            },
+            {
+              "name": "constant.character.set.regexp",
+              "match": "[^\\n]"
+            }
+          ]
+        }
+      ]
+    },
+    "single-three-regexp-named-group": {
+      "name": "meta.named.regexp",
+      "begin": "(?x)\n  (\\()  (\\?P <\\w+(?:\\s+[[:alnum:]]+)?>)\n",
+      "end": "(\\)|(?=\\'\\'\\'))",
+      "beginCaptures": {
+        "1": {
+          "name": "support.other.parenthesis.regexp punctuation.parenthesis.named.begin.regexp"
+        },
+        "2": {
+          "name": "entity.name.tag.named.group.regexp"
+        }
+      },
+      "endCaptures": {
+        "1": {
+          "name": "support.other.parenthesis.regexp punctuation.parenthesis.named.end.regexp"
+        },
+        "2": {
+          "name": "invalid.illegal.newline.python"
+        }
+      },
+      "patterns": [
+        {
+          "include": "#single-three-regexp-expression"
+        },
+        {
+          "include": "#comments-string-single-three"
+        }
+      ]
+    },
+    "single-three-regexp-comments": {
+      "name": "comment.regexp",
+      "begin": "\\(\\?#",
+      "end": "(\\)|(?=\\'\\'\\'))",
+      "beginCaptures": {
+        "0": {
+          "name": "punctuation.comment.begin.regexp"
+        }
+      },
+      "endCaptures": {
+        "1": {
+          "name": "punctuation.comment.end.regexp"
+        },
+        "2": {
+          "name": "invalid.illegal.newline.python"
+        }
+      },
+      "patterns": [
+        {
+          "include": "#codetags"
+        }
+      ]
+    },
+    "single-three-regexp-lookahead": {
+      "begin": "(\\()\\?=",
+      "end": "(\\)|(?=\\'\\'\\'))",
+      "beginCaptures": {
+        "0": {
+          "name": "keyword.operator.lookahead.regexp"
+        },
+        "1": {
+          "name": "punctuation.parenthesis.lookahead.begin.regexp"
+        }
+      },
+      "endCaptures": {
+        "1": {
+          "name": "keyword.operator.lookahead.regexp punctuation.parenthesis.lookahead.end.regexp"
+        },
+        "2": {
+          "name": "invalid.illegal.newline.python"
+        }
+      },
+      "patterns": [
+        {
+          "include": "#single-three-regexp-expression"
+        },
+        {
+          "include": "#comments-string-single-three"
+        }
+      ]
+    },
+    "single-three-regexp-lookahead-negative": {
+      "begin": "(\\()\\?!",
+      "end": "(\\)|(?=\\'\\'\\'))",
+      "beginCaptures": {
+        "0": {
+          "name": "keyword.operator.lookahead.negative.regexp"
+        },
+        "1": {
+          "name": "punctuation.parenthesis.lookahead.begin.regexp"
+        }
+      },
+      "endCaptures": {
+        "1": {
+          "name": "keyword.operator.lookahead.negative.regexp punctuation.parenthesis.lookahead.end.regexp"
+        },
+        "2": {
+          "name": "invalid.illegal.newline.python"
+        }
+      },
+      "patterns": [
+        {
+          "include": "#single-three-regexp-expression"
+        },
+        {
+          "include": "#comments-string-single-three"
+        }
+      ]
+    },
+    "single-three-regexp-lookbehind": {
+      "begin": "(\\()\\?<=",
+      "end": "(\\)|(?=\\'\\'\\'))",
+      "beginCaptures": {
+        "0": {
+          "name": "keyword.operator.lookbehind.regexp"
+        },
+        "1": {
+          "name": "punctuation.parenthesis.lookbehind.begin.regexp"
+        }
+      },
+      "endCaptures": {
+        "1": {
+          "name": "keyword.operator.lookbehind.regexp punctuation.parenthesis.lookbehind.end.regexp"
+        },
+        "2": {
+          "name": "invalid.illegal.newline.python"
+        }
+      },
+      "patterns": [
+        {
+          "include": "#single-three-regexp-expression"
+        },
+        {
+          "include": "#comments-string-single-three"
+        }
+      ]
+    },
+    "single-three-regexp-lookbehind-negative": {
+      "begin": "(\\()\\?<!",
+      "end": "(\\)|(?=\\'\\'\\'))",
+      "beginCaptures": {
+        "0": {
+          "name": "keyword.operator.lookbehind.negative.regexp"
+        },
+        "1": {
+          "name": "punctuation.parenthesis.lookbehind.begin.regexp"
+        }
+      },
+      "endCaptures": {
+        "1": {
+          "name": "keyword.operator.lookbehind.negative.regexp punctuation.parenthesis.lookbehind.end.regexp"
+        },
+        "2": {
+          "name": "invalid.illegal.newline.python"
+        }
+      },
+      "patterns": [
+        {
+          "include": "#single-three-regexp-expression"
+        },
+        {
+          "include": "#comments-string-single-three"
+        }
+      ]
+    },
+    "single-three-regexp-conditional": {
+      "begin": "(\\()\\?\\((\\w+(?:\\s+[[:alnum:]]+)?|\\d+)\\)",
+      "end": "(\\)|(?=\\'\\'\\'))",
+      "beginCaptures": {
+        "0": {
+          "name": "keyword.operator.conditional.regexp"
+        },
+        "1": {
+          "name": "punctuation.parenthesis.conditional.begin.regexp"
+        }
+      },
+      "endCaptures": {
+        "1": {
+          "name": "keyword.operator.conditional.negative.regexp punctuation.parenthesis.conditional.end.regexp"
+        },
+        "2": {
+          "name": "invalid.illegal.newline.python"
+        }
+      },
+      "patterns": [
+        {
+          "include": "#single-three-regexp-expression"
+        },
+        {
+          "include": "#comments-string-single-three"
+        }
+      ]
+    },
+    "single-three-regexp-parentheses-non-capturing": {
+      "begin": "\\(\\?:",
+      "end": "(\\)|(?=\\'\\'\\'))",
+      "beginCaptures": {
+        "0": {
+          "name": "support.other.parenthesis.regexp punctuation.parenthesis.non-capturing.begin.regexp"
+        }
+      },
+      "endCaptures": {
+        "1": {
+          "name": "support.other.parenthesis.regexp punctuation.parenthesis.non-capturing.end.regexp"
+        },
+        "2": {
+          "name": "invalid.illegal.newline.python"
+        }
+      },
+      "patterns": [
+        {
+          "include": "#single-three-regexp-expression"
+        },
+        {
+          "include": "#comments-string-single-three"
+        }
+      ]
+    },
+    "single-three-regexp-parentheses": {
+      "begin": "\\(",
+      "end": "(\\)|(?=\\'\\'\\'))",
+      "beginCaptures": {
+        "0": {
+          "name": "support.other.parenthesis.regexp punctuation.parenthesis.begin.regexp"
+        }
+      },
+      "endCaptures": {
+        "1": {
+          "name": "support.other.parenthesis.regexp punctuation.parenthesis.end.regexp"
+        },
+        "2": {
+          "name": "invalid.illegal.newline.python"
+        }
+      },
+      "patterns": [
+        {
+          "include": "#single-three-regexp-expression"
+        },
+        {
+          "include": "#comments-string-single-three"
+        }
+      ]
+    },
+    "double-one-regexp-expression": {
+      "patterns": [
+        {
+          "include": "#regexp-base-expression"
+        },
+        {
+          "include": "#double-one-regexp-character-set"
+        },
+        {
+          "include": "#double-one-regexp-comments"
+        },
+        {
+          "include": "#regexp-flags"
+        },
+        {
+          "include": "#double-one-regexp-named-group"
+        },
+        {
+          "include": "#regexp-backreference"
+        },
+        {
+          "include": "#double-one-regexp-lookahead"
+        },
+        {
+          "include": "#double-one-regexp-lookahead-negative"
+        },
+        {
+          "include": "#double-one-regexp-lookbehind"
+        },
+        {
+          "include": "#double-one-regexp-lookbehind-negative"
+        },
+        {
+          "include": "#double-one-regexp-conditional"
+        },
+        {
+          "include": "#double-one-regexp-parentheses-non-capturing"
+        },
+        {
+          "include": "#double-one-regexp-parentheses"
+        }
+      ]
+    },
+    "double-one-regexp-character-set": {
+      "patterns": [
+        {
+          "match": "(?x)\n  \\[ \\^? \\] (?! .*?\\])\n"
+        },
+        {
+          "name": "meta.character.set.regexp",
+          "begin": "(\\[)(\\^)?(\\])?",
+          "end": "(\\]|(?=\"))|((?=(?<!\\\\)\\n))",
+          "beginCaptures": {
+            "1": {
+              "name": "punctuation.character.set.begin.regexp constant.other.set.regexp"
+            },
+            "2": {
+              "name": "keyword.operator.negation.regexp"
+            },
+            "3": {
+              "name": "constant.character.set.regexp"
+            }
+          },
+          "endCaptures": {
+            "1": {
+              "name": "punctuation.character.set.end.regexp constant.other.set.regexp"
+            },
+            "2": {
+              "name": "invalid.illegal.newline.python"
+            }
+          },
+          "patterns": [
+            {
+              "include": "#regexp-charecter-set-escapes"
+            },
+            {
+              "name": "constant.character.set.regexp",
+              "match": "[^\\n]"
+            }
+          ]
+        }
+      ]
+    },
+    "double-one-regexp-named-group": {
+      "name": "meta.named.regexp",
+      "begin": "(?x)\n  (\\()  (\\?P <\\w+(?:\\s+[[:alnum:]]+)?>)\n",
+      "end": "(\\)|(?=\"))|((?=(?<!\\\\)\\n))",
+      "beginCaptures": {
+        "1": {
+          "name": "support.other.parenthesis.regexp punctuation.parenthesis.named.begin.regexp"
+        },
+        "2": {
+          "name": "entity.name.tag.named.group.regexp"
+        }
+      },
+      "endCaptures": {
+        "1": {
+          "name": "support.other.parenthesis.regexp punctuation.parenthesis.named.end.regexp"
+        },
+        "2": {
+          "name": "invalid.illegal.newline.python"
+        }
+      },
+      "patterns": [
+        {
+          "include": "#double-one-regexp-expression"
+        }
+      ]
+    },
+    "double-one-regexp-comments": {
+      "name": "comment.regexp",
+      "begin": "\\(\\?#",
+      "end": "(\\)|(?=\"))|((?=(?<!\\\\)\\n))",
+      "beginCaptures": {
+        "0": {
+          "name": "punctuation.comment.begin.regexp"
+        }
+      },
+      "endCaptures": {
+        "1": {
+          "name": "punctuation.comment.end.regexp"
+        },
+        "2": {
+          "name": "invalid.illegal.newline.python"
+        }
+      },
+      "patterns": [
+        {
+          "include": "#codetags"
+        }
+      ]
+    },
+    "double-one-regexp-lookahead": {
+      "begin": "(\\()\\?=",
+      "end": "(\\)|(?=\"))|((?=(?<!\\\\)\\n))",
+      "beginCaptures": {
+        "0": {
+          "name": "keyword.operator.lookahead.regexp"
+        },
+        "1": {
+          "name": "punctuation.parenthesis.lookahead.begin.regexp"
+        }
+      },
+      "endCaptures": {
+        "1": {
+          "name": "keyword.operator.lookahead.regexp punctuation.parenthesis.lookahead.end.regexp"
+        },
+        "2": {
+          "name": "invalid.illegal.newline.python"
+        }
+      },
+      "patterns": [
+        {
+          "include": "#double-one-regexp-expression"
+        }
+      ]
+    },
+    "double-one-regexp-lookahead-negative": {
+      "begin": "(\\()\\?!",
+      "end": "(\\)|(?=\"))|((?=(?<!\\\\)\\n))",
+      "beginCaptures": {
+        "0": {
+          "name": "keyword.operator.lookahead.negative.regexp"
+        },
+        "1": {
+          "name": "punctuation.parenthesis.lookahead.begin.regexp"
+        }
+      },
+      "endCaptures": {
+        "1": {
+          "name": "keyword.operator.lookahead.negative.regexp punctuation.parenthesis.lookahead.end.regexp"
+        },
+        "2": {
+          "name": "invalid.illegal.newline.python"
+        }
+      },
+      "patterns": [
+        {
+          "include": "#double-one-regexp-expression"
+        }
+      ]
+    },
+    "double-one-regexp-lookbehind": {
+      "begin": "(\\()\\?<=",
+      "end": "(\\)|(?=\"))|((?=(?<!\\\\)\\n))",
+      "beginCaptures": {
+        "0": {
+          "name": "keyword.operator.lookbehind.regexp"
+        },
+        "1": {
+          "name": "punctuation.parenthesis.lookbehind.begin.regexp"
+        }
+      },
+      "endCaptures": {
+        "1": {
+          "name": "keyword.operator.lookbehind.regexp punctuation.parenthesis.lookbehind.end.regexp"
+        },
+        "2": {
+          "name": "invalid.illegal.newline.python"
+        }
+      },
+      "patterns": [
+        {
+          "include": "#double-one-regexp-expression"
+        }
+      ]
+    },
+    "double-one-regexp-lookbehind-negative": {
+      "begin": "(\\()\\?<!",
+      "end": "(\\)|(?=\"))|((?=(?<!\\\\)\\n))",
+      "beginCaptures": {
+        "0": {
+          "name": "keyword.operator.lookbehind.negative.regexp"
+        },
+        "1": {
+          "name": "punctuation.parenthesis.lookbehind.begin.regexp"
+        }
+      },
+      "endCaptures": {
+        "1": {
+          "name": "keyword.operator.lookbehind.negative.regexp punctuation.parenthesis.lookbehind.end.regexp"
+        },
+        "2": {
+          "name": "invalid.illegal.newline.python"
+        }
+      },
+      "patterns": [
+        {
+          "include": "#double-one-regexp-expression"
+        }
+      ]
+    },
+    "double-one-regexp-conditional": {
+      "begin": "(\\()\\?\\((\\w+(?:\\s+[[:alnum:]]+)?|\\d+)\\)",
+      "end": "(\\)|(?=\"))|((?=(?<!\\\\)\\n))",
+      "beginCaptures": {
+        "0": {
+          "name": "keyword.operator.conditional.regexp"
+        },
+        "1": {
+          "name": "punctuation.parenthesis.conditional.begin.regexp"
+        }
+      },
+      "endCaptures": {
+        "1": {
+          "name": "keyword.operator.conditional.negative.regexp punctuation.parenthesis.conditional.end.regexp"
+        },
+        "2": {
+          "name": "invalid.illegal.newline.python"
+        }
+      },
+      "patterns": [
+        {
+          "include": "#double-one-regexp-expression"
+        }
+      ]
+    },
+    "double-one-regexp-parentheses-non-capturing": {
+      "begin": "\\(\\?:",
+      "end": "(\\)|(?=\"))|((?=(?<!\\\\)\\n))",
+      "beginCaptures": {
+        "0": {
+          "name": "support.other.parenthesis.regexp punctuation.parenthesis.non-capturing.begin.regexp"
+        }
+      },
+      "endCaptures": {
+        "1": {
+          "name": "support.other.parenthesis.regexp punctuation.parenthesis.non-capturing.end.regexp"
+        },
+        "2": {
+          "name": "invalid.illegal.newline.python"
+        }
+      },
+      "patterns": [
+        {
+          "include": "#double-one-regexp-expression"
+        }
+      ]
+    },
+    "double-one-regexp-parentheses": {
+      "begin": "\\(",
+      "end": "(\\)|(?=\"))|((?=(?<!\\\\)\\n))",
+      "beginCaptures": {
+        "0": {
+          "name": "support.other.parenthesis.regexp punctuation.parenthesis.begin.regexp"
+        }
+      },
+      "endCaptures": {
+        "1": {
+          "name": "support.other.parenthesis.regexp punctuation.parenthesis.end.regexp"
+        },
+        "2": {
+          "name": "invalid.illegal.newline.python"
+        }
+      },
+      "patterns": [
+        {
+          "include": "#double-one-regexp-expression"
+        }
+      ]
+    },
+    "double-three-regexp-expression": {
+      "patterns": [
+        {
+          "include": "#regexp-base-expression"
+        },
+        {
+          "include": "#double-three-regexp-character-set"
+        },
+        {
+          "include": "#double-three-regexp-comments"
+        },
+        {
+          "include": "#regexp-flags"
+        },
+        {
+          "include": "#double-three-regexp-named-group"
+        },
+        {
+          "include": "#regexp-backreference"
+        },
+        {
+          "include": "#double-three-regexp-lookahead"
+        },
+        {
+          "include": "#double-three-regexp-lookahead-negative"
+        },
+        {
+          "include": "#double-three-regexp-lookbehind"
+        },
+        {
+          "include": "#double-three-regexp-lookbehind-negative"
+        },
+        {
+          "include": "#double-three-regexp-conditional"
+        },
+        {
+          "include": "#double-three-regexp-parentheses-non-capturing"
+        },
+        {
+          "include": "#double-three-regexp-parentheses"
+        },
+        {
+          "include": "#comments-string-double-three"
+        }
+      ]
+    },
+    "double-three-regexp-character-set": {
+      "patterns": [
+        {
+          "match": "(?x)\n  \\[ \\^? \\] (?! .*?\\])\n"
+        },
+        {
+          "name": "meta.character.set.regexp",
+          "begin": "(\\[)(\\^)?(\\])?",
+          "end": "(\\]|(?=\"\"\"))",
+          "beginCaptures": {
+            "1": {
+              "name": "punctuation.character.set.begin.regexp constant.other.set.regexp"
+            },
+            "2": {
+              "name": "keyword.operator.negation.regexp"
+            },
+            "3": {
+              "name": "constant.character.set.regexp"
+            }
+          },
+          "endCaptures": {
+            "1": {
+              "name": "punctuation.character.set.end.regexp constant.other.set.regexp"
+            },
+            "2": {
+              "name": "invalid.illegal.newline.python"
+            }
+          },
+          "patterns": [
+            {
+              "include": "#regexp-charecter-set-escapes"
+            },
+            {
+              "name": "constant.character.set.regexp",
+              "match": "[^\\n]"
+            }
+          ]
+        }
+      ]
+    },
+    "double-three-regexp-named-group": {
+      "name": "meta.named.regexp",
+      "begin": "(?x)\n  (\\()  (\\?P <\\w+(?:\\s+[[:alnum:]]+)?>)\n",
+      "end": "(\\)|(?=\"\"\"))",
+      "beginCaptures": {
+        "1": {
+          "name": "support.other.parenthesis.regexp punctuation.parenthesis.named.begin.regexp"
+        },
+        "2": {
+          "name": "entity.name.tag.named.group.regexp"
+        }
+      },
+      "endCaptures": {
+        "1": {
+          "name": "support.other.parenthesis.regexp punctuation.parenthesis.named.end.regexp"
+        },
+        "2": {
+          "name": "invalid.illegal.newline.python"
+        }
+      },
+      "patterns": [
+        {
+          "include": "#double-three-regexp-expression"
+        },
+        {
+          "include": "#comments-string-double-three"
+        }
+      ]
+    },
+    "double-three-regexp-comments": {
+      "name": "comment.regexp",
+      "begin": "\\(\\?#",
+      "end": "(\\)|(?=\"\"\"))",
+      "beginCaptures": {
+        "0": {
+          "name": "punctuation.comment.begin.regexp"
+        }
+      },
+      "endCaptures": {
+        "1": {
+          "name": "punctuation.comment.end.regexp"
+        },
+        "2": {
+          "name": "invalid.illegal.newline.python"
+        }
+      },
+      "patterns": [
+        {
+          "include": "#codetags"
+        }
+      ]
+    },
+    "double-three-regexp-lookahead": {
+      "begin": "(\\()\\?=",
+      "end": "(\\)|(?=\"\"\"))",
+      "beginCaptures": {
+        "0": {
+          "name": "keyword.operator.lookahead.regexp"
+        },
+        "1": {
+          "name": "punctuation.parenthesis.lookahead.begin.regexp"
+        }
+      },
+      "endCaptures": {
+        "1": {
+          "name": "keyword.operator.lookahead.regexp punctuation.parenthesis.lookahead.end.regexp"
+        },
+        "2": {
+          "name": "invalid.illegal.newline.python"
+        }
+      },
+      "patterns": [
+        {
+          "include": "#double-three-regexp-expression"
+        },
+        {
+          "include": "#comments-string-double-three"
+        }
+      ]
+    },
+    "double-three-regexp-lookahead-negative": {
+      "begin": "(\\()\\?!",
+      "end": "(\\)|(?=\"\"\"))",
+      "beginCaptures": {
+        "0": {
+          "name": "keyword.operator.lookahead.negative.regexp"
+        },
+        "1": {
+          "name": "punctuation.parenthesis.lookahead.begin.regexp"
+        }
+      },
+      "endCaptures": {
+        "1": {
+          "name": "keyword.operator.lookahead.negative.regexp punctuation.parenthesis.lookahead.end.regexp"
+        },
+        "2": {
+          "name": "invalid.illegal.newline.python"
+        }
+      },
+      "patterns": [
+        {
+          "include": "#double-three-regexp-expression"
+        },
+        {
+          "include": "#comments-string-double-three"
+        }
+      ]
+    },
+    "double-three-regexp-lookbehind": {
+      "begin": "(\\()\\?<=",
+      "end": "(\\)|(?=\"\"\"))",
+      "beginCaptures": {
+        "0": {
+          "name": "keyword.operator.lookbehind.regexp"
+        },
+        "1": {
+          "name": "punctuation.parenthesis.lookbehind.begin.regexp"
+        }
+      },
+      "endCaptures": {
+        "1": {
+          "name": "keyword.operator.lookbehind.regexp punctuation.parenthesis.lookbehind.end.regexp"
+        },
+        "2": {
+          "name": "invalid.illegal.newline.python"
+        }
+      },
+      "patterns": [
+        {
+          "include": "#double-three-regexp-expression"
+        },
+        {
+          "include": "#comments-string-double-three"
+        }
+      ]
+    },
+    "double-three-regexp-lookbehind-negative": {
+      "begin": "(\\()\\?<!",
+      "end": "(\\)|(?=\"\"\"))",
+      "beginCaptures": {
+        "0": {
+          "name": "keyword.operator.lookbehind.negative.regexp"
+        },
+        "1": {
+          "name": "punctuation.parenthesis.lookbehind.begin.regexp"
+        }
+      },
+      "endCaptures": {
+        "1": {
+          "name": "keyword.operator.lookbehind.negative.regexp punctuation.parenthesis.lookbehind.end.regexp"
+        },
+        "2": {
+          "name": "invalid.illegal.newline.python"
+        }
+      },
+      "patterns": [
+        {
+          "include": "#double-three-regexp-expression"
+        },
+        {
+          "include": "#comments-string-double-three"
+        }
+      ]
+    },
+    "double-three-regexp-conditional": {
+      "begin": "(\\()\\?\\((\\w+(?:\\s+[[:alnum:]]+)?|\\d+)\\)",
+      "end": "(\\)|(?=\"\"\"))",
+      "beginCaptures": {
+        "0": {
+          "name": "keyword.operator.conditional.regexp"
+        },
+        "1": {
+          "name": "punctuation.parenthesis.conditional.begin.regexp"
+        }
+      },
+      "endCaptures": {
+        "1": {
+          "name": "keyword.operator.conditional.negative.regexp punctuation.parenthesis.conditional.end.regexp"
+        },
+        "2": {
+          "name": "invalid.illegal.newline.python"
+        }
+      },
+      "patterns": [
+        {
+          "include": "#double-three-regexp-expression"
+        },
+        {
+          "include": "#comments-string-double-three"
+        }
+      ]
+    },
+    "double-three-regexp-parentheses-non-capturing": {
+      "begin": "\\(\\?:",
+      "end": "(\\)|(?=\"\"\"))",
+      "beginCaptures": {
+        "0": {
+          "name": "support.other.parenthesis.regexp punctuation.parenthesis.non-capturing.begin.regexp"
+        }
+      },
+      "endCaptures": {
+        "1": {
+          "name": "support.other.parenthesis.regexp punctuation.parenthesis.non-capturing.end.regexp"
+        },
+        "2": {
+          "name": "invalid.illegal.newline.python"
+        }
+      },
+      "patterns": [
+        {
+          "include": "#double-three-regexp-expression"
+        },
+        {
+          "include": "#comments-string-double-three"
+        }
+      ]
+    },
+    "double-three-regexp-parentheses": {
+      "begin": "\\(",
+      "end": "(\\)|(?=\"\"\"))",
+      "beginCaptures": {
+        "0": {
+          "name": "support.other.parenthesis.regexp punctuation.parenthesis.begin.regexp"
+        }
+      },
+      "endCaptures": {
+        "1": {
+          "name": "support.other.parenthesis.regexp punctuation.parenthesis.end.regexp"
+        },
+        "2": {
+          "name": "invalid.illegal.newline.python"
+        }
+      },
+      "patterns": [
+        {
+          "include": "#double-three-regexp-expression"
+        },
+        {
+          "include": "#comments-string-double-three"
+        }
+      ]
+    },
+    "regexp-single-one-line": {
+      "name": "string.regexp.quoted.single.python",
+      "begin": "\\b(([uU]r)|([bB]r)|(r[bB]?))(\\')",
+      "end": "(\\')|(?<!\\\\)(\\n)",
+      "beginCaptures": {
+        "2": {
+          "name": "invalid.deprecated.prefix.python"
+        },
+        "3": {
+          "name": "storage.type.string.python"
+        },
+        "4": {
+          "name": "storage.type.string.python"
+        },
+        "5": {
+          "name": "punctuation.definition.string.begin.python"
+        }
+      },
+      "endCaptures": {
+        "1": {
+          "name": "punctuation.definition.string.end.python"
+        },
+        "2": {
+          "name": "invalid.illegal.newline.python"
+        }
+      },
+      "patterns": [
+        {
+          "include": "#single-one-regexp-expression"
+        }
+      ]
+    },
+    "regexp-single-three-line": {
+      "name": "string.regexp.quoted.multi.python",
+      "begin": "\\b(([uU]r)|([bB]r)|(r[bB]?))(\\'\\'\\')",
+      "end": "(\\'\\'\\')",
+      "beginCaptures": {
+        "2": {
+          "name": "invalid.deprecated.prefix.python"
+        },
+        "3": {
+          "name": "storage.type.string.python"
+        },
+        "4": {
+          "name": "storage.type.string.python"
+        },
+        "5": {
+          "name": "punctuation.definition.string.begin.python"
+        }
+      },
+      "endCaptures": {
+        "1": {
+          "name": "punctuation.definition.string.end.python"
+        },
+        "2": {
+          "name": "invalid.illegal.newline.python"
+        }
+      },
+      "patterns": [
+        {
+          "include": "#single-three-regexp-expression"
+        }
+      ]
+    },
+    "regexp-double-one-line": {
+      "name": "string.regexp.quoted.single.python",
+      "begin": "\\b(([uU]r)|([bB]r)|(r[bB]?))(\")",
+      "end": "(\")|(?<!\\\\)(\\n)",
+      "beginCaptures": {
+        "2": {
+          "name": "invalid.deprecated.prefix.python"
+        },
+        "3": {
+          "name": "storage.type.string.python"
+        },
+        "4": {
+          "name": "storage.type.string.python"
+        },
+        "5": {
+          "name": "punctuation.definition.string.begin.python"
+        }
+      },
+      "endCaptures": {
+        "1": {
+          "name": "punctuation.definition.string.end.python"
+        },
+        "2": {
+          "name": "invalid.illegal.newline.python"
+        }
+      },
+      "patterns": [
+        {
+          "include": "#double-one-regexp-expression"
+        }
+      ]
+    },
+    "regexp-double-three-line": {
+      "name": "string.regexp.quoted.multi.python",
+      "begin": "\\b(([uU]r)|([bB]r)|(r[bB]?))(\"\"\")",
+      "end": "(\"\"\")",
+      "beginCaptures": {
+        "2": {
+          "name": "invalid.deprecated.prefix.python"
+        },
+        "3": {
+          "name": "storage.type.string.python"
+        },
+        "4": {
+          "name": "storage.type.string.python"
+        },
+        "5": {
+          "name": "punctuation.definition.string.begin.python"
+        }
+      },
+      "endCaptures": {
+        "1": {
+          "name": "punctuation.definition.string.end.python"
+        },
+        "2": {
+          "name": "invalid.illegal.newline.python"
+        }
+      },
+      "patterns": [
+        {
+          "include": "#double-three-regexp-expression"
+        }
+      ]
+    },
+    "single-one-fregexp-expression": {
+      "patterns": [
+        {
+          "include": "#fregexp-base-expression"
+        },
+        {
+          "include": "#single-one-regexp-character-set"
+        },
+        {
+          "include": "#single-one-regexp-comments"
+        },
+        {
+          "include": "#regexp-flags"
+        },
+        {
+          "include": "#single-one-regexp-named-group"
+        },
+        {
+          "include": "#regexp-backreference"
+        },
+        {
+          "include": "#single-one-fregexp-lookahead"
+        },
+        {
+          "include": "#single-one-fregexp-lookahead-negative"
+        },
+        {
+          "include": "#single-one-fregexp-lookbehind"
+        },
+        {
+          "include": "#single-one-fregexp-lookbehind-negative"
+        },
+        {
+          "include": "#single-one-fregexp-conditional"
+        },
+        {
+          "include": "#single-one-fregexp-parentheses-non-capturing"
+        },
+        {
+          "include": "#single-one-fregexp-parentheses"
+        }
+      ]
+    },
+    "single-one-fregexp-named-group": {
+      "name": "meta.named.regexp",
+      "begin": "(?x)\n  (\\()  (\\?P <\\w+(?:\\s+[[:alnum:]]+)?>)\n",
+      "end": "(\\)|(?=\\'))|((?=(?<!\\\\)\\n))",
+      "beginCaptures": {
+        "1": {
+          "name": "support.other.parenthesis.regexp punctuation.parenthesis.named.begin.regexp"
+        },
+        "2": {
+          "name": "entity.name.tag.named.group.regexp"
+        }
+      },
+      "endCaptures": {
+        "1": {
+          "name": "support.other.parenthesis.regexp punctuation.parenthesis.named.end.regexp"
+        },
+        "2": {
+          "name": "invalid.illegal.newline.python"
+        }
+      },
+      "patterns": [
+        {
+          "include": "#single-one-fregexp-expression"
+        }
+      ]
+    },
+    "single-one-fregexp-lookahead": {
+      "begin": "(\\()\\?=",
+      "end": "(\\)|(?=\\'))|((?=(?<!\\\\)\\n))",
+      "beginCaptures": {
+        "0": {
+          "name": "keyword.operator.lookahead.regexp"
+        },
+        "1": {
+          "name": "punctuation.parenthesis.lookahead.begin.regexp"
+        }
+      },
+      "endCaptures": {
+        "1": {
+          "name": "keyword.operator.lookahead.regexp punctuation.parenthesis.lookahead.end.regexp"
+        },
+        "2": {
+          "name": "invalid.illegal.newline.python"
+        }
+      },
+      "patterns": [
+        {
+          "include": "#single-one-fregexp-expression"
+        }
+      ]
+    },
+    "single-one-fregexp-lookahead-negative": {
+      "begin": "(\\()\\?!",
+      "end": "(\\)|(?=\\'))|((?=(?<!\\\\)\\n))",
+      "beginCaptures": {
+        "0": {
+          "name": "keyword.operator.lookahead.negative.regexp"
+        },
+        "1": {
+          "name": "punctuation.parenthesis.lookahead.begin.regexp"
+        }
+      },
+      "endCaptures": {
+        "1": {
+          "name": "keyword.operator.lookahead.negative.regexp punctuation.parenthesis.lookahead.end.regexp"
+        },
+        "2": {
+          "name": "invalid.illegal.newline.python"
+        }
+      },
+      "patterns": [
+        {
+          "include": "#single-one-fregexp-expression"
+        }
+      ]
+    },
+    "single-one-fregexp-lookbehind": {
+      "begin": "(\\()\\?<=",
+      "end": "(\\)|(?=\\'))|((?=(?<!\\\\)\\n))",
+      "beginCaptures": {
+        "0": {
+          "name": "keyword.operator.lookbehind.regexp"
+        },
+        "1": {
+          "name": "punctuation.parenthesis.lookbehind.begin.regexp"
+        }
+      },
+      "endCaptures": {
+        "1": {
+          "name": "keyword.operator.lookbehind.regexp punctuation.parenthesis.lookbehind.end.regexp"
+        },
+        "2": {
+          "name": "invalid.illegal.newline.python"
+        }
+      },
+      "patterns": [
+        {
+          "include": "#single-one-fregexp-expression"
+        }
+      ]
+    },
+    "single-one-fregexp-lookbehind-negative": {
+      "begin": "(\\()\\?<!",
+      "end": "(\\)|(?=\\'))|((?=(?<!\\\\)\\n))",
+      "beginCaptures": {
+        "0": {
+          "name": "keyword.operator.lookbehind.negative.regexp"
+        },
+        "1": {
+          "name": "punctuation.parenthesis.lookbehind.begin.regexp"
+        }
+      },
+      "endCaptures": {
+        "1": {
+          "name": "keyword.operator.lookbehind.negative.regexp punctuation.parenthesis.lookbehind.end.regexp"
+        },
+        "2": {
+          "name": "invalid.illegal.newline.python"
+        }
+      },
+      "patterns": [
+        {
+          "include": "#single-one-fregexp-expression"
+        }
+      ]
+    },
+    "single-one-fregexp-conditional": {
+      "begin": "(\\()\\?\\((\\w+(?:\\s+[[:alnum:]]+)?|\\d+)\\)",
+      "end": "(\\)|(?=\\'))|((?=(?<!\\\\)\\n))",
+      "beginCaptures": {
+        "0": {
+          "name": "keyword.operator.conditional.regexp"
+        },
+        "1": {
+          "name": "punctuation.parenthesis.conditional.begin.regexp"
+        }
+      },
+      "endCaptures": {
+        "1": {
+          "name": "keyword.operator.conditional.negative.regexp punctuation.parenthesis.conditional.end.regexp"
+        },
+        "2": {
+          "name": "invalid.illegal.newline.python"
+        }
+      },
+      "patterns": [
+        {
+          "include": "#single-one-fregexp-expression"
+        }
+      ]
+    },
+    "single-one-fregexp-parentheses-non-capturing": {
+      "begin": "\\(\\?:",
+      "end": "(\\)|(?=\\'))|((?=(?<!\\\\)\\n))",
+      "beginCaptures": {
+        "0": {
+          "name": "support.other.parenthesis.regexp punctuation.parenthesis.non-capturing.begin.regexp"
+        }
+      },
+      "endCaptures": {
+        "1": {
+          "name": "support.other.parenthesis.regexp punctuation.parenthesis.non-capturing.end.regexp"
+        },
+        "2": {
+          "name": "invalid.illegal.newline.python"
+        }
+      },
+      "patterns": [
+        {
+          "include": "#single-one-fregexp-expression"
+        }
+      ]
+    },
+    "single-one-fregexp-parentheses": {
+      "begin": "\\(",
+      "end": "(\\)|(?=\\'))|((?=(?<!\\\\)\\n))",
+      "beginCaptures": {
+        "0": {
+          "name": "support.other.parenthesis.regexp punctuation.parenthesis.begin.regexp"
+        }
+      },
+      "endCaptures": {
+        "1": {
+          "name": "support.other.parenthesis.regexp punctuation.parenthesis.end.regexp"
+        },
+        "2": {
+          "name": "invalid.illegal.newline.python"
+        }
+      },
+      "patterns": [
+        {
+          "include": "#single-one-fregexp-expression"
+        }
+      ]
+    },
+    "single-three-fregexp-expression": {
+      "patterns": [
+        {
+          "include": "#fregexp-base-expression"
+        },
+        {
+          "include": "#single-three-regexp-character-set"
+        },
+        {
+          "include": "#single-three-regexp-comments"
+        },
+        {
+          "include": "#regexp-flags"
+        },
+        {
+          "include": "#single-three-regexp-named-group"
+        },
+        {
+          "include": "#regexp-backreference"
+        },
+        {
+          "include": "#single-three-fregexp-lookahead"
+        },
+        {
+          "include": "#single-three-fregexp-lookahead-negative"
+        },
+        {
+          "include": "#single-three-fregexp-lookbehind"
+        },
+        {
+          "include": "#single-three-fregexp-lookbehind-negative"
+        },
+        {
+          "include": "#single-three-fregexp-conditional"
+        },
+        {
+          "include": "#single-three-fregexp-parentheses-non-capturing"
+        },
+        {
+          "include": "#single-three-fregexp-parentheses"
+        },
+        {
+          "include": "#comments-string-single-three"
+        }
+      ]
+    },
+    "single-three-fregexp-named-group": {
+      "name": "meta.named.regexp",
+      "begin": "(?x)\n  (\\()  (\\?P <\\w+(?:\\s+[[:alnum:]]+)?>)\n",
+      "end": "(\\)|(?=\\'\\'\\'))",
+      "beginCaptures": {
+        "1": {
+          "name": "support.other.parenthesis.regexp punctuation.parenthesis.named.begin.regexp"
+        },
+        "2": {
+          "name": "entity.name.tag.named.group.regexp"
+        }
+      },
+      "endCaptures": {
+        "1": {
+          "name": "support.other.parenthesis.regexp punctuation.parenthesis.named.end.regexp"
+        },
+        "2": {
+          "name": "invalid.illegal.newline.python"
+        }
+      },
+      "patterns": [
+        {
+          "include": "#single-three-fregexp-expression"
+        },
+        {
+          "include": "#comments-string-single-three"
+        }
+      ]
+    },
+    "single-three-fregexp-lookahead": {
+      "begin": "(\\()\\?=",
+      "end": "(\\)|(?=\\'\\'\\'))",
+      "beginCaptures": {
+        "0": {
+          "name": "keyword.operator.lookahead.regexp"
+        },
+        "1": {
+          "name": "punctuation.parenthesis.lookahead.begin.regexp"
+        }
+      },
+      "endCaptures": {
+        "1": {
+          "name": "keyword.operator.lookahead.regexp punctuation.parenthesis.lookahead.end.regexp"
+        },
+        "2": {
+          "name": "invalid.illegal.newline.python"
+        }
+      },
+      "patterns": [
+        {
+          "include": "#single-three-fregexp-expression"
+        },
+        {
+          "include": "#comments-string-single-three"
+        }
+      ]
+    },
+    "single-three-fregexp-lookahead-negative": {
+      "begin": "(\\()\\?!",
+      "end": "(\\)|(?=\\'\\'\\'))",
+      "beginCaptures": {
+        "0": {
+          "name": "keyword.operator.lookahead.negative.regexp"
+        },
+        "1": {
+          "name": "punctuation.parenthesis.lookahead.begin.regexp"
+        }
+      },
+      "endCaptures": {
+        "1": {
+          "name": "keyword.operator.lookahead.negative.regexp punctuation.parenthesis.lookahead.end.regexp"
+        },
+        "2": {
+          "name": "invalid.illegal.newline.python"
+        }
+      },
+      "patterns": [
+        {
+          "include": "#single-three-fregexp-expression"
+        },
+        {
+          "include": "#comments-string-single-three"
+        }
+      ]
+    },
+    "single-three-fregexp-lookbehind": {
+      "begin": "(\\()\\?<=",
+      "end": "(\\)|(?=\\'\\'\\'))",
+      "beginCaptures": {
+        "0": {
+          "name": "keyword.operator.lookbehind.regexp"
+        },
+        "1": {
+          "name": "punctuation.parenthesis.lookbehind.begin.regexp"
+        }
+      },
+      "endCaptures": {
+        "1": {
+          "name": "keyword.operator.lookbehind.regexp punctuation.parenthesis.lookbehind.end.regexp"
+        },
+        "2": {
+          "name": "invalid.illegal.newline.python"
+        }
+      },
+      "patterns": [
+        {
+          "include": "#single-three-fregexp-expression"
+        },
+        {
+          "include": "#comments-string-single-three"
+        }
+      ]
+    },
+    "single-three-fregexp-lookbehind-negative": {
+      "begin": "(\\()\\?<!",
+      "end": "(\\)|(?=\\'\\'\\'))",
+      "beginCaptures": {
+        "0": {
+          "name": "keyword.operator.lookbehind.negative.regexp"
+        },
+        "1": {
+          "name": "punctuation.parenthesis.lookbehind.begin.regexp"
+        }
+      },
+      "endCaptures": {
+        "1": {
+          "name": "keyword.operator.lookbehind.negative.regexp punctuation.parenthesis.lookbehind.end.regexp"
+        },
+        "2": {
+          "name": "invalid.illegal.newline.python"
+        }
+      },
+      "patterns": [
+        {
+          "include": "#single-three-fregexp-expression"
+        },
+        {
+          "include": "#comments-string-single-three"
+        }
+      ]
+    },
+    "single-three-fregexp-conditional": {
+      "begin": "(\\()\\?\\((\\w+(?:\\s+[[:alnum:]]+)?|\\d+)\\)",
+      "end": "(\\)|(?=\\'\\'\\'))",
+      "beginCaptures": {
+        "0": {
+          "name": "keyword.operator.conditional.regexp"
+        },
+        "1": {
+          "name": "punctuation.parenthesis.conditional.begin.regexp"
+        }
+      },
+      "endCaptures": {
+        "1": {
+          "name": "keyword.operator.conditional.negative.regexp punctuation.parenthesis.conditional.end.regexp"
+        },
+        "2": {
+          "name": "invalid.illegal.newline.python"
+        }
+      },
+      "patterns": [
+        {
+          "include": "#single-three-fregexp-expression"
+        },
+        {
+          "include": "#comments-string-single-three"
+        }
+      ]
+    },
+    "single-three-fregexp-parentheses-non-capturing": {
+      "begin": "\\(\\?:",
+      "end": "(\\)|(?=\\'\\'\\'))",
+      "beginCaptures": {
+        "0": {
+          "name": "support.other.parenthesis.regexp punctuation.parenthesis.non-capturing.begin.regexp"
+        }
+      },
+      "endCaptures": {
+        "1": {
+          "name": "support.other.parenthesis.regexp punctuation.parenthesis.non-capturing.end.regexp"
+        },
+        "2": {
+          "name": "invalid.illegal.newline.python"
+        }
+      },
+      "patterns": [
+        {
+          "include": "#single-three-fregexp-expression"
+        },
+        {
+          "include": "#comments-string-single-three"
+        }
+      ]
+    },
+    "single-three-fregexp-parentheses": {
+      "begin": "\\(",
+      "end": "(\\)|(?=\\'\\'\\'))",
+      "beginCaptures": {
+        "0": {
+          "name": "support.other.parenthesis.regexp punctuation.parenthesis.begin.regexp"
+        }
+      },
+      "endCaptures": {
+        "1": {
+          "name": "support.other.parenthesis.regexp punctuation.parenthesis.end.regexp"
+        },
+        "2": {
+          "name": "invalid.illegal.newline.python"
+        }
+      },
+      "patterns": [
+        {
+          "include": "#single-three-fregexp-expression"
+        },
+        {
+          "include": "#comments-string-single-three"
+        }
+      ]
+    },
+    "double-one-fregexp-expression": {
+      "patterns": [
+        {
+          "include": "#fregexp-base-expression"
+        },
+        {
+          "include": "#double-one-regexp-character-set"
+        },
+        {
+          "include": "#double-one-regexp-comments"
+        },
+        {
+          "include": "#regexp-flags"
+        },
+        {
+          "include": "#double-one-regexp-named-group"
+        },
+        {
+          "include": "#regexp-backreference"
+        },
+        {
+          "include": "#double-one-fregexp-lookahead"
+        },
+        {
+          "include": "#double-one-fregexp-lookahead-negative"
+        },
+        {
+          "include": "#double-one-fregexp-lookbehind"
+        },
+        {
+          "include": "#double-one-fregexp-lookbehind-negative"
+        },
+        {
+          "include": "#double-one-fregexp-conditional"
+        },
+        {
+          "include": "#double-one-fregexp-parentheses-non-capturing"
+        },
+        {
+          "include": "#double-one-fregexp-parentheses"
+        }
+      ]
+    },
+    "double-one-fregexp-named-group": {
+      "name": "meta.named.regexp",
+      "begin": "(?x)\n  (\\()  (\\?P <\\w+(?:\\s+[[:alnum:]]+)?>)\n",
+      "end": "(\\)|(?=\"))|((?=(?<!\\\\)\\n))",
+      "beginCaptures": {
+        "1": {
+          "name": "support.other.parenthesis.regexp punctuation.parenthesis.named.begin.regexp"
+        },
+        "2": {
+          "name": "entity.name.tag.named.group.regexp"
+        }
+      },
+      "endCaptures": {
+        "1": {
+          "name": "support.other.parenthesis.regexp punctuation.parenthesis.named.end.regexp"
+        },
+        "2": {
+          "name": "invalid.illegal.newline.python"
+        }
+      },
+      "patterns": [
+        {
+          "include": "#double-one-fregexp-expression"
+        }
+      ]
+    },
+    "double-one-fregexp-lookahead": {
+      "begin": "(\\()\\?=",
+      "end": "(\\)|(?=\"))|((?=(?<!\\\\)\\n))",
+      "beginCaptures": {
+        "0": {
+          "name": "keyword.operator.lookahead.regexp"
+        },
+        "1": {
+          "name": "punctuation.parenthesis.lookahead.begin.regexp"
+        }
+      },
+      "endCaptures": {
+        "1": {
+          "name": "keyword.operator.lookahead.regexp punctuation.parenthesis.lookahead.end.regexp"
+        },
+        "2": {
+          "name": "invalid.illegal.newline.python"
+        }
+      },
+      "patterns": [
+        {
+          "include": "#double-one-fregexp-expression"
+        }
+      ]
+    },
+    "double-one-fregexp-lookahead-negative": {
+      "begin": "(\\()\\?!",
+      "end": "(\\)|(?=\"))|((?=(?<!\\\\)\\n))",
+      "beginCaptures": {
+        "0": {
+          "name": "keyword.operator.lookahead.negative.regexp"
+        },
+        "1": {
+          "name": "punctuation.parenthesis.lookahead.begin.regexp"
+        }
+      },
+      "endCaptures": {
+        "1": {
+          "name": "keyword.operator.lookahead.negative.regexp punctuation.parenthesis.lookahead.end.regexp"
+        },
+        "2": {
+          "name": "invalid.illegal.newline.python"
+        }
+      },
+      "patterns": [
+        {
+          "include": "#double-one-fregexp-expression"
+        }
+      ]
+    },
+    "double-one-fregexp-lookbehind": {
+      "begin": "(\\()\\?<=",
+      "end": "(\\)|(?=\"))|((?=(?<!\\\\)\\n))",
+      "beginCaptures": {
+        "0": {
+          "name": "keyword.operator.lookbehind.regexp"
+        },
+        "1": {
+          "name": "punctuation.parenthesis.lookbehind.begin.regexp"
+        }
+      },
+      "endCaptures": {
+        "1": {
+          "name": "keyword.operator.lookbehind.regexp punctuation.parenthesis.lookbehind.end.regexp"
+        },
+        "2": {
+          "name": "invalid.illegal.newline.python"
+        }
+      },
+      "patterns": [
+        {
+          "include": "#double-one-fregexp-expression"
+        }
+      ]
+    },
+    "double-one-fregexp-lookbehind-negative": {
+      "begin": "(\\()\\?<!",
+      "end": "(\\)|(?=\"))|((?=(?<!\\\\)\\n))",
+      "beginCaptures": {
+        "0": {
+          "name": "keyword.operator.lookbehind.negative.regexp"
+        },
+        "1": {
+          "name": "punctuation.parenthesis.lookbehind.begin.regexp"
+        }
+      },
+      "endCaptures": {
+        "1": {
+          "name": "keyword.operator.lookbehind.negative.regexp punctuation.parenthesis.lookbehind.end.regexp"
+        },
+        "2": {
+          "name": "invalid.illegal.newline.python"
+        }
+      },
+      "patterns": [
+        {
+          "include": "#double-one-fregexp-expression"
+        }
+      ]
+    },
+    "double-one-fregexp-conditional": {
+      "begin": "(\\()\\?\\((\\w+(?:\\s+[[:alnum:]]+)?|\\d+)\\)",
+      "end": "(\\)|(?=\"))|((?=(?<!\\\\)\\n))",
+      "beginCaptures": {
+        "0": {
+          "name": "keyword.operator.conditional.regexp"
+        },
+        "1": {
+          "name": "punctuation.parenthesis.conditional.begin.regexp"
+        }
+      },
+      "endCaptures": {
+        "1": {
+          "name": "keyword.operator.conditional.negative.regexp punctuation.parenthesis.conditional.end.regexp"
+        },
+        "2": {
+          "name": "invalid.illegal.newline.python"
+        }
+      },
+      "patterns": [
+        {
+          "include": "#double-one-fregexp-expression"
+        }
+      ]
+    },
+    "double-one-fregexp-parentheses-non-capturing": {
+      "begin": "\\(\\?:",
+      "end": "(\\)|(?=\"))|((?=(?<!\\\\)\\n))",
+      "beginCaptures": {
+        "0": {
+          "name": "support.other.parenthesis.regexp punctuation.parenthesis.non-capturing.begin.regexp"
+        }
+      },
+      "endCaptures": {
+        "1": {
+          "name": "support.other.parenthesis.regexp punctuation.parenthesis.non-capturing.end.regexp"
+        },
+        "2": {
+          "name": "invalid.illegal.newline.python"
+        }
+      },
+      "patterns": [
+        {
+          "include": "#double-one-fregexp-expression"
+        }
+      ]
+    },
+    "double-one-fregexp-parentheses": {
+      "begin": "\\(",
+      "end": "(\\)|(?=\"))|((?=(?<!\\\\)\\n))",
+      "beginCaptures": {
+        "0": {
+          "name": "support.other.parenthesis.regexp punctuation.parenthesis.begin.regexp"
+        }
+      },
+      "endCaptures": {
+        "1": {
+          "name": "support.other.parenthesis.regexp punctuation.parenthesis.end.regexp"
+        },
+        "2": {
+          "name": "invalid.illegal.newline.python"
+        }
+      },
+      "patterns": [
+        {
+          "include": "#double-one-fregexp-expression"
+        }
+      ]
+    },
+    "double-three-fregexp-expression": {
+      "patterns": [
+        {
+          "include": "#fregexp-base-expression"
+        },
+        {
+          "include": "#double-three-regexp-character-set"
+        },
+        {
+          "include": "#double-three-regexp-comments"
+        },
+        {
+          "include": "#regexp-flags"
+        },
+        {
+          "include": "#double-three-regexp-named-group"
+        },
+        {
+          "include": "#regexp-backreference"
+        },
+        {
+          "include": "#double-three-fregexp-lookahead"
+        },
+        {
+          "include": "#double-three-fregexp-lookahead-negative"
+        },
+        {
+          "include": "#double-three-fregexp-lookbehind"
+        },
+        {
+          "include": "#double-three-fregexp-lookbehind-negative"
+        },
+        {
+          "include": "#double-three-fregexp-conditional"
+        },
+        {
+          "include": "#double-three-fregexp-parentheses-non-capturing"
+        },
+        {
+          "include": "#double-three-fregexp-parentheses"
+        },
+        {
+          "include": "#comments-string-double-three"
+        }
+      ]
+    },
+    "double-three-fregexp-named-group": {
+      "name": "meta.named.regexp",
+      "begin": "(?x)\n  (\\()  (\\?P <\\w+(?:\\s+[[:alnum:]]+)?>)\n",
+      "end": "(\\)|(?=\"\"\"))",
+      "beginCaptures": {
+        "1": {
+          "name": "support.other.parenthesis.regexp punctuation.parenthesis.named.begin.regexp"
+        },
+        "2": {
+          "name": "entity.name.tag.named.group.regexp"
+        }
+      },
+      "endCaptures": {
+        "1": {
+          "name": "support.other.parenthesis.regexp punctuation.parenthesis.named.end.regexp"
+        },
+        "2": {
+          "name": "invalid.illegal.newline.python"
+        }
+      },
+      "patterns": [
+        {
+          "include": "#double-three-fregexp-expression"
+        },
+        {
+          "include": "#comments-string-double-three"
+        }
+      ]
+    },
+    "double-three-fregexp-lookahead": {
+      "begin": "(\\()\\?=",
+      "end": "(\\)|(?=\"\"\"))",
+      "beginCaptures": {
+        "0": {
+          "name": "keyword.operator.lookahead.regexp"
+        },
+        "1": {
+          "name": "punctuation.parenthesis.lookahead.begin.regexp"
+        }
+      },
+      "endCaptures": {
+        "1": {
+          "name": "keyword.operator.lookahead.regexp punctuation.parenthesis.lookahead.end.regexp"
+        },
+        "2": {
+          "name": "invalid.illegal.newline.python"
+        }
+      },
+      "patterns": [
+        {
+          "include": "#double-three-fregexp-expression"
+        },
+        {
+          "include": "#comments-string-double-three"
+        }
+      ]
+    },
+    "double-three-fregexp-lookahead-negative": {
+      "begin": "(\\()\\?!",
+      "end": "(\\)|(?=\"\"\"))",
+      "beginCaptures": {
+        "0": {
+          "name": "keyword.operator.lookahead.negative.regexp"
+        },
+        "1": {
+          "name": "punctuation.parenthesis.lookahead.begin.regexp"
+        }
+      },
+      "endCaptures": {
+        "1": {
+          "name": "keyword.operator.lookahead.negative.regexp punctuation.parenthesis.lookahead.end.regexp"
+        },
+        "2": {
+          "name": "invalid.illegal.newline.python"
+        }
+      },
+      "patterns": [
+        {
+          "include": "#double-three-fregexp-expression"
+        },
+        {
+          "include": "#comments-string-double-three"
+        }
+      ]
+    },
+    "double-three-fregexp-lookbehind": {
+      "begin": "(\\()\\?<=",
+      "end": "(\\)|(?=\"\"\"))",
+      "beginCaptures": {
+        "0": {
+          "name": "keyword.operator.lookbehind.regexp"
+        },
+        "1": {
+          "name": "punctuation.parenthesis.lookbehind.begin.regexp"
+        }
+      },
+      "endCaptures": {
+        "1": {
+          "name": "keyword.operator.lookbehind.regexp punctuation.parenthesis.lookbehind.end.regexp"
+        },
+        "2": {
+          "name": "invalid.illegal.newline.python"
+        }
+      },
+      "patterns": [
+        {
+          "include": "#double-three-fregexp-expression"
+        },
+        {
+          "include": "#comments-string-double-three"
+        }
+      ]
+    },
+    "double-three-fregexp-lookbehind-negative": {
+      "begin": "(\\()\\?<!",
+      "end": "(\\)|(?=\"\"\"))",
+      "beginCaptures": {
+        "0": {
+          "name": "keyword.operator.lookbehind.negative.regexp"
+        },
+        "1": {
+          "name": "punctuation.parenthesis.lookbehind.begin.regexp"
+        }
+      },
+      "endCaptures": {
+        "1": {
+          "name": "keyword.operator.lookbehind.negative.regexp punctuation.parenthesis.lookbehind.end.regexp"
+        },
+        "2": {
+          "name": "invalid.illegal.newline.python"
+        }
+      },
+      "patterns": [
+        {
+          "include": "#double-three-fregexp-expression"
+        },
+        {
+          "include": "#comments-string-double-three"
+        }
+      ]
+    },
+    "double-three-fregexp-conditional": {
+      "begin": "(\\()\\?\\((\\w+(?:\\s+[[:alnum:]]+)?|\\d+)\\)",
+      "end": "(\\)|(?=\"\"\"))",
+      "beginCaptures": {
+        "0": {
+          "name": "keyword.operator.conditional.regexp"
+        },
+        "1": {
+          "name": "punctuation.parenthesis.conditional.begin.regexp"
+        }
+      },
+      "endCaptures": {
+        "1": {
+          "name": "keyword.operator.conditional.negative.regexp punctuation.parenthesis.conditional.end.regexp"
+        },
+        "2": {
+          "name": "invalid.illegal.newline.python"
+        }
+      },
+      "patterns": [
+        {
+          "include": "#double-three-fregexp-expression"
+        },
+        {
+          "include": "#comments-string-double-three"
+        }
+      ]
+    },
+    "double-three-fregexp-parentheses-non-capturing": {
+      "begin": "\\(\\?:",
+      "end": "(\\)|(?=\"\"\"))",
+      "beginCaptures": {
+        "0": {
+          "name": "support.other.parenthesis.regexp punctuation.parenthesis.non-capturing.begin.regexp"
+        }
+      },
+      "endCaptures": {
+        "1": {
+          "name": "support.other.parenthesis.regexp punctuation.parenthesis.non-capturing.end.regexp"
+        },
+        "2": {
+          "name": "invalid.illegal.newline.python"
+        }
+      },
+      "patterns": [
+        {
+          "include": "#double-three-fregexp-expression"
+        },
+        {
+          "include": "#comments-string-double-three"
+        }
+      ]
+    },
+    "double-three-fregexp-parentheses": {
+      "begin": "\\(",
+      "end": "(\\)|(?=\"\"\"))",
+      "beginCaptures": {
+        "0": {
+          "name": "support.other.parenthesis.regexp punctuation.parenthesis.begin.regexp"
+        }
+      },
+      "endCaptures": {
+        "1": {
+          "name": "support.other.parenthesis.regexp punctuation.parenthesis.end.regexp"
+        },
+        "2": {
+          "name": "invalid.illegal.newline.python"
+        }
+      },
+      "patterns": [
+        {
+          "include": "#double-three-fregexp-expression"
+        },
+        {
+          "include": "#comments-string-double-three"
+        }
+      ]
+    },
+    "fregexp-single-one-line": {
+      "name": "string.interpolated.python string.regexp.quoted.single.python",
+      "begin": "\\b(([uU]r)|([fF]r)|(r[fF]?))(\\')",
+      "end": "(\\')|(?<!\\\\)(\\n)",
+      "beginCaptures": {
+        "2": {
+          "name": "invalid.deprecated.prefix.python"
+        },
+        "3": {
+          "name": "storage.type.string.python"
+        },
+        "4": {
+          "name": "storage.type.string.python"
+        },
+        "5": {
+          "name": "punctuation.definition.string.begin.python"
+        }
+      },
+      "endCaptures": {
+        "1": {
+          "name": "punctuation.definition.string.end.python"
+        },
+        "2": {
+          "name": "invalid.illegal.newline.python"
+        }
+      },
+      "patterns": [
+        {
+          "include": "#single-one-fregexp-expression"
+        }
+      ]
+    },
+    "fregexp-single-three-line": {
+      "name": "string.interpolated.python string.regexp.quoted.multi.python",
+      "begin": "\\b(([uU]r)|([fF]r)|(r[fF]?))(\\'\\'\\')",
+      "end": "(\\'\\'\\')",
+      "beginCaptures": {
+        "2": {
+          "name": "invalid.deprecated.prefix.python"
+        },
+        "3": {
+          "name": "storage.type.string.python"
+        },
+        "4": {
+          "name": "storage.type.string.python"
+        },
+        "5": {
+          "name": "punctuation.definition.string.begin.python"
+        }
+      },
+      "endCaptures": {
+        "1": {
+          "name": "punctuation.definition.string.end.python"
+        },
+        "2": {
+          "name": "invalid.illegal.newline.python"
+        }
+      },
+      "patterns": [
+        {
+          "include": "#single-three-fregexp-expression"
+        }
+      ]
+    },
+    "fregexp-double-one-line": {
+      "name": "string.interpolated.python string.regexp.quoted.single.python",
+      "begin": "\\b(([uU]r)|([fF]r)|(r[fF]?))(\")",
+      "end": "(\")|(?<!\\\\)(\\n)",
+      "beginCaptures": {
+        "2": {
+          "name": "invalid.deprecated.prefix.python"
+        },
+        "3": {
+          "name": "storage.type.string.python"
+        },
+        "4": {
+          "name": "storage.type.string.python"
+        },
+        "5": {
+          "name": "punctuation.definition.string.begin.python"
+        }
+      },
+      "endCaptures": {
+        "1": {
+          "name": "punctuation.definition.string.end.python"
+        },
+        "2": {
+          "name": "invalid.illegal.newline.python"
+        }
+      },
+      "patterns": [
+        {
+          "include": "#double-one-fregexp-expression"
+        }
+      ]
+    },
+    "fregexp-double-three-line": {
+      "name": "string.interpolated.python string.regexp.quoted.multi.python",
+      "begin": "\\b(([uU]r)|([fF]r)|(r[fF]?))(\"\"\")",
+      "end": "(\"\"\")",
+      "beginCaptures": {
+        "2": {
+          "name": "invalid.deprecated.prefix.python"
+        },
+        "3": {
+          "name": "storage.type.string.python"
+        },
+        "4": {
+          "name": "storage.type.string.python"
+        },
+        "5": {
+          "name": "punctuation.definition.string.begin.python"
+        }
+      },
+      "endCaptures": {
+        "1": {
+          "name": "punctuation.definition.string.end.python"
+        },
+        "2": {
+          "name": "invalid.illegal.newline.python"
+        }
+      },
+      "patterns": [
+        {
+          "include": "#double-three-fregexp-expression"
+        }
+      ]
+    },
+    "string-raw-quoted-single-line": {
+      "name": "string.quoted.raw.single.python",
+      "begin": "\\b(([uU]R)|(R))((['\"]))",
+      "end": "(\\4)|((?<!\\\\)\\n)",
+      "beginCaptures": {
+        "2": {
+          "name": "invalid.deprecated.prefix.python"
+        },
+        "3": {
+          "name": "storage.type.string.python"
+        },
+        "4": {
+          "name": "punctuation.definition.string.begin.python"
+        }
+      },
+      "endCaptures": {
+        "1": {
+          "name": "punctuation.definition.string.end.python"
+        },
+        "2": {
+          "name": "invalid.illegal.newline.python"
+        }
+      },
+      "patterns": [
+        {
+          "include": "#string-single-bad-brace1-formatting-raw"
+        },
+        {
+          "include": "#string-single-bad-brace2-formatting-raw"
+        },
+        {
+          "include": "#string-raw-guts"
+        }
+      ]
+    },
+    "string-bin-quoted-single-line": {
+      "name": "string.quoted.binary.single.python",
+      "begin": "(\\b[bB])((['\"]))",
+      "end": "(\\2)|((?<!\\\\)\\n)",
+      "beginCaptures": {
+        "1": {
+          "name": "storage.type.string.python"
+        },
+        "2": {
+          "name": "punctuation.definition.string.begin.python"
+        }
+      },
+      "endCaptures": {
+        "1": {
+          "name": "punctuation.definition.string.end.python"
+        },
+        "2": {
+          "name": "invalid.illegal.newline.python"
+        }
+      },
+      "patterns": [
+        {
+          "include": "#string-entity"
+        }
+      ]
+    },
+    "string-raw-bin-quoted-single-line": {
+      "name": "string.quoted.raw.binary.single.python",
+      "begin": "(\\b(?:R[bB]|[bB]R))((['\"]))",
+      "end": "(\\2)|((?<!\\\\)\\n)",
+      "beginCaptures": {
+        "1": {
+          "name": "storage.type.string.python"
+        },
+        "2": {
+          "name": "punctuation.definition.string.begin.python"
+        }
+      },
+      "endCaptures": {
+        "1": {
+          "name": "punctuation.definition.string.end.python"
+        },
+        "2": {
+          "name": "invalid.illegal.newline.python"
+        }
+      },
+      "patterns": [
+        {
+          "include": "#string-raw-bin-guts"
+        }
+      ]
+    },
+    "string-quoted-single-line": {
+      "name": "string.quoted.single.python",
+      "begin": "(?:\\b([rR])(?=[uU]))?([uU])?((['\"]))",
+      "end": "(\\3)|((?<!\\\\)\\n)",
+      "beginCaptures": {
+        "1": {
+          "name": "invalid.illegal.prefix.python"
+        },
+        "2": {
+          "name": "storage.type.string.python"
+        },
+        "3": {
+          "name": "punctuation.definition.string.begin.python"
+        }
+      },
+      "endCaptures": {
+        "1": {
+          "name": "punctuation.definition.string.end.python"
+        },
+        "2": {
+          "name": "invalid.illegal.newline.python"
+        }
+      },
+      "patterns": [
+        {
+          "include": "#string-single-bad-brace1-formatting-unicode"
+        },
+        {
+          "include": "#string-single-bad-brace2-formatting-unicode"
+        },
+        {
+          "include": "#string-unicode-guts"
+        }
+      ]
+    },
+    "string-single-bad-brace1-formatting-unicode": {
+      "comment": "template using {% ... %}",
+      "begin": "(?x)\n    (?= \\{%\n          ( .*? (?!(['\"])|((?<!\\\\)\\n)) )\n        %\\}\n    )\n",
+      "end": "(?=(['\"])|((?<!\\\\)\\n))",
+      "patterns": [
+        {
+          "include": "#escape-sequence-unicode"
+        },
+        {
+          "include": "#escape-sequence"
+        },
+        {
+          "include": "#string-line-continuation"
+        }
+      ]
+    },
+    "string-single-bad-brace1-formatting-raw": {
+      "comment": "template using {% ... %}",
+      "begin": "(?x)\n    (?= \\{%\n          ( .*? (?!(['\"])|((?<!\\\\)\\n)) )\n        %\\}\n    )\n",
+      "end": "(?=(['\"])|((?<!\\\\)\\n))",
+      "patterns": [
+        {
+          "include": "#string-consume-escape"
+        }
+      ]
+    },
+    "string-single-bad-brace2-formatting-unicode": {
+      "comment": "odd format or format-like syntax",
+      "begin": "(?x)\n    (?!\\{\\{)\n    (?= \\{ (\n              \\w*? (?!(['\"])|((?<!\\\\)\\n)) [^!:\\.\\[}\\w]\n           )\n        .*?(?!(['\"])|((?<!\\\\)\\n))\n        \\}\n    )\n",
+      "end": "(?=(['\"])|((?<!\\\\)\\n))",
+      "patterns": [
+        {
+          "include": "#escape-sequence-unicode"
+        },
+        {
+          "include": "#string-entity"
+        }
+      ]
+    },
+    "string-single-bad-brace2-formatting-raw": {
+      "comment": "odd format or format-like syntax",
+      "begin": "(?x)\n    (?!\\{\\{)\n    (?= \\{ (\n              \\w*? (?!(['\"])|((?<!\\\\)\\n)) [^!:\\.\\[}\\w]\n           )\n        .*?(?!(['\"])|((?<!\\\\)\\n))\n        \\}\n    )\n",
+      "end": "(?=(['\"])|((?<!\\\\)\\n))",
+      "patterns": [
+        {
+          "include": "#string-consume-escape"
+        },
+        {
+          "include": "#string-formatting"
+        }
+      ]
+    },
+    "string-raw-quoted-multi-line": {
+      "name": "string.quoted.raw.multi.python",
+      "begin": "\\b(([uU]R)|(R))('''|\"\"\")",
+      "end": "(\\4)",
+      "beginCaptures": {
+        "2": {
+          "name": "invalid.deprecated.prefix.python"
+        },
+        "3": {
+          "name": "storage.type.string.python"
+        },
+        "4": {
+          "name": "punctuation.definition.string.begin.python"
+        }
+      },
+      "endCaptures": {
+        "1": {
+          "name": "punctuation.definition.string.end.python"
+        },
+        "2": {
+          "name": "invalid.illegal.newline.python"
+        }
+      },
+      "patterns": [
+        {
+          "include": "#string-multi-bad-brace1-formatting-raw"
+        },
+        {
+          "include": "#string-multi-bad-brace2-formatting-raw"
+        },
+        {
+          "include": "#string-raw-guts"
+        }
+      ]
+    },
+    "string-bin-quoted-multi-line": {
+      "name": "string.quoted.binary.multi.python",
+      "begin": "(\\b[bB])('''|\"\"\")",
+      "end": "(\\2)",
+      "beginCaptures": {
+        "1": {
+          "name": "storage.type.string.python"
+        },
+        "2": {
+          "name": "punctuation.definition.string.begin.python"
+        }
+      },
+      "endCaptures": {
+        "1": {
+          "name": "punctuation.definition.string.end.python"
+        },
+        "2": {
+          "name": "invalid.illegal.newline.python"
+        }
+      },
+      "patterns": [
+        {
+          "include": "#string-entity"
+        }
+      ]
+    },
+    "string-raw-bin-quoted-multi-line": {
+      "name": "string.quoted.raw.binary.multi.python",
+      "begin": "(\\b(?:R[bB]|[bB]R))('''|\"\"\")",
+      "end": "(\\2)",
+      "beginCaptures": {
+        "1": {
+          "name": "storage.type.string.python"
+        },
+        "2": {
+          "name": "punctuation.definition.string.begin.python"
+        }
+      },
+      "endCaptures": {
+        "1": {
+          "name": "punctuation.definition.string.end.python"
+        },
+        "2": {
+          "name": "invalid.illegal.newline.python"
+        }
+      },
+      "patterns": [
+        {
+          "include": "#string-raw-bin-guts"
+        }
+      ]
+    },
+    "string-quoted-multi-line": {
+      "name": "string.quoted.multi.python",
+      "begin": "(?:\\b([rR])(?=[uU]))?([uU])?('''|\"\"\")",
+      "end": "(\\3)",
+      "beginCaptures": {
+        "1": {
+          "name": "invalid.illegal.prefix.python"
+        },
+        "2": {
+          "name": "storage.type.string.python"
+        },
+        "3": {
+          "name": "punctuation.definition.string.begin.python"
+        }
+      },
+      "endCaptures": {
+        "1": {
+          "name": "punctuation.definition.string.end.python"
+        },
+        "2": {
+          "name": "invalid.illegal.newline.python"
+        }
+      },
+      "patterns": [
+        {
+          "include": "#string-multi-bad-brace1-formatting-unicode"
+        },
+        {
+          "include": "#string-multi-bad-brace2-formatting-unicode"
+        },
+        {
+          "include": "#string-unicode-guts"
+        }
+      ]
+    },
+    "string-multi-bad-brace1-formatting-unicode": {
+      "comment": "template using {% ... %}",
+      "begin": "(?x)\n    (?= \\{%\n          ( .*? (?!'''|\"\"\") )\n        %\\}\n    )\n",
+      "end": "(?='''|\"\"\")",
+      "patterns": [
+        {
+          "include": "#escape-sequence-unicode"
+        },
+        {
+          "include": "#escape-sequence"
+        },
+        {
+          "include": "#string-line-continuation"
+        }
+      ]
+    },
+    "string-multi-bad-brace1-formatting-raw": {
+      "comment": "template using {% ... %}",
+      "begin": "(?x)\n    (?= \\{%\n          ( .*? (?!'''|\"\"\") )\n        %\\}\n    )\n",
+      "end": "(?='''|\"\"\")",
+      "patterns": [
+        {
+          "include": "#string-consume-escape"
+        }
+      ]
+    },
+    "string-multi-bad-brace2-formatting-unicode": {
+      "comment": "odd format or format-like syntax",
+      "begin": "(?x)\n    (?!\\{\\{)\n    (?= \\{ (\n              \\w*? (?!'''|\"\"\") [^!:\\.\\[}\\w]\n           )\n        .*?(?!'''|\"\"\")\n        \\}\n    )\n",
+      "end": "(?='''|\"\"\")",
+      "patterns": [
+        {
+          "include": "#escape-sequence-unicode"
+        },
+        {
+          "include": "#string-entity"
+        }
+      ]
+    },
+    "string-multi-bad-brace2-formatting-raw": {
+      "comment": "odd format or format-like syntax",
+      "begin": "(?x)\n    (?!\\{\\{)\n    (?= \\{ (\n              \\w*? (?!'''|\"\"\") [^!:\\.\\[}\\w]\n           )\n        .*?(?!'''|\"\"\")\n        \\}\n    )\n",
+      "end": "(?='''|\"\"\")",
+      "patterns": [
+        {
+          "include": "#string-consume-escape"
+        },
+        {
+          "include": "#string-formatting"
+        }
+      ]
+    },
+    "fstring-fnorm-quoted-single-line": {
+      "name": "meta.fstring.python",
+      "begin": "(\\b[fF])([bBuU])?((['\"]))",
+      "end": "(\\3)|((?<!\\\\)\\n)",
+      "beginCaptures": {
+        "1": {
+          "name": "string.interpolated.python string.quoted.single.python storage.type.string.python"
+        },
+        "2": {
+          "name": "invalid.illegal.prefix.python"
+        },
+        "3": {
+          "name": "punctuation.definition.string.begin.python string.interpolated.python string.quoted.single.python"
+        }
+      },
+      "endCaptures": {
+        "1": {
+          "name": "punctuation.definition.string.end.python string.interpolated.python string.quoted.single.python"
+        },
+        "2": {
+          "name": "invalid.illegal.newline.python"
+        }
+      },
+      "patterns": [
+        {
+          "include": "#fstring-guts"
+        },
+        {
+          "include": "#fstring-illegal-single-brace"
+        },
+        {
+          "include": "#fstring-single-brace"
+        },
+        {
+          "include": "#fstring-single-core"
+        }
+      ]
+    },
+    "fstring-normf-quoted-single-line": {
+      "name": "meta.fstring.python",
+      "begin": "(\\b[bBuU])([fF])((['\"]))",
+      "end": "(\\3)|((?<!\\\\)\\n)",
+      "beginCaptures": {
+        "1": {
+          "name": "invalid.illegal.prefix.python"
+        },
+        "2": {
+          "name": "string.interpolated.python string.quoted.single.python storage.type.string.python"
+        },
+        "3": {
+          "name": "punctuation.definition.string.begin.python string.quoted.single.python"
+        }
+      },
+      "endCaptures": {
+        "1": {
+          "name": "punctuation.definition.string.end.python string.interpolated.python string.quoted.single.python"
+        },
+        "2": {
+          "name": "invalid.illegal.newline.python"
+        }
+      },
+      "patterns": [
+        {
+          "include": "#fstring-guts"
+        },
+        {
+          "include": "#fstring-illegal-single-brace"
+        },
+        {
+          "include": "#fstring-single-brace"
+        },
+        {
+          "include": "#fstring-single-core"
+        }
+      ]
+    },
+    "fstring-raw-quoted-single-line": {
+      "name": "meta.fstring.python",
+      "begin": "(\\b(?:[R][fF]|[fF][R]))((['\"]))",
+      "end": "(\\2)|((?<!\\\\)\\n)",
+      "beginCaptures": {
+        "1": {
+          "name": "string.interpolated.python string.quoted.raw.single.python storage.type.string.python"
+        },
+        "2": {
+          "name": "punctuation.definition.string.begin.python string.quoted.raw.single.python"
+        }
+      },
+      "endCaptures": {
+        "1": {
+          "name": "punctuation.definition.string.end.python string.interpolated.python string.quoted.raw.single.python"
+        },
+        "2": {
+          "name": "invalid.illegal.newline.python"
+        }
+      },
+      "patterns": [
+        {
+          "include": "#fstring-raw-guts"
+        },
+        {
+          "include": "#fstring-illegal-single-brace"
+        },
+        {
+          "include": "#fstring-single-brace"
+        },
+        {
+          "include": "#fstring-raw-single-core"
+        }
+      ]
+    },
+    "fstring-single-core": {
+      "name": "string.interpolated.python string.quoted.single.python",
+      "match": "(?x)\n  (.+?)\n    (\n      (?# .* and .*? in multi-line match need special handling of\n        newlines otherwise SublimeText and Atom will match slightly\n        differently.\n\n        The guard for newlines has to be separate from the\n        lookahead because of special $ matching rule.)\n      ($\\n?)\n      |\n      (?=[\\\\\\}\\{]|(['\"])|((?<!\\\\)\\n))\n    )\n  (?# due to how multiline regexps are matched we need a special case\n    for matching a newline character)\n  | \\n\n"
+    },
+    "fstring-raw-single-core": {
+      "name": "string.interpolated.python string.quoted.raw.single.python",
+      "match": "(?x)\n  (.+?)\n    (\n      (?# .* and .*? in multi-line match need special handling of\n        newlines otherwise SublimeText and Atom will match slightly\n        differently.\n\n        The guard for newlines has to be separate from the\n        lookahead because of special $ matching rule.)\n      ($\\n?)\n      |\n      (?=[\\\\\\}\\{]|(['\"])|((?<!\\\\)\\n))\n    )\n  (?# due to how multiline regexps are matched we need a special case\n    for matching a newline character)\n  | \\n\n"
+    },
+    "fstring-single-brace": {
+      "comment": "value interpolation using { ... }",
+      "begin": "(\\{)",
+      "end": "(?x)\n  (\\})|(?=\\n)\n",
+      "beginCaptures": {
+        "1": {
+          "name": "constant.character.format.placeholder.other.python"
+        }
+      },
+      "endCaptures": {
+        "1": {
+          "name": "constant.character.format.placeholder.other.python"
+        }
+      },
+      "patterns": [
+        {
+          "include": "#fstring-terminator-single"
+        },
+        {
+          "include": "#f-expression"
+        }
+      ]
+    },
+    "fstring-terminator-single": {
+      "patterns": [
+        {
+          "name": "storage.type.format.python",
+          "match": "(![rsa])(?=})"
+        },
+        {
+          "match": "(?x)\n  (![rsa])?\n    ( : \\w? [<>=^]? [-+ ]? \\#?\n      \\d* ,? (\\.\\d+)? [bcdeEfFgGnosxX%]? )(?=})\n",
+          "captures": {
+            "1": {
+              "name": "storage.type.format.python"
+            },
+            "2": {
+              "name": "storage.type.format.python"
+            }
+          }
+        },
+        {
+          "include": "#fstring-terminator-single-tail"
+        }
+      ]
+    },
+    "fstring-terminator-single-tail": {
+      "begin": "(![rsa])?(:)(?=.*?{)",
+      "end": "(?=})|(?=\\n)",
+      "beginCaptures": {
+        "1": {
+          "name": "storage.type.format.python"
+        },
+        "2": {
+          "name": "storage.type.format.python"
+        }
+      },
+      "patterns": [
+        {
+          "include": "#fstring-illegal-single-brace"
+        },
+        {
+          "include": "#fstring-single-brace"
+        },
+        {
+          "name": "storage.type.format.python",
+          "match": "([bcdeEfFgGnosxX%])(?=})"
+        },
+        {
+          "name": "storage.type.format.python",
+          "match": "(\\.\\d+)"
+        },
+        {
+          "name": "storage.type.format.python",
+          "match": "(,)"
+        },
+        {
+          "name": "storage.type.format.python",
+          "match": "(\\d+)"
+        },
+        {
+          "name": "storage.type.format.python",
+          "match": "(\\#)"
+        },
+        {
+          "name": "storage.type.format.python",
+          "match": "([-+ ])"
+        },
+        {
+          "name": "storage.type.format.python",
+          "match": "([<>=^])"
+        },
+        {
+          "name": "storage.type.format.python",
+          "match": "(\\w)"
+        }
+      ]
+    },
+    "fstring-fnorm-quoted-multi-line": {
+      "name": "meta.fstring.python",
+      "begin": "(\\b[fF])([bBuU])?('''|\"\"\")",
+      "end": "(\\3)",
+      "beginCaptures": {
+        "1": {
+          "name": "string.interpolated.python string.quoted.multi.python storage.type.string.python"
+        },
+        "2": {
+          "name": "invalid.illegal.prefix.python"
+        },
+        "3": {
+          "name": "punctuation.definition.string.begin.python string.interpolated.python string.quoted.multi.python"
+        }
+      },
+      "endCaptures": {
+        "1": {
+          "name": "punctuation.definition.string.end.python string.interpolated.python string.quoted.multi.python"
+        },
+        "2": {
+          "name": "invalid.illegal.newline.python"
+        }
+      },
+      "patterns": [
+        {
+          "include": "#fstring-guts"
+        },
+        {
+          "include": "#fstring-illegal-multi-brace"
+        },
+        {
+          "include": "#fstring-multi-brace"
+        },
+        {
+          "include": "#fstring-multi-core"
+        }
+      ]
+    },
+    "fstring-normf-quoted-multi-line": {
+      "name": "meta.fstring.python",
+      "begin": "(\\b[bBuU])([fF])('''|\"\"\")",
+      "end": "(\\3)",
+      "beginCaptures": {
+        "1": {
+          "name": "invalid.illegal.prefix.python"
+        },
+        "2": {
+          "name": "string.interpolated.python string.quoted.multi.python storage.type.string.python"
+        },
+        "3": {
+          "name": "punctuation.definition.string.begin.python string.quoted.multi.python"
+        }
+      },
+      "endCaptures": {
+        "1": {
+          "name": "punctuation.definition.string.end.python string.interpolated.python string.quoted.multi.python"
+        },
+        "2": {
+          "name": "invalid.illegal.newline.python"
+        }
+      },
+      "patterns": [
+        {
+          "include": "#fstring-guts"
+        },
+        {
+          "include": "#fstring-illegal-multi-brace"
+        },
+        {
+          "include": "#fstring-multi-brace"
+        },
+        {
+          "include": "#fstring-multi-core"
+        }
+      ]
+    },
+    "fstring-raw-quoted-multi-line": {
+      "name": "meta.fstring.python",
+      "begin": "(\\b(?:[R][fF]|[fF][R]))('''|\"\"\")",
+      "end": "(\\2)",
+      "beginCaptures": {
+        "1": {
+          "name": "string.interpolated.python string.quoted.raw.multi.python storage.type.string.python"
+        },
+        "2": {
+          "name": "punctuation.definition.string.begin.python string.quoted.raw.multi.python"
+        }
+      },
+      "endCaptures": {
+        "1": {
+          "name": "punctuation.definition.string.end.python string.interpolated.python string.quoted.raw.multi.python"
+        },
+        "2": {
+          "name": "invalid.illegal.newline.python"
+        }
+      },
+      "patterns": [
+        {
+          "include": "#fstring-raw-guts"
+        },
+        {
+          "include": "#fstring-illegal-multi-brace"
+        },
+        {
+          "include": "#fstring-multi-brace"
+        },
+        {
+          "include": "#fstring-raw-multi-core"
+        }
+      ]
+    },
+    "fstring-multi-core": {
+      "name": "string.interpolated.python string.quoted.multi.python",
+      "match": "(?x)\n  (.+?)\n    (\n      (?# .* and .*? in multi-line match need special handling of\n        newlines otherwise SublimeText and Atom will match slightly\n        differently.\n\n        The guard for newlines has to be separate from the\n        lookahead because of special $ matching rule.)\n      ($\\n?)\n      |\n      (?=[\\\\\\}\\{]|'''|\"\"\")\n    )\n  (?# due to how multiline regexps are matched we need a special case\n    for matching a newline character)\n  | \\n\n"
+    },
+    "fstring-raw-multi-core": {
+      "name": "string.interpolated.python string.quoted.raw.multi.python",
+      "match": "(?x)\n  (.+?)\n    (\n      (?# .* and .*? in multi-line match need special handling of\n        newlines otherwise SublimeText and Atom will match slightly\n        differently.\n\n        The guard for newlines has to be separate from the\n        lookahead because of special $ matching rule.)\n      ($\\n?)\n      |\n      (?=[\\\\\\}\\{]|'''|\"\"\")\n    )\n  (?# due to how multiline regexps are matched we need a special case\n    for matching a newline character)\n  | \\n\n"
+    },
+    "fstring-multi-brace": {
+      "comment": "value interpolation using { ... }",
+      "begin": "(\\{)",
+      "end": "(?x)\n  (\\})\n",
+      "beginCaptures": {
+        "1": {
+          "name": "constant.character.format.placeholder.other.python"
+        }
+      },
+      "endCaptures": {
+        "1": {
+          "name": "constant.character.format.placeholder.other.python"
+        }
+      },
+      "patterns": [
+        {
+          "include": "#fstring-terminator-multi"
+        },
+        {
+          "include": "#f-expression"
+        }
+      ]
+    },
+    "fstring-terminator-multi": {
+      "patterns": [
+        {
+          "name": "storage.type.format.python",
+          "match": "(![rsa])(?=})"
+        },
+        {
+          "match": "(?x)\n  (![rsa])?\n    ( : \\w? [<>=^]? [-+ ]? \\#?\n      \\d* ,? (\\.\\d+)? [bcdeEfFgGnosxX%]? )(?=})\n",
+          "captures": {
+            "1": {
+              "name": "storage.type.format.python"
+            },
+            "2": {
+              "name": "storage.type.format.python"
+            }
+          }
+        },
+        {
+          "include": "#fstring-terminator-multi-tail"
+        }
+      ]
+    },
+    "fstring-terminator-multi-tail": {
+      "begin": "(![rsa])?(:)(?=.*?{)",
+      "end": "(?=})",
+      "beginCaptures": {
+        "1": {
+          "name": "storage.type.format.python"
+        },
+        "2": {
+          "name": "storage.type.format.python"
+        }
+      },
+      "patterns": [
+        {
+          "include": "#fstring-illegal-multi-brace"
+        },
+        {
+          "include": "#fstring-multi-brace"
+        },
+        {
+          "name": "storage.type.format.python",
+          "match": "([bcdeEfFgGnosxX%])(?=})"
+        },
+        {
+          "name": "storage.type.format.python",
+          "match": "(\\.\\d+)"
+        },
+        {
+          "name": "storage.type.format.python",
+          "match": "(,)"
+        },
+        {
+          "name": "storage.type.format.python",
+          "match": "(\\d+)"
+        },
+        {
+          "name": "storage.type.format.python",
+          "match": "(\\#)"
+        },
+        {
+          "name": "storage.type.format.python",
+          "match": "([-+ ])"
+        },
+        {
+          "name": "storage.type.format.python",
+          "match": "([<>=^])"
+        },
+        {
+          "name": "storage.type.format.python",
+          "match": "(\\w)"
+        }
+      ]
+    }
+  }
+}

+ 0 - 59
grammars/README.md

@@ -1,59 +0,0 @@
-Grammars fetched from the Internet:
-
-## Hack (source.hack)
-
-Fetched via:
-
-```
-curl -L https://github.com/slackhq/vscode-hack/raw/9232b5468b12922908382a9f7d521e8b53ea6c79/syntaxes/hack.json -o grammars/hack.json
-```
-
-## HTML (text.html.basic)
-
-Fetched via:
-
-```
-curl -L https://github.com/microsoft/vscode-textmate/raw/0730e8ef740d87401764d76e9193f74c6f458b37/test-cases/themes/syntaxes/html.json -o grammars/html.json
-```
-
-## SQL
-
-Fetched via:
-
-```
-curl -L https://github.com/microsoft/vscode-textmate/raw/0730e8ef740d87401764d76e9193f74c6f458b37/test-cases/themes/syntaxes/SQL.plist -o grammars/SQL.plist
-```
-
-## Smarty (source.smarty)
-
-Fetched via:
-
-```
-curl -L https://github.com/Modix/smarty-tmlanguage/raw/a3b46bdeb254d514f1c67227d4842d5bd3751a05/smarty.tmLanguage.json -o grammars/smarty.tmLanguage.json
-```
-
-## Smarty (text.html.smarty)
-
-Fetched via:
-
-```
-curl -L https://github.com/textmate/php-smarty.tmbundle/raw/3888046662241e02f1a7a39eb14bc4844acc082e/Syntaxes/Smarty.plist -o grammars/Smarty.plist
-```
-
-## Python
-
-```
-curl -L https://github.com/microsoft/vscode-textmate/raw/0730e8ef740d87401764d76e9193f74c6f458b37/test-cases/themes/syntaxes/MagicPython.tmLanguage.json -o grammars/MagicPython.tmLanguage.json
-```
-
-## CSS
-
-```
-curl -L https://github.com/microsoft/vscode-textmate/raw/0730e8ef740d87401764d76e9193f74c6f458b37/test-cases/themes/syntaxes/css.plist -o grammars/css.plist
-```
-
-## JavaScript
-
-```
-curl -L https://github.com/microsoft/vscode-textmate/raw/0730e8ef740d87401764d76e9193f74c6f458b37/test-cases/themes/syntaxes/JavaScript.tmLanguage.json -o grammars/JavaScript.tmLanguage.json
-```

+ 0 - 767
grammars/SQL.plist

@@ -1,767 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
-	<key>fileTypes</key>
-	<array>
-		<string>sql</string>
-		<string>ddl</string>
-		<string>dml</string>
-		<string>dsql</string>
-		<string>psql</string>
-	</array>
-	<key>keyEquivalent</key>
-	<string>^~S</string>
-	<key>name</key>
-	<string>SQL</string>
-	<key>patterns</key>
-	<array>
-		<dict>
-			<key>include</key>
-			<string>#comments</string>
-		</dict>
-		<dict>
-			<key>captures</key>
-			<dict>
-				<key>1</key>
-				<dict>
-					<key>name</key>
-					<string>keyword.other.create.sql</string>
-				</dict>
-				<key>2</key>
-				<dict>
-					<key>name</key>
-					<string>keyword.other.sql</string>
-				</dict>
-				<key>5</key>
-				<dict>
-					<key>name</key>
-					<string>entity.name.function.sql</string>
-				</dict>
-			</dict>
-			<key>match</key>
-			<string>(?i:^\s*(create(?:\s+or\s+replace)?)\s+(aggregate|conversion|database|domain|function|group|(unique\s+)?index|language|operator class|operator|rule|schema|sequence|table|tablespace|trigger|type|user|view)\s+)(['"`]?)(\w+)\4</string>
-			<key>name</key>
-			<string>meta.create.sql</string>
-		</dict>
-		<dict>
-			<key>captures</key>
-			<dict>
-				<key>1</key>
-				<dict>
-					<key>name</key>
-					<string>keyword.other.create.sql</string>
-				</dict>
-				<key>2</key>
-				<dict>
-					<key>name</key>
-					<string>keyword.other.sql</string>
-				</dict>
-			</dict>
-			<key>match</key>
-			<string>(?i:^\s*(drop)\s+(aggregate|conversion|database|domain|function|group|index|language|operator class|operator|rule|schema|sequence|table|tablespace|trigger|type|user|view))</string>
-			<key>name</key>
-			<string>meta.drop.sql</string>
-		</dict>
-		<dict>
-			<key>captures</key>
-			<dict>
-				<key>1</key>
-				<dict>
-					<key>name</key>
-					<string>keyword.other.create.sql</string>
-				</dict>
-				<key>2</key>
-				<dict>
-					<key>name</key>
-					<string>keyword.other.table.sql</string>
-				</dict>
-				<key>3</key>
-				<dict>
-					<key>name</key>
-					<string>entity.name.function.sql</string>
-				</dict>
-				<key>4</key>
-				<dict>
-					<key>name</key>
-					<string>keyword.other.cascade.sql</string>
-				</dict>
-			</dict>
-			<key>match</key>
-			<string>(?i:\s*(drop)\s+(table)\s+(\w+)(\s+cascade)?\b)</string>
-			<key>name</key>
-			<string>meta.drop.sql</string>
-		</dict>
-		<dict>
-			<key>captures</key>
-			<dict>
-				<key>1</key>
-				<dict>
-					<key>name</key>
-					<string>keyword.other.create.sql</string>
-				</dict>
-				<key>2</key>
-				<dict>
-					<key>name</key>
-					<string>keyword.other.table.sql</string>
-				</dict>
-			</dict>
-			<key>match</key>
-			<string>(?i:^\s*(alter)\s+(aggregate|conversion|database|domain|function|group|index|language|operator class|operator|rule|schema|sequence|table|tablespace|trigger|type|user|view)\s+)</string>
-			<key>name</key>
-			<string>meta.alter.sql</string>
-		</dict>
-		<dict>
-			<key>captures</key>
-			<dict>
-				<key>1</key>
-				<dict>
-					<key>name</key>
-					<string>storage.type.sql</string>
-				</dict>
-				<key>10</key>
-				<dict>
-					<key>name</key>
-					<string>constant.numeric.sql</string>
-				</dict>
-				<key>11</key>
-				<dict>
-					<key>name</key>
-					<string>storage.type.sql</string>
-				</dict>
-				<key>12</key>
-				<dict>
-					<key>name</key>
-					<string>storage.type.sql</string>
-				</dict>
-				<key>13</key>
-				<dict>
-					<key>name</key>
-					<string>storage.type.sql</string>
-				</dict>
-				<key>14</key>
-				<dict>
-					<key>name</key>
-					<string>constant.numeric.sql</string>
-				</dict>
-				<key>15</key>
-				<dict>
-					<key>name</key>
-					<string>storage.type.sql</string>
-				</dict>
-				<key>2</key>
-				<dict>
-					<key>name</key>
-					<string>storage.type.sql</string>
-				</dict>
-				<key>3</key>
-				<dict>
-					<key>name</key>
-					<string>constant.numeric.sql</string>
-				</dict>
-				<key>4</key>
-				<dict>
-					<key>name</key>
-					<string>storage.type.sql</string>
-				</dict>
-				<key>5</key>
-				<dict>
-					<key>name</key>
-					<string>constant.numeric.sql</string>
-				</dict>
-				<key>6</key>
-				<dict>
-					<key>name</key>
-					<string>storage.type.sql</string>
-				</dict>
-				<key>7</key>
-				<dict>
-					<key>name</key>
-					<string>constant.numeric.sql</string>
-				</dict>
-				<key>8</key>
-				<dict>
-					<key>name</key>
-					<string>constant.numeric.sql</string>
-				</dict>
-				<key>9</key>
-				<dict>
-					<key>name</key>
-					<string>storage.type.sql</string>
-				</dict>
-			</dict>
-			<key>match</key>
-			<string>(?xi)
-
-				# normal stuff, capture 1
-				 \b(bigint|bigserial|bit|boolean|box|bytea|cidr|circle|date|double\sprecision|inet|int|integer|line|lseg|macaddr|money|oid|path|point|polygon|real|serial|smallint|sysdate|text)\b
-
-				# numeric suffix, capture 2 + 3i
-				|\b(bit\svarying|character\s(?:varying)?|tinyint|var\schar|float|interval)\((\d+)\)
-
-				# optional numeric suffix, capture 4 + 5i
-				|\b(char|number|varchar\d?)\b(?:\((\d+)\))?
-
-				# special case, capture 6 + 7i + 8i
-				|\b(numeric|decimal)\b(?:\((\d+),(\d+)\))?
-
-				# special case, captures 9, 10i, 11
-				|\b(times?)\b(?:\((\d+)\))?(\swith(?:out)?\stime\szone\b)?
-
-				# special case, captures 12, 13, 14i, 15
-				|\b(timestamp)(?:(s|tz))?\b(?:\((\d+)\))?(\s(with|without)\stime\szone\b)?
-
-			</string>
-		</dict>
-		<dict>
-			<key>match</key>
-			<string>(?i:\b((?:primary|foreign)\s+key|references|on\sdelete(\s+cascade)?|check|constraint)\b)</string>
-			<key>name</key>
-			<string>storage.modifier.sql</string>
-		</dict>
-		<dict>
-			<key>match</key>
-			<string>\b\d+\b</string>
-			<key>name</key>
-			<string>constant.numeric.sql</string>
-		</dict>
-		<dict>
-			<key>match</key>
-			<string>(?i:\b(select(\s+distinct)?|insert\s+(ignore\s+)?into|update|delete|from|declare|set|where|group\sby|or|like|and|union(\s+all)?|having|order\sby|limit|(inner|cross)\s+join|join|straight_join|(left|right)(\s+outer)?\s+join|natural(\s+(left|right)(\s+outer)?)?\s+join)\b)</string>
-			<key>name</key>
-			<string>keyword.other.DML.sql</string>
-		</dict>
-		<dict>
-			<key>match</key>
-			<string>(?i:\b(on|((is\s+)?not\s+)?null)\b)</string>
-			<key>name</key>
-			<string>keyword.other.DDL.create.II.sql</string>
-		</dict>
-		<dict>
-			<key>match</key>
-			<string>(?i:\b(values|go|use|into|exec|execute|openquery)\b)</string>
-			<key>name</key>
-			<string>keyword.other.DML.II.sql</string>
-		</dict>
-		<dict>
-			<key>match</key>
-			<string>(?i:\b(begin(\s+work)?|start\s+transaction|commit(\s+work)?|rollback(\s+work)?)\b)</string>
-			<key>name</key>
-			<string>keyword.other.LUW.sql</string>
-		</dict>
-		<dict>
-			<key>match</key>
-			<string>(?i:\b(grant(\swith\sgrant\soption)?|revoke)\b)</string>
-			<key>name</key>
-			<string>keyword.other.authorization.sql</string>
-		</dict>
-		<dict>
-			<key>match</key>
-			<string>(?i:\bin\b)</string>
-			<key>name</key>
-			<string>keyword.other.data-integrity.sql</string>
-		</dict>
-		<dict>
-			<key>match</key>
-			<string>(?i:^\s*(comment\s+on\s+(table|column|aggregate|constraint|database|domain|function|index|operator|rule|schema|sequence|trigger|type|view))\s+.*?\s+(is)\s+)</string>
-			<key>name</key>
-			<string>keyword.other.object-comments.sql</string>
-		</dict>
-		<dict>
-			<key>match</key>
-			<string>(?i)\bAS\b</string>
-			<key>name</key>
-			<string>keyword.other.alias.sql</string>
-		</dict>
-		<dict>
-			<key>match</key>
-			<string>(?i)\b(DESC|ASC)\b</string>
-			<key>name</key>
-			<string>keyword.other.order.sql</string>
-		</dict>
-		<dict>
-			<key>match</key>
-			<string>\*</string>
-			<key>name</key>
-			<string>keyword.operator.star.sql</string>
-		</dict>
-		<dict>
-			<key>match</key>
-			<string>[!&lt;&gt;]?=|&lt;&gt;|&lt;|&gt;</string>
-			<key>name</key>
-			<string>keyword.operator.comparison.sql</string>
-		</dict>
-		<dict>
-			<key>match</key>
-			<string>-|\+|/</string>
-			<key>name</key>
-			<string>keyword.operator.math.sql</string>
-		</dict>
-		<dict>
-			<key>match</key>
-			<string>\|\|</string>
-			<key>name</key>
-			<string>keyword.operator.concatenator.sql</string>
-		</dict>
-		<dict>
-			<key>comment</key>
-			<string>List of SQL99 built-in functions from http://www.oreilly.com/catalog/sqlnut/chapter/ch04.html</string>
-			<key>match</key>
-			<string>(?i)\b(CURRENT_(DATE|TIME(STAMP)?|USER)|(SESSION|SYSTEM)_USER)\b</string>
-			<key>name</key>
-			<string>support.function.scalar.sql</string>
-		</dict>
-		<dict>
-			<key>comment</key>
-			<string>List of SQL99 built-in functions from http://www.oreilly.com/catalog/sqlnut/chapter/ch04.html</string>
-			<key>match</key>
-			<string>(?i)\b(AVG|COUNT|MIN|MAX|SUM)(?=\s*\()</string>
-			<key>name</key>
-			<string>support.function.aggregate.sql</string>
-		</dict>
-		<dict>
-			<key>match</key>
-			<string>(?i)\b(CONCATENATE|CONVERT|LOWER|SUBSTRING|TRANSLATE|TRIM|UPPER)\b</string>
-			<key>name</key>
-			<string>support.function.string.sql</string>
-		</dict>
-		<dict>
-			<key>captures</key>
-			<dict>
-				<key>1</key>
-				<dict>
-					<key>name</key>
-					<string>constant.other.database-name.sql</string>
-				</dict>
-				<key>2</key>
-				<dict>
-					<key>name</key>
-					<string>constant.other.table-name.sql</string>
-				</dict>
-			</dict>
-			<key>match</key>
-			<string>(\w+?)\.(\w+)</string>
-		</dict>
-		<dict>
-			<key>include</key>
-			<string>#strings</string>
-		</dict>
-		<dict>
-			<key>include</key>
-			<string>#regexps</string>
-		</dict>
-		<dict>
-			<key>captures</key>
-			<dict>
-				<key>1</key>
-				<dict>
-					<key>name</key>
-					<string>punctuation.section.scope.begin.sql</string>
-				</dict>
-				<key>2</key>
-				<dict>
-					<key>name</key>
-					<string>punctuation.section.scope.end.sql</string>
-				</dict>
-			</dict>
-			<key>comment</key>
-			<string>Allow for special ↩ behavior</string>
-			<key>match</key>
-			<string>(\()(\))</string>
-			<key>name</key>
-			<string>meta.block.sql</string>
-		</dict>
-	</array>
-	<key>repository</key>
-	<dict>
-		<key>comments</key>
-		<dict>
-			<key>patterns</key>
-			<array>
-				<dict>
-					<key>begin</key>
-					<string>(^[ \t]+)?(?=--)</string>
-					<key>beginCaptures</key>
-					<dict>
-						<key>1</key>
-						<dict>
-							<key>name</key>
-							<string>punctuation.whitespace.comment.leading.sql</string>
-						</dict>
-					</dict>
-					<key>end</key>
-					<string>(?!\G)</string>
-					<key>patterns</key>
-					<array>
-						<dict>
-							<key>begin</key>
-							<string>--</string>
-							<key>beginCaptures</key>
-							<dict>
-								<key>0</key>
-								<dict>
-									<key>name</key>
-									<string>punctuation.definition.comment.sql</string>
-								</dict>
-							</dict>
-							<key>end</key>
-							<string>\n</string>
-							<key>name</key>
-							<string>comment.line.double-dash.sql</string>
-						</dict>
-					</array>
-				</dict>
-				<dict>
-					<key>begin</key>
-					<string>(^[ \t]+)?(?=#)</string>
-					<key>beginCaptures</key>
-					<dict>
-						<key>1</key>
-						<dict>
-							<key>name</key>
-							<string>punctuation.whitespace.comment.leading.sql</string>
-						</dict>
-					</dict>
-					<key>end</key>
-					<string>(?!\G)</string>
-					<key>patterns</key>
-					<array>
-						<dict>
-							<key>begin</key>
-							<string>#</string>
-							<key>beginCaptures</key>
-							<dict>
-								<key>0</key>
-								<dict>
-									<key>name</key>
-									<string>punctuation.definition.comment.sql</string>
-								</dict>
-							</dict>
-							<key>end</key>
-							<string>\n</string>
-							<key>name</key>
-							<string>comment.line.number-sign.sql</string>
-						</dict>
-					</array>
-				</dict>
-				<dict>
-					<key>begin</key>
-					<string>/\*</string>
-					<key>captures</key>
-					<dict>
-						<key>0</key>
-						<dict>
-							<key>name</key>
-							<string>punctuation.definition.comment.sql</string>
-						</dict>
-					</dict>
-					<key>end</key>
-					<string>\*/</string>
-					<key>name</key>
-					<string>comment.block.c</string>
-				</dict>
-			</array>
-		</dict>
-		<key>regexps</key>
-		<dict>
-			<key>patterns</key>
-			<array>
-				<dict>
-					<key>begin</key>
-					<string>/(?=\S.*/)</string>
-					<key>beginCaptures</key>
-					<dict>
-						<key>0</key>
-						<dict>
-							<key>name</key>
-							<string>punctuation.definition.string.begin.sql</string>
-						</dict>
-					</dict>
-					<key>end</key>
-					<string>/</string>
-					<key>endCaptures</key>
-					<dict>
-						<key>0</key>
-						<dict>
-							<key>name</key>
-							<string>punctuation.definition.string.end.sql</string>
-						</dict>
-					</dict>
-					<key>name</key>
-					<string>string.regexp.sql</string>
-					<key>patterns</key>
-					<array>
-						<dict>
-							<key>include</key>
-							<string>#string_interpolation</string>
-						</dict>
-						<dict>
-							<key>match</key>
-							<string>\\/</string>
-							<key>name</key>
-							<string>constant.character.escape.slash.sql</string>
-						</dict>
-					</array>
-				</dict>
-				<dict>
-					<key>begin</key>
-					<string>%r\{</string>
-					<key>beginCaptures</key>
-					<dict>
-						<key>0</key>
-						<dict>
-							<key>name</key>
-							<string>punctuation.definition.string.begin.sql</string>
-						</dict>
-					</dict>
-					<key>comment</key>
-					<string>We should probably handle nested bracket pairs!?! -- Allan</string>
-					<key>end</key>
-					<string>\}</string>
-					<key>endCaptures</key>
-					<dict>
-						<key>0</key>
-						<dict>
-							<key>name</key>
-							<string>punctuation.definition.string.end.sql</string>
-						</dict>
-					</dict>
-					<key>name</key>
-					<string>string.regexp.modr.sql</string>
-					<key>patterns</key>
-					<array>
-						<dict>
-							<key>include</key>
-							<string>#string_interpolation</string>
-						</dict>
-					</array>
-				</dict>
-			</array>
-		</dict>
-		<key>string_escape</key>
-		<dict>
-			<key>match</key>
-			<string>\\.</string>
-			<key>name</key>
-			<string>constant.character.escape.sql</string>
-		</dict>
-		<key>string_interpolation</key>
-		<dict>
-			<key>captures</key>
-			<dict>
-				<key>1</key>
-				<dict>
-					<key>name</key>
-					<string>punctuation.definition.string.begin.sql</string>
-				</dict>
-				<key>3</key>
-				<dict>
-					<key>name</key>
-					<string>punctuation.definition.string.end.sql</string>
-				</dict>
-			</dict>
-			<key>match</key>
-			<string>(#\{)([^\}]*)(\})</string>
-			<key>name</key>
-			<string>string.interpolated.sql</string>
-		</dict>
-		<key>strings</key>
-		<dict>
-			<key>patterns</key>
-			<array>
-				<dict>
-					<key>captures</key>
-					<dict>
-						<key>1</key>
-						<dict>
-							<key>name</key>
-							<string>punctuation.definition.string.begin.sql</string>
-						</dict>
-						<key>2</key>
-						<dict>
-							<key>name</key>
-							<string>punctuation.definition.string.end.sql</string>
-						</dict>
-					</dict>
-					<key>comment</key>
-					<string>this is faster than the next begin/end rule since sub-pattern will match till end-of-line and SQL files tend to have very long lines.</string>
-					<key>match</key>
-					<string>(')[^'\\]*(')</string>
-					<key>name</key>
-					<string>string.quoted.single.sql</string>
-				</dict>
-				<dict>
-					<key>begin</key>
-					<string>'</string>
-					<key>beginCaptures</key>
-					<dict>
-						<key>0</key>
-						<dict>
-							<key>name</key>
-							<string>punctuation.definition.string.begin.sql</string>
-						</dict>
-					</dict>
-					<key>end</key>
-					<string>'</string>
-					<key>endCaptures</key>
-					<dict>
-						<key>0</key>
-						<dict>
-							<key>name</key>
-							<string>punctuation.definition.string.end.sql</string>
-						</dict>
-					</dict>
-					<key>name</key>
-					<string>string.quoted.single.sql</string>
-					<key>patterns</key>
-					<array>
-						<dict>
-							<key>include</key>
-							<string>#string_escape</string>
-						</dict>
-					</array>
-				</dict>
-				<dict>
-					<key>captures</key>
-					<dict>
-						<key>1</key>
-						<dict>
-							<key>name</key>
-							<string>punctuation.definition.string.begin.sql</string>
-						</dict>
-						<key>2</key>
-						<dict>
-							<key>name</key>
-							<string>punctuation.definition.string.end.sql</string>
-						</dict>
-					</dict>
-					<key>comment</key>
-					<string>this is faster than the next begin/end rule since sub-pattern will match till end-of-line and SQL files tend to have very long lines.</string>
-					<key>match</key>
-					<string>(`)[^`\\]*(`)</string>
-					<key>name</key>
-					<string>string.quoted.other.backtick.sql</string>
-				</dict>
-				<dict>
-					<key>begin</key>
-					<string>`</string>
-					<key>beginCaptures</key>
-					<dict>
-						<key>0</key>
-						<dict>
-							<key>name</key>
-							<string>punctuation.definition.string.begin.sql</string>
-						</dict>
-					</dict>
-					<key>end</key>
-					<string>`</string>
-					<key>endCaptures</key>
-					<dict>
-						<key>0</key>
-						<dict>
-							<key>name</key>
-							<string>punctuation.definition.string.end.sql</string>
-						</dict>
-					</dict>
-					<key>name</key>
-					<string>string.quoted.other.backtick.sql</string>
-					<key>patterns</key>
-					<array>
-						<dict>
-							<key>include</key>
-							<string>#string_escape</string>
-						</dict>
-					</array>
-				</dict>
-				<dict>
-					<key>captures</key>
-					<dict>
-						<key>1</key>
-						<dict>
-							<key>name</key>
-							<string>punctuation.definition.string.begin.sql</string>
-						</dict>
-						<key>2</key>
-						<dict>
-							<key>name</key>
-							<string>punctuation.definition.string.end.sql</string>
-						</dict>
-					</dict>
-					<key>comment</key>
-					<string>this is faster than the next begin/end rule since sub-pattern will match till end-of-line and SQL files tend to have very long lines.</string>
-					<key>match</key>
-					<string>(")[^"#]*(")</string>
-					<key>name</key>
-					<string>string.quoted.double.sql</string>
-				</dict>
-				<dict>
-					<key>begin</key>
-					<string>"</string>
-					<key>beginCaptures</key>
-					<dict>
-						<key>0</key>
-						<dict>
-							<key>name</key>
-							<string>punctuation.definition.string.begin.sql</string>
-						</dict>
-					</dict>
-					<key>end</key>
-					<string>"</string>
-					<key>endCaptures</key>
-					<dict>
-						<key>0</key>
-						<dict>
-							<key>name</key>
-							<string>punctuation.definition.string.end.sql</string>
-						</dict>
-					</dict>
-					<key>name</key>
-					<string>string.quoted.double.sql</string>
-					<key>patterns</key>
-					<array>
-						<dict>
-							<key>include</key>
-							<string>#string_interpolation</string>
-						</dict>
-					</array>
-				</dict>
-				<dict>
-					<key>begin</key>
-					<string>%\{</string>
-					<key>beginCaptures</key>
-					<dict>
-						<key>0</key>
-						<dict>
-							<key>name</key>
-							<string>punctuation.definition.string.begin.sql</string>
-						</dict>
-					</dict>
-					<key>end</key>
-					<string>\}</string>
-					<key>endCaptures</key>
-					<dict>
-						<key>0</key>
-						<dict>
-							<key>name</key>
-							<string>punctuation.definition.string.end.sql</string>
-						</dict>
-					</dict>
-					<key>name</key>
-					<string>string.other.quoted.brackets.sql</string>
-					<key>patterns</key>
-					<array>
-						<dict>
-							<key>include</key>
-							<string>#string_interpolation</string>
-						</dict>
-					</array>
-				</dict>
-			</array>
-		</dict>
-	</dict>
-	<key>scopeName</key>
-	<string>source.sql</string>
-	<key>uuid</key>
-	<string>C49120AC-6ECC-11D9-ACC8-000D93589AF6</string>
-</dict>
-</plist>

+ 0 - 373
grammars/Smarty.plist

@@ -1,373 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
-	<key>fileTypes</key>
-	<array>
-		<string>tpl</string>
-	</array>
-	<key>injections</key>
-	<dict>
-		<key>text.html.smarty - (meta.embedded | meta.tag | comment.block | meta.block.literal), L:text.html.smarty meta.tag</key>
-		<dict>
-			<key>patterns</key>
-			<array>
-				<dict>
-					<key>include</key>
-					<string>#comments</string>
-				</dict>
-				<dict>
-					<key>include</key>
-					<string>#blocks</string>
-				</dict>
-			</array>
-		</dict>
-	</dict>
-	<key>keyEquivalent</key>
-	<string>^~S</string>
-	<key>name</key>
-	<string>Smarty</string>
-	<key>patterns</key>
-	<array>
-		<dict>
-			<key>include</key>
-			<string>text.html.basic</string>
-		</dict>
-	</array>
-	<key>repository</key>
-	<dict>
-		<key>blocks</key>
-		<dict>
-			<key>patterns</key>
-			<array>
-				<dict>
-					<key>begin</key>
-					<string>(\{)(literal)(\})</string>
-					<key>captures</key>
-					<dict>
-						<key>0</key>
-						<dict>
-							<key>name</key>
-							<string>meta.embedded.line.tag.literal.smarty</string>
-						</dict>
-						<key>1</key>
-						<dict>
-							<key>name</key>
-							<string>punctuation.definition.tag.begin.smarty</string>
-						</dict>
-						<key>2</key>
-						<dict>
-							<key>name</key>
-							<string>support.function.built-in.smarty</string>
-						</dict>
-						<key>3</key>
-						<dict>
-							<key>name</key>
-							<string>punctuation.definition.tag.end.smarty</string>
-						</dict>
-					</dict>
-					<key>end</key>
-					<string>(\{/)(literal)(\})</string>
-					<key>name</key>
-					<string>meta.block.literal.smarty</string>
-					<key>patterns</key>
-					<array>
-						<dict>
-							<key>include</key>
-							<string>text.html.basic</string>
-						</dict>
-					</array>
-				</dict>
-				<dict>
-					<key>begin</key>
-					<string>(\{%?)</string>
-					<key>beginCaptures</key>
-					<dict>
-						<key>0</key>
-						<dict>
-							<key>name</key>
-							<string>source.smarty</string>
-						</dict>
-						<key>1</key>
-						<dict>
-							<key>name</key>
-							<string>punctuation.section.embedded.begin.smarty</string>
-						</dict>
-					</dict>
-					<key>contentName</key>
-					<string>source.smarty</string>
-					<key>end</key>
-					<string>(%?\})</string>
-					<key>endCaptures</key>
-					<dict>
-						<key>0</key>
-						<dict>
-							<key>name</key>
-							<string>source.smarty</string>
-						</dict>
-						<key>1</key>
-						<dict>
-							<key>name</key>
-							<string>punctuation.section.embedded.end.smarty</string>
-						</dict>
-					</dict>
-					<key>name</key>
-					<string>meta.embedded.line.tag.smarty</string>
-					<key>patterns</key>
-					<array>
-						<dict>
-							<key>include</key>
-							<string>#strings</string>
-						</dict>
-						<dict>
-							<key>include</key>
-							<string>#variables</string>
-						</dict>
-						<dict>
-							<key>include</key>
-							<string>#lang</string>
-						</dict>
-					</array>
-				</dict>
-			</array>
-		</dict>
-		<key>comments</key>
-		<dict>
-			<key>patterns</key>
-			<array>
-				<dict>
-					<key>begin</key>
-					<string>(\{%?)\*</string>
-					<key>beginCaptures</key>
-					<dict>
-						<key>1</key>
-						<dict>
-							<key>name</key>
-							<string>punctuation.definition.comment.smarty</string>
-						</dict>
-					</dict>
-					<key>end</key>
-					<string>\*(%?\})</string>
-					<key>name</key>
-					<string>comment.block.smarty</string>
-					<key>patterns</key>
-					<array/>
-				</dict>
-			</array>
-		</dict>
-		<key>lang</key>
-		<dict>
-			<key>patterns</key>
-			<array>
-				<dict>
-					<key>match</key>
-					<string>(!==|!=|!|&lt;=|&gt;=|&lt;|&gt;|===|==|%|&amp;&amp;|\|\|)|\b(and|or|eq|neq|ne|gte|gt|ge|lte|lt|le|not|mod)\b</string>
-					<key>name</key>
-					<string>keyword.operator.smarty</string>
-				</dict>
-				<dict>
-					<key>match</key>
-					<string>\b(TRUE|FALSE|true|false)\b</string>
-					<key>name</key>
-					<string>constant.language.smarty</string>
-				</dict>
-				<dict>
-					<key>match</key>
-					<string>\b(if|else|elseif|foreach|foreachelse|section|switch|case|break|default)\b</string>
-					<key>name</key>
-					<string>keyword.control.smarty</string>
-				</dict>
-				<dict>
-					<key>captures</key>
-					<dict>
-						<key>0</key>
-						<dict>
-							<key>name</key>
-							<string>variable.parameter.smarty</string>
-						</dict>
-					</dict>
-					<key>match</key>
-					<string>\b([a-zA-Z]+)=</string>
-					<key>name</key>
-					<string>meta.attribute.smarty</string>
-				</dict>
-				<dict>
-					<key>match</key>
-					<string>\b(capture|config_load|counter|cycle|debug|eval|fetch|include_php|include|insert|literal|math|strip|rdelim|ldelim|assign|constant|block|html_[a-z_]*)\b</string>
-					<key>name</key>
-					<string>support.function.built-in.smarty</string>
-				</dict>
-				<dict>
-					<key>match</key>
-					<string>\|(capitalize|cat|count_characters|count_paragraphs|count_sentences|count_words|date_format|default|escape|indent|lower|nl2br|regex_replace|replace|spacify|string_format|strip_tags|strip|truncate|upper|wordwrap)</string>
-					<key>name</key>
-					<string>support.function.variable-modifier.smarty</string>
-				</dict>
-			</array>
-		</dict>
-		<key>strings</key>
-		<dict>
-			<key>patterns</key>
-			<array>
-				<dict>
-					<key>begin</key>
-					<string>'</string>
-					<key>beginCaptures</key>
-					<dict>
-						<key>0</key>
-						<dict>
-							<key>name</key>
-							<string>punctuation.definition.string.begin.smarty</string>
-						</dict>
-					</dict>
-					<key>end</key>
-					<string>'</string>
-					<key>endCaptures</key>
-					<dict>
-						<key>0</key>
-						<dict>
-							<key>name</key>
-							<string>punctuation.definition.string.end.smarty</string>
-						</dict>
-					</dict>
-					<key>name</key>
-					<string>string.quoted.single.smarty</string>
-					<key>patterns</key>
-					<array>
-						<dict>
-							<key>match</key>
-							<string>\\.</string>
-							<key>name</key>
-							<string>constant.character.escape.smarty</string>
-						</dict>
-					</array>
-				</dict>
-				<dict>
-					<key>begin</key>
-					<string>"</string>
-					<key>beginCaptures</key>
-					<dict>
-						<key>0</key>
-						<dict>
-							<key>name</key>
-							<string>punctuation.definition.string.begin.smarty</string>
-						</dict>
-					</dict>
-					<key>end</key>
-					<string>"</string>
-					<key>endCaptures</key>
-					<dict>
-						<key>0</key>
-						<dict>
-							<key>name</key>
-							<string>punctuation.definition.string.end.smarty</string>
-						</dict>
-					</dict>
-					<key>name</key>
-					<string>string.quoted.double.smarty</string>
-					<key>patterns</key>
-					<array>
-						<dict>
-							<key>match</key>
-							<string>\\.</string>
-							<key>name</key>
-							<string>constant.character.escape.smarty</string>
-						</dict>
-					</array>
-				</dict>
-			</array>
-		</dict>
-		<key>variables</key>
-		<dict>
-			<key>patterns</key>
-			<array>
-				<dict>
-					<key>captures</key>
-					<dict>
-						<key>1</key>
-						<dict>
-							<key>name</key>
-							<string>punctuation.definition.variable.smarty</string>
-						</dict>
-					</dict>
-					<key>match</key>
-					<string>\b(\$)Smarty\.</string>
-					<key>name</key>
-					<string>variable.other.global.smarty</string>
-				</dict>
-				<dict>
-					<key>captures</key>
-					<dict>
-						<key>1</key>
-						<dict>
-							<key>name</key>
-							<string>punctuation.definition.variable.smarty</string>
-						</dict>
-						<key>2</key>
-						<dict>
-							<key>name</key>
-							<string>variable.other.smarty</string>
-						</dict>
-					</dict>
-					<key>match</key>
-					<string>(\$)([a-zA-Z_][a-zA-Z0-9_]*)\b</string>
-					<key>name</key>
-					<string>variable.other.smarty</string>
-				</dict>
-				<dict>
-					<key>captures</key>
-					<dict>
-						<key>1</key>
-						<dict>
-							<key>name</key>
-							<string>keyword.operator.smarty</string>
-						</dict>
-						<key>2</key>
-						<dict>
-							<key>name</key>
-							<string>variable.other.property.smarty</string>
-						</dict>
-					</dict>
-					<key>match</key>
-					<string>(-&gt;)([a-zA-Z_][a-zA-Z0-9_]*)\b</string>
-					<key>name</key>
-					<string>variable.other.smarty</string>
-				</dict>
-				<dict>
-					<key>captures</key>
-					<dict>
-						<key>1</key>
-						<dict>
-							<key>name</key>
-							<string>keyword.operator.smarty</string>
-						</dict>
-						<key>2</key>
-						<dict>
-							<key>name</key>
-							<string>meta.function-call.object.smarty</string>
-						</dict>
-						<key>3</key>
-						<dict>
-							<key>name</key>
-							<string>punctuation.definition.variable.smarty</string>
-						</dict>
-						<key>4</key>
-						<dict>
-							<key>name</key>
-							<string>punctuation.definition.variable.smarty</string>
-						</dict>
-					</dict>
-					<key>match</key>
-					<string>(-&gt;)([a-zA-Z_][a-zA-Z0-9_]*)(\().*?(\))</string>
-					<key>name</key>
-					<string>variable.other.smarty</string>
-				</dict>
-			</array>
-		</dict>
-	</dict>
-	<key>scopeName</key>
-	<string>text.html.smarty</string>
-	<key>uuid</key>
-	<string>4D6BBA54-E3FC-4296-9CA1-662B2AD537C6</string>
-</dict>
-</plist>

Fișier diff suprimat deoarece este prea mare
+ 0 - 534
grammars/css.plist


Fișier diff suprimat deoarece este prea mare
+ 0 - 23
grammars/hack.json


+ 0 - 553
grammars/html.json

@@ -1,553 +0,0 @@
-{
-	"fileTypes": [
-		"html",
-		"htm",
-		"shtml",
-		"xhtml",
-		"inc",
-		"tmpl",
-		"tpl"
-	],
-	"firstLineMatch": "<(?i:(!DOCTYPE\\s*)?html)",
-	"injections": {
-		"R:text.html - comment.block": {
-			"comment": "Use R: to ensure this matches after any other injections.",
-			"patterns": [
-				{
-					"match": "<",
-					"name": "invalid.illegal.bad-angle-bracket.html"
-				}
-			]
-		}
-	},
-	"keyEquivalent": "^~H",
-	"name": "HTML",
-	"patterns": [
-		{
-			"begin": "(<)([a-zA-Z0-9:\\-]++)(?=[^>]*></\\2>)",
-			"beginCaptures": {
-				"1": {
-					"name": "punctuation.definition.tag.html"
-				},
-				"2": {
-					"name": "entity.name.tag.html"
-				}
-			},
-			"end": "(>(<)/)(\\2)(>)",
-			"endCaptures": {
-				"1": {
-					"name": "punctuation.definition.tag.html"
-				},
-				"2": {
-					"name": "meta.scope.between-tag-pair.html"
-				},
-				"3": {
-					"name": "entity.name.tag.html"
-				},
-				"4": {
-					"name": "punctuation.definition.tag.html"
-				}
-			},
-			"name": "meta.tag.any.html",
-			"patterns": [
-				{
-					"include": "#tag-stuff"
-				}
-			]
-		},
-		{
-			"begin": "(<\\?)(xml)",
-			"captures": {
-				"1": {
-					"name": "punctuation.definition.tag.html"
-				},
-				"2": {
-					"name": "entity.name.tag.xml.html"
-				}
-			},
-			"end": "(\\?>)",
-			"name": "meta.tag.preprocessor.xml.html",
-			"patterns": [
-				{
-					"include": "#tag-generic-attribute"
-				},
-				{
-					"include": "#string-double-quoted"
-				},
-				{
-					"include": "#string-single-quoted"
-				}
-			]
-		},
-		{
-			"begin": "<!--",
-			"captures": {
-				"0": {
-					"name": "punctuation.definition.comment.html"
-				}
-			},
-			"end": "--\\s*>",
-			"name": "comment.block.html",
-			"patterns": [
-				{
-					"match": "--",
-					"name": "invalid.illegal.bad-comments-or-CDATA.html"
-				},
-				{
-					"include": "#embedded-code"
-				}
-			]
-		},
-		{
-			"begin": "<!",
-			"captures": {
-				"0": {
-					"name": "punctuation.definition.tag.html"
-				}
-			},
-			"end": ">",
-			"name": "meta.tag.sgml.html",
-			"patterns": [
-				{
-					"begin": "(?i:DOCTYPE)",
-					"captures": {
-						"1": {
-							"name": "entity.name.tag.doctype.html"
-						}
-					},
-					"end": "(?=>)",
-					"name": "meta.tag.sgml.doctype.html",
-					"patterns": [
-						{
-							"match": "\"[^\">]*\"",
-							"name": "string.quoted.double.doctype.identifiers-and-DTDs.html"
-						}
-					]
-				},
-				{
-					"begin": "\\[CDATA\\[",
-					"end": "]](?=>)",
-					"name": "constant.other.inline-data.html"
-				},
-				{
-					"match": "(\\s*)(?!--|>)\\S(\\s*)",
-					"name": "invalid.illegal.bad-comments-or-CDATA.html"
-				}
-			]
-		},
-		{
-			"include": "#embedded-code"
-		},
-		{
-			"begin": "(?:^\\s+)?(<)((?i:style))\\b(?![^>]*/>)",
-			"captures": {
-				"1": {
-					"name": "punctuation.definition.tag.html"
-				},
-				"2": {
-					"name": "entity.name.tag.style.html"
-				},
-				"3": {
-					"name": "punctuation.definition.tag.html"
-				}
-			},
-			"end": "(</)((?i:style))(>)(?:\\s*\\n)?",
-			"contentName": "source.css.embedded.html",
-			"patterns": [
-				{
-					"include": "#tag-stuff"
-				},
-				{
-					"begin": "(>)",
-					"beginCaptures": {
-						"1": {
-							"name": "punctuation.definition.tag.html"
-						}
-					},
-					"end": "(?=</(?i:style))",
-					"patterns": [
-						{
-							"include": "#embedded-code"
-						},
-						{
-							"include": "source.css"
-						}
-					]
-				}
-			]
-		},
-		{
-			"begin": "(?:^\\s+)?(<)((?i:script))\\b(?![^>]*/>)(?![^>]*(?i:type.?=.?text/((?!javascript).*)))",
-			"beginCaptures": {
-				"1": {
-					"name": "punctuation.definition.tag.html"
-				},
-				"2": {
-					"name": "entity.name.tag.script.html"
-				}
-			},
-			"end": "(?<=</(script|SCRIPT))(>)(?:\\s*\\n)?",
-			"endCaptures": {
-				"2": {
-					"name": "punctuation.definition.tag.html"
-				}
-			},
-			"contentName": "source.js.embedded.html",
-			"patterns": [
-				{
-					"include": "#tag-stuff"
-				},
-				{
-					"begin": "(?<!</(?:script|SCRIPT))(>)",
-					"captures": {
-						"1": {
-							"name": "punctuation.definition.tag.html"
-						},
-						"2": {
-							"name": "entity.name.tag.script.html"
-						}
-					},
-					"end": "(</)((?i:script))",
-					"patterns": [
-						{
-							"captures": {
-								"1": {
-									"name": "punctuation.definition.comment.js"
-								}
-							},
-							"match": "(//).*?((?=</script)|$\\n?)",
-							"name": "comment.line.double-slash.js"
-						},
-						{
-							"begin": "/\\*",
-							"captures": {
-								"0": {
-									"name": "punctuation.definition.comment.js"
-								}
-							},
-							"end": "\\*/|(?=</script)",
-							"name": "comment.block.js"
-						},
-						{
-							"include": "source.js"
-						}
-					]
-				}
-			]
-		},
-		{
-			"begin": "(</?)((?i:body|head|html)(?=\\s|\\\\|>))",
-			"captures": {
-				"1": {
-					"name": "punctuation.definition.tag.html"
-				},
-				"2": {
-					"name": "entity.name.tag.structure.any.html"
-				}
-			},
-			"end": "(>)",
-			"name": "meta.tag.structure.any.html",
-			"patterns": [
-				{
-					"include": "#tag-stuff"
-				}
-			]
-		},
-		{
-			"begin": "(</?)((?i:address|blockquote|dd|div|section|article|aside|header|footer|nav|menu|dl|dt|fieldset|form|frame|frameset|h1|h2|h3|h4|h5|h6|iframe|noframes|object|ol|p|ul|applet|center|dir|hr|pre)(?=\\s|\\\\|>))",
-			"beginCaptures": {
-				"1": {
-					"name": "punctuation.definition.tag.begin.html"
-				},
-				"2": {
-					"name": "entity.name.tag.block.any.html"
-				}
-			},
-			"end": "(>)",
-			"endCaptures": {
-				"1": {
-					"name": "punctuation.definition.tag.end.html"
-				}
-			},
-			"name": "meta.tag.block.any.html",
-			"patterns": [
-				{
-					"include": "#tag-stuff"
-				}
-			]
-		},
-		{
-			"begin": "(</?)((?i:a|abbr|acronym|area|b|base|basefont|bdo|big|br|button|caption|cite|code|col|colgroup|del|dfn|em|font|head|html|i|img|input|ins|isindex|kbd|label|legend|li|link|map|meta|noscript|optgroup|option|param|q|s|samp|script|select|small|span|strike|strong|style|sub|sup|table|tbody|td|textarea|tfoot|th|thead|title|tr|tt|u|var)(?=\\s|\\\\|>))",
-			"beginCaptures": {
-				"1": {
-					"name": "punctuation.definition.tag.begin.html"
-				},
-				"2": {
-					"name": "entity.name.tag.inline.any.html"
-				}
-			},
-			"end": "((?: ?/)?>)",
-			"endCaptures": {
-				"1": {
-					"name": "punctuation.definition.tag.end.html"
-				}
-			},
-			"name": "meta.tag.inline.any.html",
-			"patterns": [
-				{
-					"include": "#tag-stuff"
-				}
-			]
-		},
-		{
-			"begin": "(</?)([a-zA-Z0-9:\\-]+)",
-			"beginCaptures": {
-				"1": {
-					"name": "punctuation.definition.tag.begin.html"
-				},
-				"2": {
-					"name": "entity.name.tag.other.html"
-				}
-			},
-			"end": "(>)",
-			"endCaptures": {
-				"1": {
-					"name": "punctuation.definition.tag.end.html"
-				}
-			},
-			"name": "meta.tag.other.html",
-			"patterns": [
-				{
-					"include": "#tag-stuff"
-				}
-			]
-		},
-		{
-			"include": "#entities"
-		},
-		{
-			"match": "<>",
-			"name": "invalid.illegal.incomplete.html"
-		}
-	],
-	"repository": {
-		"embedded-code": {
-			"patterns": [
-				{
-					"include": "#smarty"
-				},
-				{
-					"include": "#python"
-				}
-			]
-		},
-		"entities": {
-			"patterns": [
-				{
-					"captures": {
-						"1": {
-							"name": "punctuation.definition.entity.html"
-						},
-						"3": {
-							"name": "punctuation.definition.entity.html"
-						}
-					},
-					"match": "(&)([a-zA-Z0-9]+|#[0-9]+|#[xX][0-9a-fA-F]+)(;)",
-					"name": "constant.character.entity.html"
-				},
-				{
-					"match": "&",
-					"name": "invalid.illegal.bad-ampersand.html"
-				}
-			]
-		},
-		"python": {
-			"begin": "(?:^\\s*)<\\?python(?!.*\\?>)",
-			"end": "\\?>(?:\\s*$\\n)?",
-			"contentName": "source.python.embedded.html",
-			"patterns": [
-				{
-					"include": "source.python"
-				}
-			]
-		},
-		"smarty": {
-			"patterns": [
-				{
-					"begin": "(\\{(literal)\\})",
-					"captures": {
-						"1": {
-							"name": "source.smarty.embedded.html"
-						},
-						"2": {
-							"name": "support.function.built-in.smarty"
-						}
-					},
-					"end": "(\\{/(literal)\\})"
-				},
-				{
-					"begin": "{{|{",
-					"disabled": 1,
-					"end": "}}|}",
-					"contentName": "source.smarty.embedded.html",
-					"patterns": [
-						{
-							"include": "source.smarty"
-						}
-					]
-				}
-			]
-		},
-		"string-double-quoted": {
-			"begin": "\"",
-			"beginCaptures": {
-				"0": {
-					"name": "punctuation.definition.string.begin.html"
-				}
-			},
-			"end": "\"",
-			"endCaptures": {
-				"0": {
-					"name": "punctuation.definition.string.end.html"
-				}
-			},
-			"name": "string.quoted.double.html",
-			"patterns": [
-				{
-					"include": "#embedded-code"
-				},
-				{
-					"include": "#entities"
-				}
-			]
-		},
-		"string-single-quoted": {
-			"begin": "'",
-			"beginCaptures": {
-				"0": {
-					"name": "punctuation.definition.string.begin.html"
-				}
-			},
-			"end": "'",
-			"endCaptures": {
-				"0": {
-					"name": "punctuation.definition.string.end.html"
-				}
-			},
-			"name": "string.quoted.single.html",
-			"patterns": [
-				{
-					"include": "#embedded-code"
-				},
-				{
-					"include": "#entities"
-				}
-			]
-		},
-		"tag-generic-attribute": {
-			"match": "(?<=[^=])\\b([a-zA-Z0-9:-]+)",
-			"name": "entity.other.attribute-name.html"
-		},
-		"tag-id-attribute": {
-			"begin": "\\b(id)\\b\\s*(=)",
-			"captures": {
-				"1": {
-					"name": "entity.other.attribute-name.id.html"
-				},
-				"2": {
-					"name": "punctuation.separator.key-value.html"
-				}
-			},
-			"end": "(?!\\G)(?<='|\"|[^\\s<>/])",
-			"name": "meta.attribute-with-value.id.html",
-			"patterns": [
-				{
-					"begin": "\"",
-					"beginCaptures": {
-						"0": {
-							"name": "punctuation.definition.string.begin.html"
-						}
-					},
-					"contentName": "meta.toc-list.id.html",
-					"end": "\"",
-					"endCaptures": {
-						"0": {
-							"name": "punctuation.definition.string.end.html"
-						}
-					},
-					"name": "string.quoted.double.html",
-					"patterns": [
-						{
-							"include": "#embedded-code"
-						},
-						{
-							"include": "#entities"
-						}
-					]
-				},
-				{
-					"begin": "'",
-					"beginCaptures": {
-						"0": {
-							"name": "punctuation.definition.string.begin.html"
-						}
-					},
-					"contentName": "meta.toc-list.id.html",
-					"end": "'",
-					"endCaptures": {
-						"0": {
-							"name": "punctuation.definition.string.end.html"
-						}
-					},
-					"name": "string.quoted.single.html",
-					"patterns": [
-						{
-							"include": "#embedded-code"
-						},
-						{
-							"include": "#entities"
-						}
-					]
-				},
-				{
-					"captures": {
-						"0": {
-							"name": "meta.toc-list.id.html"
-						}
-					},
-					"match": "(?<==)(?:[^\\s<>/'\"]|/(?!>))+",
-					"name": "string.unquoted.html"
-				}
-			]
-		},
-		"tag-stuff": {
-			"patterns": [
-				{
-					"include": "#tag-id-attribute"
-				},
-				{
-					"include": "#tag-generic-attribute"
-				},
-				{
-					"include": "#string-double-quoted"
-				},
-				{
-					"include": "#string-single-quoted"
-				},
-				{
-					"include": "#embedded-code"
-				},
-				{
-					"include": "#unquoted-attribute"
-				}
-			]
-		},
-		"unquoted-attribute": {
-			"match": "(?<==)(?:[^\\s<>/'\"]|/(?!>))+",
-			"name": "string.unquoted.html"
-		}
-	},
-	"scopeName": "text.html.basic",
-	"uuid": "17994EC8-6B1D-11D9-AC3A-000D93589AF6",
-	"version": "https://github.com/textmate/html.tmbundle/commit/9f812c89f4990a98391701caa77824c94860538f"
-}

+ 0 - 838
grammars/smarty.tmLanguage.json

@@ -1,838 +0,0 @@
-{
-	"name": "mx-smarty",
-	"scopeName": "source.smarty",
-	"fileTypes": [
-		"tpl"
-	],
-	"injectionSelector": "L:text.html.derivative",
-	"patterns": [
-		{ "include": "#nonSmarty"},
-		{ "include": "#smartyComment" },
-		{ "include": "#smartyLiteralBlock" },
-		{ "include": "#smarty" },
-		{ "include": "#others" }
-	],
-	"repository": {
-		"/* Empty non-Smarty Block */": {},
-
-		"nonSmarty": {
-			"match": "\\{\\}"
-		},
-
-		"/* Smarty Comments */": {},
-
-		"smartyComment": {
-			"name": "comment.block.smarty",
-			"contentName": "comment.block.content.smarty",
-			"begin": "\\{\\*",
-			"beginCaptures": {
-				"0": { "name": "punctuation.definition.comment.begin.smarty" }
-			},
-			"end": "\\*\\}",
-			"endCaptures": {
-				"0": { "name": "punctuation.definition.comment.end.smarty" }
-			}
-		},
-
-		"/* Smarty Literal Block*/": {},
-
-		"smartyLiteralBlock": {
-			"name": "meta.block-literal.smarty",
-			"begin": "(\\{)((?i:literal))\\b",
-			"beginCaptures": {
-				"1": { "name": "punctuation.section.embedded.begin.smarty" },
-				"2": { "name": "keyword.control.function.smarty" }
-			},
-			"end": "({/)((?i:literal))(})",
-			"endCaptures": {
-				"0": { "name": "meta.block-literal.close.smarty" },
-				"1": { "name": "punctuation.section.embedded.block-literal.close.begin.smarty" },
-				"2": { "name": "keyword.control.function.smarty" },
-				"3": { "name": "punctuation.section.embedded.end.smarty" }
-			},
-			"patterns": [
-				{ "include": "#literalBlockContent" },
-				{ "name": "invalid.illegal.block-literal.smarty", "match": "." }
-			]
-		},
-		"literalBlockContent": {
-			"contentName": "string.block-literal.content.smarty",
-			"begin": "\\}",
-			"beginCaptures": {
-				"0": { "name": "punctuation.section.embedded.open.end.smarty" }
-			},
-			"end": "(?={/(?i:literal)})",
-			"patterns": [
-				{ "match": "[^{]+" }
-			]
-		},
-
-		"/* Smarty Code Blocks */": {},
-
-		"smarty": {
-			"name": "meta.block.smarty",
-			"begin": "\\{(?!\\s)",
-			"beginCaptures": {
-				"0": { "name": "punctuation.section.embedded.begin.smarty" }
-			},
-			"end": "\\s*(\\})",
-			"endCaptures": {
-				"1": { "name": "punctuation.section.embedded.end.smarty" }
-			},
-			"patterns": [
-				{ "include": "#smartyBlockFor" },
-				{ "include": "#smartyBlockForEach" },
-				{ "include": "#smartyBlockCondition" },
-				{ "include": "#smartyBlock" },
-				{ "include": "#smartyFunctionModifier" },
-				{ "include": "#smartyFunction" },
-				{ "include": "#smartyExpression" },
-				{ "name": "invalid.illegal.smarty", "match": "." }
-			]
-		},
-		"smartyBlockFor": {
-			"name": "meta.block-for.smarty",
-			"begin": "\\G((?i:for))\\b\\s*",
-			"beginCaptures": {
-				"1": { "name": "keyword.control.function.smarty" }
-			},
-			"end": "({/)((?i:\\1))(?=})",
-			"endCaptures": {
-				"0": { "name": "meta.block-for.close.begin.smarty" },
-				"1": { "name": "punctuation.section.embedded.block-for.close.begin.smarty" },
-				"2": { "name": "keyword.control.function.smarty" }
-			},
-			"patterns": [
-				{ "include": "#blockContent" },
-				{
-					"match": "\\s*(=)\\s*",
-					"captures": {
-						"0": { "name": "keyword.operator.expression.for.assignment.smarty" }
-					}
-				},
-				{
-					"match": "\\s+(to|step)\\s+",
-					"captures": {
-						"0": { "name": "keyword.operator.expression.for.$1.smarty" }
-					}
-				},
-				{
-					"match": "\\s*(;)\\s*",
-					"captures": {
-						"0": { "name": "punctuation.terminator.block-for.statement.smarty" }
-					}
-				},
-				{
-					"match": "\\s*(,)\\s*",
-					"captures": {
-						"0": { "name": "punctuation.separator.block-for.comma.smarty" }
-					}
-				},
-				{ "include": "#namedAttribute" },
-				{ "include": "#expressionACUONMSx" },
-				{ "name": "invalid.illegal.block-for.smarty", "match": "." }
-			]
-		},
-		"smartyBlockForEach": {
-			"name": "meta.block-foreach.smarty",
-			"begin": "\\G((?i:foreach))\\b",
-			"beginCaptures": {
-				"1": { "name": "keyword.control.function.smarty" }
-			},
-			"end": "({/)((?i:\\1))(?=})",
-			"endCaptures": {
-				"0": { "name": "meta.block-foreach.close.begin.smarty" },
-				"1": { "name": "punctuation.section.embedded.block-foreach.close.begin.smarty" },
-				"2": { "name": "keyword.control.function.smarty" }
-			},
-			"patterns": [
-				{ "include": "#blockContent" },
-				{
-					"match": "\\s*(=>)\\s*",
-					"captures": {
-						"0": { "name": "keyword.operator.block-foreach.value.smarty" }
-					}
-				},
-				{
-					"match": "\\s+(as)\\b",
-					"captures": {
-						"0": { "name": "keyword.operator.expression.block-foreach.as.smarty" }
-					}
-				},
-				{ "include": "#namedAttribute" },
-				{ "include": "#unnamedAttribute" },
-				{ "name": "invalid.illegal.block-foreach.smarty", "match": "." }
-			]
-		},
-		"smartyBlockCondition": {
-			"name": "meta.block-$1-condition.smarty",
-			"begin": "\\G((?i:if|while))\\s+",
-			"beginCaptures": {
-				"1": { "name": "keyword.control.function.smarty" }
-			},
-			"end": "({/)((?i:\\1))(?=})",
-			"endCaptures": {
-				"0": { "name": "meta.block-$2.close.smarty" },
-				"1": { "name": "punctuation.section.embedded.block-$2.close.begin.smarty" },
-				"2": { "name": "keyword.control.function.smarty" }
-			},
-			"patterns": [
-				{ "match": "\\s+" },
-				{ "include": "#blockContent" },
-				{ "include": "#expressionACUONMSx" },
-				{ "name": "invalid.illegal.block.smarty", "match": "." }
-			]
-		},
-		"smartyBlock": {
-			"name": "meta.block-$1.smarty",
-			"begin": "\\G((?i:foreach|function|mdx_loop|section|setfilter|strip))\\b",
-			"beginCaptures": {
-				"1": { "name": "keyword.control.function.smarty" }
-			},
-			"end": "({/)((?i:\\1))(?=})",
-			"endCaptures": {
-				"0": { "name": "meta.block-$2.close.smarty" },
-				"1": { "name": "punctuation.section.embedded.block-$2.close.begin.smarty" },
-				"2": { "name": "keyword.control.function.smarty" }
-			},
-			"patterns": [
-				{ "include": "#blockContent" },
-				{ "include": "#namedAttribute" },
-				{ "include": "#unnamedAttribute" },
-				{ "name": "invalid.illegal.block.smarty", "match": "." }
-			]
-		},
-		"blockContent": {
-			"contentName": "meta.block.content.smarty",
-			"begin": "\\}",
-			"beginCaptures": {
-				"0": { "name": "punctuation.section.embedded.open.end.smarty" }
-			},
-			"end": "(?=\\{/)",
-			"patterns": [
-				{ "include": "#nonSmarty" },
-				{ "include": "#smartyComment" },
-				{ "include": "#smartyLiteralBlock" },
-				{ "include": "#smartySubBlockForElse" },
-				{ "include": "#smartySubBlockForEachElse" },
-				{ "include": "#smartySubBlockElseIf" },
-				{ "include": "#smartySubBlockElse" },
-				{ "include": "#smartySubBlockSectionElse" },
-				{ "include": "#smarty" },
-				{ "include": "#others" }
-			]
-		},
-		"smartySubBlockForElse": {
-			"name": "meta.sub-block-forelse.smarty",
-			"begin": "({)((?i:forelse))\\b",
-			"beginCaptures": {
-				"1": { "name": "punctuation.section.embedded.begin.smarty" },
-				"2": { "name": "keyword.control.function.smarty" }
-			},
-			"end": "(?={/(?i:for))",
-			"patterns": [
-				{ "include": "#blockContent" },
-				{ "name": "invalid.illegal.sub-block-forelse.smarty", "match": "." }
-			]
-		},
-		"smartySubBlockForEachElse": {
-			"name": "meta.sub-block-foreachelse.smarty",
-			"begin": "(\\{)((?i:foreachelse))\\b",
-			"beginCaptures": {
-				"1": { "name": "punctuation.section.embedded.begin.smarty" },
-				"2": { "name": "keyword.control.function.smarty" }
-			},
-			"end": "(?={/(?i:foreach))",
-			"patterns": [
-				{ "include": "#blockContent" },
-				{ "name": "invalid.illegal.sub-block-foreachelse.smarty", "match": "." }
-			]
-		},
-		"smartySubBlockElseIf": {
-			"name": "meta.sub-block-elseif.smarty",
-			"begin": "({)((?i:else\\s*if))\\s+",
-			"beginCaptures": {
-				"1": { "name": "punctuation.section.embedded.begin.smarty" },
-				"2": { "name": "keyword.control.function.smarty" }
-			},
-			"end": "(?={/(?i:if))",
-			"patterns": [
-				{ "match": "\\s+" },
-				{ "include": "#blockContent" },
-				{ "include": "#expressionACUONMSx" },
-				{ "name": "invalid.illegal.sub-block-elseif.smarty", "match": "." }
-			]
-		},
-		"smartySubBlockElse": {
-			"name": "meta.sub-block-else.smarty",
-			"begin": "(\\{)((?i:else))\\b",
-			"beginCaptures": {
-				"1": { "name": "punctuation.section.embedded.begin.smarty" },
-				"2": { "name": "keyword.control.function.smarty" }
-			},
-			"end": "(?=\\{/(?i:if))",
-			"patterns": [
-				{ "include": "#blockContent" },
-				{ "name": "invalid.illegal.sub-block-else.smarty", "match": "." }
-			]
-		},
-		"smartySubBlockSectionElse": {
-			"name": "meta.sub-block-sectionelse.smarty",
-			"begin": "(\\{)((?i:sectionelse))\\b",
-			"beginCaptures": {
-				"1": { "name": "punctuation.section.embedded.begin.smarty" },
-				"2": { "name": "keyword.control.function.smarty" }
-			},
-			"end": "(?=\\{/(?i:section))",
-			"patterns": [
-				{ "include": "#blockContent" },
-				{ "name": "invalid.illegal.sub-block-sectionelse.smarty", "match": "." }
-			]
-		},
-		"namedAttribute": {
-			"name": "meta.named-attribute.name-$1.smarty",
-			"begin": "(?:^|\\s+)([a-zA-Z_][a-zA-Z0-9_]*)\\s?=\\s?",
-			"beginCaptures": {
-				"1": { "name": "entity.other.attribute-name.smarty" }
-			},
-			"end": "(?=[}\\s])",
-			"patterns": [
-				{ "include": "#expressionACUONMSx" },
-				{ "name": "invalid.illegal.named-attribute.smarty", "match": "." }
-			]
-		},
-		"unnamedAttribute": {
-			"name": "meta.unnamed-attribute.smarty",
-			"begin": "(\\s++|^)(?=[^=])",
-			"beginCaptures": {
-				"1": { "name": "punctuation.separator.unnamed-attribute.begin.smarty" }
-			},
-			"end": "(?<!$)(?=\\}|\\s++(?!(?:!==|!=|=>|<=|>=|<|>|===|==|&&|&|\\|\\|\\+|\\-|\\*|/|%)|(?i:and|or|eq|neq|ne|gte|gt|ge|lte|lt|le|mod|is)\\b))",
-			"patterns": [
-				{ "include": "#expressionACUONMSx" },
-				{ "name": "invalid.illegal.unnamed-attribute.smarty", "match": "." }
-			]
-		},
-
-		"smartyFunctionModifier": {
-			"name": "meta.function-call.name-$1.smarty",
-			"begin": "\\G([a-zA-Z_][a-zA-Z0-9_]*)(?=\\|)",
-			"beginCaptures": {
-				"1": { "name": "entity.name.function.smarty" }
-			},
-			"end": "(?=\\})",
-			"patterns": [
-				{ "include": "#modifier" },
-				{ "name": "invalid.illegal.function-modifier.smarty", "match": "." }
-			]
-		},
-
-		"smartyFunction": {
-			"name": "meta.function-call.name-$1.smarty",
-			"begin": "\\G([a-zA-Z_][a-zA-Z0-9_]*)",
-			"beginCaptures": {
-				"1": { "name": "entity.name.function.smarty" }
-			},
-			"end": "(?=\\})",
-			"patterns": [
-				{ "include": "#namedAttribute" },
-				{ "include": "#unnamedAttribute" },
-				{ "name": "invalid.illegal.function.smarty", "match": "." }
-			]
-		},
-
-		"smartyExpression": {
-			"name": "meta.expression.smarty",
-			"patterns": [
-				{ "include": "#expressionAACUONMS" },
-				{ "name": "invalid.illegal.expression.smarty", "match": "." }
-			]
-		},
-
-		"/* Expressions (combinations of Basic Data Types) */": {},
-
-		"expression": {
-			"patterns":  [
-				{ "include": "#singleQuotedString" },
-				{ "include": "#doubleQuotedString" },
-				{ "include": "#typeCasting" },
-				{ "include": "#variable" },
-				{ "include": "#encapsulatedExpression" }
-			]
-		},
-
-		"expressionAUONMS": {
-			"patterns":  [
-				{ "include": "#expression" },
-				{ "include": "#array" },
-				{ "include": "#operation" },
-				{ "include": "#operationIsBy" },
-				{ "include": "#operationIs" },
-				{ "include": "#negation" },
-				{ "include": "#unquotedString" },
-				{ "include": "#number" },
-				{ "include": "#modifier" },
-				{ "include": "#smartyComment" },
-				{ "include": "#smarty" },
-				{ "name": "invalid.illegal.expression-auonms.smarty", "match": "." }
-			]
-		},
-
-		"expressionAACUONMS": {
-			"patterns":  [
-				{ "include": "#expression" },
-				{ "include": "#array" },
-				{ "include": "#assignment" },
-				{ "include": "#constant" },
-				{ "include": "#operation" },
-				{ "include": "#operationIsBy" },
-				{ "include": "#operationIs" },
-				{ "include": "#negation" },
-				{ "include": "#unquotedString" },
-				{ "include": "#number" },
-				{ "include": "#modifier" },
-				{ "include": "#smartyComment" },
-				{ "include": "#smarty" },
-				{ "name": "invalid.illegal.expression-aauonms.smarty", "match": "." }
-			]
-		},
-
-		"expressionACUONMS": {
-			"patterns":  [
-				{ "include": "#expression" },
-				{ "include": "#array" },
-				{ "include": "#constant" },
-				{ "include": "#operation" },
-				{ "include": "#operationIsBy" },
-				{ "include": "#operationIs" },
-				{ "include": "#negation" },
-				{ "include": "#unquotedString" },
-				{ "include": "#number" },
-				{ "include": "#modifier" },
-				{ "include": "#smartyComment" },
-				{ "include": "#smarty" },
-				{ "name": "invalid.illegal.expression-acuonms.smarty", "match": "." }
-			]
-		},
-
-		"expressionACUONMSx": {
-			"patterns":  [
-				{ "include": "#expression" },
-				{ "include": "#array" },
-				{ "include": "#constant" },
-				{ "include": "#operation" },
-				{ "include": "#operationIsBy" },
-				{ "include": "#operationIs" },
-				{ "include": "#negation" },
-				{ "include": "#unquotedString" },
-				{ "include": "#number" },
-				{ "include": "#modifier" },
-				{ "include": "#smartyComment" },
-				{ "include": "#smarty" }
-			]
-		},
-
-		"encapsulatedExpression": {
-			"name": "meta.encapsulated-expression.smarty",
-			"begin": "(\\()\\s*",
-			"beginCaptures": {
-				"1": { "name": "meta.brace.begin.smarty" }
-			},
-			"end": "\\s*(\\))",
-			"endCaptures": {
-				"1": { "name": "meta.brace.end.smarty" }
-			},
-			"patterns": [
-				{ "match": "\\s+" },
-				{ "include": "#expressionACUONMS" }
-			]
-		},
-
-		"operation": {
-			"name": "meta.operation.smarty",
-			"match": "\\s*(?:(!==|!=|=>|<=|>=|<|>|===|==|&&|&|\\|\\|)|(\\+|\\-|\\*|/|%)|\\b(?:((?i:and|or|eq|neq|ne|gte|gt|ge|lte|lt|le))|((?i:mod)))\\s)\\s*",
-			"captures": {
-				"1": { "name": "keyword.operator.logical.smarty" },
-				"2": { "name": "keyword.operator.arithmetic.smarty" },
-				"3": { "name": "keyword.operator.logical.smarty" },
-				"4": { "name": "keyword.operator.arithmetic.smarty" }
-			}
-		},
-
-		"operationIsBy": {
-			"name": "meta.operation.is-by.smarty",
-			"match": "\\s*\\b((?i:is)(?i:\\s+not)?\\s+(?i:div|even|odd)\\s+(?i:by))\\s+",
-			"captures": {
-				"1": { "name": "keyword.operator.logical.smarty" }
-			}
-		},
-
-		"operationIs": {
-			"name": "meta.operation.is.smarty",
-			"match": "\\s*\\b((?i:is)(?i:\\s+not)?)\\s+((?i:even|odd))\\b",
-			"captures": {
-				"1": { "name": "keyword.operator.logical.smarty" },
-				"2": { "name": "keyword.operator.logical.constant.smarty" }
-			}
-		},
-
-		"negation": {
-			"name": "meta.negation.smarty",
-			"match": "\\s*((?:!)|\\s(?:not)\\s)\\s*",
-			"captures": {
-				"1": { "name": "keyword.operator.negation.smarty" }
-			}
-		},
-
-		"/* Basic Data Types */": {},
-
-		"singleQuotedString": {
-			"name": "string.quoted.single.smarty",
-			"contentName": "string.content.smarty",
-			"begin": "'",
-			"beginCaptures": {
-				"0": { "name": "punctuation.definition.string.begin.smarty" }
-			},
-			"end": "'",
-			"endCaptures": {
-				"0": { "name": "punctuation.definition.string.end.smarty" }
-			},
-			"patterns": [
-				{
-					"name": "constant.character.escape.smarty",
-					"match": "\\\\\\\\|\\\\'"
-				}
-			]
-		},
-
-		"doubleQuotedString": {
-			"name": "string.quoted.double.smarty",
-			"contentName": "string.content.smarty",
-			"begin": "\"",
-			"beginCaptures": {
-				"0": { "name": "punctuation.definition.string.begin.smarty" }
-			},
-			"end": "\"",
-			"endCaptures": {
-				"0": { "name": "punctuation.definition.string.end.smarty" }
-			},
-			"patterns": [
-				{
-					"name": "constant.character.escape.smarty",
-					"match": "\\\\\\\\|\\\\\"|\\\\\\$|\\\\{"
-				},
-				{ "include": "#basicVariable" },
-				{ "include": "#smartyComment" },
-				{ "include": "#smartyLiteralBlock" },
-				{ "include": "#smarty" },
-				{
-					"name": "meta.template-expression.smarty",
-					"begin": "`(?=\\$[a-zA-Z_][a-zA-Z0-9_]*)",
-					"beginCaptures": {
-						"0": { "name": "punctuation.definition.template-expression.begin.smarty" }
-					},
-					"end": "`",
-					"endCaptures": {
-						"0": { "name": "punctuation.definition.template-expression.end.smarty" }
-					},
-					"patterns": [
-						{ "include": "#expressionACUONMSx" },
-						{ "name": "invalid.illegal.wrapped-variable-expression.smarty", "match": "." }
-					]
-				}
-			]
-		},
-
-		"unquotedString": {
-			"name"	: "string.unquoted.smarty",
-			"match": "[a-zA-Z_][a-zA-Z0-9_]*|\\d+[a-df-zA-DF-Z_][a-zA-Z0-9_]*|\\d+[eE]([a-zA-Z_][a-zA-Z0-9_]*|\\d+[a-zA-Z_][a-zA-Z0-9_]*)",
-			"captures": {
-				"0": { "name": "string.content.smarty" }
-			}
-		},
-
-		"number": {
-			"name": "constant.numeric.smarty",
-			"match": "((?:\\d+\\.\\d*)|(?:\\d*\\.\\d+)|(?:\\d+))(?:[eE](\\d+))?",
-			"captures": {
-				"1": { "name": "constant.numeric.value.smarty" },
-				"2": { "name": "constant.numeric.exponent.smarty" }
-			}
-		},
-
-		"constant": {
-			"name": "constant.language.$1.smarty",
-			"match": "\\b((?i:true|false|null))\\b"
-		},
-
-		"array": {
-			"name": "meta.array.literal.smarty",
-			"begin": "(\\[)\\s*",
-			"beginCaptures": {
-				"1": { "name": "punctuation.definition.array.begin.smarty" }
-			},
-			"end": "\\s*(\\])",
-			"endCaptures": {
-				"1": { "name": "punctuation.definition.array.end.smarty" }
-			},
-			"patterns": [
-				{
-					"match": "\\s*(,)\\s*",
-					"captures": {
-						"1": { "name": "punctuation.separator.array.comma.smarty" }
-					}
-				},
-				{
-					"match": "\\s+"
-				},
-				{
-					"contentName": "meta.array.item.value.smarty",
-					"begin": "\\s*(=>)\\s*",
-					"beginCaptures": {
-						"1": { "name": "punctuation.separator.array.key-value.smarty" }
-					},
-					"end": "(?=\\s*(?:,|\\]))",
-					"patterns": [
-						{ "match": "\\s+" },
-						{ "include": "#expressionACUONMS" }
-					]
-				},
-				{ "include": "#expressionACUONMSx" },
-				{ "name": "invalid.illegal.array.literal.smarty", "match": "." }
-			]
-		},
-
-		"variable": {
-			"name": "variable.smarty",
-			"begin": "(\\$)([a-zA-Z0-9_]+)(?:(@)([a-zA-Z_][a-zA-Z0-9_]*))?",
-			"beginCaptures": {
-				"1": { "name": "punctuation.definition.variable.begin.smarty" },
-				"2": { "name": "entity.name.variable.smarty" },
-				"3": { "name": "punctuation.separator.variable.property.smarty" },
-				"4": { "name": "entity.name.variable.property.name-$3.smarty" }
-			},
-			"end": "(\\+\\+|--\\s*\\})?|(?=.)",
-			"endCaptures": {
-				"1": { "name": "keyword.operator.unary.smarty" }
-			},
-			"applyEndPatternLast": 1,
-			"patterns": [
-				{ "include": "#property" }
-			]
-		},
-
-		"basicVariable": {
-			"name": "variable.basic.smarty",
-			"match": "\\$([a-zA-Z0-9_]+)",
-			"captures": {
-				"1": { "name": "entity.name.variable.smarty" }
-			}
-		},
-
-		"property": {
-			"patterns": [
-				{
-					"name": "variable.other.property.smarty",
-					"begin": "(\\.|->)",
-					"beginCaptures": {
-						"0": { "name": "punctuation.separator.property.smarty" }
-					},
-					"end": "(?=.)",
-					"applyEndPatternLast": 1,
-					"patterns": [
-						{
-							"name": "entity.name.property.smarty",
-							"match": "\\G[a-zA-Z0-9_]+"
-						},
-						{ "include": "#basicVariable" },
-						{ "include": "#smartyComment" },
-						{ "include": "#smarty" }
-					]
-				},
-				{
-					"name": "meta.property-expression.smarty",
-					"begin": "(\\[)\\s*",
-					"beginCaptures": {
-						"1": { "name": "punctuation.definition.property.begin.smarty" }
-					},
-					"end":"\\s*(\\])",
-					"endCaptures": {
-						"1": { "name": "punctuation.definition.property.end.smarty" }
-					},
-					"patterns": [
-						{ "include": "#expressionAUONMS" }
-					]
-				}
-			]
-		},
-
-		"assignment": {
-			"name": "meta.assignment.smarty",
-			"begin": "\\s*(=)(?!=)\\s*",
-			"beginCaptures": {
-				"1": { "name": "keyword.operator.assignment.smarty" }
-			},
-			"end": "(?=[};,])",
-			"patterns": [
-				{ "match": "^\\s+" },
-				{ "include": "#expressionACUONMSx" },
-				{ "name": "invalid.illegal.assignment.smarty", "match": "." }
-			]
-		},
-
-		"modifier": {
-			"name": "meta.modifier.smarty",
-			"begin": "(\\|)(@)?([a-zA-Z0-9_]+)",
-			"beginCaptures": {
-				"1": { "name": "punctuation.definition.modifier.begin.smarty" },
-				"2": { "name": "punctuation.definition.modifier.array.smarty" },
-				"3": { "name": "entity.name.function.modifier.smarty" }
-			},
-			"end": "(?=\\s*+[^:])",
-			"patterns": [
-				{
-					"begin": "\\s*+(\\:)\\s*+",
-					"beginCaptures": {
-						"1": { "name": "punctuation.separator.modifier.parameter.smarty" }
-					},
-					"end": "(?<!\\G|[+-])(?!$)",
-					"patterns": [
-						{
-							"match": "\\s*+(:)\\s*+",
-							"captures": {
-								"1": { "name": "punctuation.separator.modifier.parameter.smarty" }
-							}
-						},
-						{
-							"name": "wurstbrot",
-							"match": "^\\s*+"
-						},
-						{ "include": "#expressionACUONMSx" }
-					]
-				}
-			]
-		},
-
-		"typeCasting": {
-			"name": "meta.type-casting.smarty",
-			"match": "(\\()((?i:int|integer|bool|boolean|float|double|real|string|array|object))(\\))",
-			"captures": {
-				"1": { "name": "punctuation.definition.type-casting.begin.smarty" },
-				"2": { "name": "entity.name.type.smarty" },
-				"3": { "name": "punctuation.definition.type-casting.end.smarty" }
-			}
-		},
-
-		"/* External Definitions */": {},
-
-		"others": {
-			"patterns": [
-				{
-					"begin": "<(script)>",
-					"end": "</(script)>",
-					"beginCaptures": {
-						"0": { "name":"punctuation.definition.tag.start.html" },
-						"1": { "name": "entity.name.tag.html" }
-					},
-					"endCaptures": {
-						"0": { "name":"punctuation.definition.tag.end.html" },
-						"1": { "name": "entity.name.tag.html" }
-					},
-					"patterns": [
-						{ "include": "#nonSmarty"},
-						{ "include": "#smartyComment" },
-						{ "include": "#smartyLiteralBlock" },
-						{ "include": "#smarty" },
-						{ "include": "source.js" }
-					]
-				},
-				{
-					"begin": "<(style)>",
-					"end": "</(style)>",
-					"beginCaptures": {
-						"0": { "name":"punctuation.definition.tag.start.html" },
-						"1": { "name": "entity.name.tag.html" }
-					},
-					"endCaptures": {
-						"0": { "name":"punctuation.definition.tag.end.html" },
-						"1": { "name": "entity.name.tag.html" }
-					},
-					"patterns": [
-						{ "include": "#nonSmarty"},
-						{ "include": "#smartyComment" },
-						{ "include": "#smartyLiteralBlock" },
-						{ "include": "#smarty" },
-						{ "include": "source.css" }
-					]
-				},
-				{
-					"name": "punctuation.definition.tag.doctype.html",
-					"begin": "<!(DOCTYPE)",
-					"beginCaptures": {
-						"1": { "name": "entity.name.tag.html" }
-					},
-					"end": ">",
-					"patterns": [
-						{ "include": "#smartyComment" },
-						{ "include": "#smarty" },
-						{
-							"name": "entity.other.attribute-name.content.html",
-							"match": "[^>]+"
-						}
-					]
-				},
-				{ "include": "#html" }
-			]
-		},
-
-		"html": {
-			"patterns": [
-				{
-					"name": "comment.block.html",
-					"begin": "<!--",
-					"beginCaptures": {
-						"1": { "name": "punctuation.definition.comment.html" }
-					},
-					"end": "-->"
-				},
-				{
-					"name": "source.html",
-					"begin": "<(\/)?([a-zA-Z0-9]+)",
-					"beginCaptures": {
-						"0": { "name": "punctuation.definition.tag.start.html" },
-						"1": { "name": "punctuation.definition.tag.start.html" },
-						"2": { "name": "variable.name.tag.html" }
-					},
-					"end": ">",
-					"endCaptures": {
-						"0": { "name": "punctuation.definition.tag.end.html" }
-					},
-					"patterns": [
-						{ "include": "#comment" },
-						{ "include": "#nonSmarty"},
-						{ "include": "#smartyComment" },
-						{ "include": "#smartyLiteralBlock" },
-						{ "include": "#smarty" },
-						{
-							"name": "variable.attribute.html",
-							"match": "\\b([a-zA-Z0-9\\-]+)(=)",
-							"captures": {
-								"0": { "name": "variable.parameter.html" },
-								"2": { "name": "keyword.operator.assignment.html" }
-							}
-						},
-						{ "include": "#string" }
-					]
-				},
-				{
-					"name": "punctuation.definition.tag.isolated.start.html",
-					"match": "<"
-				},
-				{
-					"name": "constant.character.html",
-					"match": "&([a-zA-Z0-9]+);"
-				}
-			]
-		}
-	}
-}

+ 96 - 36
src/app.ts

@@ -1,4 +1,4 @@
-import type {SupportedLanguage} from './examples';
+import type {LanguageId} from './register';
 
 // Recall we are using MonacoWebpackPlugin. According to the
 // monaco-editor-webpack-plugin docs, we must use:
@@ -11,38 +11,80 @@ import type {SupportedLanguage} from './examples';
 //
 // because we are shipping only a subset of the languages.
 import * as monaco from 'monaco-editor/esm/vs/editor/editor.api';
-import {createGrammarStore} from './index';
-import {getSampleCodeForLanguage} from './examples';
+import {createOnigScanner, createOnigString, loadWASM} from 'vscode-oniguruma';
+import {SimpleLanguageInfoProvider} from './providers';
+import {registerLanguages} from './register';
+import VsCodeDarkTheme from './vs-dark-plus-theme';
 
-type GrammarConfiguration = {language: string; scopeName: string; url: string};
+main('python');
 
-main('hack');
-
-async function main(language: SupportedLanguage) {
-  // Note that Hack lists text.html.basic as an embedded grammar, so we must
-  // provide that grammar (and all of its transitive deps) as well.
+async function main(language: LanguageId) {
+  // In this demo, the following values are hardcoded to support Python using
+  // the VS Code Dark+ theme. Currently, end users are responsible for
+  // extracting the data from the relevant VS Code extensions themselves to
+  // leverage other TextMate grammars or themes. Scripts may be provided to
+  // facilitate this in the future.
+  //
+  // Note that adding a new TextMate grammar entails the following:
+  // - adding an entry in the languages array
+  // - adding an entry in the grammars map
+  // - making the TextMate file available in the grammars/ folder
+  // - making the monaco.languages.LanguageConfiguration available in the
+  //   configurations/ folder.
   //
-  // This sort of looks like:
-  // https://github.com/microsoft/vscode-textmate/blob/0730e8ef740d87401764d76e9193f74c6f458b37/test-cases/themes/grammars.json
-  const grammarConfigurations: GrammarConfiguration[] = [
-    {language: 'css', scopeName: 'source.css', url: '/grammars/css.plist'},
-    {language: 'hack', scopeName: 'source.hack', url: '/grammars/hack.json'},
-    {language: 'html', scopeName: 'text.html.basic', url: '/grammars/html.json'},
-    {language: 'javascript', scopeName: 'source.js', url: '/grammars/JavaScript.tmLanguage.json'},
-    {language: 'python', scopeName: 'source.python', url: '/grammars/MagicPython.tmLanguage.json'},
-    {language: 'smarty', scopeName: 'source.smarty', url: '/grammars/smarty.tmLanguage.json'},
-    {language: 'sql', scopeName: 'source.sql', url: '/grammars/SQL.plist'},
+  // You likely also want to add an entry in getSampleCodeForLanguage() and
+  // change the call to main() above to pass your LanguageId.
+  const languages: monaco.languages.ILanguageExtensionPoint[] = [
+    {
+      id: 'python',
+      extensions: [
+        '.py',
+        '.rpy',
+        '.pyw',
+        '.cpy',
+        '.gyp',
+        '.gypi',
+        '.pyi',
+        '.ipy',
+        '.bzl',
+        '.cconf',
+        '.cinc',
+        '.mcconf',
+        '.sky',
+        '.td',
+        '.tw',
+      ],
+      aliases: ['Python', 'py'],
+      filenames: ['Snakefile', 'BUILD', 'BUCK', 'TARGETS'],
+      firstLine: '^#!\\s*/?.*\\bpython[0-9.-]*\\b',
+    },
   ];
+  const grammars = {
+    'source.python': {
+      language: 'python',
+      path: 'MagicPython.tmLanguage.json',
+    },
+  };
+  const manifest = {
+    baseResourceURI: '',
+    grammars,
+    configurations: languages.map((language) => language.id),
+    theme: VsCodeDarkTheme,
+  };
 
-  // We have to register all of the languages with Monaco before we can configure them.
-  for (const {language} of grammarConfigurations) {
-    monaco.languages.register({
-      id: language,
-      extensions: [],
-    });
-  }
+  const data: ArrayBuffer | Response = await loadVSCodeOnigurumWASM();
+  loadWASM(data);
+  const oniguruma = Promise.resolve({
+    createOnigScanner,
+    createOnigString,
+  });
 
-  await registerEncodedTokensProviders(grammarConfigurations);
+  const provider = new SimpleLanguageInfoProvider(manifest, oniguruma, monaco);
+  registerLanguages(
+    languages,
+    (language: LanguageId) => provider.fetchLanguageInfo(language),
+    monaco,
+  );
 
   const value = getSampleCodeForLanguage(language);
   const id = 'container';
@@ -54,21 +96,39 @@ async function main(language: SupportedLanguage) {
   monaco.editor.create(element, {
     value,
     language,
-    theme: 'vs', // 'vs' or 'vs-dark' should both work here
+    theme: 'vs-dark',
     minimap: {
       enabled: false,
     },
   });
+  provider.injectCSS();
 }
 
-async function registerEncodedTokensProviders(grammarConfigurations: GrammarConfiguration[]) {
-  const scopeNameToTextMateGrammarURL: Map<string, string> = new Map(
-    grammarConfigurations.map(({scopeName, url}) => [scopeName, url]),
-  );
-  const grammarStore = await createGrammarStore(scopeNameToTextMateGrammarURL);
+// Taken from https://github.com/microsoft/vscode/blob/829230a5a83768a3494ebbc61144e7cde9105c73/src/vs/workbench/services/textMate/browser/textMateService.ts#L33-L40
+async function loadVSCodeOnigurumWASM(): Promise<Response | ArrayBuffer> {
+  const response = await fetch('/node_modules/vscode-oniguruma/release/onig.wasm');
+  const contentType = response.headers.get('content-type');
+  if (contentType === 'application/wasm') {
+    return response;
+  }
+
+  // Using the response directly only works if the server sets the MIME type 'application/wasm'.
+  // Otherwise, a TypeError is thrown when using the streaming compiler.
+  // We therefore use the non-streaming compiler :(.
+  return await response.arrayBuffer();
+}
+
+function getSampleCodeForLanguage(language: LanguageId): string {
+  if (language === 'python') {
+    return `\
+import foo
 
-  for (const {language, scopeName} of grammarConfigurations) {
-    const tokensProvider = await grammarStore.createEncodedTokensProvider(scopeName);
-    monaco.languages.setTokensProvider(language, tokensProvider);
+async def bar(): string:
+  f = await foo()
+  f_string = f"Hooray {f}! format strings are not supported in current Monarch grammar"
+  return foo_string
+`;
   }
+
+  throw Error(`unsupported language: ${language}`);
 }

+ 0 - 336
src/dark_vs.ts

@@ -1,336 +0,0 @@
-// Taken from
-// https://github.com/microsoft/vscode-textmate/blob/0730e8ef740d87401764d76e9193f74c6f458b37/test-cases/themes/dark_vs.json
-export default {
-  name: 'Dark Visual Studio',
-  settings: [
-    {
-      settings: {
-        foreground: '#D4D4D4',
-        background: '#1E1E1E',
-      },
-    },
-    {
-      scope: 'emphasis',
-      settings: {
-        fontStyle: 'italic',
-      },
-    },
-    {
-      scope: 'strong',
-      settings: {
-        fontStyle: 'bold',
-      },
-    },
-    {
-      scope: 'header',
-      settings: {
-        foreground: '#000080',
-      },
-    },
-
-    {
-      scope: 'comment',
-      settings: {
-        foreground: '#608b4e',
-      },
-    },
-    {
-      scope: 'constant.language',
-      settings: {
-        foreground: '#569cd6',
-      },
-    },
-    {
-      scope: 'constant.numeric',
-      settings: {
-        foreground: '#b5cea8',
-      },
-    },
-    {
-      scope: 'constant.regexp',
-      settings: {
-        foreground: '#646695',
-      },
-    },
-    {
-      scope: [
-        'constant.other.color.rgb-value.css',
-        'constant.numeric.color.rgb-value.scss',
-        'constant.other.rgb-value.css',
-      ],
-      settings: {
-        foreground: '#d4d4d4',
-      },
-    },
-    {
-      scope: 'entity.name.tag',
-      settings: {
-        foreground: '#569cd6',
-      },
-    },
-    {
-      scope: 'entity.name.tag.css',
-      settings: {
-        foreground: '#d7ba7d',
-      },
-    },
-    {
-      scope: 'entity.other.attribute-name',
-      settings: {
-        foreground: '#9cdcfe',
-      },
-    },
-    {
-      scope: [
-        'entity.other.attribute-name.class.css',
-        'entity.other.attribute-name.class.mixin.css',
-        'entity.other.attribute-name.id.css',
-        'entity.other.attribute-name.parent-selector.css',
-        'entity.other.attribute-name.pseudo-class.css',
-        'entity.other.attribute-name.pseudo-element.css',
-
-        'source.css.less entity.other.attribute-name.id',
-
-        'entity.other.attribute-name.attribute.scss',
-        'entity.other.attribute-name.scss',
-      ],
-      settings: {
-        foreground: '#d7ba7d',
-      },
-    },
-    {
-      scope: 'invalid',
-      settings: {
-        foreground: '#f44747',
-      },
-    },
-    {
-      scope: 'markup.underline',
-      settings: {
-        fontStyle: 'underline',
-      },
-    },
-    {
-      scope: 'markup.bold',
-      settings: {
-        fontStyle: 'bold',
-        foreground: '#569cd6',
-      },
-    },
-    {
-      scope: 'markup.heading',
-      settings: {
-        fontStyle: 'bold',
-        foreground: '#569cd6',
-      },
-    },
-    {
-      scope: 'markup.italic',
-      settings: {
-        fontStyle: 'italic',
-      },
-    },
-    {
-      scope: 'markup.inserted',
-      settings: {
-        foreground: '#b5cea8',
-      },
-    },
-    {
-      scope: 'markup.deleted',
-      settings: {
-        foreground: '#ce9178',
-      },
-    },
-    {
-      scope: 'markup.changed',
-      settings: {
-        foreground: '#569cd6',
-      },
-    },
-    {
-      scope: 'beginning.punctuation.definition.quote.markdown',
-      settings: {
-        foreground: '#608b4e',
-      },
-    },
-    {
-      scope: 'beginning.punctuation.definition.list.markdown',
-      settings: {
-        foreground: '#6796e6',
-      },
-    },
-    {
-      scope: 'markup.inline.raw',
-      settings: {
-        foreground: '#ce9178',
-      },
-    },
-    {
-      scope: 'meta.selector',
-      settings: {
-        foreground: '#d7ba7d',
-      },
-    },
-    {
-      name: 'brackets of XML/HTML tags',
-      scope: 'punctuation.definition.tag',
-      settings: {
-        foreground: '#808080',
-      },
-    },
-    {
-      scope: 'meta.preprocessor',
-      settings: {
-        foreground: '#569cd6',
-      },
-    },
-    {
-      scope: 'meta.preprocessor.string',
-      settings: {
-        foreground: '#ce9178',
-      },
-    },
-    {
-      scope: 'meta.preprocessor.numeric',
-      settings: {
-        foreground: '#b5cea8',
-      },
-    },
-    {
-      scope: 'meta.structure.dictionary.key.python',
-      settings: {
-        foreground: '#9cdcfe',
-      },
-    },
-    {
-      scope: 'meta.diff.header',
-      settings: {
-        foreground: '#569cd6',
-      },
-    },
-    {
-      scope: 'storage',
-      settings: {
-        foreground: '#569cd6',
-      },
-    },
-    {
-      scope: 'storage.type',
-      settings: {
-        foreground: '#569cd6',
-      },
-    },
-    {
-      scope: 'storage.modifier',
-      settings: {
-        foreground: '#569cd6',
-      },
-    },
-    {
-      scope: 'string',
-      settings: {
-        foreground: '#ce9178',
-      },
-    },
-    {
-      scope: 'string.tag',
-      settings: {
-        foreground: '#ce9178',
-      },
-    },
-    {
-      scope: 'string.value',
-      settings: {
-        foreground: '#ce9178',
-      },
-    },
-    {
-      scope: 'string.regexp',
-      settings: {
-        foreground: '#d16969',
-      },
-    },
-    {
-      name: 'JavaScript string interpolation ${}',
-      scope: [
-        'punctuation.definition.template-expression.begin.ts',
-        'punctuation.definition.template-expression.end.ts',
-      ],
-      settings: {
-        foreground: '#569cd6',
-      },
-    },
-    {
-      scope: 'support.type.property-name',
-      settings: {
-        foreground: '#9cdcfe',
-      },
-    },
-    {
-      scope: 'keyword',
-      settings: {
-        foreground: '#569cd6',
-      },
-    },
-    {
-      scope: 'keyword.control',
-      settings: {
-        foreground: '#569cd6',
-      },
-    },
-    {
-      scope: 'keyword.operator',
-      settings: {
-        foreground: '#d4d4d4',
-      },
-    },
-    {
-      scope: ['keyword.operator.new', 'keyword.operator.expression'],
-      settings: {
-        foreground: '#569cd6',
-      },
-    },
-    {
-      scope: 'keyword.other.unit',
-      settings: {
-        foreground: '#b5cea8',
-      },
-    },
-    {
-      scope: [
-        'punctuation.section.embedded.metatag.begin.php',
-        'punctuation.section.embedded.metatag.end.php',
-      ],
-      settings: {
-        foreground: '#569cd6',
-      },
-    },
-    {
-      scope: 'support.function.git-rebase',
-      settings: {
-        foreground: '#9cdcfe',
-      },
-    },
-    {
-      scope: 'constant.sha.git-rebase',
-      settings: {
-        foreground: '#b5cea8',
-      },
-    },
-    {
-      name: 'coloring of the Java import and package identifiers',
-      scope: ['storage.modifier.import.java', 'storage.modifier.package.java'],
-      settings: {
-        foreground: '#d4d4d4',
-      },
-    },
-    {
-      name: 'this.self',
-      scope: 'variable.language',
-      settings: {
-        foreground: '#569cd6',
-      },
-    },
-  ],
-};

+ 0 - 52
src/examples.ts

@@ -1,52 +0,0 @@
-export type SupportedLanguage = keyof typeof examples;
-
-const examples = {
-  hack: `<?hh // strict
-
-type SomeShape = shape(
-  'frame_type' => FrameType,
-  ?'commit_id' => ?string,
-);
-
-abstract final class ClassDefWithLotsOfKeywords {
-  const int BIG_NUMBER = 30000000;
-
-  public static async function genRender(): Awaitable<Stuff> {
-    return <xhp:div>
-      hello world
-    </xhp:div>;
-  }
-}
-`,
-  html: `<!DOCTYPE HTML>
-<html>
-<head>
-</head>
-<body>
-</body>
-</html>
-`,
-  javascript: `\
-const React = require('react');
-
-function create() {
-  return (
-    <div>
-      hello world
-    </div>
-  );
-}
-`,
-  python: `\
-import foo
-
-async def bar(): string:
-  f = await foo()
-  f_string = f"Hooray {f}! format strings are not supported in current Monarch grammar"
-  return foo_string
-`,
-};
-
-export function getSampleCodeForLanguage(language: keyof typeof examples): string {
-  return examples[language];
-}

+ 3 - 103
src/index.ts

@@ -1,104 +1,4 @@
-import type * as monaco from 'monaco-editor';
-import type {IGrammar, IRawGrammar, StackElement} from 'vscode-textmate';
+import {SimpleLanguageInfoProvider} from './providers';
+import {registerLanguages} from './register';
 
-import {createOnigScanner, createOnigString, loadWASM} from 'vscode-oniguruma';
-import {INITIAL, Registry, parseRawGrammar} from 'vscode-textmate';
-type IState = monaco.languages.IState;
-
-import DARK_VISUAL_STUDIO from './dark_vs';
-
-export async function createGrammarStore(
-  scopeNameToTextMateGrammarURL: Map<string, string>,
-): Promise<GrammarStore> {
-  const registry = await createRegistry(scopeNameToTextMateGrammarURL);
-  return new GrammarStore(registry);
-}
-
-class GrammarStore {
-  private scopeNameToGrammar: Map<string, Promise<IGrammar | null>> = new Map();
-
-  constructor(private registry: Registry) {}
-
-  // https://github.com/NeekSandhu/monaco-editor-textmate/issues/11#issuecomment-561984387
-  // provides some insight as to why this isn't working.
-  async createEncodedTokensProvider(
-    scopeName: string,
-  ): Promise<monaco.languages.EncodedTokensProvider> {
-    const grammar = await this.getGrammar(scopeName);
-    if (grammar == null) {
-      throw Error(`no grammar for ${scopeName}`);
-    }
-
-    return {
-      getInitialState(): IState {
-        return INITIAL;
-      },
-
-      tokenizeEncoded(line: string, state: IState): monaco.languages.IEncodedLineTokens {
-        const tokenizeLineResult2 = grammar.tokenizeLine2(line, <StackElement>state);
-        const endState = <IState>tokenizeLineResult2.ruleStack;
-        const {tokens} = tokenizeLineResult2;
-        return {tokens, endState};
-      },
-    };
-  }
-
-  async getGrammar(scopeName: string): Promise<IGrammar | null> {
-    const grammar = this.scopeNameToGrammar.get(scopeName);
-    if (grammar != null) {
-      return grammar;
-    }
-
-    const promise = this.registry.loadGrammar(scopeName);
-    this.scopeNameToGrammar.set(scopeName, promise);
-    return promise;
-  }
-}
-
-async function createRegistry(
-  scopeNameToTextMateGrammarURL: Map<string, string>,
-): Promise<Registry> {
-  const data: ArrayBuffer | Response = await loadVSCodeOnigurumWASM();
-  loadWASM(data);
-
-  return new Registry({
-    onigLib: Promise.resolve({
-      createOnigScanner,
-      createOnigString,
-    }),
-    async loadGrammar(scopeName: string): Promise<IRawGrammar | undefined | null> {
-      const url = scopeNameToTextMateGrammarURL.get(scopeName);
-      if (url == null) {
-        throw Error(`no URL for ${scopeName}`);
-      }
-
-      const response = await fetch(url);
-      if (response.ok) {
-        const content = await response.text();
-        // If this is a JSON grammar, filePath must be specified with a `.json`
-        // file extension or else parseRawGrammar() will assume it is a PLIST
-        // grammar.
-        const match = url.match(/\/([^\/]+\.json)$/);
-        const filePath = match != null ? match[1] : undefined;
-        return parseRawGrammar(content, filePath);
-      }
-
-      throw Error(`request to ${url} failed: ${response}`);
-    },
-    theme: DARK_VISUAL_STUDIO,
-  });
-}
-
-// Taken from https://github.com/microsoft/vscode/blob/829230a5a83768a3494ebbc61144e7cde9105c73/src/vs/workbench/services/textMate/browser/textMateService.ts#L33-L40
-async function loadVSCodeOnigurumWASM(): Promise<Response | ArrayBuffer> {
-  const response = await fetch('/node_modules/vscode-oniguruma/release/onig.wasm');
-  const contentType = response.headers.get('content-type');
-  if (contentType === 'application/wasm') {
-    return response;
-  }
-
-  // Using the response directly only works if the server sets the MIME type 'application/wasm'.
-  // Otherwise, a TypeError is thrown when using the streaming compiler.
-  // We therefore use the non-streaming compiler :(.
-  return await response.arrayBuffer();
-}
+export {SimpleLanguageInfoProvider, registerLanguages};

+ 294 - 0
src/providers.ts

@@ -0,0 +1,294 @@
+import type * as monaco from 'monaco-editor';
+type Monaco = typeof monaco;
+import type {IGrammar, IRawGrammar, IRawTheme, IOnigLib, StackElement} from 'vscode-textmate';
+import type {LanguageId, LanguageInfo} from './register';
+
+import {INITIAL, Registry, parseRawGrammar} from 'vscode-textmate';
+// @ts-ignore
+import {generateTokensCSSForColorMap} from 'monaco-editor/esm/vs/editor/common/modes/supports/tokenization.js';
+
+/** String identifier for a "scope name" such as 'source.cpp' or 'source.java'. */
+type ScopeName = string;
+
+export type SimpleLanguageInfoProviderManifest = {
+  baseResourceURI: string;
+  // Key is a ScopeName.
+  grammars: {[scopeName: string]: ScopeNameInfo};
+  configurations: LanguageId[];
+  // This must be available synchronously to the SimpleLanguageInfoProvider
+  // constructor, so the user is responsible for fetching the theme data rather
+  // than SimpleLanguageInfoProvider.
+  theme: IRawTheme;
+};
+
+type ScopeNameInfo = {
+  /**
+   * If set, this is the id of an ILanguageExtensionPoint. This establishes the
+   * mapping from a MonacoLanguage to a TextMate grammar.
+   */
+  language?: LanguageId;
+
+  /**
+   * Scopes that are injected *into* this scope. For example, the
+   * `text.html.markdown` scope likely has a number of injections to support
+   * fenced code blocks.
+   */
+  injections?: ScopeName[];
+
+  /** Relative to baseResourceURI: should end in '.plist' or '.json'. */
+  path: string;
+};
+
+/**
+ * Basic provider to implement the fetchLanguageInfo() function needed to
+ * power registerLanguages(). It is designed to fetch all resources
+ * asynchronously based on a simple layout of static resources on the server.
+ */
+export class SimpleLanguageInfoProvider {
+  private registry: Registry;
+  private tokensProviderCache: TokensProviderCache;
+
+  constructor(
+    private manifest: SimpleLanguageInfoProviderManifest,
+    oniguruma: Promise<IOnigLib>,
+    private monaco: Monaco,
+  ) {
+    const {baseResourceURI, grammars, theme} = manifest;
+    this.registry = new Registry({
+      onigLib: oniguruma,
+
+      async loadGrammar(scopeName: ScopeName): Promise<IRawGrammar | null> {
+        const scopeNameInfo = grammars[scopeName];
+        if (scopeNameInfo == null) {
+          return null;
+        }
+
+        const {path} = scopeNameInfo;
+        const uri = `${baseResourceURI}/grammars/${path}`;
+        const response = await fetch(uri);
+        const grammar = await response.text();
+        // If this is a JSON grammar, filePath must be specified with a `.json`
+        // file extension or else parseRawGrammar() will assume it is a PLIST
+        // grammar.
+        return parseRawGrammar(grammar, path);
+      },
+
+      /**
+       * For the given scope, returns a list of additional grammars that should be
+       * "injected into" it (i.e., a list of grammars that want to extend the
+       * specified `scopeName`). The most common example is other grammars that
+       * want to "inject themselves" into the `text.html.markdown` scope so they
+       * can be used with fenced code blocks.
+       *
+       * In the manifest of a VS Code extension, a grammar signals that it wants
+       * to do this via the "injectTo" property:
+       * https://code.visualstudio.com/api/language-extensions/syntax-highlight-guide#injection-grammars
+       */
+      getInjections(scopeName: ScopeName): string[] | undefined {
+        const grammar = grammars[scopeName];
+        return grammar ? grammar.injections : undefined;
+      },
+
+      // Note that nothing will display without the theme!
+      theme,
+    });
+
+    this.tokensProviderCache = new TokensProviderCache(this.registry);
+  }
+
+  /**
+   * Be sure this is done after Monaco injects its default styles so that the
+   * injected CSS overrides the defaults.
+   */
+  injectCSS() {
+    const colorMap = this.registry.getColorMap();
+    const css = generateTokensCSSForColorMap(colorMap);
+    const style = createStyleElementForColorsCSS();
+    style.innerHTML = css;
+  }
+
+  async fetchLanguageInfo(language: LanguageId): Promise<LanguageInfo> {
+    const [tokensProvider, configuration] = await Promise.all([
+      this.getTokensProviderForLanguage(language),
+      this.getConfigurationForLanguage(language),
+    ]);
+    return {tokensProvider, configuration};
+  }
+
+  private async getConfigurationForLanguage(
+    language: LanguageId,
+  ): Promise<monaco.languages.LanguageConfiguration | null> {
+    const uri = `${this.manifest.baseResourceURI}/configurations/${language}.json`;
+    const response = await fetch(uri);
+    const rawConfiguration = await response.text();
+    return rehydrateRegexps(rawConfiguration);
+  }
+
+  private getTokensProviderForLanguage(
+    language: string,
+  ): Promise<monaco.languages.EncodedTokensProvider | null> {
+    const scopeName = this.getScopeNameForLanguage(language);
+    if (scopeName == null) {
+      return Promise.resolve(null);
+    }
+
+    const encodedLanguageId = this.monaco.languages.getEncodedLanguageId(language);
+    // Ensure the result of createEncodedTokensProvider() is resolved before
+    // setting the language configuration.
+    return this.tokensProviderCache.createEncodedTokensProvider(scopeName, encodedLanguageId);
+  }
+
+  private getScopeNameForLanguage(language: string): string | null {
+    for (const [scopeName, grammar] of Object.entries(this.manifest.grammars)) {
+      if (grammar.language === language) {
+        return scopeName;
+      }
+    }
+    return null;
+  }
+}
+
+class TokensProviderCache {
+  private scopeNameToGrammar: Map<string, Promise<IGrammar>> = new Map();
+
+  constructor(private registry: Registry) {}
+
+  async createEncodedTokensProvider(
+    scopeName: string,
+    encodedLanguageId: number,
+  ): Promise<monaco.languages.EncodedTokensProvider> {
+    const grammar = await this.getGrammar(scopeName, encodedLanguageId);
+
+    return {
+      getInitialState() {
+        return INITIAL;
+      },
+
+      tokenizeEncoded(
+        line: string,
+        state: monaco.languages.IState,
+      ): monaco.languages.IEncodedLineTokens {
+        const tokenizeLineResult2 = grammar.tokenizeLine2(line, state as StackElement);
+        const {tokens, ruleStack: endState} = tokenizeLineResult2;
+        return {tokens, endState};
+      },
+    };
+  }
+
+  getGrammar(scopeName: string, encodedLanguageId: number): Promise<IGrammar> {
+    const grammar = this.scopeNameToGrammar.get(scopeName);
+    if (grammar != null) {
+      return grammar;
+    }
+
+    // This is defined in vscode-textmate and has optional embeddedLanguages
+    // and tokenTypes fields that might be useful/necessary to take advantage of
+    // at some point.
+    const grammarConfiguration = {};
+    // We use loadGrammarWithConfiguration() rather than loadGrammar() because
+    // we discovered that if the numeric LanguageId is not specified, then it
+    // does not get encoded in the TokenMetadata.
+    //
+    // Failure to do so means that the LanguageId cannot be read back later,
+    // which can cause other Monaco features, such as "Toggle Line Comment",
+    // to fail.
+    const promise = this.registry
+      .loadGrammarWithConfiguration(scopeName, encodedLanguageId, grammarConfiguration)
+      .then((grammar: IGrammar | null) => {
+        if (grammar) {
+          return grammar;
+        } else {
+          throw Error(`failed to load grammar for ${scopeName}`);
+        }
+      });
+    this.scopeNameToGrammar.set(scopeName, promise);
+    return promise;
+  }
+}
+
+function createStyleElementForColorsCSS(): HTMLStyleElement {
+  // We want to ensure that our <style> element appears after Monaco's so that
+  // we can override some styles it inserted for the default theme.
+  const style = document.createElement('style');
+
+  // We expect the styles we need to override to be in an element with the class
+  // name 'monaco-colors' based on:
+  // https://github.com/microsoft/vscode/blob/f78d84606cd16d75549c82c68888de91d8bdec9f/src/vs/editor/standalone/browser/standaloneThemeServiceImpl.ts#L206-L214
+  const monacoColors = document.getElementsByClassName('monaco-colors')[0];
+  if (monacoColors) {
+    monacoColors.parentElement?.insertBefore(style, monacoColors.nextSibling);
+  } else {
+    // Though if we cannot find it, just append to <head>.
+    let {head} = document;
+    if (head == null) {
+      head = document.getElementsByTagName('head')[0];
+    }
+    head?.appendChild(style);
+  }
+  return style;
+}
+
+/**
+ * Fields that, if present in a LanguageConfiguration, must be a RegExp object
+ * rather than a string literal.
+ */
+const REGEXP_PROPERTIES = [
+  // indentation
+  'indentationRules.decreaseIndentPattern',
+  'indentationRules.increaseIndentPattern',
+  'indentationRules.indentNextLinePattern',
+  'indentationRules.unIndentedLinePattern',
+
+  // code folding
+  'folding.markers.start',
+  'folding.markers.end',
+
+  // language's "word definition"
+  'wordPattern',
+];
+
+/**
+ * Configuration data is read from JSON and JSONC files, which cannot contain
+ * regular expression literals. Although Monarch grammars will often accept
+ * either the source of a RegExp as a string OR a RegExp object, certain Monaco
+ * APIs accept only a RegExp object, so we must "rehydrate" those, as appropriate.
+ *
+ * It would probably save everyone a lot of trouble if we updated the APIs to
+ * accept a RegExp or a string literal. Possibly a small struct if flags need
+ * to be specified to the RegExp constructor.
+ */
+function rehydrateRegexps(rawConfiguration: string): monaco.languages.LanguageConfiguration {
+  const out = JSON.parse(rawConfiguration);
+  for (const property of REGEXP_PROPERTIES) {
+    const value = getProp(out, property);
+    if (typeof value === 'string') {
+      setProp(out, property, new RegExp(value));
+    }
+  }
+  return out;
+}
+
+function getProp(obj: {string: any}, selector: string): any {
+  const components = selector.split('.');
+  // @ts-ignore
+  return components.reduce((acc, cur) => (acc != null ? acc[cur] : null), obj);
+}
+
+function setProp(obj: {string: any}, selector: string, value: RegExp): void {
+  const components = selector.split('.');
+  const indexToSet = components.length - 1;
+  components.reduce((acc, cur, index) => {
+    if (acc == null) {
+      return acc;
+    }
+
+    if (index === indexToSet) {
+      // @ts-ignore
+      acc[cur] = value;
+      return null;
+    } else {
+      // @ts-ignore
+      return acc[cur];
+    }
+  }, obj);
+}

+ 44 - 0
src/register.ts

@@ -0,0 +1,44 @@
+import type * as monaco from 'monaco-editor';
+type Monaco = typeof monaco;
+
+/** String identifier like 'cpp' or 'java'. */
+export type LanguageId = string;
+
+export type LanguageInfo = {
+  tokensProvider: monaco.languages.EncodedTokensProvider | null;
+  configuration: monaco.languages.LanguageConfiguration | null;
+};
+
+/**
+ * This function needs to be called before monaco.editor.create().
+ *
+ * @param languages the set of languages Monaco must know about up front.
+ * @param fetchLanguageInfo fetches full language configuration on demand.
+ * @param monaco instance of Monaco on which to register languages information.
+ */
+export function registerLanguages(
+  languages: monaco.languages.ILanguageExtensionPoint[],
+  fetchLanguageInfo: (language: LanguageId) => Promise<LanguageInfo>,
+  monaco: Monaco,
+) {
+  // We have to register all of the languages with Monaco synchronously before
+  // we can configure them.
+  for (const extensionPoint of languages) {
+    // Recall that the id is a short name like 'cpp' or 'java'.
+    const {id: languageId} = extensionPoint;
+    monaco.languages.register(extensionPoint);
+
+    // Lazy-load the tokens provider and configuration data.
+    monaco.languages.onLanguage(languageId, async () => {
+      const {tokensProvider, configuration} = await fetchLanguageInfo(languageId);
+
+      if (tokensProvider != null) {
+        monaco.languages.setTokensProvider(languageId, tokensProvider);
+      }
+
+      if (configuration != null) {
+        monaco.languages.setLanguageConfiguration(languageId, configuration);
+      }
+    });
+  }
+}

+ 530 - 0
src/vs-dark-plus-theme.ts

@@ -0,0 +1,530 @@
+// Theme data derived from:
+// https://github.com/microsoft/vscode/raw/a716714a88891cad69c0753fb95923870df295f5/extensions/theme-defaults/themes/dark_plus.json
+
+// This satisfies the contract of IRawTheme as defined in vscode-textmate.
+export default {
+  name: 'Dark+ (default dark)',
+  settings: [
+    {
+      settings: {
+        foreground: '#D4D4D4',
+        background: '#1E1E1E',
+      },
+    },
+    {
+      name: 'Function declarations',
+      scope: [
+        'entity.name.function',
+        'support.function',
+        'support.constant.handlebars',
+        'source.powershell variable.other.member',
+        'entity.name.operator.custom-literal',
+      ],
+      settings: {
+        foreground: '#DCDCAA',
+      },
+    },
+    {
+      name: 'Types declaration and references',
+      scope: [
+        'meta.return-type',
+        'support.class',
+        'support.type',
+        'entity.name.type',
+        'entity.name.namespace',
+        'entity.other.attribute',
+        'entity.name.scope-resolution',
+        'entity.name.class',
+        'storage.type.numeric.go',
+        'storage.type.byte.go',
+        'storage.type.boolean.go',
+        'storage.type.string.go',
+        'storage.type.uintptr.go',
+        'storage.type.error.go',
+        'storage.type.rune.go',
+        'storage.type.cs',
+        'storage.type.generic.cs',
+        'storage.type.modifier.cs',
+        'storage.type.variable.cs',
+        'storage.type.annotation.java',
+        'storage.type.generic.java',
+        'storage.type.java',
+        'storage.type.object.array.java',
+        'storage.type.primitive.array.java',
+        'storage.type.primitive.java',
+        'storage.type.token.java',
+        'storage.type.groovy',
+        'storage.type.annotation.groovy',
+        'storage.type.parameters.groovy',
+        'storage.type.generic.groovy',
+        'storage.type.object.array.groovy',
+        'storage.type.primitive.array.groovy',
+        'storage.type.primitive.groovy',
+      ],
+      settings: {
+        foreground: '#4EC9B0',
+      },
+    },
+    {
+      name: 'Types declaration and references, TS grammar specific',
+      scope: [
+        'meta.type.cast.expr',
+        'meta.type.new.expr',
+        'support.constant.math',
+        'support.constant.dom',
+        'support.constant.json',
+        'entity.other.inherited-class',
+      ],
+      settings: {
+        foreground: '#4EC9B0',
+      },
+    },
+    {
+      name: 'Control flow / Special keywords',
+      scope: [
+        'keyword.control',
+        'source.cpp keyword.operator.new',
+        'keyword.operator.delete',
+        'keyword.other.using',
+        'keyword.other.operator',
+        'entity.name.operator',
+      ],
+      settings: {
+        foreground: '#C586C0',
+      },
+    },
+    {
+      name: 'Variable and parameter name',
+      scope: [
+        'variable',
+        'meta.definition.variable.name',
+        'support.variable',
+        'entity.name.variable',
+      ],
+      settings: {
+        foreground: '#9CDCFE',
+      },
+    },
+    {
+      name: 'Constants and enums',
+      scope: ['variable.other.constant', 'variable.other.enummember'],
+      settings: {
+        foreground: '#51B6C4',
+      },
+    },
+    {
+      name: 'Object keys, TS grammar specific',
+      scope: 'meta.object-literal.key',
+      settings: {
+        foreground: '#9CDCFE',
+      },
+    },
+    {
+      name: 'CSS property value',
+      scope: [
+        'support.constant.property-value',
+        'support.constant.font-name',
+        'support.constant.media-type',
+        'support.constant.media',
+        'constant.other.color.rgb-value',
+        'constant.other.rgb-value',
+        'support.constant.color',
+      ],
+      settings: {
+        foreground: '#CE9178',
+      },
+    },
+    {
+      name: 'Regular expression groups',
+      scope: [
+        'punctuation.definition.group.regexp',
+        'punctuation.definition.group.assertion.regexp',
+        'punctuation.definition.character-class.regexp',
+        'punctuation.character.set.begin.regexp',
+        'punctuation.character.set.end.regexp',
+        'keyword.operator.negation.regexp',
+        'support.other.parenthesis.regexp',
+      ],
+      settings: {
+        foreground: '#CE9178',
+      },
+    },
+    {
+      scope: [
+        'constant.character.character-class.regexp',
+        'constant.other.character-class.set.regexp',
+        'constant.other.character-class.regexp',
+        'constant.character.set.regexp',
+      ],
+      settings: {
+        foreground: '#d16969',
+      },
+    },
+    {
+      scope: ['keyword.operator.or.regexp', 'keyword.control.anchor.regexp'],
+      settings: {
+        foreground: '#DCDCAA',
+      },
+    },
+    {
+      scope: 'keyword.operator.quantifier.regexp',
+      settings: {
+        foreground: '#d7ba7d',
+      },
+    },
+    {
+      scope: 'constant.character',
+      settings: {
+        foreground: '#569cd6',
+      },
+    },
+    {
+      scope: 'constant.character.escape',
+      settings: {
+        foreground: '#d7ba7d',
+      },
+    },
+    {
+      scope: 'entity.name.label',
+      settings: {
+        foreground: '#C8C8C8',
+      },
+    },
+    {
+      scope: ['meta.embedded', 'source.groovy.embedded'],
+      settings: {
+        foreground: '#D4D4D4',
+      },
+    },
+    {
+      scope: 'emphasis',
+      settings: {
+        fontStyle: 'italic',
+      },
+    },
+    {
+      scope: 'strong',
+      settings: {
+        fontStyle: 'bold',
+      },
+    },
+    {
+      scope: 'header',
+      settings: {
+        foreground: '#000080',
+      },
+    },
+    {
+      scope: 'comment',
+      settings: {
+        foreground: '#6A9955',
+      },
+    },
+    {
+      scope: 'constant.language',
+      settings: {
+        foreground: '#569cd6',
+      },
+    },
+    {
+      scope: [
+        'constant.numeric',
+        'entity.name.operator.custom-literal.number',
+        'keyword.operator.plus.exponent',
+        'keyword.operator.minus.exponent',
+      ],
+      settings: {
+        foreground: '#b5cea8',
+      },
+    },
+    {
+      scope: 'constant.regexp',
+      settings: {
+        foreground: '#646695',
+      },
+    },
+    {
+      scope: 'entity.name.tag',
+      settings: {
+        foreground: '#569cd6',
+      },
+    },
+    {
+      scope: 'entity.name.tag.css',
+      settings: {
+        foreground: '#d7ba7d',
+      },
+    },
+    {
+      scope: 'entity.other.attribute-name',
+      settings: {
+        foreground: '#9cdcfe',
+      },
+    },
+    {
+      scope: [
+        'entity.other.attribute-name.class.css',
+        'entity.other.attribute-name.class.mixin.css',
+        'entity.other.attribute-name.id.css',
+        'entity.other.attribute-name.parent-selector.css',
+        'entity.other.attribute-name.pseudo-class.css',
+        'entity.other.attribute-name.pseudo-element.css',
+        'source.css.less entity.other.attribute-name.id',
+        'entity.other.attribute-name.attribute.scss',
+        'entity.other.attribute-name.scss',
+      ],
+      settings: {
+        foreground: '#d7ba7d',
+      },
+    },
+    {
+      scope: 'invalid',
+      settings: {
+        foreground: '#f44747',
+      },
+    },
+    {
+      scope: 'markup.underline',
+      settings: {
+        fontStyle: 'underline',
+      },
+    },
+    {
+      scope: 'markup.bold',
+      settings: {
+        fontStyle: 'bold',
+        foreground: '#569cd6',
+      },
+    },
+    {
+      scope: 'markup.heading',
+      settings: {
+        fontStyle: 'bold',
+        foreground: '#569cd6',
+      },
+    },
+    {
+      scope: 'markup.italic',
+      settings: {
+        fontStyle: 'italic',
+      },
+    },
+    {
+      scope: 'markup.inserted',
+      settings: {
+        foreground: '#b5cea8',
+      },
+    },
+    {
+      scope: 'markup.deleted',
+      settings: {
+        foreground: '#ce9178',
+      },
+    },
+    {
+      scope: 'markup.changed',
+      settings: {
+        foreground: '#569cd6',
+      },
+    },
+    {
+      scope: 'punctuation.definition.quote.begin.markdown',
+      settings: {
+        foreground: '#6A9955',
+      },
+    },
+    {
+      scope: 'punctuation.definition.list.begin.markdown',
+      settings: {
+        foreground: '#6796e6',
+      },
+    },
+    {
+      scope: 'markup.inline.raw',
+      settings: {
+        foreground: '#ce9178',
+      },
+    },
+    {
+      name: 'brackets of XML/HTML tags',
+      scope: 'punctuation.definition.tag',
+      settings: {
+        foreground: '#808080',
+      },
+    },
+    {
+      scope: ['meta.preprocessor', 'entity.name.function.preprocessor'],
+      settings: {
+        foreground: '#569cd6',
+      },
+    },
+    {
+      scope: 'meta.preprocessor.string',
+      settings: {
+        foreground: '#ce9178',
+      },
+    },
+    {
+      scope: 'meta.preprocessor.numeric',
+      settings: {
+        foreground: '#b5cea8',
+      },
+    },
+    {
+      scope: 'meta.structure.dictionary.key.python',
+      settings: {
+        foreground: '#9cdcfe',
+      },
+    },
+    {
+      scope: 'meta.diff.header',
+      settings: {
+        foreground: '#569cd6',
+      },
+    },
+    {
+      scope: 'storage',
+      settings: {
+        foreground: '#569cd6',
+      },
+    },
+    {
+      scope: 'storage.type',
+      settings: {
+        foreground: '#569cd6',
+      },
+    },
+    {
+      scope: ['storage.modifier', 'keyword.operator.noexcept'],
+      settings: {
+        foreground: '#569cd6',
+      },
+    },
+    {
+      scope: ['string', 'entity.name.operator.custom-literal.string', 'meta.embedded.assembly'],
+      settings: {
+        foreground: '#ce9178',
+      },
+    },
+    {
+      scope: 'string.tag',
+      settings: {
+        foreground: '#ce9178',
+      },
+    },
+    {
+      scope: 'string.value',
+      settings: {
+        foreground: '#ce9178',
+      },
+    },
+    {
+      scope: 'string.regexp',
+      settings: {
+        foreground: '#d16969',
+      },
+    },
+    {
+      name: 'String interpolation',
+      scope: [
+        'punctuation.definition.template-expression.begin',
+        'punctuation.definition.template-expression.end',
+        'punctuation.section.embedded',
+      ],
+      settings: {
+        foreground: '#569cd6',
+      },
+    },
+    {
+      name: 'Reset JavaScript string interpolation expression',
+      scope: 'meta.template.expression',
+      settings: {
+        foreground: '#d4d4d4',
+      },
+    },
+    {
+      scope: [
+        'support.type.vendored.property-name',
+        'support.type.property-name',
+        'variable.css',
+        'variable.scss',
+        'variable.other.less',
+        'source.coffee.embedded',
+      ],
+      settings: {
+        foreground: '#9cdcfe',
+      },
+    },
+    {
+      scope: 'keyword',
+      settings: {
+        foreground: '#569cd6',
+      },
+    },
+    {
+      scope: 'keyword.operator',
+      settings: {
+        foreground: '#d4d4d4',
+      },
+    },
+    {
+      scope: [
+        'keyword.operator.new',
+        'keyword.operator.expression',
+        'keyword.operator.cast',
+        'keyword.operator.sizeof',
+        'keyword.operator.alignof',
+        'keyword.operator.typeid',
+        'keyword.operator.alignas',
+        'keyword.operator.instanceof',
+        'keyword.operator.logical.python',
+        'keyword.operator.wordlike',
+      ],
+      settings: {
+        foreground: '#569cd6',
+      },
+    },
+    {
+      scope: 'keyword.other.unit',
+      settings: {
+        foreground: '#b5cea8',
+      },
+    },
+    {
+      scope: ['punctuation.section.embedded.begin.php', 'punctuation.section.embedded.end.php'],
+      settings: {
+        foreground: '#569cd6',
+      },
+    },
+    {
+      scope: 'support.function.git-rebase',
+      settings: {
+        foreground: '#9cdcfe',
+      },
+    },
+    {
+      scope: 'constant.sha.git-rebase',
+      settings: {
+        foreground: '#b5cea8',
+      },
+    },
+    {
+      name: 'coloring of the Java import and package identifiers',
+      scope: [
+        'storage.modifier.import.java',
+        'variable.language.wildcard.java',
+        'storage.modifier.package.java',
+      ],
+      settings: {
+        foreground: '#d4d4d4',
+      },
+    },
+    {
+      name: 'this.self',
+      scope: 'variable.language',
+      settings: {
+        foreground: '#569cd6',
+      },
+    },
+  ],
+};

Unele fișiere nu au fost afișate deoarece prea multe fișiere au fost modificate în acest diff