1 line
76 KiB
JSON
1 line
76 KiB
JSON
{"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/7d0f2b22a5ad8fccbd7341bc7b7a715169283044","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"}},"endCa
|