diff --git a/extensions/python/syntaxes/MagicPython.tmLanguage.json b/extensions/python/syntaxes/MagicPython.tmLanguage.json index 451a7b46ca7..f9d673e6273 100644 --- a/extensions/python/syntaxes/MagicPython.tmLanguage.json +++ b/extensions/python/syntaxes/MagicPython.tmLanguage.json @@ -7,15 +7,20 @@ "rpy", "pyw", "cpy", + "pyi", "SConstruct", "Sconstruct", "sconstruct", "SConscript", "gyp", - "gypi" + "gypi", + "wsgi", + "kv", + "Snakefile", + "tac" ], - "first_line_match": "^#!/.*\\bpython[\\d\\.]*\\b", - "firstLineMatch": "^#!/.*\\bpython[\\d\\.]*\\b", + "first_line_match": "^#![ \\t]*/.*\\bpython[\\d\\.]*\\b", + "firstLineMatch": "^#![ \\t]*/.*\\bpython[\\d\\.]*\\b", "uuid": "742deb57-6e38-4192-bed6-410746efd85d", "patterns": [ { @@ -26,6 +31,10 @@ } ], "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": [ { @@ -273,8 +282,8 @@ } ] }, - "expression-base": { - "comment": "All valid Python expressions", + "expression-bare": { + "comment": "valid Python expressions w/o comments and line continuation", "patterns": [ { "include": "#backticks" @@ -282,9 +291,6 @@ { "include": "#illegal-anno" }, - { - "include": "#comments" - }, { "include": "#literal" }, @@ -340,10 +346,27 @@ "include": "#special-variables" }, { - "include": "#line-continuation" + "include": "#ellipsis" }, { - "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" } ] }, @@ -398,7 +421,7 @@ }, "special-names": { "name": "constant.other.caps.python", - "match": "(?x)\n \\b\n (\n _* [[:upper:]]\n )\n [[:upper:]\\d]* (_\\w*)?\n \\b\n" + "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": "\\{", @@ -414,6 +437,10 @@ } }, "patterns": [ + { + "name": "punctuation.separator.dict.python", + "match": ":" + }, { "include": "#expression" } @@ -463,7 +490,7 @@ "match": "(\\\\)\\s*(\\S.*$\\n?)", "captures": { "1": { - "name": "separator.continuation.line.python" + "name": "punctuation.separator.continuation.line.python" }, "2": { "name": "invalid.illegal.line.continuation.python" @@ -475,7 +502,7 @@ "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" + "name": "punctuation.separator.continuation.line.python" } }, "patterns": [ @@ -513,6 +540,18 @@ } } }, + "punctuation": { + "patterns": [ + { + "name": "punctuation.separator.colon.python", + "match": ":" + }, + { + "name": "punctuation.separator.element.python", + "match": "," + } + ] + }, "literal": { "patterns": [ { @@ -553,16 +592,16 @@ }, "number-float": { "name": "constant.numeric.float.python", - "match": "(?x)\n (?" }, "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" + } + ] + }, + "regexp-base-common": { "patterns": [ { "name": "support.other.match.any.regexp", @@ -1686,15 +1785,19 @@ "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-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?)", @@ -1709,13 +1812,13 @@ "match": "(?x)\n (\\() (\\?P= \\w+(?:\\s+[[:alnum:]]+)?) (\\))\n", "captures": { "1": { - "name": "punctuation.parenthesis.backreference.named.begin.regexp support.other.parenthesis.regexp" + "name": "support.other.parenthesis.regexp punctuation.parenthesis.backreference.named.begin.regexp" }, "2": { "name": "entity.name.tag.named.backreference.regexp" }, "3": { - "name": "punctuation.parenthesis.backreference.named.end.regexp support.other.parenthesis.regexp" + "name": "support.other.parenthesis.regexp punctuation.parenthesis.backreference.named.end.regexp" } } }, @@ -1881,7 +1984,7 @@ "end": "(\\]|(?=\\'))|((?=(?)\n", + "end": "(\\)|(?=\\'))|((?=(?)\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": "(\\()\\?)\n", + "end": "(\\)|(?=\"))|((?=(?)\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": "(\\()\\?=^]? [-+ ]? \\#?\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)" + } + ] } }, - "version": "https://github.com/MagicStack/MagicPython/commit/37b660d0490d69ffd8cb4eabc0dd768e6cdaae7a" + "version": "https://github.com/MagicStack/MagicPython/commit/976e59dcb78cb577e79c8f2117216c06718337e0" } \ No newline at end of file diff --git a/extensions/python/syntaxes/MagicRegExp.tmLanguage.json b/extensions/python/syntaxes/MagicRegExp.tmLanguage.json index 2a173bfe5d1..b5795a7b89f 100644 --- a/extensions/python/syntaxes/MagicRegExp.tmLanguage.json +++ b/extensions/python/syntaxes/MagicRegExp.tmLanguage.json @@ -12,6 +12,32 @@ ], "repository": { "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" + } + ] + }, + "regexp-base-common": { "patterns": [ { "name": "support.other.match.any.regexp", @@ -33,15 +59,19 @@ "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-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?)", @@ -56,13 +86,13 @@ "match": "(?x)\n (\\() (\\?P= \\w+(?:\\s+[[:alnum:]]+)?) (\\))\n", "captures": { "1": { - "name": "punctuation.parenthesis.backreference.named.begin.regexp support.other.parenthesis.regexp" + "name": "support.other.parenthesis.regexp punctuation.parenthesis.backreference.named.begin.regexp" }, "2": { "name": "entity.name.tag.named.backreference.regexp" }, "3": { - "name": "punctuation.parenthesis.backreference.named.end.regexp support.other.parenthesis.regexp" + "name": "support.other.parenthesis.regexp punctuation.parenthesis.backreference.named.end.regexp" } } }, @@ -183,7 +213,7 @@ "end": "(\\])", "beginCaptures": { "1": { - "name": "constant.other.set.regexp punctuation.character.set.begin.regexp" + "name": "punctuation.character.set.begin.regexp constant.other.set.regexp" }, "2": { "name": "keyword.operator.negation.regexp" @@ -194,7 +224,7 @@ }, "endCaptures": { "1": { - "name": "constant.other.set.regexp punctuation.character.set.end.regexp" + "name": "punctuation.character.set.end.regexp constant.other.set.regexp" }, "2": { "name": "invalid.illegal.newline.python" @@ -218,7 +248,7 @@ "end": "(\\))", "beginCaptures": { "1": { - "name": "punctuation.parenthesis.named.begin.regexp support.other.parenthesis.regexp" + "name": "support.other.parenthesis.regexp punctuation.parenthesis.named.begin.regexp" }, "2": { "name": "entity.name.tag.named.group.regexp" @@ -226,7 +256,7 @@ }, "endCaptures": { "1": { - "name": "punctuation.parenthesis.named.end.regexp support.other.parenthesis.regexp" + "name": "support.other.parenthesis.regexp punctuation.parenthesis.named.end.regexp" }, "2": { "name": "invalid.illegal.newline.python" @@ -274,7 +304,7 @@ }, "endCaptures": { "1": { - "name": "punctuation.parenthesis.lookahead.end.regexp keyword.operator.lookahead.regexp" + "name": "keyword.operator.lookahead.regexp punctuation.parenthesis.lookahead.end.regexp" }, "2": { "name": "invalid.illegal.newline.python" @@ -299,7 +329,7 @@ }, "endCaptures": { "1": { - "name": "punctuation.parenthesis.lookahead.end.regexp keyword.operator.lookahead.negative.regexp" + "name": "keyword.operator.lookahead.negative.regexp punctuation.parenthesis.lookahead.end.regexp" }, "2": { "name": "invalid.illegal.newline.python" @@ -324,7 +354,7 @@ }, "endCaptures": { "1": { - "name": "punctuation.parenthesis.lookbehind.end.regexp keyword.operator.lookbehind.regexp" + "name": "keyword.operator.lookbehind.regexp punctuation.parenthesis.lookbehind.end.regexp" }, "2": { "name": "invalid.illegal.newline.python" @@ -349,7 +379,7 @@ }, "endCaptures": { "1": { - "name": "punctuation.parenthesis.lookbehind.end.regexp keyword.operator.lookbehind.negative.regexp" + "name": "keyword.operator.lookbehind.negative.regexp punctuation.parenthesis.lookbehind.end.regexp" }, "2": { "name": "invalid.illegal.newline.python" @@ -374,7 +404,7 @@ }, "endCaptures": { "1": { - "name": "punctuation.parenthesis.conditional.end.regexp keyword.operator.conditional.negative.regexp" + "name": "keyword.operator.conditional.negative.regexp punctuation.parenthesis.conditional.end.regexp" }, "2": { "name": "invalid.illegal.newline.python" @@ -391,12 +421,12 @@ "end": "(\\))", "beginCaptures": { "0": { - "name": "punctuation.parenthesis.non-capturing.begin.regexp support.other.parenthesis.regexp" + "name": "support.other.parenthesis.regexp punctuation.parenthesis.non-capturing.begin.regexp" } }, "endCaptures": { "1": { - "name": "punctuation.parenthesis.non-capturing.end.regexp support.other.parenthesis.regexp" + "name": "support.other.parenthesis.regexp punctuation.parenthesis.non-capturing.end.regexp" }, "2": { "name": "invalid.illegal.newline.python" @@ -413,12 +443,12 @@ "end": "(\\))", "beginCaptures": { "0": { - "name": "punctuation.parenthesis.begin.regexp support.other.parenthesis.regexp" + "name": "support.other.parenthesis.regexp punctuation.parenthesis.begin.regexp" } }, "endCaptures": { "1": { - "name": "punctuation.parenthesis.end.regexp support.other.parenthesis.regexp" + "name": "support.other.parenthesis.regexp punctuation.parenthesis.end.regexp" }, "2": { "name": "invalid.illegal.newline.python" @@ -431,5 +461,5 @@ ] } }, - "version": "https://github.com/MagicStack/MagicPython/commit/a45287d159f82256c768ad2e1114ca9751d28670" + "version": "https://github.com/MagicStack/MagicPython/commit/df5bb18c64252f2e7b1aa87e2ed124666d314f1d" } \ No newline at end of file diff --git a/extensions/python/test/colorize-results/test_py.json b/extensions/python/test/colorize-results/test_py.json index b1aa0db8bfb..c3ceb6edbe6 100644 --- a/extensions/python/test/colorize-results/test_py.json +++ b/extensions/python/test/colorize-results/test_py.json @@ -385,7 +385,7 @@ } }, { - "c": " ", + "c": " N", "t": "source.python", "r": { "dark_plus": "default: #D4D4D4", @@ -395,17 +395,6 @@ "hc_black": "default: #FFFFFF" } }, - { - "c": "N", - "t": "source.python constant.other.caps.python", - "r": { - "dark_plus": "default: #D4D4D4", - "light_plus": "default: #000000", - "dark_vs": "default: #D4D4D4", - "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" - } - }, { "c": "*", "t": "source.python keyword.operator.arithmetic.python", @@ -814,7 +803,29 @@ } }, { - "c": "key: val", + "c": "key", + "t": "source.python meta.function.python meta.function.parameters.python", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF" + } + }, + { + "c": ":", + "t": "source.python meta.function.python meta.function.parameters.python punctuation.separator.dict.python", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF" + } + }, + { + "c": " val", "t": "source.python meta.function.python meta.function.parameters.python", "r": { "dark_plus": "default: #D4D4D4", @@ -847,7 +858,29 @@ } }, { - "c": " key, val ", + "c": " key", + "t": "source.python meta.function.python meta.function.parameters.python", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF" + } + }, + { + "c": ",", + "t": "source.python meta.function.python meta.function.parameters.python punctuation.separator.element.python", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF" + } + }, + { + "c": " val ", "t": "source.python meta.function.python meta.function.parameters.python", "r": { "dark_plus": "default: #D4D4D4", @@ -1354,7 +1387,7 @@ }, { "c": "\\", - "t": "source.python separator.continuation.line.python", + "t": "source.python punctuation.separator.continuation.line.python", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1596,7 +1629,7 @@ }, { "c": "\\", - "t": "source.python separator.continuation.line.python", + "t": "source.python punctuation.separator.continuation.line.python", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1826,7 +1859,18 @@ } }, { - "c": ": ", + "c": ":", + "t": "source.python punctuation.separator.colon.python", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF" + } + }, + { + "c": " ", "t": "source.python", "r": { "dark_plus": "default: #D4D4D4", @@ -2113,7 +2157,7 @@ }, { "c": ":", - "t": "source.python", + "t": "source.python punctuation.separator.colon.python", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -2355,7 +2399,7 @@ }, { "c": ",", - "t": "source.python meta.function-call.python meta.function-call.arguments.python", + "t": "source.python meta.function-call.python meta.function-call.arguments.python punctuation.separator.element.python", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -2377,7 +2421,7 @@ }, { "c": ",", - "t": "source.python meta.function-call.python meta.function-call.arguments.python", + "t": "source.python meta.function-call.python meta.function-call.arguments.python punctuation.separator.element.python", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -2399,7 +2443,7 @@ }, { "c": ",", - "t": "source.python meta.function-call.python meta.function-call.arguments.python", + "t": "source.python meta.function-call.python meta.function-call.arguments.python punctuation.separator.element.python", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -2519,7 +2563,29 @@ } }, { - "c": " : ", + "c": " ", + "t": "source.python", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF" + } + }, + { + "c": ":", + "t": "source.python punctuation.separator.dict.python", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF" + } + }, + { + "c": " ", "t": "source.python", "r": { "dark_plus": "default: #D4D4D4", @@ -2563,7 +2629,18 @@ } }, { - "c": ", ", + "c": ",", + "t": "source.python punctuation.separator.element.python", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF" + } + }, + { + "c": " ", "t": "source.python", "r": { "dark_plus": "default: #D4D4D4", @@ -2608,7 +2685,7 @@ }, { "c": ":", - "t": "source.python", + "t": "source.python punctuation.separator.dict.python", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -2651,7 +2728,18 @@ } }, { - "c": ", ", + "c": ",", + "t": "source.python punctuation.separator.element.python", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF" + } + }, + { + "c": " ", "t": "source.python", "r": { "dark_plus": "default: #D4D4D4", @@ -2696,7 +2784,7 @@ }, { "c": ":", - "t": "source.python", + "t": "source.python punctuation.separator.dict.python", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -2838,7 +2926,18 @@ } }, { - "c": ": ", + "c": ":", + "t": "source.python punctuation.separator.dict.python", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF" + } + }, + { + "c": " ", "t": "source.python", "r": { "dark_plus": "default: #D4D4D4", @@ -2860,7 +2959,18 @@ } }, { - "c": ", ", + "c": ",", + "t": "source.python punctuation.separator.element.python", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF" + } + }, + { + "c": " ", "t": "source.python", "r": { "dark_plus": "default: #D4D4D4", @@ -2937,7 +3047,18 @@ } }, { - "c": ": ", + "c": ":", + "t": "source.python punctuation.separator.dict.python", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF" + } + }, + { + "c": " ", "t": "source.python", "r": { "dark_plus": "default: #D4D4D4", @@ -3213,7 +3334,7 @@ }, { "c": ":", - "t": "source.python", + "t": "source.python punctuation.separator.colon.python", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -3334,7 +3455,7 @@ }, { "c": ":", - "t": "source.python", + "t": "source.python punctuation.separator.colon.python", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -3631,7 +3752,7 @@ }, { "c": ":", - "t": "source.python", + "t": "source.python punctuation.separator.colon.python", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -4004,7 +4125,40 @@ } }, { - "c": ", x, ", + "c": ",", + "t": "source.python punctuation.separator.element.python", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF" + } + }, + { + "c": " x", + "t": "source.python", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF" + } + }, + { + "c": ",", + "t": "source.python punctuation.separator.element.python", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF" + } + }, + { + "c": " ", "t": "source.python", "r": { "dark_plus": "default: #D4D4D4", @@ -4048,7 +4202,18 @@ } }, { - "c": ", y", + "c": ",", + "t": "source.python punctuation.separator.element.python", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF" + } + }, + { + "c": " y", "t": "source.python", "r": { "dark_plus": "default: #D4D4D4", @@ -4125,7 +4290,18 @@ } }, { - "c": ", mehr", + "c": ",", + "t": "source.python punctuation.separator.element.python", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF" + } + }, + { + "c": " mehr", "t": "source.python", "r": { "dark_plus": "default: #D4D4D4", @@ -4653,7 +4829,7 @@ } }, { - "c": ".memo:", + "c": ".memo", "t": "source.python", "r": { "dark_plus": "default: #D4D4D4", @@ -4663,6 +4839,17 @@ "hc_black": "default: #FFFFFF" } }, + { + "c": ":", + "t": "source.python punctuation.separator.colon.python", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF" + } + }, { "c": " ", "t": "source.python", @@ -5028,7 +5215,7 @@ }, { "c": "(", - "t": "source.python meta.function-call.python meta.function-call.arguments.python string.regexp.quoted.single.python punctuation.parenthesis.begin.regexp support.other.parenthesis.regexp", + "t": "source.python meta.function-call.python meta.function-call.arguments.python string.regexp.quoted.single.python support.other.parenthesis.regexp punctuation.parenthesis.begin.regexp", "r": { "dark_plus": "string.regexp: #D16969", "light_plus": "string.regexp: #811F3F", @@ -5039,7 +5226,7 @@ }, { "c": "[", - "t": "source.python meta.function-call.python meta.function-call.arguments.python string.regexp.quoted.single.python meta.character.set.regexp constant.other.set.regexp punctuation.character.set.begin.regexp", + "t": "source.python meta.function-call.python meta.function-call.arguments.python string.regexp.quoted.single.python meta.character.set.regexp punctuation.character.set.begin.regexp constant.other.set.regexp", "r": { "dark_plus": "string.regexp: #D16969", "light_plus": "string.regexp: #811F3F", @@ -5061,7 +5248,7 @@ }, { "c": "]", - "t": "source.python meta.function-call.python meta.function-call.arguments.python string.regexp.quoted.single.python meta.character.set.regexp constant.other.set.regexp punctuation.character.set.end.regexp", + "t": "source.python meta.function-call.python meta.function-call.arguments.python string.regexp.quoted.single.python meta.character.set.regexp punctuation.character.set.end.regexp constant.other.set.regexp", "r": { "dark_plus": "string.regexp: #D16969", "light_plus": "string.regexp: #811F3F", @@ -5083,7 +5270,7 @@ }, { "c": ")", - "t": "source.python meta.function-call.python meta.function-call.arguments.python string.regexp.quoted.single.python punctuation.parenthesis.end.regexp support.other.parenthesis.regexp", + "t": "source.python meta.function-call.python meta.function-call.arguments.python string.regexp.quoted.single.python support.other.parenthesis.regexp punctuation.parenthesis.end.regexp", "r": { "dark_plus": "string.regexp: #D16969", "light_plus": "string.regexp: #811F3F", @@ -5116,7 +5303,7 @@ }, { "c": "(", - "t": "source.python meta.function-call.python meta.function-call.arguments.python string.regexp.quoted.single.python punctuation.parenthesis.begin.regexp support.other.parenthesis.regexp", + "t": "source.python meta.function-call.python meta.function-call.arguments.python string.regexp.quoted.single.python support.other.parenthesis.regexp punctuation.parenthesis.begin.regexp", "r": { "dark_plus": "string.regexp: #D16969", "light_plus": "string.regexp: #811F3F", @@ -5127,7 +5314,7 @@ }, { "c": "[", - "t": "source.python meta.function-call.python meta.function-call.arguments.python string.regexp.quoted.single.python meta.character.set.regexp constant.other.set.regexp punctuation.character.set.begin.regexp", + "t": "source.python meta.function-call.python meta.function-call.arguments.python string.regexp.quoted.single.python meta.character.set.regexp punctuation.character.set.begin.regexp constant.other.set.regexp", "r": { "dark_plus": "string.regexp: #D16969", "light_plus": "string.regexp: #811F3F", @@ -5149,7 +5336,7 @@ }, { "c": "]", - "t": "source.python meta.function-call.python meta.function-call.arguments.python string.regexp.quoted.single.python meta.character.set.regexp constant.other.set.regexp punctuation.character.set.end.regexp", + "t": "source.python meta.function-call.python meta.function-call.arguments.python string.regexp.quoted.single.python meta.character.set.regexp punctuation.character.set.end.regexp constant.other.set.regexp", "r": { "dark_plus": "string.regexp: #D16969", "light_plus": "string.regexp: #811F3F", @@ -5171,7 +5358,7 @@ }, { "c": ")", - "t": "source.python meta.function-call.python meta.function-call.arguments.python string.regexp.quoted.single.python punctuation.parenthesis.end.regexp support.other.parenthesis.regexp", + "t": "source.python meta.function-call.python meta.function-call.arguments.python string.regexp.quoted.single.python support.other.parenthesis.regexp punctuation.parenthesis.end.regexp", "r": { "dark_plus": "string.regexp: #D16969", "light_plus": "string.regexp: #811F3F", @@ -5215,7 +5402,7 @@ }, { "c": "(", - "t": "source.python meta.function-call.python meta.function-call.arguments.python string.regexp.quoted.single.python punctuation.parenthesis.begin.regexp support.other.parenthesis.regexp", + "t": "source.python meta.function-call.python meta.function-call.arguments.python string.regexp.quoted.single.python support.other.parenthesis.regexp punctuation.parenthesis.begin.regexp", "r": { "dark_plus": "string.regexp: #D16969", "light_plus": "string.regexp: #811F3F", @@ -5248,7 +5435,7 @@ }, { "c": ")", - "t": "source.python meta.function-call.python meta.function-call.arguments.python string.regexp.quoted.single.python punctuation.parenthesis.end.regexp support.other.parenthesis.regexp", + "t": "source.python meta.function-call.python meta.function-call.arguments.python string.regexp.quoted.single.python support.other.parenthesis.regexp punctuation.parenthesis.end.regexp", "r": { "dark_plus": "string.regexp: #D16969", "light_plus": "string.regexp: #811F3F", @@ -5336,7 +5523,7 @@ }, { "c": ":", - "t": "source.python", + "t": "source.python punctuation.separator.colon.python", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -5369,7 +5556,7 @@ }, { "c": ":", - "t": "source.python", + "t": "source.python punctuation.separator.colon.python", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -5622,7 +5809,7 @@ }, { "c": ":", - "t": "source.python", + "t": "source.python punctuation.separator.colon.python", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -5809,7 +5996,7 @@ }, { "c": ":", - "t": "source.python", + "t": "source.python punctuation.separator.colon.python", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -5952,7 +6139,7 @@ }, { "c": ":", - "t": "source.python", + "t": "source.python punctuation.separator.dict.python", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -5973,7 +6160,18 @@ } }, { - "c": ", ", + "c": ",", + "t": "source.python punctuation.separator.element.python", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF" + } + }, + { + "c": " ", "t": "source.python", "r": { "dark_plus": "default: #D4D4D4", @@ -6051,7 +6249,7 @@ }, { "c": ":", - "t": "source.python", + "t": "source.python punctuation.separator.dict.python", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -6227,7 +6425,7 @@ }, { "c": "[", - "t": "source.python string.regexp.quoted.multi.python meta.character.set.regexp constant.other.set.regexp punctuation.character.set.begin.regexp", + "t": "source.python string.regexp.quoted.multi.python meta.character.set.regexp punctuation.character.set.begin.regexp constant.other.set.regexp", "r": { "dark_plus": "string.regexp: #D16969", "light_plus": "string.regexp: #811F3F",