diff --git a/Makefile b/Makefile index 85c19a17..21b1edbf 100644 --- a/Makefile +++ b/Makefile @@ -15,6 +15,11 @@ ci-test: release ] ; \ then echo "Error: package.version != git.tag" && exit 1 ; fi +update-test: +# Run tests and overwrite the output + ./node_modules/.bin/syntaxdev test --tests test/**/*.py --syntax grammars/src/MagicPython.syntax.yaml --overwrite-tests + ./node_modules/.bin/syntaxdev test --tests test/**/*.re --syntax grammars/src/MagicRegExp.syntax.yaml --overwrite-tests + test: ci-test atom -t test/atom-spec diff --git a/README.md b/README.md index 41a48420..64d9eb43 100644 --- a/README.md +++ b/README.md @@ -6,8 +6,6 @@ with [Sublime Text](http://www.sublimetext.com), [Atom](http://atom.io) and [Visual Studio Code](http://code.visualstudio.com). It is meant to be a drop-in replacement for the default Python package. -We are proud to say that MagicPython is used by GitHub to highlight Python. - **Attention VSCode users**: MagicPython is used as the _default_ Python highlighter in Visual Studio Code. Don't install it unless you want or need the cutting edge version of it. You will likely see no diff --git a/grammars/MagicPython.cson b/grammars/MagicPython.cson index 8fe447f9..d837d6a3 100644 --- a/grammars/MagicPython.cson +++ b/grammars/MagicPython.cson @@ -17,9 +17,9 @@ fileTypes: [ "wsgi" "kv" "Snakefile" + "smk" "tac" ] -first_line_match: "^#![ \\t]*/.*\\bpython[\\d\\.]*\\b" firstLineMatch: "^#![ \\t]*/.*\\bpython[\\d\\.]*\\b" uuid: "742deb57-6e38-4192-bed6-410746efd85d" patterns: [ @@ -45,6 +45,9 @@ repository: { include: "#function-declaration" } + { + include: "#generator" + } { include: "#statement-keyword" } @@ -305,6 +308,18 @@ repository: name: "storage.type.class.python" match: "\\b(?= | <= | < | >) (?# 5) + | (:=) (?# 6) + ''' captures: "1": @@ -588,6 +645,8 @@ repository: name: "keyword.operator.arithmetic.python" "5": name: "keyword.operator.comparison.python" + "6": + name: "keyword.operator.assignment.python" punctuation: patterns: [ { @@ -675,8 +734,6 @@ repository: 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: ''' @@ -740,18 +797,6 @@ repository: { 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: [ @@ -1167,6 +1212,7 @@ repository: "1": name: "entity.other.inherited-class.python" "member-access-class": + name: "meta.member.access.python" begin: "(\\.)\\s*(?!\\.)" end: "(?<=\\S)(?=\\W)|$" beginCaptures: @@ -1213,6 +1259,10 @@ repository: name: "punctuation.section.function.lambda.begin.python" contentName: "meta.function.lambda.parameters.python" patterns: [ + { + name: "keyword.operator.positional.parameter.python" + match: "/" + } { name: "keyword.operator.unpacking.parameter.python" match: "(\\*\\*|\\*)" @@ -1279,6 +1329,25 @@ repository: include: "#expression" } ] + generator: + comment: ''' + Match "for ... in" construct used in generators and for loops to + correctly identify the "in" as a control flow keyword. + + ''' + 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: ''' @@ -1341,6 +1410,10 @@ repository: "1": name: "punctuation.definition.parameters.end.python" patterns: [ + { + name: "keyword.operator.positional.parameter.python" + match: "/" + } { name: "keyword.operator.unpacking.parameter.python" match: "(\\*\\*|\\*)" @@ -1485,6 +1558,7 @@ repository: include: "#special-names" } { + name: "meta.indexed-name.python" match: ''' (?x) \\b ([[:alpha:]_]\\w*) \\b @@ -1612,6 +1686,7 @@ repository: ] "function-call": name: "meta.function-call.python" + comment: "Regular function call of the type \"name(args)\"" begin: ''' (?x) \\b(?= @@ -1763,14 +1838,14 @@ repository: match: ''' (?x) (?) - - ''' - end: "(\\)|(?=\\'))|((?=(?) - - ''' - 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-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: "punctuation.parenthesis.lookahead.end.regexp keyword.operator.lookahead.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: "punctuation.parenthesis.lookahead.end.regexp keyword.operator.lookahead.negative.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: "punctuation.parenthesis.lookbehind.end.regexp keyword.operator.lookbehind.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: "(\\)|(?=\"))|((?=(?) - - ''' - 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-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: "punctuation.parenthesis.lookahead.end.regexp keyword.operator.lookahead.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: "punctuation.parenthesis.lookahead.end.regexp keyword.operator.lookahead.negative.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: "punctuation.parenthesis.lookbehind.end.regexp keyword.operator.lookbehind.regexp" - "2": - name: "invalid.illegal.newline.python" - patterns: [ - { - include: "#double-three-fregexp-expression" - } - { - include: "#comments-string-double-three" - } - ] - "double-three-fregexp-lookbehind-negative": - begin: "(\\()\\?=^]? [-+ ]? \\#? \\d* ,? (\\.\\d+)? [bcdeEfFgGnosxX%]? )(?=}) @@ -4678,7 +3868,7 @@ repository: } ] "fstring-terminator-single-tail": - begin: "(![rsa])?(:)(?=.*?{)" + begin: "((?:=?)(?:![rsa])?)(:)(?=.*?{)" end: "(?=})|(?=\\n)" beginCaptures: "1": @@ -4787,7 +3977,7 @@ repository: ] "fstring-raw-quoted-multi-line": name: "meta.fstring.python" - begin: "(\\b(?:[R][fF]|[fF][R]))('''|\"\"\")" + begin: "(\\b(?:[rR][fF]|[fF][rR]))('''|\"\"\")" end: "(\\2)" beginCaptures: "1": @@ -4881,12 +4071,16 @@ repository: patterns: [ { name: "storage.type.format.python" - match: "(![rsa])(?=})" + match: "(=(![rsa])?)(?=})" + } + { + name: "storage.type.format.python" + match: "(=?![rsa])(?=})" } { match: ''' (?x) - (![rsa])? + ( (?: =?) (?: ![rsa])? ) ( : \\w? [<>=^]? [-+ ]? \\#? \\d* ,? (\\.\\d+)? [bcdeEfFgGnosxX%]? )(?=}) @@ -4902,7 +4096,7 @@ repository: } ] "fstring-terminator-multi-tail": - begin: "(![rsa])?(:)(?=.*?{)" + begin: "((?:=?)(?:![rsa])?)(:)(?=.*?{)" end: "(?=})" beginCaptures: "1": diff --git a/grammars/MagicPython.tmLanguage b/grammars/MagicPython.tmLanguage index 4fa597d1..a1c3f8e7 100644 --- a/grammars/MagicPython.tmLanguage +++ b/grammars/MagicPython.tmLanguage @@ -1,7 +1,7 @@ - + name MagicPython @@ -24,10 +24,9 @@ wsgi kv Snakefile + smk tac - first_line_match - ^#![ \t]*/.*\bpython[\d\.]*\b firstLineMatch ^#![ \t]*/.*\bpython[\d\.]*\b uuid @@ -68,6 +67,10 @@ include #function-declaration + + include + #generator + include #statement-keyword @@ -468,6 +471,22 @@ it's probably control flow like: match \b(?<!\.)(class)\b + + match + (?x) + ^\s*( + case | match + )(?=\s*([-+\w\d(\[{'":#]|$))\b + + captures + + 1 + + name + keyword.control.flow.python + + + expression-bare @@ -500,6 +519,10 @@ it's probably control flow like: include #lambda + + include + #generator + include #illegal-operator @@ -520,6 +543,10 @@ it's probably control flow like: include #list + + include + #odd-function-call + include #round-braces @@ -614,6 +641,8 @@ it's probably control flow like: member-access + name + meta.member.access.python begin (\.)\s*(?!\.) end @@ -644,6 +673,10 @@ it's probably control flow like: include #member-access-base + + include + #member-access-attribute + member-access-base @@ -676,6 +709,17 @@ it's probably control flow like: + member-access-attribute + + comment + Highlight attribute access in otherwise non-specialized cases. + name + meta.attribute.python + match + (?x) + \b ([[:alpha:]_]\w*) \b + + special-names name @@ -761,6 +805,36 @@ it's probably control flow like: + odd-function-call + + comment + A bit obscured function call where there may have been an +arbitrary number of other operations to get the function. +E.g. "arr[idx](args)" + + begin + (?x) + (?<= \] | \) ) \s* + (?=\() + + end + (\)) + endCaptures + + 1 + + name + punctuation.definition.arguments.end.python + + + patterns + + + include + #function-arguments + + + round-braces begin @@ -875,6 +949,8 @@ it's probably control flow like: | (\*\* | \* | \+ | - | % | // | / | @) (?# 4) | (!= | == | >= | <= | < | >) (?# 5) + + | (:=) (?# 6) captures @@ -903,6 +979,11 @@ it's probably control flow like: name keyword.operator.comparison.python + 6 + + name + keyword.operator.assignment.python + punctuation @@ -1032,11 +1113,6 @@ it's probably control flow like: name invalid.illegal.dec.python - 3 - - name - invalid.illegal.dec.python - number-hex @@ -1137,22 +1213,6 @@ it's probably control flow like: 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 @@ -1796,6 +1856,8 @@ it's probably control flow like: member-access-class + name + meta.member.access.python begin (\.)\s*(?!\.) end @@ -1881,6 +1943,12 @@ it's probably control flow like: meta.function.lambda.parameters.python patterns + + name + keyword.operator.positional.parameter.python + match + / + name keyword.operator.unpacking.parameter.python @@ -1992,6 +2060,40 @@ it's probably control flow like: + generator + + comment + Match "for ... in" construct used in generators and for loops to +correctly identify the "in" as a control flow keyword. + + 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 @@ -2095,6 +2197,12 @@ it's probably control flow like: patterns + + name + keyword.operator.positional.parameter.python + match + / + name keyword.operator.unpacking.parameter.python @@ -2335,6 +2443,8 @@ it's probably control flow like: #special-names + name + meta.indexed-name.python match (?x) \b ([[:alpha:]_]\w*) \b @@ -2532,6 +2642,8 @@ it's probably control flow like: name meta.function-call.python + comment + Regular function call of the type "name(args)" begin (?x) \b(?= @@ -2756,14 +2868,14 @@ it's probably control flow like: match (?x) (?<!\.) \b( - __import__ | abs | all | any | ascii | bin | breakpoint | callable - | chr | compile | copyright | credits | delattr | dir | divmod - | enumerate | eval | exec | exit | filter | format | getattr - | globals | hasattr | hash | help | hex | id | input - | isinstance | issubclass | iter | len | license | locals | map - | max | memoryview | min | next | oct | open | ord | pow | print - | quit | range | reload | repr | reversed | round - | setattr | sorted | sum | vars | zip + __import__ | abs | aiter | all | any | anext | ascii | bin + | breakpoint | callable | chr | compile | copyright | credits + | delattr | dir | divmod | enumerate | eval | exec | exit + | filter | format | getattr | globals | hasattr | hash | help + | hex | id | input | isinstance | issubclass | iter | len + | license | locals | map | max | memoryview | min | next + | oct | open | ord | pow | print | quit | range | reload | repr + | reversed | round | setattr | sorted | sum | vars | zip )\b @@ -2808,24 +2920,29 @@ indirectly through syntactic constructs (?x) \b( __(?: - abs | add | aenter | aexit | aiter | and | anext | await - | bool | call | ceil | cmp | coerce | complex | contains - | copy | deepcopy | del | delattr | delete | delitem - | delslice | dir | div | divmod | enter | eq | exit | float - | floor | floordiv | format | ge | get | getattr - | getattribute | getinitargs | getitem | getnewargs - | getslice | getstate | gt | hash | hex | iadd | iand | idiv - | ifloordiv | ilshift | imod | imul | index | init - | instancecheck | int | invert | ior | ipow | irshift | isub - | iter | itruediv | ixor | le | len | long | lshift | lt - | missing | mod | mul | ne | neg | new | next | nonzero | oct | or - | pos | pow | radd | rand | rdiv | rdivmod | reduce - | reduce_ex | repr | reversed | rfloordiv | rlshift | rmod - | rmul | ror | round | rpow | rrshift | rshift | rsub - | rtruediv | rxor | set | setattr | setitem | setslice - | setstate | sizeof | str | sub | subclasscheck | truediv - | trunc | unicode | xor | matmul | rmatmul | imatmul - | init_subclass | set_name | fspath | bytes | prepare + abs | add | aenter | aexit | aiter | and | anext + | await | bool | call | ceil | class_getitem + | cmp | coerce | complex | contains | copy + | deepcopy | del | delattr | delete | delitem + | delslice | dir | div | divmod | enter | eq + | exit | float | floor | floordiv | format | ge + | get | getattr | getattribute | getinitargs + | getitem | getnewargs | getslice | getstate | gt + | hash | hex | iadd | iand | idiv | ifloordiv | + | ilshift | imod | imul | index | init + | instancecheck | int | invert | ior | ipow + | irshift | isub | iter | itruediv | ixor | le + | len | long | lshift | lt | missing | mod | mul + | ne | neg | new | next | nonzero | oct | or | pos + | pow | radd | rand | rdiv | rdivmod | reduce + | reduce_ex | repr | reversed | rfloordiv | + | rlshift | rmod | rmul | ror | round | rpow + | rrshift | rshift | rsub | rtruediv | rxor | set + | setattr | setitem | set_name | setslice + | setstate | sizeof | str | sub | subclasscheck + | truediv | trunc | unicode | xor | matmul + | rmatmul | imatmul | init_subclass | set_name + | fspath | bytes | prepare | length_hint )__ )\b @@ -2846,12 +2963,12 @@ indirectly through syntactic constructs (?x) \b( __(?: - all | bases | builtins | class | class_getitem | code | debug - | defaults | dict | doc | file | func | kwdefaults | members - | metaclass | methods | module | mro | mro_entries | name - | qualname | post_init | self | signature | slots | subclasses - | version | weakref | wrapped | annotations | classcell - | spec | path | package | future | traceback + all | annotations | bases | builtins | class + | closure | code | debug | defaults | dict | doc | file | func + | globals | kwdefaults | match_args | members | metaclass | methods + | module | mro | mro_entries | name | qualname | post_init | self + | signature | slots | subclasses | version | weakref | wrapped + | classcell | spec | path | package | future | traceback )__ )\b @@ -5534,85 +5651,80 @@ indirectly through syntactic constructs - single-one-fregexp-expression + string-raw-quoted-single-line - 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 - + name + string.quoted.raw.single.python + begin + \b(([uU]R)|(R))((['"])) + end + (\4)|((?<!\\)\n) + beginCaptures + + 2 - include - #regexp-backreference + name + invalid.deprecated.prefix.python + 3 - include - #single-one-fregexp-lookahead + name + storage.type.string.python + 4 - include - #single-one-fregexp-lookahead-negative + name + punctuation.definition.string.begin.python + + endCaptures + + 1 - include - #single-one-fregexp-lookbehind + name + punctuation.definition.string.end.python + 2 - include - #single-one-fregexp-lookbehind-negative + name + invalid.illegal.newline.python + + patterns + include - #single-one-fregexp-conditional + #string-single-bad-brace1-formatting-raw include - #single-one-fregexp-parentheses-non-capturing + #string-single-bad-brace2-formatting-raw include - #single-one-fregexp-parentheses + #string-raw-guts - single-one-fregexp-named-group + string-bin-quoted-single-line name - meta.named.regexp + string.quoted.binary.single.python begin - (?x) - (\() (\?P <\w+(?:\s+[[:alnum:]]+)?>) - + (\b[bB])((['"])) end - (\)|(?=\'))|((?=(?<!\\)\n)) + (\2)|((?<!\\)\n) beginCaptures 1 name - support.other.parenthesis.regexp punctuation.parenthesis.named.begin.regexp + storage.type.string.python 2 name - entity.name.tag.named.group.regexp + punctuation.definition.string.begin.python endCaptures @@ -5620,7 +5732,7 @@ indirectly through syntactic constructs 1 name - support.other.parenthesis.regexp punctuation.parenthesis.named.end.regexp + punctuation.definition.string.end.python 2 @@ -5632,27 +5744,29 @@ indirectly through syntactic constructs include - #single-one-fregexp-expression + #string-entity - single-one-fregexp-lookahead + string-raw-bin-quoted-single-line + name + string.quoted.raw.binary.single.python begin - (\()\?= + (\b(?:R[bB]|[bB]R))((['"])) end - (\)|(?=\'))|((?=(?<!\\)\n)) + (\2)|((?<!\\)\n) beginCaptures - 0 + 1 name - keyword.operator.lookahead.regexp + storage.type.string.python - 1 + 2 name - punctuation.parenthesis.lookahead.begin.regexp + punctuation.definition.string.begin.python endCaptures @@ -5660,7 +5774,7 @@ indirectly through syntactic constructs 1 name - keyword.operator.lookahead.regexp punctuation.parenthesis.lookahead.end.regexp + punctuation.definition.string.end.python 2 @@ -5672,27 +5786,34 @@ indirectly through syntactic constructs include - #single-one-fregexp-expression + #string-raw-bin-guts - single-one-fregexp-lookahead-negative + string-quoted-single-line + name + string.quoted.single.python begin - (\()\?! + (?:\b([rR])(?=[uU]))?([uU])?((['"])) end - (\)|(?=\'))|((?=(?<!\\)\n)) + (\3)|((?<!\\)\n) beginCaptures - 0 + 1 name - keyword.operator.lookahead.negative.regexp + invalid.illegal.prefix.python - 1 + 2 name - punctuation.parenthesis.lookahead.begin.regexp + storage.type.string.python + + 3 + + name + punctuation.definition.string.begin.python endCaptures @@ -5700,7 +5821,7 @@ indirectly through syntactic constructs 1 name - keyword.operator.lookahead.negative.regexp punctuation.parenthesis.lookahead.end.regexp + punctuation.definition.string.end.python 2 @@ -5712,1801 +5833,29 @@ indirectly through syntactic constructs include - #single-one-fregexp-expression + #string-single-bad-brace1-formatting-unicode + + + include + #string-single-bad-brace2-formatting-unicode + + + include + #string-unicode-guts - single-one-fregexp-lookbehind + string-single-bad-brace1-formatting-unicode + comment + template using {% ... %} 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) - (\() (\?P <\w+(?:\s+[[:alnum:]]+)?>) - - 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) - (\() (\?P <\w+(?:\s+[[:alnum:]]+)?>) - - 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) - (\() (\?P <\w+(?:\s+[[:alnum:]]+)?>) - - 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)) ) - %\} - ) - + (?x) + (?= \{% + ( .*? (?!(['"])|((?<!\\)\n)) ) + %\} + ) + end (?=(['"])|((?<!\\)\n)) patterns @@ -8025,7 +6374,7 @@ indirectly through syntactic constructs name meta.fstring.python begin - (\b(?:[R][fF]|[fF][R]))((['"])) + (\b(?:[rR][fF]|[fF][rR]))((['"])) end (\2)|((?<!\\)\n) beginCaptures @@ -8166,12 +6515,18 @@ indirectly through syntactic constructs name storage.type.format.python match - (![rsa])(?=}) + (=(![rsa])?)(?=}) + + + name + storage.type.format.python + match + (=?![rsa])(?=}) match (?x) - (![rsa])? + ( (?: =?) (?: ![rsa])? ) ( : \w? [<>=^]? [-+ ]? \#? \d* ,? (\.\d+)? [bcdeEfFgGnosxX%]? )(?=}) @@ -8198,7 +6553,7 @@ indirectly through syntactic constructs fstring-terminator-single-tail begin - (![rsa])?(:)(?=.*?{) + ((?:=?)(?:![rsa])?)(:)(?=.*?{) end (?=})|(?=\n) beginCaptures @@ -8397,7 +6752,7 @@ indirectly through syntactic constructs name meta.fstring.python begin - (\b(?:[R][fF]|[fF][R]))('''|""") + (\b(?:[rR][fF]|[fF][rR]))('''|""") end (\2) beginCaptures @@ -8538,12 +6893,18 @@ indirectly through syntactic constructs name storage.type.format.python match - (![rsa])(?=}) + (=(![rsa])?)(?=}) + + + name + storage.type.format.python + match + (=?![rsa])(?=}) match (?x) - (![rsa])? + ( (?: =?) (?: ![rsa])? ) ( : \w? [<>=^]? [-+ ]? \#? \d* ,? (\.\d+)? [bcdeEfFgGnosxX%]? )(?=}) @@ -8570,7 +6931,7 @@ indirectly through syntactic constructs fstring-terminator-multi-tail begin - (![rsa])?(:)(?=.*?{) + ((?:=?)(?:![rsa])?)(:)(?=.*?{) end (?=}) beginCaptures diff --git a/grammars/MagicRegExp.tmLanguage b/grammars/MagicRegExp.tmLanguage index 3d19e058..3ddacc70 100644 --- a/grammars/MagicRegExp.tmLanguage +++ b/grammars/MagicRegExp.tmLanguage @@ -1,7 +1,7 @@ - + name MagicRegExp diff --git a/grammars/src/MagicPython.syntax.yaml b/grammars/src/MagicPython.syntax.yaml index baf73a1c..ebfccdaf 100644 --- a/grammars/src/MagicPython.syntax.yaml +++ b/grammars/src/MagicPython.syntax.yaml @@ -4,8 +4,7 @@ scopeName: source.python # NOTE: remember to update package.json with VSCode file types. fileTypes: [py, py3, rpy, pyw, cpy, pyi, SConstruct, Sconstruct, sconstruct, SConscript, - gyp, gypi, wsgi, kv, Snakefile, tac] -first_line_match: ^#![ \t]*/.*\bpython[\d\.]*\b + gyp, gypi, wsgi, kv, Snakefile, smk, tac] firstLineMatch: ^#![ \t]*/.*\bpython[\d\.]*\b uuid: 742deb57-6e38-4192-bed6-410746efd85d @@ -104,82 +103,6 @@ repository: bquote: '(""")' equote: '(""")' - - file: 'regexp.inc.syntax.yaml' - vars: - prefix: 'single-one-' - basename: 'fregexp' - marker: "|(?=\\')" - nested: '' - guard: "|((?=(?= | <= | < | >) (?# 5) + | (:=) (?# 6) + 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} + '6': {name: keyword.operator.assignment.python} punctuation: patterns: @@ -623,7 +583,6 @@ repository: 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 @@ -672,10 +631,6 @@ repository: - 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: @@ -947,6 +902,7 @@ repository: '1': {name: entity.other.inherited-class.python} member-access-class: + name: meta.member.access.python begin: (\.)\s*(?!\.) end: (?<=\S)(?=\W)|$ beginCaptures: @@ -976,6 +932,8 @@ repository: contentName: meta.function.lambda.parameters.python patterns: + - name: keyword.operator.positional.parameter.python + match: / - name: keyword.operator.unpacking.parameter.python match: (\*\*|\*) - include: '#lambda-nested-incomplete' @@ -1014,6 +972,19 @@ repository: patterns: - include: '#expression' + generator: + comment: | + Match "for ... in" construct used in generators and for loops to + correctly identify the "in" as a control flow keyword. + 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: | @@ -1057,6 +1028,8 @@ repository: '1': {name: punctuation.definition.parameters.end.python} patterns: + - name: keyword.operator.positional.parameter.python + match: / - name: keyword.operator.unpacking.parameter.python match: (\*\*|\*) - include: '#lambda-incomplete' @@ -1140,7 +1113,8 @@ repository: - include: '#special-variables' - include: '#builtin-functions' - include: '#special-names' - - match: | + - name: meta.indexed-name.python + match: | (?x) \b ([[:alpha:]_]\w*) \b @@ -1219,6 +1193,7 @@ repository: function-call: name: meta.function-call.python + comment: Regular function call of the type "name(args)" begin: | (?x) \b(?= @@ -1316,14 +1291,14 @@ repository: match: | (?x) (?=^]? [-+ ]? \#? \d* ,? (\.\d+)? [bcdeEfFgGnosxX%]? )(?=}) captures: @@ -148,7 +150,7 @@ fstring-terminator-${line}: - include: '#fstring-terminator-${line}-tail' fstring-terminator-${line}-tail: - begin: (![rsa])?(:)(?=.*?{) + begin: ((?:=?)(?:![rsa])?)(:)(?=.*?{) end: (?=})${fguard} beginCaptures: '1': {name: storage.type.format.python} diff --git a/misc/example.py b/misc/example.py index 6b820e63..718f3074 100644 --- a/misc/example.py +++ b/misc/example.py @@ -1,7 +1,7 @@ import asyncio -def showcase(): +def showcase(a, b, /, c, d, *, e, f): """Some code to showcase the syntax. Docstrings are recognized and have an additional scope. @@ -21,7 +21,9 @@ async def coroutine(db:aio_db.DatabaseConnection) -> List[str]: async with db.transaction(): result = await db.query(...) - print(f'Result: {result!r}') + print(f'Result: {result!r} {a=} {b=!r}') + print(Rf'data: {c=}') + print(rf'data: {c=}') mapping = None # type: Dict[int, Any] # PEP 484 @@ -41,8 +43,14 @@ async def coroutine(db:aio_db.DatabaseConnection) -> List[str]: # NOTE Numbers with leading zeros are invalid in Python 3, # use 0o... answer = func(0xdeadbeef + 0b00100001 + 0123 + 0o123 + - 1_005_123 + # PEP 515 + 1_005_123 + # PEP 515 # complex numbers .10e12 + 2j) @ mat + # walrus operator + filtered_data = [y for x in data if (y := f(x)) is not None] + + # position-only params + bar = lambda q, w, /, e, r: (q + w + e + r) + return R'''No escapes '\' in this \one''' diff --git a/misc/scopes b/misc/scopes index a49a024d..8eec651e 100644 --- a/misc/scopes +++ b/misc/scopes @@ -56,10 +56,12 @@ keyword.operator.lookahead.regexp keyword.operator.lookbehind.negative.regexp keyword.operator.lookbehind.regexp keyword.operator.negation.regexp +keyword.operator.positional.parameter.python keyword.operator.python keyword.operator.quantifier.regexp keyword.operator.unpacking.arguments.python keyword.operator.unpacking.parameter.python +meta.attribute.python meta.backreference.named.regexp meta.backreference.regexp meta.character.set.regexp @@ -73,8 +75,10 @@ meta.function-call.python meta.function.decorator.python meta.function.parameters.python meta.function.python +meta.indexed-name.python meta.item-access.python meta.lambda-function.python +meta.member.access.python meta.named.regexp meta.typehint.comment.python punctuation.character.set.begin.regexp diff --git a/package.json b/package.json index 92b1a2ec..a974bd74 100644 --- a/package.json +++ b/package.json @@ -55,7 +55,11 @@ ".SConscript", ".gyp", ".gypi", - ".wsgi" + ".wsgi", + ".kv", + "Snakefile", + ".smk", + ".tac" ] } ], @@ -69,7 +73,7 @@ }, "devDependencies": { "oniguruma": "^7.0.0", - "syntaxdev": "^0.1.0" + "syntaxdev": "^0.1.3" }, "dependencies": {} } diff --git a/test/atom-spec/python-spec.js b/test/atom-spec/python-spec.js index 37e92940..79edf0a0 100644 --- a/test/atom-spec/python-spec.js +++ b/test/atom-spec/python-spec.js @@ -134,7 +134,7 @@ describe("Grammar Tests", function() { it("test/builtins/builtins3.py", function() { - tokens = grammar.tokenizeLines("__all__ = ['bar', 'baz']\nsome.__bases__\nsome.__class__\nassert __debug__\n__builtins__\n__builtins__.len\nprint(__builtins__)\nsome.__dict__\nsome.__doc__\nsome.__file__\nsome.__members__\nsome.__metaclass__\nsome.__methods__\nsome.__module__\nsome.__mro__\nsome.__name__\nsome.__slots__\nsome.__subclasses__\nsome.__version__\nsome.__weakref__\nsome.__qualname__\nsome.__code__\nsome.__wrapped__\nsome.__signature__\nsome.__defaults__\nsome.__func__\nsome.__self__\nsome.__kwdefaults__\nsome.__matmul__\nsome.__imatmul__\nsome.__rmatmul__\nsome.__annotations__\nsome.__init_subclass__\nsome.__set_name__\nsome.__fspath__\nsome.__classcell__\nsome.__bytes__\nsome.__spec__\nsome.__path__\nsome.__prepare__\nsome.__package__\nsome.__traceback__\nsome.__notspecial__") + tokens = grammar.tokenizeLines("__all__ = ['bar', 'baz']\nsome.__bases__\nsome.__class__\nassert __debug__\n__builtins__\n__builtins__.len\nprint(__builtins__)\nsome.__dict__\nsome.__doc__\nsome.__file__\nsome.__members__\nsome.__metaclass__\nsome.__methods__\nsome.__module__\nsome.__mro__\nsome.__name__\nsome.__slots__\nsome.__subclasses__\nsome.__version__\nsome.__weakref__\nsome.__qualname__\nsome.__code__\nsome.__wrapped__\nsome.__signature__\nsome.__defaults__\nsome.__func__\nsome.__self__\nsome.__kwdefaults__\nsome.__matmul__\nsome.__imatmul__\nsome.__rmatmul__\nsome.__annotations__\nsome.__init_subclass__\nsome.__set_name__\nsome.__fspath__\nsome.__classcell__\nsome.__bytes__\nsome.__spec__\nsome.__path__\nsome.__prepare__\nsome.__package__\nsome.__traceback__\nsome.__closure__\nsome.__globals__\nsome.__match_args__\nsome.__notspecial__") expect(tokens[0][0].value).toBe("__all__"); expect(tokens[0][0].scopes).toEqual(["source.python","support.variable.magic.python"]); expect(tokens[0][1].value).toBe(" "); @@ -166,15 +166,15 @@ describe("Grammar Tests", function() { expect(tokens[1][0].value).toBe("some"); expect(tokens[1][0].scopes).toEqual(["source.python"]); expect(tokens[1][1].value).toBe("."); - expect(tokens[1][1].scopes).toEqual(["source.python","punctuation.separator.period.python"]); + expect(tokens[1][1].scopes).toEqual(["source.python","meta.member.access.python","punctuation.separator.period.python"]); expect(tokens[1][2].value).toBe("__bases__"); - expect(tokens[1][2].scopes).toEqual(["source.python","support.variable.magic.python"]); + expect(tokens[1][2].scopes).toEqual(["source.python","meta.member.access.python","support.variable.magic.python"]); expect(tokens[2][0].value).toBe("some"); expect(tokens[2][0].scopes).toEqual(["source.python"]); expect(tokens[2][1].value).toBe("."); - expect(tokens[2][1].scopes).toEqual(["source.python","punctuation.separator.period.python"]); + expect(tokens[2][1].scopes).toEqual(["source.python","meta.member.access.python","punctuation.separator.period.python"]); expect(tokens[2][2].value).toBe("__class__"); - expect(tokens[2][2].scopes).toEqual(["source.python","support.variable.magic.python"]); + expect(tokens[2][2].scopes).toEqual(["source.python","meta.member.access.python","support.variable.magic.python"]); expect(tokens[3][0].value).toBe("assert"); expect(tokens[3][0].scopes).toEqual(["source.python","keyword.control.flow.python"]); expect(tokens[3][1].value).toBe(" "); @@ -186,9 +186,9 @@ describe("Grammar Tests", function() { expect(tokens[5][0].value).toBe("__builtins__"); expect(tokens[5][0].scopes).toEqual(["source.python","support.variable.magic.python"]); expect(tokens[5][1].value).toBe("."); - expect(tokens[5][1].scopes).toEqual(["source.python","punctuation.separator.period.python"]); + expect(tokens[5][1].scopes).toEqual(["source.python","meta.member.access.python","punctuation.separator.period.python"]); expect(tokens[5][2].value).toBe("len"); - expect(tokens[5][2].scopes).toEqual(["source.python"]); + expect(tokens[5][2].scopes).toEqual(["source.python","meta.member.access.python","meta.attribute.python"]); expect(tokens[6][0].value).toBe("print"); expect(tokens[6][0].scopes).toEqual(["source.python","meta.function-call.python","support.function.builtin.python"]); expect(tokens[6][1].value).toBe("("); @@ -200,219 +200,237 @@ describe("Grammar Tests", function() { expect(tokens[7][0].value).toBe("some"); expect(tokens[7][0].scopes).toEqual(["source.python"]); expect(tokens[7][1].value).toBe("."); - expect(tokens[7][1].scopes).toEqual(["source.python","punctuation.separator.period.python"]); + expect(tokens[7][1].scopes).toEqual(["source.python","meta.member.access.python","punctuation.separator.period.python"]); expect(tokens[7][2].value).toBe("__dict__"); - expect(tokens[7][2].scopes).toEqual(["source.python","support.variable.magic.python"]); + expect(tokens[7][2].scopes).toEqual(["source.python","meta.member.access.python","support.variable.magic.python"]); expect(tokens[8][0].value).toBe("some"); expect(tokens[8][0].scopes).toEqual(["source.python"]); expect(tokens[8][1].value).toBe("."); - expect(tokens[8][1].scopes).toEqual(["source.python","punctuation.separator.period.python"]); + expect(tokens[8][1].scopes).toEqual(["source.python","meta.member.access.python","punctuation.separator.period.python"]); expect(tokens[8][2].value).toBe("__doc__"); - expect(tokens[8][2].scopes).toEqual(["source.python","support.variable.magic.python"]); + expect(tokens[8][2].scopes).toEqual(["source.python","meta.member.access.python","support.variable.magic.python"]); expect(tokens[9][0].value).toBe("some"); expect(tokens[9][0].scopes).toEqual(["source.python"]); expect(tokens[9][1].value).toBe("."); - expect(tokens[9][1].scopes).toEqual(["source.python","punctuation.separator.period.python"]); + expect(tokens[9][1].scopes).toEqual(["source.python","meta.member.access.python","punctuation.separator.period.python"]); expect(tokens[9][2].value).toBe("__file__"); - expect(tokens[9][2].scopes).toEqual(["source.python","support.variable.magic.python"]); + expect(tokens[9][2].scopes).toEqual(["source.python","meta.member.access.python","support.variable.magic.python"]); expect(tokens[10][0].value).toBe("some"); expect(tokens[10][0].scopes).toEqual(["source.python"]); expect(tokens[10][1].value).toBe("."); - expect(tokens[10][1].scopes).toEqual(["source.python","punctuation.separator.period.python"]); + expect(tokens[10][1].scopes).toEqual(["source.python","meta.member.access.python","punctuation.separator.period.python"]); expect(tokens[10][2].value).toBe("__members__"); - expect(tokens[10][2].scopes).toEqual(["source.python","support.variable.magic.python"]); + expect(tokens[10][2].scopes).toEqual(["source.python","meta.member.access.python","support.variable.magic.python"]); expect(tokens[11][0].value).toBe("some"); expect(tokens[11][0].scopes).toEqual(["source.python"]); expect(tokens[11][1].value).toBe("."); - expect(tokens[11][1].scopes).toEqual(["source.python","punctuation.separator.period.python"]); + expect(tokens[11][1].scopes).toEqual(["source.python","meta.member.access.python","punctuation.separator.period.python"]); expect(tokens[11][2].value).toBe("__metaclass__"); - expect(tokens[11][2].scopes).toEqual(["source.python","support.variable.magic.python"]); + expect(tokens[11][2].scopes).toEqual(["source.python","meta.member.access.python","support.variable.magic.python"]); expect(tokens[12][0].value).toBe("some"); expect(tokens[12][0].scopes).toEqual(["source.python"]); expect(tokens[12][1].value).toBe("."); - expect(tokens[12][1].scopes).toEqual(["source.python","punctuation.separator.period.python"]); + expect(tokens[12][1].scopes).toEqual(["source.python","meta.member.access.python","punctuation.separator.period.python"]); expect(tokens[12][2].value).toBe("__methods__"); - expect(tokens[12][2].scopes).toEqual(["source.python","support.variable.magic.python"]); + expect(tokens[12][2].scopes).toEqual(["source.python","meta.member.access.python","support.variable.magic.python"]); expect(tokens[13][0].value).toBe("some"); expect(tokens[13][0].scopes).toEqual(["source.python"]); expect(tokens[13][1].value).toBe("."); - expect(tokens[13][1].scopes).toEqual(["source.python","punctuation.separator.period.python"]); + expect(tokens[13][1].scopes).toEqual(["source.python","meta.member.access.python","punctuation.separator.period.python"]); expect(tokens[13][2].value).toBe("__module__"); - expect(tokens[13][2].scopes).toEqual(["source.python","support.variable.magic.python"]); + expect(tokens[13][2].scopes).toEqual(["source.python","meta.member.access.python","support.variable.magic.python"]); expect(tokens[14][0].value).toBe("some"); expect(tokens[14][0].scopes).toEqual(["source.python"]); expect(tokens[14][1].value).toBe("."); - expect(tokens[14][1].scopes).toEqual(["source.python","punctuation.separator.period.python"]); + expect(tokens[14][1].scopes).toEqual(["source.python","meta.member.access.python","punctuation.separator.period.python"]); expect(tokens[14][2].value).toBe("__mro__"); - expect(tokens[14][2].scopes).toEqual(["source.python","support.variable.magic.python"]); + expect(tokens[14][2].scopes).toEqual(["source.python","meta.member.access.python","support.variable.magic.python"]); expect(tokens[15][0].value).toBe("some"); expect(tokens[15][0].scopes).toEqual(["source.python"]); expect(tokens[15][1].value).toBe("."); - expect(tokens[15][1].scopes).toEqual(["source.python","punctuation.separator.period.python"]); + expect(tokens[15][1].scopes).toEqual(["source.python","meta.member.access.python","punctuation.separator.period.python"]); expect(tokens[15][2].value).toBe("__name__"); - expect(tokens[15][2].scopes).toEqual(["source.python","support.variable.magic.python"]); + expect(tokens[15][2].scopes).toEqual(["source.python","meta.member.access.python","support.variable.magic.python"]); expect(tokens[16][0].value).toBe("some"); expect(tokens[16][0].scopes).toEqual(["source.python"]); expect(tokens[16][1].value).toBe("."); - expect(tokens[16][1].scopes).toEqual(["source.python","punctuation.separator.period.python"]); + expect(tokens[16][1].scopes).toEqual(["source.python","meta.member.access.python","punctuation.separator.period.python"]); expect(tokens[16][2].value).toBe("__slots__"); - expect(tokens[16][2].scopes).toEqual(["source.python","support.variable.magic.python"]); + expect(tokens[16][2].scopes).toEqual(["source.python","meta.member.access.python","support.variable.magic.python"]); expect(tokens[17][0].value).toBe("some"); expect(tokens[17][0].scopes).toEqual(["source.python"]); expect(tokens[17][1].value).toBe("."); - expect(tokens[17][1].scopes).toEqual(["source.python","punctuation.separator.period.python"]); + expect(tokens[17][1].scopes).toEqual(["source.python","meta.member.access.python","punctuation.separator.period.python"]); expect(tokens[17][2].value).toBe("__subclasses__"); - expect(tokens[17][2].scopes).toEqual(["source.python","support.variable.magic.python"]); + expect(tokens[17][2].scopes).toEqual(["source.python","meta.member.access.python","support.variable.magic.python"]); expect(tokens[18][0].value).toBe("some"); expect(tokens[18][0].scopes).toEqual(["source.python"]); expect(tokens[18][1].value).toBe("."); - expect(tokens[18][1].scopes).toEqual(["source.python","punctuation.separator.period.python"]); + expect(tokens[18][1].scopes).toEqual(["source.python","meta.member.access.python","punctuation.separator.period.python"]); expect(tokens[18][2].value).toBe("__version__"); - expect(tokens[18][2].scopes).toEqual(["source.python","support.variable.magic.python"]); + expect(tokens[18][2].scopes).toEqual(["source.python","meta.member.access.python","support.variable.magic.python"]); expect(tokens[19][0].value).toBe("some"); expect(tokens[19][0].scopes).toEqual(["source.python"]); expect(tokens[19][1].value).toBe("."); - expect(tokens[19][1].scopes).toEqual(["source.python","punctuation.separator.period.python"]); + expect(tokens[19][1].scopes).toEqual(["source.python","meta.member.access.python","punctuation.separator.period.python"]); expect(tokens[19][2].value).toBe("__weakref__"); - expect(tokens[19][2].scopes).toEqual(["source.python","support.variable.magic.python"]); + expect(tokens[19][2].scopes).toEqual(["source.python","meta.member.access.python","support.variable.magic.python"]); expect(tokens[20][0].value).toBe("some"); expect(tokens[20][0].scopes).toEqual(["source.python"]); expect(tokens[20][1].value).toBe("."); - expect(tokens[20][1].scopes).toEqual(["source.python","punctuation.separator.period.python"]); + expect(tokens[20][1].scopes).toEqual(["source.python","meta.member.access.python","punctuation.separator.period.python"]); expect(tokens[20][2].value).toBe("__qualname__"); - expect(tokens[20][2].scopes).toEqual(["source.python","support.variable.magic.python"]); + expect(tokens[20][2].scopes).toEqual(["source.python","meta.member.access.python","support.variable.magic.python"]); expect(tokens[21][0].value).toBe("some"); expect(tokens[21][0].scopes).toEqual(["source.python"]); expect(tokens[21][1].value).toBe("."); - expect(tokens[21][1].scopes).toEqual(["source.python","punctuation.separator.period.python"]); + expect(tokens[21][1].scopes).toEqual(["source.python","meta.member.access.python","punctuation.separator.period.python"]); expect(tokens[21][2].value).toBe("__code__"); - expect(tokens[21][2].scopes).toEqual(["source.python","support.variable.magic.python"]); + expect(tokens[21][2].scopes).toEqual(["source.python","meta.member.access.python","support.variable.magic.python"]); expect(tokens[22][0].value).toBe("some"); expect(tokens[22][0].scopes).toEqual(["source.python"]); expect(tokens[22][1].value).toBe("."); - expect(tokens[22][1].scopes).toEqual(["source.python","punctuation.separator.period.python"]); + expect(tokens[22][1].scopes).toEqual(["source.python","meta.member.access.python","punctuation.separator.period.python"]); expect(tokens[22][2].value).toBe("__wrapped__"); - expect(tokens[22][2].scopes).toEqual(["source.python","support.variable.magic.python"]); + expect(tokens[22][2].scopes).toEqual(["source.python","meta.member.access.python","support.variable.magic.python"]); expect(tokens[23][0].value).toBe("some"); expect(tokens[23][0].scopes).toEqual(["source.python"]); expect(tokens[23][1].value).toBe("."); - expect(tokens[23][1].scopes).toEqual(["source.python","punctuation.separator.period.python"]); + expect(tokens[23][1].scopes).toEqual(["source.python","meta.member.access.python","punctuation.separator.period.python"]); expect(tokens[23][2].value).toBe("__signature__"); - expect(tokens[23][2].scopes).toEqual(["source.python","support.variable.magic.python"]); + expect(tokens[23][2].scopes).toEqual(["source.python","meta.member.access.python","support.variable.magic.python"]); expect(tokens[24][0].value).toBe("some"); expect(tokens[24][0].scopes).toEqual(["source.python"]); expect(tokens[24][1].value).toBe("."); - expect(tokens[24][1].scopes).toEqual(["source.python","punctuation.separator.period.python"]); + expect(tokens[24][1].scopes).toEqual(["source.python","meta.member.access.python","punctuation.separator.period.python"]); expect(tokens[24][2].value).toBe("__defaults__"); - expect(tokens[24][2].scopes).toEqual(["source.python","support.variable.magic.python"]); + expect(tokens[24][2].scopes).toEqual(["source.python","meta.member.access.python","support.variable.magic.python"]); expect(tokens[25][0].value).toBe("some"); expect(tokens[25][0].scopes).toEqual(["source.python"]); expect(tokens[25][1].value).toBe("."); - expect(tokens[25][1].scopes).toEqual(["source.python","punctuation.separator.period.python"]); + expect(tokens[25][1].scopes).toEqual(["source.python","meta.member.access.python","punctuation.separator.period.python"]); expect(tokens[25][2].value).toBe("__func__"); - expect(tokens[25][2].scopes).toEqual(["source.python","support.variable.magic.python"]); + expect(tokens[25][2].scopes).toEqual(["source.python","meta.member.access.python","support.variable.magic.python"]); expect(tokens[26][0].value).toBe("some"); expect(tokens[26][0].scopes).toEqual(["source.python"]); expect(tokens[26][1].value).toBe("."); - expect(tokens[26][1].scopes).toEqual(["source.python","punctuation.separator.period.python"]); + expect(tokens[26][1].scopes).toEqual(["source.python","meta.member.access.python","punctuation.separator.period.python"]); expect(tokens[26][2].value).toBe("__self__"); - expect(tokens[26][2].scopes).toEqual(["source.python","support.variable.magic.python"]); + expect(tokens[26][2].scopes).toEqual(["source.python","meta.member.access.python","support.variable.magic.python"]); expect(tokens[27][0].value).toBe("some"); expect(tokens[27][0].scopes).toEqual(["source.python"]); expect(tokens[27][1].value).toBe("."); - expect(tokens[27][1].scopes).toEqual(["source.python","punctuation.separator.period.python"]); + expect(tokens[27][1].scopes).toEqual(["source.python","meta.member.access.python","punctuation.separator.period.python"]); expect(tokens[27][2].value).toBe("__kwdefaults__"); - expect(tokens[27][2].scopes).toEqual(["source.python","support.variable.magic.python"]); + expect(tokens[27][2].scopes).toEqual(["source.python","meta.member.access.python","support.variable.magic.python"]); expect(tokens[28][0].value).toBe("some"); expect(tokens[28][0].scopes).toEqual(["source.python"]); expect(tokens[28][1].value).toBe("."); - expect(tokens[28][1].scopes).toEqual(["source.python","punctuation.separator.period.python"]); + expect(tokens[28][1].scopes).toEqual(["source.python","meta.member.access.python","punctuation.separator.period.python"]); expect(tokens[28][2].value).toBe("__matmul__"); - expect(tokens[28][2].scopes).toEqual(["source.python","support.function.magic.python"]); + expect(tokens[28][2].scopes).toEqual(["source.python","meta.member.access.python","support.function.magic.python"]); expect(tokens[29][0].value).toBe("some"); expect(tokens[29][0].scopes).toEqual(["source.python"]); expect(tokens[29][1].value).toBe("."); - expect(tokens[29][1].scopes).toEqual(["source.python","punctuation.separator.period.python"]); + expect(tokens[29][1].scopes).toEqual(["source.python","meta.member.access.python","punctuation.separator.period.python"]); expect(tokens[29][2].value).toBe("__imatmul__"); - expect(tokens[29][2].scopes).toEqual(["source.python","support.function.magic.python"]); + expect(tokens[29][2].scopes).toEqual(["source.python","meta.member.access.python","support.function.magic.python"]); expect(tokens[30][0].value).toBe("some"); expect(tokens[30][0].scopes).toEqual(["source.python"]); expect(tokens[30][1].value).toBe("."); - expect(tokens[30][1].scopes).toEqual(["source.python","punctuation.separator.period.python"]); + expect(tokens[30][1].scopes).toEqual(["source.python","meta.member.access.python","punctuation.separator.period.python"]); expect(tokens[30][2].value).toBe("__rmatmul__"); - expect(tokens[30][2].scopes).toEqual(["source.python","support.function.magic.python"]); + expect(tokens[30][2].scopes).toEqual(["source.python","meta.member.access.python","support.function.magic.python"]); expect(tokens[31][0].value).toBe("some"); expect(tokens[31][0].scopes).toEqual(["source.python"]); expect(tokens[31][1].value).toBe("."); - expect(tokens[31][1].scopes).toEqual(["source.python","punctuation.separator.period.python"]); + expect(tokens[31][1].scopes).toEqual(["source.python","meta.member.access.python","punctuation.separator.period.python"]); expect(tokens[31][2].value).toBe("__annotations__"); - expect(tokens[31][2].scopes).toEqual(["source.python","support.variable.magic.python"]); + expect(tokens[31][2].scopes).toEqual(["source.python","meta.member.access.python","support.variable.magic.python"]); expect(tokens[32][0].value).toBe("some"); expect(tokens[32][0].scopes).toEqual(["source.python"]); expect(tokens[32][1].value).toBe("."); - expect(tokens[32][1].scopes).toEqual(["source.python","punctuation.separator.period.python"]); + expect(tokens[32][1].scopes).toEqual(["source.python","meta.member.access.python","punctuation.separator.period.python"]); expect(tokens[32][2].value).toBe("__init_subclass__"); - expect(tokens[32][2].scopes).toEqual(["source.python","support.function.magic.python"]); + expect(tokens[32][2].scopes).toEqual(["source.python","meta.member.access.python","support.function.magic.python"]); expect(tokens[33][0].value).toBe("some"); expect(tokens[33][0].scopes).toEqual(["source.python"]); expect(tokens[33][1].value).toBe("."); - expect(tokens[33][1].scopes).toEqual(["source.python","punctuation.separator.period.python"]); + expect(tokens[33][1].scopes).toEqual(["source.python","meta.member.access.python","punctuation.separator.period.python"]); expect(tokens[33][2].value).toBe("__set_name__"); - expect(tokens[33][2].scopes).toEqual(["source.python","support.function.magic.python"]); + expect(tokens[33][2].scopes).toEqual(["source.python","meta.member.access.python","support.function.magic.python"]); expect(tokens[34][0].value).toBe("some"); expect(tokens[34][0].scopes).toEqual(["source.python"]); expect(tokens[34][1].value).toBe("."); - expect(tokens[34][1].scopes).toEqual(["source.python","punctuation.separator.period.python"]); + expect(tokens[34][1].scopes).toEqual(["source.python","meta.member.access.python","punctuation.separator.period.python"]); expect(tokens[34][2].value).toBe("__fspath__"); - expect(tokens[34][2].scopes).toEqual(["source.python","support.function.magic.python"]); + expect(tokens[34][2].scopes).toEqual(["source.python","meta.member.access.python","support.function.magic.python"]); expect(tokens[35][0].value).toBe("some"); expect(tokens[35][0].scopes).toEqual(["source.python"]); expect(tokens[35][1].value).toBe("."); - expect(tokens[35][1].scopes).toEqual(["source.python","punctuation.separator.period.python"]); + expect(tokens[35][1].scopes).toEqual(["source.python","meta.member.access.python","punctuation.separator.period.python"]); expect(tokens[35][2].value).toBe("__classcell__"); - expect(tokens[35][2].scopes).toEqual(["source.python","support.variable.magic.python"]); + expect(tokens[35][2].scopes).toEqual(["source.python","meta.member.access.python","support.variable.magic.python"]); expect(tokens[36][0].value).toBe("some"); expect(tokens[36][0].scopes).toEqual(["source.python"]); expect(tokens[36][1].value).toBe("."); - expect(tokens[36][1].scopes).toEqual(["source.python","punctuation.separator.period.python"]); + expect(tokens[36][1].scopes).toEqual(["source.python","meta.member.access.python","punctuation.separator.period.python"]); expect(tokens[36][2].value).toBe("__bytes__"); - expect(tokens[36][2].scopes).toEqual(["source.python","support.function.magic.python"]); + expect(tokens[36][2].scopes).toEqual(["source.python","meta.member.access.python","support.function.magic.python"]); expect(tokens[37][0].value).toBe("some"); expect(tokens[37][0].scopes).toEqual(["source.python"]); expect(tokens[37][1].value).toBe("."); - expect(tokens[37][1].scopes).toEqual(["source.python","punctuation.separator.period.python"]); + expect(tokens[37][1].scopes).toEqual(["source.python","meta.member.access.python","punctuation.separator.period.python"]); expect(tokens[37][2].value).toBe("__spec__"); - expect(tokens[37][2].scopes).toEqual(["source.python","support.variable.magic.python"]); + expect(tokens[37][2].scopes).toEqual(["source.python","meta.member.access.python","support.variable.magic.python"]); expect(tokens[38][0].value).toBe("some"); expect(tokens[38][0].scopes).toEqual(["source.python"]); expect(tokens[38][1].value).toBe("."); - expect(tokens[38][1].scopes).toEqual(["source.python","punctuation.separator.period.python"]); + expect(tokens[38][1].scopes).toEqual(["source.python","meta.member.access.python","punctuation.separator.period.python"]); expect(tokens[38][2].value).toBe("__path__"); - expect(tokens[38][2].scopes).toEqual(["source.python","support.variable.magic.python"]); + expect(tokens[38][2].scopes).toEqual(["source.python","meta.member.access.python","support.variable.magic.python"]); expect(tokens[39][0].value).toBe("some"); expect(tokens[39][0].scopes).toEqual(["source.python"]); expect(tokens[39][1].value).toBe("."); - expect(tokens[39][1].scopes).toEqual(["source.python","punctuation.separator.period.python"]); + expect(tokens[39][1].scopes).toEqual(["source.python","meta.member.access.python","punctuation.separator.period.python"]); expect(tokens[39][2].value).toBe("__prepare__"); - expect(tokens[39][2].scopes).toEqual(["source.python","support.function.magic.python"]); + expect(tokens[39][2].scopes).toEqual(["source.python","meta.member.access.python","support.function.magic.python"]); expect(tokens[40][0].value).toBe("some"); expect(tokens[40][0].scopes).toEqual(["source.python"]); expect(tokens[40][1].value).toBe("."); - expect(tokens[40][1].scopes).toEqual(["source.python","punctuation.separator.period.python"]); + expect(tokens[40][1].scopes).toEqual(["source.python","meta.member.access.python","punctuation.separator.period.python"]); expect(tokens[40][2].value).toBe("__package__"); - expect(tokens[40][2].scopes).toEqual(["source.python","support.variable.magic.python"]); + expect(tokens[40][2].scopes).toEqual(["source.python","meta.member.access.python","support.variable.magic.python"]); expect(tokens[41][0].value).toBe("some"); expect(tokens[41][0].scopes).toEqual(["source.python"]); expect(tokens[41][1].value).toBe("."); - expect(tokens[41][1].scopes).toEqual(["source.python","punctuation.separator.period.python"]); + expect(tokens[41][1].scopes).toEqual(["source.python","meta.member.access.python","punctuation.separator.period.python"]); expect(tokens[41][2].value).toBe("__traceback__"); - expect(tokens[41][2].scopes).toEqual(["source.python","support.variable.magic.python"]); + expect(tokens[41][2].scopes).toEqual(["source.python","meta.member.access.python","support.variable.magic.python"]); expect(tokens[42][0].value).toBe("some"); expect(tokens[42][0].scopes).toEqual(["source.python"]); expect(tokens[42][1].value).toBe("."); - expect(tokens[42][1].scopes).toEqual(["source.python","punctuation.separator.period.python"]); - expect(tokens[42][2].value).toBe("__notspecial__"); - expect(tokens[42][2].scopes).toEqual(["source.python"]); + expect(tokens[42][1].scopes).toEqual(["source.python","meta.member.access.python","punctuation.separator.period.python"]); + expect(tokens[42][2].value).toBe("__closure__"); + expect(tokens[42][2].scopes).toEqual(["source.python","meta.member.access.python","support.variable.magic.python"]); + expect(tokens[43][0].value).toBe("some"); + expect(tokens[43][0].scopes).toEqual(["source.python"]); + expect(tokens[43][1].value).toBe("."); + expect(tokens[43][1].scopes).toEqual(["source.python","meta.member.access.python","punctuation.separator.period.python"]); + expect(tokens[43][2].value).toBe("__globals__"); + expect(tokens[43][2].scopes).toEqual(["source.python","meta.member.access.python","support.variable.magic.python"]); + expect(tokens[44][0].value).toBe("some"); + expect(tokens[44][0].scopes).toEqual(["source.python"]); + expect(tokens[44][1].value).toBe("."); + expect(tokens[44][1].scopes).toEqual(["source.python","meta.member.access.python","punctuation.separator.period.python"]); + expect(tokens[44][2].value).toBe("__match_args__"); + expect(tokens[44][2].scopes).toEqual(["source.python","meta.member.access.python","support.variable.magic.python"]); + expect(tokens[45][0].value).toBe("some"); + expect(tokens[45][0].scopes).toEqual(["source.python"]); + expect(tokens[45][1].value).toBe("."); + expect(tokens[45][1].scopes).toEqual(["source.python","meta.member.access.python","punctuation.separator.period.python"]); + expect(tokens[45][2].value).toBe("__notspecial__"); + expect(tokens[45][2].scopes).toEqual(["source.python","meta.member.access.python","meta.attribute.python"]); }); it("test/builtins/builtins4.py", @@ -421,39 +439,39 @@ describe("Grammar Tests", function() { expect(tokens[0][0].value).toBe("some"); expect(tokens[0][0].scopes).toEqual(["source.python"]); expect(tokens[0][1].value).toBe("."); - expect(tokens[0][1].scopes).toEqual(["source.python","punctuation.separator.period.python"]); + expect(tokens[0][1].scopes).toEqual(["source.python","meta.member.access.python","punctuation.separator.period.python"]); expect(tokens[0][2].value).toBe("int"); - expect(tokens[0][2].scopes).toEqual(["source.python"]); + expect(tokens[0][2].scopes).toEqual(["source.python","meta.member.access.python","meta.attribute.python"]); expect(tokens[1][0].value).toBe("some"); expect(tokens[1][0].scopes).toEqual(["source.python"]); expect(tokens[1][1].value).toBe("."); - expect(tokens[1][1].scopes).toEqual(["source.python","punctuation.separator.period.python"]); + expect(tokens[1][1].scopes).toEqual(["source.python","meta.member.access.python","punctuation.separator.period.python"]); expect(tokens[1][2].value).toBe("sum"); - expect(tokens[1][2].scopes).toEqual(["source.python"]); + expect(tokens[1][2].scopes).toEqual(["source.python","meta.member.access.python","meta.attribute.python"]); expect(tokens[2][0].value).toBe("some"); expect(tokens[2][0].scopes).toEqual(["source.python"]); expect(tokens[2][1].value).toBe("."); - expect(tokens[2][1].scopes).toEqual(["source.python","punctuation.separator.period.python"]); + expect(tokens[2][1].scopes).toEqual(["source.python","meta.member.access.python","punctuation.separator.period.python"]); expect(tokens[2][2].value).toBe("super"); - expect(tokens[2][2].scopes).toEqual(["source.python"]); + expect(tokens[2][2].scopes).toEqual(["source.python","meta.member.access.python","meta.attribute.python"]); expect(tokens[3][0].value).toBe("some"); expect(tokens[3][0].scopes).toEqual(["source.python"]); expect(tokens[3][1].value).toBe("."); - expect(tokens[3][1].scopes).toEqual(["source.python","punctuation.separator.period.python"]); + expect(tokens[3][1].scopes).toEqual(["source.python","meta.member.access.python","punctuation.separator.period.python"]); expect(tokens[3][2].value).toBe("unicode"); - expect(tokens[3][2].scopes).toEqual(["source.python"]); + expect(tokens[3][2].scopes).toEqual(["source.python","meta.member.access.python","meta.attribute.python"]); expect(tokens[4][0].value).toBe("some"); expect(tokens[4][0].scopes).toEqual(["source.python"]); expect(tokens[4][1].value).toBe("."); - expect(tokens[4][1].scopes).toEqual(["source.python","punctuation.separator.period.python"]); + expect(tokens[4][1].scopes).toEqual(["source.python","meta.member.access.python","punctuation.separator.period.python"]); expect(tokens[4][2].value).toBe("foo"); - expect(tokens[4][2].scopes).toEqual(["source.python"]); + expect(tokens[4][2].scopes).toEqual(["source.python","meta.member.access.python","meta.attribute.python"]); expect(tokens[5][0].value).toBe("some"); expect(tokens[5][0].scopes).toEqual(["source.python"]); expect(tokens[5][1].value).toBe("."); - expect(tokens[5][1].scopes).toEqual(["source.python","punctuation.separator.period.python"]); + expect(tokens[5][1].scopes).toEqual(["source.python","meta.member.access.python","punctuation.separator.period.python"]); expect(tokens[5][2].value).toBe("Exception"); - expect(tokens[5][2].scopes).toEqual(["source.python"]); + expect(tokens[5][2].scopes).toEqual(["source.python","meta.member.access.python","meta.attribute.python"]); }); it("test/builtins/builtins5.py", @@ -462,37 +480,37 @@ describe("Grammar Tests", function() { expect(tokens[0][0].value).toBe("some"); expect(tokens[0][0].scopes).toEqual(["source.python"]); expect(tokens[0][1].value).toBe("."); - expect(tokens[0][1].scopes).toEqual(["source.python","punctuation.separator.period.python"]); + expect(tokens[0][1].scopes).toEqual(["source.python","meta.member.access.python","punctuation.separator.period.python"]); expect(tokens[0][2].value).toBe(" "); - expect(tokens[0][2].scopes).toEqual(["source.python"]); + expect(tokens[0][2].scopes).toEqual(["source.python","meta.member.access.python"]); expect(tokens[0][3].value).toBe("True"); - expect(tokens[0][3].scopes).toEqual(["source.python","keyword.illegal.name.python"]); + expect(tokens[0][3].scopes).toEqual(["source.python","meta.member.access.python","keyword.illegal.name.python"]); expect(tokens[1][0].value).toBe("some"); expect(tokens[1][0].scopes).toEqual(["source.python"]); expect(tokens[1][1].value).toBe("."); - expect(tokens[1][1].scopes).toEqual(["source.python","punctuation.separator.period.python"]); + expect(tokens[1][1].scopes).toEqual(["source.python","meta.member.access.python","punctuation.separator.period.python"]); expect(tokens[1][2].value).toBe(" "); - expect(tokens[1][2].scopes).toEqual(["source.python"]); + expect(tokens[1][2].scopes).toEqual(["source.python","meta.member.access.python"]); expect(tokens[1][3].value).toBe("\\"); - expect(tokens[1][3].scopes).toEqual(["source.python","punctuation.separator.continuation.line.python"]); + expect(tokens[1][3].scopes).toEqual(["source.python","meta.member.access.python","punctuation.separator.continuation.line.python"]); expect(tokens[1][4].value).toBe(""); - expect(tokens[1][4].scopes).toEqual(["source.python"]); + expect(tokens[1][4].scopes).toEqual(["source.python","meta.member.access.python"]); expect(tokens[2][0].value).toBe(" "); - expect(tokens[2][0].scopes).toEqual(["source.python"]); + expect(tokens[2][0].scopes).toEqual(["source.python","meta.member.access.python"]); expect(tokens[2][1].value).toBe("True"); - expect(tokens[2][1].scopes).toEqual(["source.python","keyword.illegal.name.python"]); + expect(tokens[2][1].scopes).toEqual(["source.python","meta.member.access.python","keyword.illegal.name.python"]); expect(tokens[3][0].value).toBe("True"); expect(tokens[3][0].scopes).toEqual(["source.python","constant.language.python"]); expect(tokens[4][0].value).toBe("some"); expect(tokens[4][0].scopes).toEqual(["source.python"]); expect(tokens[4][1].value).toBe("."); - expect(tokens[4][1].scopes).toEqual(["source.python","punctuation.separator.period.python"]); + expect(tokens[4][1].scopes).toEqual(["source.python","meta.member.access.python","punctuation.separator.period.python"]); expect(tokens[4][2].value).toBe(""); - expect(tokens[4][2].scopes).toEqual(["source.python"]); + expect(tokens[4][2].scopes).toEqual(["source.python","meta.member.access.python"]); expect(tokens[5][0].value).toBe(" "); - expect(tokens[5][0].scopes).toEqual(["source.python"]); + expect(tokens[5][0].scopes).toEqual(["source.python","meta.member.access.python"]); expect(tokens[5][1].value).toBe("True"); - expect(tokens[5][1].scopes).toEqual(["source.python","keyword.illegal.name.python"]); + expect(tokens[5][1].scopes).toEqual(["source.python","meta.member.access.python","keyword.illegal.name.python"]); }); it("test/builtins/builtins6.py", @@ -516,13 +534,25 @@ describe("Grammar Tests", function() { it("test/builtins/builtins7.py", function() { - tokens = grammar.tokenizeLines("breakpoint()") + tokens = grammar.tokenizeLines("breakpoint()\naiter()\nanext()") expect(tokens[0][0].value).toBe("breakpoint"); expect(tokens[0][0].scopes).toEqual(["source.python","meta.function-call.python","support.function.builtin.python"]); expect(tokens[0][1].value).toBe("("); expect(tokens[0][1].scopes).toEqual(["source.python","meta.function-call.python","punctuation.definition.arguments.begin.python"]); expect(tokens[0][2].value).toBe(")"); expect(tokens[0][2].scopes).toEqual(["source.python","meta.function-call.python","punctuation.definition.arguments.end.python"]); + expect(tokens[1][0].value).toBe("aiter"); + expect(tokens[1][0].scopes).toEqual(["source.python","meta.function-call.python","support.function.builtin.python"]); + expect(tokens[1][1].value).toBe("("); + expect(tokens[1][1].scopes).toEqual(["source.python","meta.function-call.python","punctuation.definition.arguments.begin.python"]); + expect(tokens[1][2].value).toBe(")"); + expect(tokens[1][2].scopes).toEqual(["source.python","meta.function-call.python","punctuation.definition.arguments.end.python"]); + expect(tokens[2][0].value).toBe("anext"); + expect(tokens[2][0].scopes).toEqual(["source.python","meta.function-call.python","support.function.builtin.python"]); + expect(tokens[2][1].value).toBe("("); + expect(tokens[2][1].scopes).toEqual(["source.python","meta.function-call.python","punctuation.definition.arguments.begin.python"]); + expect(tokens[2][2].value).toBe(")"); + expect(tokens[2][2].scopes).toEqual(["source.python","meta.function-call.python","punctuation.definition.arguments.end.python"]); }); it("test/calls/call1.py", @@ -545,7 +575,7 @@ describe("Grammar Tests", function() { expect(tokens[0][7].value).toBe(" "); expect(tokens[0][7].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python"]); expect(tokens[0][8].value).toBe("c"); - expect(tokens[0][8].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","meta.item-access.python"]); + expect(tokens[0][8].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","meta.item-access.python","meta.indexed-name.python"]); expect(tokens[0][9].value).toBe("["); expect(tokens[0][9].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","meta.item-access.python","punctuation.definition.arguments.begin.python"]); expect(tokens[0][10].value).toBe("1"); @@ -651,6 +681,77 @@ describe("Grammar Tests", function() { expect(tokens[3][3].scopes).toEqual(["source.python","meta.function-call.python","punctuation.definition.arguments.end.python"]); }); + it("test/calls/call11.py", + function() { + tokens = grammar.tokenizeLines("id = Field[uuid.UUID] (\n uuid.UUID,\n inheritable=False,\n simpledelta=False,\n allow_ddl_set=True,\n)") + expect(tokens[0][0].value).toBe("id"); + expect(tokens[0][0].scopes).toEqual(["source.python","support.function.builtin.python"]); + expect(tokens[0][1].value).toBe(" "); + expect(tokens[0][1].scopes).toEqual(["source.python"]); + expect(tokens[0][2].value).toBe("="); + expect(tokens[0][2].scopes).toEqual(["source.python","keyword.operator.assignment.python"]); + expect(tokens[0][3].value).toBe(" "); + expect(tokens[0][3].scopes).toEqual(["source.python"]); + expect(tokens[0][4].value).toBe("Field"); + expect(tokens[0][4].scopes).toEqual(["source.python","meta.item-access.python","meta.indexed-name.python"]); + expect(tokens[0][5].value).toBe("["); + expect(tokens[0][5].scopes).toEqual(["source.python","meta.item-access.python","punctuation.definition.arguments.begin.python"]); + expect(tokens[0][6].value).toBe("uuid"); + expect(tokens[0][6].scopes).toEqual(["source.python","meta.item-access.python","meta.item-access.arguments.python"]); + expect(tokens[0][7].value).toBe("."); + expect(tokens[0][7].scopes).toEqual(["source.python","meta.item-access.python","meta.item-access.arguments.python","meta.member.access.python","punctuation.separator.period.python"]); + expect(tokens[0][8].value).toBe("UUID"); + expect(tokens[0][8].scopes).toEqual(["source.python","meta.item-access.python","meta.item-access.arguments.python","meta.member.access.python","constant.other.caps.python"]); + expect(tokens[0][9].value).toBe("]"); + expect(tokens[0][9].scopes).toEqual(["source.python","meta.item-access.python","punctuation.definition.arguments.end.python"]); + expect(tokens[0][10].value).toBe(" "); + expect(tokens[0][10].scopes).toEqual(["source.python"]); + expect(tokens[0][11].value).toBe("("); + expect(tokens[0][11].scopes).toEqual(["source.python","punctuation.definition.arguments.begin.python"]); + expect(tokens[1][0].value).toBe(" "); + expect(tokens[1][0].scopes).toEqual(["source.python","meta.function-call.arguments.python"]); + expect(tokens[1][1].value).toBe("uuid"); + expect(tokens[1][1].scopes).toEqual(["source.python","meta.function-call.arguments.python"]); + expect(tokens[1][2].value).toBe("."); + expect(tokens[1][2].scopes).toEqual(["source.python","meta.function-call.arguments.python","meta.member.access.python","punctuation.separator.period.python"]); + expect(tokens[1][3].value).toBe("UUID"); + expect(tokens[1][3].scopes).toEqual(["source.python","meta.function-call.arguments.python","meta.member.access.python","constant.other.caps.python"]); + expect(tokens[1][4].value).toBe(","); + expect(tokens[1][4].scopes).toEqual(["source.python","meta.function-call.arguments.python","punctuation.separator.arguments.python"]); + expect(tokens[2][0].value).toBe(" "); + expect(tokens[2][0].scopes).toEqual(["source.python","meta.function-call.arguments.python"]); + expect(tokens[2][1].value).toBe("inheritable"); + expect(tokens[2][1].scopes).toEqual(["source.python","meta.function-call.arguments.python","variable.parameter.function-call.python"]); + expect(tokens[2][2].value).toBe("="); + expect(tokens[2][2].scopes).toEqual(["source.python","meta.function-call.arguments.python","keyword.operator.assignment.python"]); + expect(tokens[2][3].value).toBe("False"); + expect(tokens[2][3].scopes).toEqual(["source.python","meta.function-call.arguments.python","constant.language.python"]); + expect(tokens[2][4].value).toBe(","); + expect(tokens[2][4].scopes).toEqual(["source.python","meta.function-call.arguments.python","punctuation.separator.arguments.python"]); + expect(tokens[3][0].value).toBe(" "); + expect(tokens[3][0].scopes).toEqual(["source.python","meta.function-call.arguments.python"]); + expect(tokens[3][1].value).toBe("simpledelta"); + expect(tokens[3][1].scopes).toEqual(["source.python","meta.function-call.arguments.python","variable.parameter.function-call.python"]); + expect(tokens[3][2].value).toBe("="); + expect(tokens[3][2].scopes).toEqual(["source.python","meta.function-call.arguments.python","keyword.operator.assignment.python"]); + expect(tokens[3][3].value).toBe("False"); + expect(tokens[3][3].scopes).toEqual(["source.python","meta.function-call.arguments.python","constant.language.python"]); + expect(tokens[3][4].value).toBe(","); + expect(tokens[3][4].scopes).toEqual(["source.python","meta.function-call.arguments.python","punctuation.separator.arguments.python"]); + expect(tokens[4][0].value).toBe(" "); + expect(tokens[4][0].scopes).toEqual(["source.python","meta.function-call.arguments.python"]); + expect(tokens[4][1].value).toBe("allow_ddl_set"); + expect(tokens[4][1].scopes).toEqual(["source.python","meta.function-call.arguments.python","variable.parameter.function-call.python"]); + expect(tokens[4][2].value).toBe("="); + expect(tokens[4][2].scopes).toEqual(["source.python","meta.function-call.arguments.python","keyword.operator.assignment.python"]); + expect(tokens[4][3].value).toBe("True"); + expect(tokens[4][3].scopes).toEqual(["source.python","meta.function-call.arguments.python","constant.language.python"]); + expect(tokens[4][4].value).toBe(","); + expect(tokens[4][4].scopes).toEqual(["source.python","meta.function-call.arguments.python","punctuation.separator.arguments.python"]); + expect(tokens[5][0].value).toBe(")"); + expect(tokens[5][0].scopes).toEqual(["source.python","punctuation.definition.arguments.end.python"]); + }); + it("test/calls/call2.py", function() { tokens = grammar.tokenizeLines("foo(from=1)") @@ -674,31 +775,31 @@ describe("Grammar Tests", function() { expect(tokens[0][0].value).toBe("foo"); expect(tokens[0][0].scopes).toEqual(["source.python"]); expect(tokens[0][1].value).toBe("."); - expect(tokens[0][1].scopes).toEqual(["source.python","punctuation.separator.period.python"]); + expect(tokens[0][1].scopes).toEqual(["source.python","meta.member.access.python","punctuation.separator.period.python"]); expect(tokens[0][2].value).toBe("class"); - expect(tokens[0][2].scopes).toEqual(["source.python","meta.function-call.python","keyword.control.flow.python"]); + expect(tokens[0][2].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","keyword.control.flow.python"]); expect(tokens[0][3].value).toBe("("); - expect(tokens[0][3].scopes).toEqual(["source.python","meta.function-call.python","punctuation.definition.arguments.begin.python"]); + expect(tokens[0][3].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","punctuation.definition.arguments.begin.python"]); expect(tokens[0][4].value).toBe("a"); - expect(tokens[0][4].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python"]); + expect(tokens[0][4].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python"]); expect(tokens[0][5].value).toBe(")"); - expect(tokens[0][5].scopes).toEqual(["source.python","meta.function-call.python","punctuation.definition.arguments.end.python"]); + expect(tokens[0][5].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","punctuation.definition.arguments.end.python"]); expect(tokens[1][0].value).toBe("foo"); expect(tokens[1][0].scopes).toEqual(["source.python"]); expect(tokens[1][1].value).toBe("."); - expect(tokens[1][1].scopes).toEqual(["source.python","punctuation.separator.period.python"]); + expect(tokens[1][1].scopes).toEqual(["source.python","meta.member.access.python","punctuation.separator.period.python"]); expect(tokens[1][2].value).toBe("and"); - expect(tokens[1][2].scopes).toEqual(["source.python","meta.function-call.python","keyword.control.flow.python"]); + expect(tokens[1][2].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","keyword.control.flow.python"]); expect(tokens[1][3].value).toBe("("); - expect(tokens[1][3].scopes).toEqual(["source.python","meta.function-call.python","punctuation.definition.arguments.begin.python"]); + expect(tokens[1][3].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","punctuation.definition.arguments.begin.python"]); expect(tokens[1][4].value).toBe(")"); - expect(tokens[1][4].scopes).toEqual(["source.python","meta.function-call.python","punctuation.definition.arguments.end.python"]); + expect(tokens[1][4].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","punctuation.definition.arguments.end.python"]); expect(tokens[2][0].value).toBe("foo"); expect(tokens[2][0].scopes).toEqual(["source.python"]); expect(tokens[2][1].value).toBe("."); - expect(tokens[2][1].scopes).toEqual(["source.python","punctuation.separator.period.python"]); + expect(tokens[2][1].scopes).toEqual(["source.python","meta.member.access.python","punctuation.separator.period.python"]); expect(tokens[2][2].value).toBe("if"); - expect(tokens[2][2].scopes).toEqual(["source.python","keyword.control.flow.python"]); + expect(tokens[2][2].scopes).toEqual(["source.python","meta.member.access.python","keyword.control.flow.python"]); }); it("test/calls/call4.py", @@ -707,9 +808,9 @@ describe("Grammar Tests", function() { expect(tokens[0][0].value).toBe("foo"); expect(tokens[0][0].scopes).toEqual(["source.python"]); expect(tokens[0][1].value).toBe("."); - expect(tokens[0][1].scopes).toEqual(["source.python","punctuation.separator.period.python"]); + expect(tokens[0][1].scopes).toEqual(["source.python","meta.member.access.python","punctuation.separator.period.python"]); expect(tokens[0][2].value).toBe("1"); - expect(tokens[0][2].scopes).toEqual(["source.python"]); + expect(tokens[0][2].scopes).toEqual(["source.python","meta.member.access.python"]); expect(tokens[1][0].value).toBe("foo"); expect(tokens[1][0].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.generic.python"]); expect(tokens[1][1].value).toBe("("); @@ -735,9 +836,9 @@ describe("Grammar Tests", function() { expect(tokens[2][0].value).toBe("foo"); expect(tokens[2][0].scopes).toEqual(["source.python"]); expect(tokens[2][1].value).toBe("."); - expect(tokens[2][1].scopes).toEqual(["source.python","punctuation.separator.period.python"]); + expect(tokens[2][1].scopes).toEqual(["source.python","meta.member.access.python","punctuation.separator.period.python"]); expect(tokens[2][2].value).toBe("None"); - expect(tokens[2][2].scopes).toEqual(["source.python","keyword.illegal.name.python"]); + expect(tokens[2][2].scopes).toEqual(["source.python","meta.member.access.python","keyword.illegal.name.python"]); expect(tokens[2][3].value).toBe(" "); expect(tokens[2][3].scopes).toEqual(["source.python"]); expect(tokens[2][4].value).toBe("and"); @@ -747,13 +848,13 @@ describe("Grammar Tests", function() { expect(tokens[2][6].value).toBe("foo"); expect(tokens[2][6].scopes).toEqual(["source.python"]); expect(tokens[2][7].value).toBe("."); - expect(tokens[2][7].scopes).toEqual(["source.python","punctuation.separator.period.python"]); + expect(tokens[2][7].scopes).toEqual(["source.python","meta.member.access.python","punctuation.separator.period.python"]); expect(tokens[2][8].value).toBe("None"); - expect(tokens[2][8].scopes).toEqual(["source.python","keyword.illegal.name.python"]); + expect(tokens[2][8].scopes).toEqual(["source.python","meta.member.access.python","keyword.illegal.name.python"]); expect(tokens[2][9].value).toBe("."); - expect(tokens[2][9].scopes).toEqual(["source.python","punctuation.separator.period.python"]); + expect(tokens[2][9].scopes).toEqual(["source.python","meta.member.access.python","punctuation.separator.period.python"]); expect(tokens[2][10].value).toBe("baz"); - expect(tokens[2][10].scopes).toEqual(["source.python"]); + expect(tokens[2][10].scopes).toEqual(["source.python","meta.member.access.python","meta.attribute.python"]); }); it("test/calls/call5.py", @@ -840,79 +941,79 @@ describe("Grammar Tests", function() { expect(tokens[0][0].value).toBe("foo"); expect(tokens[0][0].scopes).toEqual(["source.python"]); expect(tokens[0][1].value).toBe("."); - expect(tokens[0][1].scopes).toEqual(["source.python","punctuation.separator.period.python"]); + expect(tokens[0][1].scopes).toEqual(["source.python","meta.member.access.python","punctuation.separator.period.python"]); expect(tokens[0][2].value).toBe("__class__"); - expect(tokens[0][2].scopes).toEqual(["source.python","meta.function-call.python","support.variable.magic.python"]); + expect(tokens[0][2].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","support.variable.magic.python"]); expect(tokens[0][3].value).toBe(" "); - expect(tokens[0][3].scopes).toEqual(["source.python","meta.function-call.python"]); + expect(tokens[0][3].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python"]); expect(tokens[0][4].value).toBe("("); - expect(tokens[0][4].scopes).toEqual(["source.python","meta.function-call.python","punctuation.definition.arguments.begin.python"]); + expect(tokens[0][4].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","punctuation.definition.arguments.begin.python"]); expect(tokens[0][5].value).toBe("foo"); - expect(tokens[0][5].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","variable.parameter.function-call.python"]); + expect(tokens[0][5].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","variable.parameter.function-call.python"]); expect(tokens[0][6].value).toBe("="); - expect(tokens[0][6].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","keyword.operator.assignment.python"]); + expect(tokens[0][6].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","keyword.operator.assignment.python"]); expect(tokens[0][7].value).toBe("bar"); - expect(tokens[0][7].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python"]); + expect(tokens[0][7].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python"]); expect(tokens[0][8].value).toBe(")"); - expect(tokens[0][8].scopes).toEqual(["source.python","meta.function-call.python","punctuation.definition.arguments.end.python"]); + expect(tokens[0][8].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","punctuation.definition.arguments.end.python"]); expect(tokens[1][0].value).toBe("foo"); expect(tokens[1][0].scopes).toEqual(["source.python"]); expect(tokens[1][1].value).toBe("."); - expect(tokens[1][1].scopes).toEqual(["source.python","punctuation.separator.period.python"]); + expect(tokens[1][1].scopes).toEqual(["source.python","meta.member.access.python","punctuation.separator.period.python"]); expect(tokens[1][2].value).toBe("__class__"); - expect(tokens[1][2].scopes).toEqual(["source.python","meta.function-call.python","support.variable.magic.python"]); + expect(tokens[1][2].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","support.variable.magic.python"]); expect(tokens[1][3].value).toBe("("); - expect(tokens[1][3].scopes).toEqual(["source.python","meta.function-call.python","punctuation.definition.arguments.begin.python"]); + expect(tokens[1][3].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","punctuation.definition.arguments.begin.python"]); expect(tokens[1][4].value).toBe("foo"); - expect(tokens[1][4].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","variable.parameter.function-call.python"]); + expect(tokens[1][4].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","variable.parameter.function-call.python"]); expect(tokens[1][5].value).toBe("="); - expect(tokens[1][5].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","keyword.operator.assignment.python"]); + expect(tokens[1][5].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","keyword.operator.assignment.python"]); expect(tokens[1][6].value).toBe("bar"); - expect(tokens[1][6].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python"]); + expect(tokens[1][6].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python"]); expect(tokens[1][7].value).toBe(")"); - expect(tokens[1][7].scopes).toEqual(["source.python","meta.function-call.python","punctuation.definition.arguments.end.python"]); + expect(tokens[1][7].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","punctuation.definition.arguments.end.python"]); expect(tokens[2][0].value).toBe("foo"); expect(tokens[2][0].scopes).toEqual(["source.python"]); expect(tokens[2][1].value).toBe("."); - expect(tokens[2][1].scopes).toEqual(["source.python","punctuation.separator.period.python"]); + expect(tokens[2][1].scopes).toEqual(["source.python","meta.member.access.python","punctuation.separator.period.python"]); expect(tokens[2][2].value).toBe("__add__"); - expect(tokens[2][2].scopes).toEqual(["source.python","meta.function-call.python","support.function.magic.python"]); + expect(tokens[2][2].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","support.function.magic.python"]); expect(tokens[2][3].value).toBe(" "); - expect(tokens[2][3].scopes).toEqual(["source.python","meta.function-call.python"]); + expect(tokens[2][3].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python"]); expect(tokens[2][4].value).toBe("("); - expect(tokens[2][4].scopes).toEqual(["source.python","meta.function-call.python","punctuation.definition.arguments.begin.python"]); + expect(tokens[2][4].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","punctuation.definition.arguments.begin.python"]); expect(tokens[2][5].value).toBe("foo"); - expect(tokens[2][5].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","variable.parameter.function-call.python"]); + expect(tokens[2][5].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","variable.parameter.function-call.python"]); expect(tokens[2][6].value).toBe("="); - expect(tokens[2][6].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","keyword.operator.assignment.python"]); + expect(tokens[2][6].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","keyword.operator.assignment.python"]); expect(tokens[2][7].value).toBe("bar"); - expect(tokens[2][7].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python"]); + expect(tokens[2][7].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python"]); expect(tokens[2][8].value).toBe(")"); - expect(tokens[2][8].scopes).toEqual(["source.python","meta.function-call.python","punctuation.definition.arguments.end.python"]); + expect(tokens[2][8].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","punctuation.definition.arguments.end.python"]); expect(tokens[3][0].value).toBe("foo"); expect(tokens[3][0].scopes).toEqual(["source.python"]); expect(tokens[3][1].value).toBe("."); - expect(tokens[3][1].scopes).toEqual(["source.python","punctuation.separator.period.python"]); + expect(tokens[3][1].scopes).toEqual(["source.python","meta.member.access.python","punctuation.separator.period.python"]); expect(tokens[3][2].value).toBe("__add__"); - expect(tokens[3][2].scopes).toEqual(["source.python","meta.function-call.python","support.function.magic.python"]); + expect(tokens[3][2].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","support.function.magic.python"]); expect(tokens[3][3].value).toBe("("); - expect(tokens[3][3].scopes).toEqual(["source.python","meta.function-call.python","punctuation.definition.arguments.begin.python"]); + expect(tokens[3][3].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","punctuation.definition.arguments.begin.python"]); expect(tokens[3][4].value).toBe("foo"); - expect(tokens[3][4].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","variable.parameter.function-call.python"]); + expect(tokens[3][4].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","variable.parameter.function-call.python"]); expect(tokens[3][5].value).toBe("="); - expect(tokens[3][5].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","keyword.operator.assignment.python"]); + expect(tokens[3][5].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","keyword.operator.assignment.python"]); expect(tokens[3][6].value).toBe("bar"); - expect(tokens[3][6].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python"]); + expect(tokens[3][6].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python"]); expect(tokens[3][7].value).toBe(")"); - expect(tokens[3][7].scopes).toEqual(["source.python","meta.function-call.python","punctuation.definition.arguments.end.python"]); + expect(tokens[3][7].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","punctuation.definition.arguments.end.python"]); expect(tokens[4][0].value).toBe(""); expect(tokens[4][0].scopes).toEqual(["source.python"]); expect(tokens[5][0].value).toBe("foo"); expect(tokens[5][0].scopes).toEqual(["source.python"]); expect(tokens[5][1].value).toBe("."); - expect(tokens[5][1].scopes).toEqual(["source.python","punctuation.separator.period.python"]); + expect(tokens[5][1].scopes).toEqual(["source.python","meta.member.access.python","punctuation.separator.period.python"]); expect(tokens[5][2].value).toBe("__class__"); - expect(tokens[5][2].scopes).toEqual(["source.python","support.variable.magic.python"]); + expect(tokens[5][2].scopes).toEqual(["source.python","meta.member.access.python","support.variable.magic.python"]); expect(tokens[5][3].value).toBe(" "); expect(tokens[5][3].scopes).toEqual(["source.python"]); expect(tokens[5][4].value).toBe("1"); @@ -925,79 +1026,79 @@ describe("Grammar Tests", function() { expect(tokens[0][0].value).toBe("foo"); expect(tokens[0][0].scopes).toEqual(["source.python"]); expect(tokens[0][1].value).toBe("."); - expect(tokens[0][1].scopes).toEqual(["source.python","punctuation.separator.period.python"]); + expect(tokens[0][1].scopes).toEqual(["source.python","meta.member.access.python","punctuation.separator.period.python"]); expect(tokens[0][2].value).toBe(" "); - expect(tokens[0][2].scopes).toEqual(["source.python"]); + expect(tokens[0][2].scopes).toEqual(["source.python","meta.member.access.python"]); expect(tokens[0][3].value).toBe("__class__"); - expect(tokens[0][3].scopes).toEqual(["source.python","meta.function-call.python","support.variable.magic.python"]); + expect(tokens[0][3].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","support.variable.magic.python"]); expect(tokens[0][4].value).toBe("("); - expect(tokens[0][4].scopes).toEqual(["source.python","meta.function-call.python","punctuation.definition.arguments.begin.python"]); + expect(tokens[0][4].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","punctuation.definition.arguments.begin.python"]); expect(tokens[0][5].value).toBe("foo"); - expect(tokens[0][5].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","variable.parameter.function-call.python"]); + expect(tokens[0][5].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","variable.parameter.function-call.python"]); expect(tokens[0][6].value).toBe("="); - expect(tokens[0][6].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","keyword.operator.assignment.python"]); + expect(tokens[0][6].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","keyword.operator.assignment.python"]); expect(tokens[0][7].value).toBe("bar"); - expect(tokens[0][7].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python"]); + expect(tokens[0][7].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python"]); expect(tokens[0][8].value).toBe(")"); - expect(tokens[0][8].scopes).toEqual(["source.python","meta.function-call.python","punctuation.definition.arguments.end.python"]); + expect(tokens[0][8].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","punctuation.definition.arguments.end.python"]); expect(tokens[1][0].value).toBe("foo"); expect(tokens[1][0].scopes).toEqual(["source.python"]); expect(tokens[1][1].value).toBe("."); - expect(tokens[1][1].scopes).toEqual(["source.python","punctuation.separator.period.python"]); + expect(tokens[1][1].scopes).toEqual(["source.python","meta.member.access.python","punctuation.separator.period.python"]); expect(tokens[1][2].value).toBe(" "); - expect(tokens[1][2].scopes).toEqual(["source.python"]); + expect(tokens[1][2].scopes).toEqual(["source.python","meta.member.access.python"]); expect(tokens[1][3].value).toBe("__class__"); - expect(tokens[1][3].scopes).toEqual(["source.python","meta.function-call.python","support.variable.magic.python"]); + expect(tokens[1][3].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","support.variable.magic.python"]); expect(tokens[1][4].value).toBe(" "); - expect(tokens[1][4].scopes).toEqual(["source.python","meta.function-call.python"]); + expect(tokens[1][4].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python"]); expect(tokens[1][5].value).toBe("("); - expect(tokens[1][5].scopes).toEqual(["source.python","meta.function-call.python","punctuation.definition.arguments.begin.python"]); + expect(tokens[1][5].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","punctuation.definition.arguments.begin.python"]); expect(tokens[1][6].value).toBe("foo"); - expect(tokens[1][6].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","variable.parameter.function-call.python"]); + expect(tokens[1][6].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","variable.parameter.function-call.python"]); expect(tokens[1][7].value).toBe("="); - expect(tokens[1][7].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","keyword.operator.assignment.python"]); + expect(tokens[1][7].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","keyword.operator.assignment.python"]); expect(tokens[1][8].value).toBe("bar"); - expect(tokens[1][8].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python"]); + expect(tokens[1][8].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python"]); expect(tokens[1][9].value).toBe(")"); - expect(tokens[1][9].scopes).toEqual(["source.python","meta.function-call.python","punctuation.definition.arguments.end.python"]); + expect(tokens[1][9].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","punctuation.definition.arguments.end.python"]); expect(tokens[2][0].value).toBe("foo"); expect(tokens[2][0].scopes).toEqual(["source.python"]); expect(tokens[2][1].value).toBe("."); - expect(tokens[2][1].scopes).toEqual(["source.python","punctuation.separator.period.python"]); + expect(tokens[2][1].scopes).toEqual(["source.python","meta.member.access.python","punctuation.separator.period.python"]); expect(tokens[2][2].value).toBe(" "); - expect(tokens[2][2].scopes).toEqual(["source.python"]); + expect(tokens[2][2].scopes).toEqual(["source.python","meta.member.access.python"]); expect(tokens[2][3].value).toBe("__add__"); - expect(tokens[2][3].scopes).toEqual(["source.python","meta.function-call.python","support.function.magic.python"]); + expect(tokens[2][3].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","support.function.magic.python"]); expect(tokens[2][4].value).toBe(" "); - expect(tokens[2][4].scopes).toEqual(["source.python","meta.function-call.python"]); + expect(tokens[2][4].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python"]); expect(tokens[2][5].value).toBe("("); - expect(tokens[2][5].scopes).toEqual(["source.python","meta.function-call.python","punctuation.definition.arguments.begin.python"]); + expect(tokens[2][5].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","punctuation.definition.arguments.begin.python"]); expect(tokens[2][6].value).toBe("foo"); - expect(tokens[2][6].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","variable.parameter.function-call.python"]); + expect(tokens[2][6].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","variable.parameter.function-call.python"]); expect(tokens[2][7].value).toBe("="); - expect(tokens[2][7].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","keyword.operator.assignment.python"]); + expect(tokens[2][7].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","keyword.operator.assignment.python"]); expect(tokens[2][8].value).toBe("bar"); - expect(tokens[2][8].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python"]); + expect(tokens[2][8].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python"]); expect(tokens[2][9].value).toBe(")"); - expect(tokens[2][9].scopes).toEqual(["source.python","meta.function-call.python","punctuation.definition.arguments.end.python"]); + expect(tokens[2][9].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","punctuation.definition.arguments.end.python"]); expect(tokens[3][0].value).toBe("foo"); expect(tokens[3][0].scopes).toEqual(["source.python"]); expect(tokens[3][1].value).toBe("."); - expect(tokens[3][1].scopes).toEqual(["source.python","punctuation.separator.period.python"]); + expect(tokens[3][1].scopes).toEqual(["source.python","meta.member.access.python","punctuation.separator.period.python"]); expect(tokens[3][2].value).toBe(" "); - expect(tokens[3][2].scopes).toEqual(["source.python"]); + expect(tokens[3][2].scopes).toEqual(["source.python","meta.member.access.python"]); expect(tokens[3][3].value).toBe("__add__"); - expect(tokens[3][3].scopes).toEqual(["source.python","meta.function-call.python","support.function.magic.python"]); + expect(tokens[3][3].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","support.function.magic.python"]); expect(tokens[3][4].value).toBe("("); - expect(tokens[3][4].scopes).toEqual(["source.python","meta.function-call.python","punctuation.definition.arguments.begin.python"]); + expect(tokens[3][4].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","punctuation.definition.arguments.begin.python"]); expect(tokens[3][5].value).toBe("foo"); - expect(tokens[3][5].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","variable.parameter.function-call.python"]); + expect(tokens[3][5].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","variable.parameter.function-call.python"]); expect(tokens[3][6].value).toBe("="); - expect(tokens[3][6].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","keyword.operator.assignment.python"]); + expect(tokens[3][6].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","keyword.operator.assignment.python"]); expect(tokens[3][7].value).toBe("bar"); - expect(tokens[3][7].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python"]); + expect(tokens[3][7].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python"]); expect(tokens[3][8].value).toBe(")"); - expect(tokens[3][8].scopes).toEqual(["source.python","meta.function-call.python","punctuation.definition.arguments.end.python"]); + expect(tokens[3][8].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","punctuation.definition.arguments.end.python"]); }); it("test/calls/call9.py", @@ -1109,9 +1210,9 @@ describe("Grammar Tests", function() { expect(tokens[6][3].value).toBe("sys"); expect(tokens[6][3].scopes).toEqual(["source.python"]); expect(tokens[6][4].value).toBe("."); - expect(tokens[6][4].scopes).toEqual(["source.python","punctuation.separator.period.python"]); + expect(tokens[6][4].scopes).toEqual(["source.python","meta.member.access.python","punctuation.separator.period.python"]); expect(tokens[6][5].value).toBe("stderr"); - expect(tokens[6][5].scopes).toEqual(["source.python"]); + expect(tokens[6][5].scopes).toEqual(["source.python","meta.member.access.python","meta.attribute.python"]); expect(tokens[6][6].value).toBe(","); expect(tokens[6][6].scopes).toEqual(["source.python","punctuation.separator.element.python"]); expect(tokens[6][7].value).toBe(" "); @@ -1143,9 +1244,9 @@ describe("Grammar Tests", function() { expect(tokens[7][9].value).toBe("sys"); expect(tokens[7][9].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python"]); expect(tokens[7][10].value).toBe("."); - expect(tokens[7][10].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","punctuation.separator.period.python"]); + expect(tokens[7][10].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","meta.member.access.python","punctuation.separator.period.python"]); expect(tokens[7][11].value).toBe("stderr"); - expect(tokens[7][11].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python"]); + expect(tokens[7][11].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","meta.member.access.python","meta.attribute.python"]); expect(tokens[7][12].value).toBe(")"); expect(tokens[7][12].scopes).toEqual(["source.python","meta.function-call.python","punctuation.definition.arguments.end.python"]); expect(tokens[8][0].value).toBe("print"); @@ -1314,9 +1415,9 @@ describe("Grammar Tests", function() { expect(tokens[2][1].value).toBe("self"); expect(tokens[2][1].scopes).toEqual(["source.python","variable.language.special.self.python"]); expect(tokens[2][2].value).toBe("."); - expect(tokens[2][2].scopes).toEqual(["source.python","punctuation.separator.period.python"]); + expect(tokens[2][2].scopes).toEqual(["source.python","meta.member.access.python","punctuation.separator.period.python"]); expect(tokens[2][3].value).toBe("a"); - expect(tokens[2][3].scopes).toEqual(["source.python"]); + expect(tokens[2][3].scopes).toEqual(["source.python","meta.member.access.python","meta.attribute.python"]); expect(tokens[2][4].value).toBe(" "); expect(tokens[2][4].scopes).toEqual(["source.python"]); expect(tokens[2][5].value).toBe("="); @@ -1330,9 +1431,9 @@ describe("Grammar Tests", function() { expect(tokens[3][1].value).toBe("self"); expect(tokens[3][1].scopes).toEqual(["source.python","variable.language.special.self.python"]); expect(tokens[3][2].value).toBe("."); - expect(tokens[3][2].scopes).toEqual(["source.python","punctuation.separator.period.python"]); + expect(tokens[3][2].scopes).toEqual(["source.python","meta.member.access.python","punctuation.separator.period.python"]); expect(tokens[3][3].value).toBe("b"); - expect(tokens[3][3].scopes).toEqual(["source.python"]); + expect(tokens[3][3].scopes).toEqual(["source.python","meta.member.access.python","meta.attribute.python"]); expect(tokens[3][4].value).toBe(" "); expect(tokens[3][4].scopes).toEqual(["source.python"]); expect(tokens[3][5].value).toBe("="); @@ -1364,9 +1465,9 @@ describe("Grammar Tests", function() { expect(tokens[6][1].value).toBe("a"); expect(tokens[6][1].scopes).toEqual(["source.python"]); expect(tokens[6][2].value).toBe("."); - expect(tokens[6][2].scopes).toEqual(["source.python","punctuation.separator.period.python"]); + expect(tokens[6][2].scopes).toEqual(["source.python","meta.member.access.python","punctuation.separator.period.python"]); expect(tokens[6][3].value).toBe("self"); - expect(tokens[6][3].scopes).toEqual(["source.python"]); + expect(tokens[6][3].scopes).toEqual(["source.python","meta.member.access.python","meta.attribute.python"]); expect(tokens[6][4].value).toBe(" "); expect(tokens[6][4].scopes).toEqual(["source.python"]); expect(tokens[6][5].value).toBe("="); @@ -1380,13 +1481,13 @@ describe("Grammar Tests", function() { expect(tokens[7][1].value).toBe("a"); expect(tokens[7][1].scopes).toEqual(["source.python"]); expect(tokens[7][2].value).toBe("."); - expect(tokens[7][2].scopes).toEqual(["source.python","punctuation.separator.period.python"]); + expect(tokens[7][2].scopes).toEqual(["source.python","meta.member.access.python","punctuation.separator.period.python"]); expect(tokens[7][3].value).toBe("self"); - expect(tokens[7][3].scopes).toEqual(["source.python"]); + expect(tokens[7][3].scopes).toEqual(["source.python","meta.member.access.python","meta.attribute.python"]); expect(tokens[7][4].value).toBe("."); - expect(tokens[7][4].scopes).toEqual(["source.python","punctuation.separator.period.python"]); + expect(tokens[7][4].scopes).toEqual(["source.python","meta.member.access.python","punctuation.separator.period.python"]); expect(tokens[7][5].value).toBe("bar"); - expect(tokens[7][5].scopes).toEqual(["source.python"]); + expect(tokens[7][5].scopes).toEqual(["source.python","meta.member.access.python","meta.attribute.python"]); expect(tokens[7][6].value).toBe(" "); expect(tokens[7][6].scopes).toEqual(["source.python"]); expect(tokens[7][7].value).toBe("="); @@ -1461,9 +1562,9 @@ describe("Grammar Tests", function() { expect(tokens[3][1].value).toBe("cls"); expect(tokens[3][1].scopes).toEqual(["source.python","variable.language.special.cls.python"]); expect(tokens[3][2].value).toBe("."); - expect(tokens[3][2].scopes).toEqual(["source.python","punctuation.separator.period.python"]); + expect(tokens[3][2].scopes).toEqual(["source.python","meta.member.access.python","punctuation.separator.period.python"]); expect(tokens[3][3].value).toBe("a"); - expect(tokens[3][3].scopes).toEqual(["source.python"]); + expect(tokens[3][3].scopes).toEqual(["source.python","meta.member.access.python","meta.attribute.python"]); expect(tokens[3][4].value).toBe(" "); expect(tokens[3][4].scopes).toEqual(["source.python"]); expect(tokens[3][5].value).toBe("="); @@ -1477,9 +1578,9 @@ describe("Grammar Tests", function() { expect(tokens[4][1].value).toBe("cls"); expect(tokens[4][1].scopes).toEqual(["source.python","variable.language.special.cls.python"]); expect(tokens[4][2].value).toBe("."); - expect(tokens[4][2].scopes).toEqual(["source.python","punctuation.separator.period.python"]); + expect(tokens[4][2].scopes).toEqual(["source.python","meta.member.access.python","punctuation.separator.period.python"]); expect(tokens[4][3].value).toBe("b"); - expect(tokens[4][3].scopes).toEqual(["source.python"]); + expect(tokens[4][3].scopes).toEqual(["source.python","meta.member.access.python","meta.attribute.python"]); expect(tokens[4][4].value).toBe(" "); expect(tokens[4][4].scopes).toEqual(["source.python"]); expect(tokens[4][5].value).toBe("="); @@ -1523,9 +1624,9 @@ describe("Grammar Tests", function() { expect(tokens[8][1].value).toBe("a"); expect(tokens[8][1].scopes).toEqual(["source.python"]); expect(tokens[8][2].value).toBe("."); - expect(tokens[8][2].scopes).toEqual(["source.python","punctuation.separator.period.python"]); + expect(tokens[8][2].scopes).toEqual(["source.python","meta.member.access.python","punctuation.separator.period.python"]); expect(tokens[8][3].value).toBe("cls"); - expect(tokens[8][3].scopes).toEqual(["source.python"]); + expect(tokens[8][3].scopes).toEqual(["source.python","meta.member.access.python","meta.attribute.python"]); expect(tokens[8][4].value).toBe(" "); expect(tokens[8][4].scopes).toEqual(["source.python"]); expect(tokens[8][5].value).toBe("="); @@ -1539,13 +1640,13 @@ describe("Grammar Tests", function() { expect(tokens[9][1].value).toBe("a"); expect(tokens[9][1].scopes).toEqual(["source.python"]); expect(tokens[9][2].value).toBe("."); - expect(tokens[9][2].scopes).toEqual(["source.python","punctuation.separator.period.python"]); + expect(tokens[9][2].scopes).toEqual(["source.python","meta.member.access.python","punctuation.separator.period.python"]); expect(tokens[9][3].value).toBe("cls"); - expect(tokens[9][3].scopes).toEqual(["source.python"]); + expect(tokens[9][3].scopes).toEqual(["source.python","meta.member.access.python","meta.attribute.python"]); expect(tokens[9][4].value).toBe("."); - expect(tokens[9][4].scopes).toEqual(["source.python","punctuation.separator.period.python"]); + expect(tokens[9][4].scopes).toEqual(["source.python","meta.member.access.python","punctuation.separator.period.python"]); expect(tokens[9][5].value).toBe("__name__"); - expect(tokens[9][5].scopes).toEqual(["source.python","support.variable.magic.python"]); + expect(tokens[9][5].scopes).toEqual(["source.python","meta.member.access.python","support.variable.magic.python"]); expect(tokens[10][0].value).toBe(" "); expect(tokens[10][0].scopes).toEqual(["source.python"]); expect(tokens[10][1].value).toBe("cls"); @@ -1605,9 +1706,9 @@ describe("Grammar Tests", function() { expect(tokens[0][4].value).toBe("f"); expect(tokens[0][4].scopes).toEqual(["source.python","meta.class.python","meta.class.inheritance.python","entity.other.inherited-class.python"]); expect(tokens[0][5].value).toBe("."); - expect(tokens[0][5].scopes).toEqual(["source.python","meta.class.python","meta.class.inheritance.python","punctuation.separator.period.python"]); + expect(tokens[0][5].scopes).toEqual(["source.python","meta.class.python","meta.class.inheritance.python","meta.member.access.python","punctuation.separator.period.python"]); expect(tokens[0][6].value).toBe("Exception"); - expect(tokens[0][6].scopes).toEqual(["source.python","meta.class.python","meta.class.inheritance.python","entity.other.inherited-class.python"]); + expect(tokens[0][6].scopes).toEqual(["source.python","meta.class.python","meta.class.inheritance.python","meta.member.access.python","entity.other.inherited-class.python"]); expect(tokens[0][7].value).toBe(","); expect(tokens[0][7].scopes).toEqual(["source.python","meta.class.python","meta.class.inheritance.python","punctuation.separator.inheritance.python"]); expect(tokens[0][8].value).toBe(" "); @@ -1615,9 +1716,9 @@ describe("Grammar Tests", function() { expect(tokens[0][9].value).toBe("f"); expect(tokens[0][9].scopes).toEqual(["source.python","meta.class.python","meta.class.inheritance.python","entity.other.inherited-class.python"]); expect(tokens[0][10].value).toBe("."); - expect(tokens[0][10].scopes).toEqual(["source.python","meta.class.python","meta.class.inheritance.python","punctuation.separator.period.python"]); + expect(tokens[0][10].scopes).toEqual(["source.python","meta.class.python","meta.class.inheritance.python","meta.member.access.python","punctuation.separator.period.python"]); expect(tokens[0][11].value).toBe("type"); - expect(tokens[0][11].scopes).toEqual(["source.python","meta.class.python","meta.class.inheritance.python","entity.other.inherited-class.python"]); + expect(tokens[0][11].scopes).toEqual(["source.python","meta.class.python","meta.class.inheritance.python","meta.member.access.python","entity.other.inherited-class.python"]); expect(tokens[0][12].value).toBe(","); expect(tokens[0][12].scopes).toEqual(["source.python","meta.class.python","meta.class.inheritance.python","punctuation.separator.inheritance.python"]); expect(tokens[0][13].value).toBe(" "); @@ -1631,9 +1732,9 @@ describe("Grammar Tests", function() { expect(tokens[0][17].value).toBe("Exception"); expect(tokens[0][17].scopes).toEqual(["source.python","meta.class.python","meta.class.inheritance.python","support.type.exception.python"]); expect(tokens[0][18].value).toBe("."); - expect(tokens[0][18].scopes).toEqual(["source.python","meta.class.python","meta.class.inheritance.python","punctuation.separator.period.python"]); + expect(tokens[0][18].scopes).toEqual(["source.python","meta.class.python","meta.class.inheritance.python","meta.member.access.python","punctuation.separator.period.python"]); expect(tokens[0][19].value).toBe("a"); - expect(tokens[0][19].scopes).toEqual(["source.python","meta.class.python","meta.class.inheritance.python","entity.other.inherited-class.python"]); + expect(tokens[0][19].scopes).toEqual(["source.python","meta.class.python","meta.class.inheritance.python","meta.member.access.python","entity.other.inherited-class.python"]); expect(tokens[0][20].value).toBe(","); expect(tokens[0][20].scopes).toEqual(["source.python","meta.class.python","meta.class.inheritance.python","punctuation.separator.inheritance.python"]); expect(tokens[0][21].value).toBe(" "); @@ -1758,9 +1859,9 @@ describe("Grammar Tests", function() { expect(tokens[2][4].value).toBe("Foo"); expect(tokens[2][4].scopes).toEqual(["source.python","meta.class.python","meta.class.inheritance.python","entity.other.inherited-class.python"]); expect(tokens[2][5].value).toBe("."); - expect(tokens[2][5].scopes).toEqual(["source.python","meta.class.python","meta.class.inheritance.python","punctuation.separator.period.python"]); + expect(tokens[2][5].scopes).toEqual(["source.python","meta.class.python","meta.class.inheritance.python","meta.member.access.python","punctuation.separator.period.python"]); expect(tokens[2][6].value).toBe("Bar"); - expect(tokens[2][6].scopes).toEqual(["source.python","meta.class.python","meta.class.inheritance.python","entity.other.inherited-class.python"]); + expect(tokens[2][6].scopes).toEqual(["source.python","meta.class.python","meta.class.inheritance.python","meta.member.access.python","entity.other.inherited-class.python"]); expect(tokens[2][7].value).toBe(","); expect(tokens[2][7].scopes).toEqual(["source.python","meta.class.python","meta.class.inheritance.python","punctuation.separator.inheritance.python"]); expect(tokens[2][8].value).toBe(" "); @@ -1768,9 +1869,9 @@ describe("Grammar Tests", function() { expect(tokens[2][9].value).toBe("Bar"); expect(tokens[2][9].scopes).toEqual(["source.python","meta.class.python","meta.class.inheritance.python","entity.other.inherited-class.python"]); expect(tokens[2][10].value).toBe("."); - expect(tokens[2][10].scopes).toEqual(["source.python","meta.class.python","meta.class.inheritance.python","punctuation.separator.period.python"]); + expect(tokens[2][10].scopes).toEqual(["source.python","meta.class.python","meta.class.inheritance.python","meta.member.access.python","punctuation.separator.period.python"]); expect(tokens[2][11].value).toBe("name"); - expect(tokens[2][11].scopes).toEqual(["source.python","meta.class.python","meta.class.inheritance.python","entity.other.inherited-class.python"]); + expect(tokens[2][11].scopes).toEqual(["source.python","meta.class.python","meta.class.inheritance.python","meta.member.access.python","entity.other.inherited-class.python"]); expect(tokens[2][12].value).toBe("="); expect(tokens[2][12].scopes).toEqual(["source.python","meta.class.python","meta.class.inheritance.python","keyword.operator.assignment.python"]); expect(tokens[2][13].value).toBe("{"); @@ -1985,7 +2086,7 @@ describe("Grammar Tests", function() { it("test/classes/class9.py", function() { - tokens = grammar.tokenizeLines("class Foo:\n __slots__ = ()") + tokens = grammar.tokenizeLines("class Foo:\n __slots__ = ()\n __match_args__ = ('key', 'name')") expect(tokens[0][0].value).toBe("class"); expect(tokens[0][0].scopes).toEqual(["source.python","meta.class.python","storage.type.class.python"]); expect(tokens[0][1].value).toBe(" "); @@ -2008,6 +2109,36 @@ describe("Grammar Tests", function() { expect(tokens[1][5].scopes).toEqual(["source.python","punctuation.parenthesis.begin.python"]); expect(tokens[1][6].value).toBe(")"); expect(tokens[1][6].scopes).toEqual(["source.python","punctuation.parenthesis.end.python"]); + expect(tokens[2][0].value).toBe(" "); + expect(tokens[2][0].scopes).toEqual(["source.python"]); + expect(tokens[2][1].value).toBe("__match_args__"); + expect(tokens[2][1].scopes).toEqual(["source.python","support.variable.magic.python"]); + expect(tokens[2][2].value).toBe(" "); + expect(tokens[2][2].scopes).toEqual(["source.python"]); + expect(tokens[2][3].value).toBe("="); + expect(tokens[2][3].scopes).toEqual(["source.python","keyword.operator.assignment.python"]); + expect(tokens[2][4].value).toBe(" "); + expect(tokens[2][4].scopes).toEqual(["source.python"]); + expect(tokens[2][5].value).toBe("("); + expect(tokens[2][5].scopes).toEqual(["source.python","punctuation.parenthesis.begin.python"]); + expect(tokens[2][6].value).toBe("'"); + expect(tokens[2][6].scopes).toEqual(["source.python","string.quoted.single.python","punctuation.definition.string.begin.python"]); + expect(tokens[2][7].value).toBe("key"); + expect(tokens[2][7].scopes).toEqual(["source.python","string.quoted.single.python"]); + expect(tokens[2][8].value).toBe("'"); + expect(tokens[2][8].scopes).toEqual(["source.python","string.quoted.single.python","punctuation.definition.string.end.python"]); + expect(tokens[2][9].value).toBe(","); + expect(tokens[2][9].scopes).toEqual(["source.python","punctuation.separator.element.python"]); + expect(tokens[2][10].value).toBe(" "); + expect(tokens[2][10].scopes).toEqual(["source.python"]); + expect(tokens[2][11].value).toBe("'"); + expect(tokens[2][11].scopes).toEqual(["source.python","string.quoted.single.python","punctuation.definition.string.begin.python"]); + expect(tokens[2][12].value).toBe("name"); + expect(tokens[2][12].scopes).toEqual(["source.python","string.quoted.single.python"]); + expect(tokens[2][13].value).toBe("'"); + expect(tokens[2][13].scopes).toEqual(["source.python","string.quoted.single.python","punctuation.definition.string.end.python"]); + expect(tokens[2][14].value).toBe(")"); + expect(tokens[2][14].scopes).toEqual(["source.python","punctuation.parenthesis.end.python"]); }); it("test/classes/super1.py", @@ -2046,19 +2177,19 @@ describe("Grammar Tests", function() { expect(tokens[2][3].value).toBe(")"); expect(tokens[2][3].scopes).toEqual(["source.python","meta.function-call.python","punctuation.definition.arguments.end.python"]); expect(tokens[2][4].value).toBe("."); - expect(tokens[2][4].scopes).toEqual(["source.python","punctuation.separator.period.python"]); + expect(tokens[2][4].scopes).toEqual(["source.python","meta.member.access.python","punctuation.separator.period.python"]); expect(tokens[2][5].value).toBe("__init__"); - expect(tokens[2][5].scopes).toEqual(["source.python","meta.function-call.python","support.function.magic.python"]); + expect(tokens[2][5].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","support.function.magic.python"]); expect(tokens[2][6].value).toBe("("); - expect(tokens[2][6].scopes).toEqual(["source.python","meta.function-call.python","punctuation.definition.arguments.begin.python"]); + expect(tokens[2][6].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","punctuation.definition.arguments.begin.python"]); expect(tokens[2][7].value).toBe("foo"); - expect(tokens[2][7].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","variable.parameter.function-call.python"]); + expect(tokens[2][7].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","variable.parameter.function-call.python"]); expect(tokens[2][8].value).toBe("="); - expect(tokens[2][8].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","keyword.operator.assignment.python"]); + expect(tokens[2][8].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","keyword.operator.assignment.python"]); expect(tokens[2][9].value).toBe("1"); - expect(tokens[2][9].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","constant.numeric.dec.python"]); + expect(tokens[2][9].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","constant.numeric.dec.python"]); expect(tokens[2][10].value).toBe(")"); - expect(tokens[2][10].scopes).toEqual(["source.python","meta.function-call.python","punctuation.definition.arguments.end.python"]); + expect(tokens[2][10].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","punctuation.definition.arguments.end.python"]); expect(tokens[3][0].value).toBe(" "); expect(tokens[3][0].scopes).toEqual(["source.python"]); expect(tokens[3][1].value).toBe("super"); @@ -2068,21 +2199,21 @@ describe("Grammar Tests", function() { expect(tokens[3][3].value).toBe(")"); expect(tokens[3][3].scopes).toEqual(["source.python","meta.function-call.python","punctuation.definition.arguments.end.python"]); expect(tokens[3][4].value).toBe("."); - expect(tokens[3][4].scopes).toEqual(["source.python","punctuation.separator.period.python"]); + expect(tokens[3][4].scopes).toEqual(["source.python","meta.member.access.python","punctuation.separator.period.python"]); expect(tokens[3][5].value).toBe(" "); - expect(tokens[3][5].scopes).toEqual(["source.python"]); + expect(tokens[3][5].scopes).toEqual(["source.python","meta.member.access.python"]); expect(tokens[3][6].value).toBe("__init__"); - expect(tokens[3][6].scopes).toEqual(["source.python","meta.function-call.python","support.function.magic.python"]); + expect(tokens[3][6].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","support.function.magic.python"]); expect(tokens[3][7].value).toBe("("); - expect(tokens[3][7].scopes).toEqual(["source.python","meta.function-call.python","punctuation.definition.arguments.begin.python"]); + expect(tokens[3][7].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","punctuation.definition.arguments.begin.python"]); expect(tokens[3][8].value).toBe("foo"); - expect(tokens[3][8].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","variable.parameter.function-call.python"]); + expect(tokens[3][8].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","variable.parameter.function-call.python"]); expect(tokens[3][9].value).toBe("="); - expect(tokens[3][9].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","keyword.operator.assignment.python"]); + expect(tokens[3][9].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","keyword.operator.assignment.python"]); expect(tokens[3][10].value).toBe("1"); - expect(tokens[3][10].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","constant.numeric.dec.python"]); + expect(tokens[3][10].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","constant.numeric.dec.python"]); expect(tokens[3][11].value).toBe(")"); - expect(tokens[3][11].scopes).toEqual(["source.python","meta.function-call.python","punctuation.definition.arguments.end.python"]); + expect(tokens[3][11].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","punctuation.definition.arguments.end.python"]); expect(tokens[4][0].value).toBe(" "); expect(tokens[4][0].scopes).toEqual(["source.python"]); expect(tokens[4][1].value).toBe("super"); @@ -2092,25 +2223,25 @@ describe("Grammar Tests", function() { expect(tokens[4][3].value).toBe(")"); expect(tokens[4][3].scopes).toEqual(["source.python","meta.function-call.python","punctuation.definition.arguments.end.python"]); expect(tokens[4][4].value).toBe("."); - expect(tokens[4][4].scopes).toEqual(["source.python","punctuation.separator.period.python"]); + expect(tokens[4][4].scopes).toEqual(["source.python","meta.member.access.python","punctuation.separator.period.python"]); expect(tokens[4][5].value).toBe(" "); - expect(tokens[4][5].scopes).toEqual(["source.python"]); + expect(tokens[4][5].scopes).toEqual(["source.python","meta.member.access.python"]); expect(tokens[4][6].value).toBe("\\"); - expect(tokens[4][6].scopes).toEqual(["source.python","punctuation.separator.continuation.line.python"]); + expect(tokens[4][6].scopes).toEqual(["source.python","meta.member.access.python","punctuation.separator.continuation.line.python"]); expect(tokens[4][7].value).toBe(""); - expect(tokens[4][7].scopes).toEqual(["source.python"]); + expect(tokens[4][7].scopes).toEqual(["source.python","meta.member.access.python"]); expect(tokens[5][0].value).toBe("__init__"); - expect(tokens[5][0].scopes).toEqual(["source.python","meta.function-call.python","support.function.magic.python"]); + expect(tokens[5][0].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","support.function.magic.python"]); expect(tokens[5][1].value).toBe("("); - expect(tokens[5][1].scopes).toEqual(["source.python","meta.function-call.python","punctuation.definition.arguments.begin.python"]); + expect(tokens[5][1].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","punctuation.definition.arguments.begin.python"]); expect(tokens[5][2].value).toBe("foo"); - expect(tokens[5][2].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","variable.parameter.function-call.python"]); + expect(tokens[5][2].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","variable.parameter.function-call.python"]); expect(tokens[5][3].value).toBe("="); - expect(tokens[5][3].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","keyword.operator.assignment.python"]); + expect(tokens[5][3].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","keyword.operator.assignment.python"]); expect(tokens[5][4].value).toBe("1"); - expect(tokens[5][4].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","constant.numeric.dec.python"]); + expect(tokens[5][4].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","constant.numeric.dec.python"]); expect(tokens[5][5].value).toBe(")"); - expect(tokens[5][5].scopes).toEqual(["source.python","meta.function-call.python","punctuation.definition.arguments.end.python"]); + expect(tokens[5][5].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","punctuation.definition.arguments.end.python"]); expect(tokens[6][0].value).toBe(" "); expect(tokens[6][0].scopes).toEqual(["source.python"]); expect(tokens[6][1].value).toBe("__init__"); @@ -2132,19 +2263,19 @@ describe("Grammar Tests", function() { expect(tokens[8][1].value).toBe("foo"); expect(tokens[8][1].scopes).toEqual(["source.python"]); expect(tokens[8][2].value).toBe("."); - expect(tokens[8][2].scopes).toEqual(["source.python","punctuation.separator.period.python"]); + expect(tokens[8][2].scopes).toEqual(["source.python","meta.member.access.python","punctuation.separator.period.python"]); expect(tokens[8][3].value).toBe("__init__"); - expect(tokens[8][3].scopes).toEqual(["source.python","meta.function-call.python","support.function.magic.python"]); + expect(tokens[8][3].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","support.function.magic.python"]); expect(tokens[8][4].value).toBe("("); - expect(tokens[8][4].scopes).toEqual(["source.python","meta.function-call.python","punctuation.definition.arguments.begin.python"]); + expect(tokens[8][4].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","punctuation.definition.arguments.begin.python"]); expect(tokens[8][5].value).toBe("bar"); - expect(tokens[8][5].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","variable.parameter.function-call.python"]); + expect(tokens[8][5].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","variable.parameter.function-call.python"]); expect(tokens[8][6].value).toBe("="); - expect(tokens[8][6].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","keyword.operator.assignment.python"]); + expect(tokens[8][6].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","keyword.operator.assignment.python"]); expect(tokens[8][7].value).toBe("1"); - expect(tokens[8][7].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","constant.numeric.dec.python"]); + expect(tokens[8][7].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","constant.numeric.dec.python"]); expect(tokens[8][8].value).toBe(")"); - expect(tokens[8][8].scopes).toEqual(["source.python","meta.function-call.python","punctuation.definition.arguments.end.python"]); + expect(tokens[8][8].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","punctuation.definition.arguments.end.python"]); expect(tokens[9][0].value).toBe(" "); expect(tokens[9][0].scopes).toEqual(["source.python"]); expect(tokens[9][1].value).toBe("__init__"); @@ -5069,17 +5200,17 @@ describe("Grammar Tests", function() { expect(tokens[0][8].value).toBe("QQQ"); expect(tokens[0][8].scopes).toEqual(["source.python","constant.other.caps.python"]); expect(tokens[0][9].value).toBe("."); - expect(tokens[0][9].scopes).toEqual(["source.python","punctuation.separator.period.python"]); + expect(tokens[0][9].scopes).toEqual(["source.python","meta.member.access.python","punctuation.separator.period.python"]); expect(tokens[0][10].value).toBe("bar"); - expect(tokens[0][10].scopes).toEqual(["source.python"]); + expect(tokens[0][10].scopes).toEqual(["source.python","meta.member.access.python","meta.attribute.python"]); expect(tokens[0][11].value).toBe(" "); expect(tokens[0][11].scopes).toEqual(["source.python"]); expect(tokens[0][12].value).toBe("baz"); expect(tokens[0][12].scopes).toEqual(["source.python"]); expect(tokens[0][13].value).toBe("."); - expect(tokens[0][13].scopes).toEqual(["source.python","punctuation.separator.period.python"]); + expect(tokens[0][13].scopes).toEqual(["source.python","meta.member.access.python","punctuation.separator.period.python"]); expect(tokens[0][14].value).toBe("AA_a"); - expect(tokens[0][14].scopes).toEqual(["source.python","constant.other.caps.python"]); + expect(tokens[0][14].scopes).toEqual(["source.python","meta.member.access.python","constant.other.caps.python"]); expect(tokens[0][15].value).toBe(" "); expect(tokens[0][15].scopes).toEqual(["source.python"]); expect(tokens[0][16].value).toBe("_AAA"); @@ -5089,9 +5220,9 @@ describe("Grammar Tests", function() { expect(tokens[0][18].value).toBe("foo"); expect(tokens[0][18].scopes).toEqual(["source.python"]); expect(tokens[0][19].value).toBe("."); - expect(tokens[0][19].scopes).toEqual(["source.python","punctuation.separator.period.python"]); + expect(tokens[0][19].scopes).toEqual(["source.python","meta.member.access.python","punctuation.separator.period.python"]); expect(tokens[0][20].value).toBe("_AAA"); - expect(tokens[0][20].scopes).toEqual(["source.python","constant.other.caps.python"]); + expect(tokens[0][20].scopes).toEqual(["source.python","meta.member.access.python","constant.other.caps.python"]); expect(tokens[1][0].value).toBe("QQQq"); expect(tokens[1][0].scopes).toEqual(["source.python"]); expect(tokens[1][1].value).toBe(" "); @@ -5103,13 +5234,13 @@ describe("Grammar Tests", function() { expect(tokens[1][4].value).toBe("self"); expect(tokens[1][4].scopes).toEqual(["source.python","variable.language.special.self.python"]); expect(tokens[1][5].value).toBe("."); - expect(tokens[1][5].scopes).toEqual(["source.python","punctuation.separator.period.python"]); + expect(tokens[1][5].scopes).toEqual(["source.python","meta.member.access.python","punctuation.separator.period.python"]); expect(tokens[1][6].value).toBe("FOOO"); - expect(tokens[1][6].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.generic.python"]); + expect(tokens[1][6].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.generic.python"]); expect(tokens[1][7].value).toBe("("); - expect(tokens[1][7].scopes).toEqual(["source.python","meta.function-call.python","punctuation.definition.arguments.begin.python"]); + expect(tokens[1][7].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","punctuation.definition.arguments.begin.python"]); expect(tokens[1][8].value).toBe(")"); - expect(tokens[1][8].scopes).toEqual(["source.python","meta.function-call.python","punctuation.definition.arguments.end.python"]); + expect(tokens[1][8].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","punctuation.definition.arguments.end.python"]); expect(tokens[1][9].value).toBe(" "); expect(tokens[1][9].scopes).toEqual(["source.python"]); expect(tokens[1][10].value).toBe("_"); @@ -5373,9 +5504,9 @@ describe("Grammar Tests", function() { expect(tokens[3][0].value).toBe("..."); expect(tokens[3][0].scopes).toEqual(["source.python","constant.other.ellipsis.python"]); expect(tokens[3][1].value).toBe("."); - expect(tokens[3][1].scopes).toEqual(["source.python","punctuation.separator.period.python"]); + expect(tokens[3][1].scopes).toEqual(["source.python","meta.member.access.python","punctuation.separator.period.python"]); expect(tokens[3][2].value).toBe("__class__"); - expect(tokens[3][2].scopes).toEqual(["source.python","support.variable.magic.python"]); + expect(tokens[3][2].scopes).toEqual(["source.python","meta.member.access.python","support.variable.magic.python"]); }); it("test/expressions/expr11.py", @@ -5392,19 +5523,19 @@ describe("Grammar Tests", function() { expect(tokens[0][4].value).toBe("self"); expect(tokens[0][4].scopes).toEqual(["source.python","variable.language.special.self.python"]); expect(tokens[0][5].value).toBe("."); - expect(tokens[0][5].scopes).toEqual(["source.python","punctuation.separator.period.python"]); + expect(tokens[0][5].scopes).toEqual(["source.python","meta.member.access.python","punctuation.separator.period.python"]); expect(tokens[0][6].value).toBe("some_list"); - expect(tokens[0][6].scopes).toEqual(["source.python","meta.item-access.python"]); + expect(tokens[0][6].scopes).toEqual(["source.python","meta.member.access.python","meta.item-access.python","meta.indexed-name.python"]); expect(tokens[0][7].value).toBe("["); - expect(tokens[0][7].scopes).toEqual(["source.python","meta.item-access.python","punctuation.definition.arguments.begin.python"]); + expect(tokens[0][7].scopes).toEqual(["source.python","meta.member.access.python","meta.item-access.python","punctuation.definition.arguments.begin.python"]); expect(tokens[0][8].value).toBe("1"); - expect(tokens[0][8].scopes).toEqual(["source.python","meta.item-access.python","meta.item-access.arguments.python","constant.numeric.dec.python"]); + expect(tokens[0][8].scopes).toEqual(["source.python","meta.member.access.python","meta.item-access.python","meta.item-access.arguments.python","constant.numeric.dec.python"]); expect(tokens[0][9].value).toBe(":"); - expect(tokens[0][9].scopes).toEqual(["source.python","meta.item-access.python","meta.item-access.arguments.python","punctuation.separator.slice.python"]); + expect(tokens[0][9].scopes).toEqual(["source.python","meta.member.access.python","meta.item-access.python","meta.item-access.arguments.python","punctuation.separator.slice.python"]); expect(tokens[0][10].value).toBe("2"); - expect(tokens[0][10].scopes).toEqual(["source.python","meta.item-access.python","meta.item-access.arguments.python","constant.numeric.dec.python"]); + expect(tokens[0][10].scopes).toEqual(["source.python","meta.member.access.python","meta.item-access.python","meta.item-access.arguments.python","constant.numeric.dec.python"]); expect(tokens[0][11].value).toBe("]"); - expect(tokens[0][11].scopes).toEqual(["source.python","meta.item-access.python","punctuation.definition.arguments.end.python"]); + expect(tokens[0][11].scopes).toEqual(["source.python","meta.member.access.python","meta.item-access.python","punctuation.definition.arguments.end.python"]); }); it("test/expressions/expr12.py", @@ -5468,9 +5599,9 @@ describe("Grammar Tests", function() { expect(tokens[0][0].value).toBe("foofrom"); expect(tokens[0][0].scopes).toEqual(["source.python"]); expect(tokens[0][1].value).toBe("."); - expect(tokens[0][1].scopes).toEqual(["source.python","punctuation.separator.period.python"]); + expect(tokens[0][1].scopes).toEqual(["source.python","meta.member.access.python","punctuation.separator.period.python"]); expect(tokens[0][2].value).toBe("something"); - expect(tokens[0][2].scopes).toEqual(["source.python"]); + expect(tokens[0][2].scopes).toEqual(["source.python","meta.member.access.python","meta.attribute.python"]); }); it("test/expressions/expr16.py", @@ -5539,15 +5670,15 @@ describe("Grammar Tests", function() { expect(tokens[0][0].value).toBe("a"); expect(tokens[0][0].scopes).toEqual(["source.python"]); expect(tokens[0][1].value).toBe("."); - expect(tokens[0][1].scopes).toEqual(["source.python","punctuation.separator.period.python"]); + expect(tokens[0][1].scopes).toEqual(["source.python","meta.member.access.python","punctuation.separator.period.python"]); expect(tokens[0][2].value).toBe("Exception"); - expect(tokens[0][2].scopes).toEqual(["source.python"]); + expect(tokens[0][2].scopes).toEqual(["source.python","meta.member.access.python","meta.attribute.python"]); expect(tokens[1][0].value).toBe("Exception"); expect(tokens[1][0].scopes).toEqual(["source.python","support.type.exception.python"]); expect(tokens[1][1].value).toBe("."); - expect(tokens[1][1].scopes).toEqual(["source.python","punctuation.separator.period.python"]); + expect(tokens[1][1].scopes).toEqual(["source.python","meta.member.access.python","punctuation.separator.period.python"]); expect(tokens[1][2].value).toBe("a"); - expect(tokens[1][2].scopes).toEqual(["source.python"]); + expect(tokens[1][2].scopes).toEqual(["source.python","meta.member.access.python","meta.attribute.python"]); }); it("test/expressions/expr19.py", @@ -5556,9 +5687,9 @@ describe("Grammar Tests", function() { expect(tokens[0][0].value).toBe("a"); expect(tokens[0][0].scopes).toEqual(["source.python"]); expect(tokens[0][1].value).toBe("."); - expect(tokens[0][1].scopes).toEqual(["source.python","punctuation.separator.period.python"]); + expect(tokens[0][1].scopes).toEqual(["source.python","meta.member.access.python","punctuation.separator.period.python"]); expect(tokens[0][2].value).toBe(" "); - expect(tokens[0][2].scopes).toEqual(["source.python"]); + expect(tokens[0][2].scopes).toEqual(["source.python","meta.member.access.python"]); expect(tokens[0][3].value).toBe("#"); expect(tokens[0][3].scopes).toEqual(["source.python","comment.line.number-sign.python","punctuation.definition.comment.python"]); expect(tokens[0][4].value).toBe("foo"); @@ -5566,9 +5697,9 @@ describe("Grammar Tests", function() { expect(tokens[1][0].value).toBe("a"); expect(tokens[1][0].scopes).toEqual(["source.python"]); expect(tokens[1][1].value).toBe("."); - expect(tokens[1][1].scopes).toEqual(["source.python","punctuation.separator.period.python"]); + expect(tokens[1][1].scopes).toEqual(["source.python","meta.member.access.python","punctuation.separator.period.python"]); expect(tokens[1][2].value).toBe(""); - expect(tokens[1][2].scopes).toEqual(["source.python"]); + expect(tokens[1][2].scopes).toEqual(["source.python","meta.member.access.python"]); expect(tokens[2][0].value).toBe("#"); expect(tokens[2][0].scopes).toEqual(["source.python","comment.line.number-sign.python","punctuation.definition.comment.python"]); expect(tokens[2][1].value).toBe("foo"); @@ -5576,13 +5707,13 @@ describe("Grammar Tests", function() { expect(tokens[3][0].value).toBe("a"); expect(tokens[3][0].scopes).toEqual(["source.python"]); expect(tokens[3][1].value).toBe("."); - expect(tokens[3][1].scopes).toEqual(["source.python","punctuation.separator.period.python"]); + expect(tokens[3][1].scopes).toEqual(["source.python","meta.member.access.python","punctuation.separator.period.python"]); expect(tokens[3][2].value).toBe(" "); - expect(tokens[3][2].scopes).toEqual(["source.python"]); + expect(tokens[3][2].scopes).toEqual(["source.python","meta.member.access.python"]); expect(tokens[3][3].value).toBe("\\"); - expect(tokens[3][3].scopes).toEqual(["source.python","punctuation.separator.continuation.line.python"]); + expect(tokens[3][3].scopes).toEqual(["source.python","meta.member.access.python","punctuation.separator.continuation.line.python"]); expect(tokens[3][4].value).toBe(""); - expect(tokens[3][4].scopes).toEqual(["source.python"]); + expect(tokens[3][4].scopes).toEqual(["source.python","meta.member.access.python"]); expect(tokens[4][0].value).toBe("#"); expect(tokens[4][0].scopes).toEqual(["source.python","comment.line.number-sign.python","punctuation.definition.comment.python"]); expect(tokens[4][1].value).toBe("foo"); @@ -5590,9 +5721,9 @@ describe("Grammar Tests", function() { expect(tokens[5][0].value).toBe("a"); expect(tokens[5][0].scopes).toEqual(["source.python"]); expect(tokens[5][1].value).toBe("."); - expect(tokens[5][1].scopes).toEqual(["source.python","punctuation.separator.period.python"]); + expect(tokens[5][1].scopes).toEqual(["source.python","meta.member.access.python","punctuation.separator.period.python"]); expect(tokens[5][2].value).toBe(" "); - expect(tokens[5][2].scopes).toEqual(["source.python"]); + expect(tokens[5][2].scopes).toEqual(["source.python","meta.member.access.python"]); expect(tokens[5][3].value).toBe("'"); expect(tokens[5][3].scopes).toEqual(["source.python","string.quoted.single.python","punctuation.definition.string.begin.python"]); expect(tokens[5][4].value).toBe("bar"); @@ -5602,9 +5733,9 @@ describe("Grammar Tests", function() { expect(tokens[6][0].value).toBe("a"); expect(tokens[6][0].scopes).toEqual(["source.python"]); expect(tokens[6][1].value).toBe("."); - expect(tokens[6][1].scopes).toEqual(["source.python","punctuation.separator.period.python"]); + expect(tokens[6][1].scopes).toEqual(["source.python","meta.member.access.python","punctuation.separator.period.python"]); expect(tokens[6][2].value).toBe(""); - expect(tokens[6][2].scopes).toEqual(["source.python"]); + expect(tokens[6][2].scopes).toEqual(["source.python","meta.member.access.python"]); expect(tokens[7][0].value).toBe("'"); expect(tokens[7][0].scopes).toEqual(["source.python","string.quoted.docstring.single.python","punctuation.definition.string.begin.python"]); expect(tokens[7][1].value).toBe("bar"); @@ -5614,19 +5745,19 @@ describe("Grammar Tests", function() { expect(tokens[8][0].value).toBe("a"); expect(tokens[8][0].scopes).toEqual(["source.python"]); expect(tokens[8][1].value).toBe("."); - expect(tokens[8][1].scopes).toEqual(["source.python","punctuation.separator.period.python"]); + expect(tokens[8][1].scopes).toEqual(["source.python","meta.member.access.python","punctuation.separator.period.python"]); expect(tokens[8][2].value).toBe(" "); - expect(tokens[8][2].scopes).toEqual(["source.python"]); + expect(tokens[8][2].scopes).toEqual(["source.python","meta.member.access.python"]); expect(tokens[8][3].value).toBe("\\"); - expect(tokens[8][3].scopes).toEqual(["source.python","punctuation.separator.continuation.line.python"]); + expect(tokens[8][3].scopes).toEqual(["source.python","meta.member.access.python","punctuation.separator.continuation.line.python"]); expect(tokens[8][4].value).toBe(""); - expect(tokens[8][4].scopes).toEqual(["source.python"]); + expect(tokens[8][4].scopes).toEqual(["source.python","meta.member.access.python"]); expect(tokens[9][0].value).toBe("'"); - expect(tokens[9][0].scopes).toEqual(["source.python","string.quoted.single.python","punctuation.definition.string.begin.python"]); + expect(tokens[9][0].scopes).toEqual(["source.python","meta.member.access.python","string.quoted.single.python","punctuation.definition.string.begin.python"]); expect(tokens[9][1].value).toBe("bar"); - expect(tokens[9][1].scopes).toEqual(["source.python","string.quoted.single.python"]); + expect(tokens[9][1].scopes).toEqual(["source.python","meta.member.access.python","string.quoted.single.python"]); expect(tokens[9][2].value).toBe("'"); - expect(tokens[9][2].scopes).toEqual(["source.python","string.quoted.single.python","punctuation.definition.string.end.python"]); + expect(tokens[9][2].scopes).toEqual(["source.python","meta.member.access.python","string.quoted.single.python","punctuation.definition.string.end.python"]); }); it("test/expressions/expr2.py", @@ -5729,6 +5860,134 @@ describe("Grammar Tests", function() { expect(tokens[5][4].scopes).toEqual(["source.python"]); }); + it("test/expressions/expr21.py", + function() { + tokens = grammar.tokenizeLines("while chunk := file.read(8192):\n process(chunk)\n y0 = (y1 := f(x))") + expect(tokens[0][0].value).toBe("while"); + expect(tokens[0][0].scopes).toEqual(["source.python","keyword.control.flow.python"]); + expect(tokens[0][1].value).toBe(" "); + expect(tokens[0][1].scopes).toEqual(["source.python"]); + expect(tokens[0][2].value).toBe("chunk"); + expect(tokens[0][2].scopes).toEqual(["source.python"]); + expect(tokens[0][3].value).toBe(" "); + expect(tokens[0][3].scopes).toEqual(["source.python"]); + expect(tokens[0][4].value).toBe(":="); + expect(tokens[0][4].scopes).toEqual(["source.python","keyword.operator.assignment.python"]); + expect(tokens[0][5].value).toBe(" "); + expect(tokens[0][5].scopes).toEqual(["source.python"]); + expect(tokens[0][6].value).toBe("file"); + expect(tokens[0][6].scopes).toEqual(["source.python","variable.legacy.builtin.python"]); + expect(tokens[0][7].value).toBe("."); + expect(tokens[0][7].scopes).toEqual(["source.python","meta.member.access.python","punctuation.separator.period.python"]); + expect(tokens[0][8].value).toBe("read"); + expect(tokens[0][8].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.generic.python"]); + expect(tokens[0][9].value).toBe("("); + expect(tokens[0][9].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","punctuation.definition.arguments.begin.python"]); + expect(tokens[0][10].value).toBe("8192"); + expect(tokens[0][10].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","constant.numeric.dec.python"]); + expect(tokens[0][11].value).toBe(")"); + expect(tokens[0][11].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","punctuation.definition.arguments.end.python"]); + expect(tokens[0][12].value).toBe(":"); + expect(tokens[0][12].scopes).toEqual(["source.python","punctuation.separator.colon.python"]); + expect(tokens[1][0].value).toBe(" "); + expect(tokens[1][0].scopes).toEqual(["source.python"]); + expect(tokens[1][1].value).toBe("process"); + expect(tokens[1][1].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.generic.python"]); + expect(tokens[1][2].value).toBe("("); + expect(tokens[1][2].scopes).toEqual(["source.python","meta.function-call.python","punctuation.definition.arguments.begin.python"]); + expect(tokens[1][3].value).toBe("chunk"); + expect(tokens[1][3].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python"]); + expect(tokens[1][4].value).toBe(")"); + expect(tokens[1][4].scopes).toEqual(["source.python","meta.function-call.python","punctuation.definition.arguments.end.python"]); + expect(tokens[2][0].value).toBe(" "); + expect(tokens[2][0].scopes).toEqual(["source.python"]); + expect(tokens[2][1].value).toBe("y0"); + expect(tokens[2][1].scopes).toEqual(["source.python"]); + expect(tokens[2][2].value).toBe(" "); + expect(tokens[2][2].scopes).toEqual(["source.python"]); + expect(tokens[2][3].value).toBe("="); + expect(tokens[2][3].scopes).toEqual(["source.python","keyword.operator.assignment.python"]); + expect(tokens[2][4].value).toBe(" "); + expect(tokens[2][4].scopes).toEqual(["source.python"]); + expect(tokens[2][5].value).toBe("("); + expect(tokens[2][5].scopes).toEqual(["source.python","punctuation.parenthesis.begin.python"]); + expect(tokens[2][6].value).toBe("y1"); + expect(tokens[2][6].scopes).toEqual(["source.python"]); + expect(tokens[2][7].value).toBe(" "); + expect(tokens[2][7].scopes).toEqual(["source.python"]); + expect(tokens[2][8].value).toBe(":="); + expect(tokens[2][8].scopes).toEqual(["source.python","keyword.operator.assignment.python"]); + expect(tokens[2][9].value).toBe(" "); + expect(tokens[2][9].scopes).toEqual(["source.python"]); + expect(tokens[2][10].value).toBe("f"); + expect(tokens[2][10].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.generic.python"]); + expect(tokens[2][11].value).toBe("("); + expect(tokens[2][11].scopes).toEqual(["source.python","meta.function-call.python","punctuation.definition.arguments.begin.python"]); + expect(tokens[2][12].value).toBe("x"); + expect(tokens[2][12].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python"]); + expect(tokens[2][13].value).toBe(")"); + expect(tokens[2][13].scopes).toEqual(["source.python","meta.function-call.python","punctuation.definition.arguments.end.python"]); + expect(tokens[2][14].value).toBe(")"); + expect(tokens[2][14].scopes).toEqual(["source.python","punctuation.parenthesis.end.python"]); + }); + + it("test/expressions/expr22.py", + function() { + tokens = grammar.tokenizeLines("match = 13\ncase = 12\nif case == 4:\n return match * 5") + expect(tokens[0][0].value).toBe("match"); + expect(tokens[0][0].scopes).toEqual(["source.python"]); + expect(tokens[0][1].value).toBe(" "); + expect(tokens[0][1].scopes).toEqual(["source.python"]); + expect(tokens[0][2].value).toBe("="); + expect(tokens[0][2].scopes).toEqual(["source.python","keyword.operator.assignment.python"]); + expect(tokens[0][3].value).toBe(" "); + expect(tokens[0][3].scopes).toEqual(["source.python"]); + expect(tokens[0][4].value).toBe("13"); + expect(tokens[0][4].scopes).toEqual(["source.python","constant.numeric.dec.python"]); + expect(tokens[1][0].value).toBe("case"); + expect(tokens[1][0].scopes).toEqual(["source.python"]); + expect(tokens[1][1].value).toBe(" "); + expect(tokens[1][1].scopes).toEqual(["source.python"]); + expect(tokens[1][2].value).toBe("="); + expect(tokens[1][2].scopes).toEqual(["source.python","keyword.operator.assignment.python"]); + expect(tokens[1][3].value).toBe(" "); + expect(tokens[1][3].scopes).toEqual(["source.python"]); + expect(tokens[1][4].value).toBe("12"); + expect(tokens[1][4].scopes).toEqual(["source.python","constant.numeric.dec.python"]); + expect(tokens[2][0].value).toBe("if"); + expect(tokens[2][0].scopes).toEqual(["source.python","keyword.control.flow.python"]); + expect(tokens[2][1].value).toBe(" "); + expect(tokens[2][1].scopes).toEqual(["source.python"]); + expect(tokens[2][2].value).toBe("case"); + expect(tokens[2][2].scopes).toEqual(["source.python"]); + expect(tokens[2][3].value).toBe(" "); + expect(tokens[2][3].scopes).toEqual(["source.python"]); + expect(tokens[2][4].value).toBe("=="); + expect(tokens[2][4].scopes).toEqual(["source.python","keyword.operator.comparison.python"]); + expect(tokens[2][5].value).toBe(" "); + expect(tokens[2][5].scopes).toEqual(["source.python"]); + expect(tokens[2][6].value).toBe("4"); + expect(tokens[2][6].scopes).toEqual(["source.python","constant.numeric.dec.python"]); + expect(tokens[2][7].value).toBe(":"); + expect(tokens[2][7].scopes).toEqual(["source.python","punctuation.separator.colon.python"]); + expect(tokens[3][0].value).toBe(" "); + expect(tokens[3][0].scopes).toEqual(["source.python"]); + expect(tokens[3][1].value).toBe("return"); + expect(tokens[3][1].scopes).toEqual(["source.python","keyword.control.flow.python"]); + expect(tokens[3][2].value).toBe(" "); + expect(tokens[3][2].scopes).toEqual(["source.python"]); + expect(tokens[3][3].value).toBe("match"); + expect(tokens[3][3].scopes).toEqual(["source.python"]); + expect(tokens[3][4].value).toBe(" "); + expect(tokens[3][4].scopes).toEqual(["source.python"]); + expect(tokens[3][5].value).toBe("*"); + expect(tokens[3][5].scopes).toEqual(["source.python","keyword.operator.arithmetic.python"]); + expect(tokens[3][6].value).toBe(" "); + expect(tokens[3][6].scopes).toEqual(["source.python"]); + expect(tokens[3][7].value).toBe("5"); + expect(tokens[3][7].scopes).toEqual(["source.python","constant.numeric.dec.python"]); + }); + it("test/expressions/expr3.py", function() { tokens = grammar.tokenizeLines("(a, *rest, b) = range(5)") @@ -5794,7 +6053,7 @@ describe("Grammar Tests", function() { expect(tokens[0][10].value).toBe(" "); expect(tokens[0][10].scopes).toEqual(["source.python"]); expect(tokens[0][11].value).toBe("in"); - expect(tokens[0][11].scopes).toEqual(["source.python","keyword.operator.logical.python"]); + expect(tokens[0][11].scopes).toEqual(["source.python","keyword.control.flow.python"]); expect(tokens[0][12].value).toBe(" "); expect(tokens[0][12].scopes).toEqual(["source.python"]); expect(tokens[0][13].value).toBe("range"); @@ -5999,9 +6258,9 @@ describe("Grammar Tests", function() { expect(tokens[0][0].value).toBe("a"); expect(tokens[0][0].scopes).toEqual(["source.python"]); expect(tokens[0][1].value).toBe("."); - expect(tokens[0][1].scopes).toEqual(["source.python","punctuation.separator.period.python"]); + expect(tokens[0][1].scopes).toEqual(["source.python","meta.member.access.python","punctuation.separator.period.python"]); expect(tokens[0][2].value).toBe("True"); - expect(tokens[0][2].scopes).toEqual(["source.python","keyword.illegal.name.python"]); + expect(tokens[0][2].scopes).toEqual(["source.python","meta.member.access.python","keyword.illegal.name.python"]); expect(tokens[0][3].value).toBe(" "); expect(tokens[0][3].scopes).toEqual(["source.python"]); expect(tokens[0][4].value).toBe("="); @@ -6011,9 +6270,9 @@ describe("Grammar Tests", function() { expect(tokens[0][6].value).toBe("b"); expect(tokens[0][6].scopes).toEqual(["source.python"]); expect(tokens[0][7].value).toBe("."); - expect(tokens[0][7].scopes).toEqual(["source.python","punctuation.separator.period.python"]); + expect(tokens[0][7].scopes).toEqual(["source.python","meta.member.access.python","punctuation.separator.period.python"]); expect(tokens[0][8].value).toBe("False"); - expect(tokens[0][8].scopes).toEqual(["source.python","keyword.illegal.name.python"]); + expect(tokens[0][8].scopes).toEqual(["source.python","meta.member.access.python","keyword.illegal.name.python"]); expect(tokens[0][9].value).toBe(" "); expect(tokens[0][9].scopes).toEqual(["source.python"]); expect(tokens[0][10].value).toBe("="); @@ -6023,9 +6282,9 @@ describe("Grammar Tests", function() { expect(tokens[0][12].value).toBe("d"); expect(tokens[0][12].scopes).toEqual(["source.python"]); expect(tokens[0][13].value).toBe("."); - expect(tokens[0][13].scopes).toEqual(["source.python","punctuation.separator.period.python"]); + expect(tokens[0][13].scopes).toEqual(["source.python","meta.member.access.python","punctuation.separator.period.python"]); expect(tokens[0][14].value).toBe("None"); - expect(tokens[0][14].scopes).toEqual(["source.python","keyword.illegal.name.python"]); + expect(tokens[0][14].scopes).toEqual(["source.python","meta.member.access.python","keyword.illegal.name.python"]); }); it("test/expressions/expr8.py", @@ -6076,7 +6335,7 @@ describe("Grammar Tests", function() { it("test/expressions/keywords.py", function() { - tokens = grammar.tokenizeLines("as async await continue del assert break finally for\nfrom elif else if import except pass raise\nreturn try while with\n\nnonlocal global class def") + tokens = grammar.tokenizeLines("as async await continue del assert break finally\nfrom elif else if import except pass raise\nreturn try while with\n\nnonlocal global class def\n\nfor") expect(tokens[0][0].value).toBe("as"); expect(tokens[0][0].scopes).toEqual(["source.python","keyword.control.import.python"]); expect(tokens[0][1].value).toBe(" "); @@ -6107,10 +6366,6 @@ describe("Grammar Tests", function() { expect(tokens[0][13].scopes).toEqual(["source.python"]); expect(tokens[0][14].value).toBe("finally"); expect(tokens[0][14].scopes).toEqual(["source.python","keyword.control.flow.python"]); - expect(tokens[0][15].value).toBe(" "); - expect(tokens[0][15].scopes).toEqual(["source.python"]); - expect(tokens[0][16].value).toBe("for"); - expect(tokens[0][16].scopes).toEqual(["source.python","keyword.control.flow.python"]); expect(tokens[1][0].value).toBe("from"); expect(tokens[1][0].scopes).toEqual(["source.python","keyword.control.import.python"]); expect(tokens[1][1].value).toBe(" "); @@ -6169,6 +6424,10 @@ describe("Grammar Tests", function() { expect(tokens[4][4].scopes).toEqual(["source.python","storage.type.class.python"]); expect(tokens[4][5].value).toBe(" def"); expect(tokens[4][5].scopes).toEqual(["source.python","storage.type.function.python"]); + expect(tokens[5][0].value).toBe(""); + expect(tokens[5][0].scopes).toEqual(["source.python"]); + expect(tokens[6][0].value).toBe("for"); + expect(tokens[6][0].scopes).toEqual(["source.python","keyword.control.flow.python"]); }); it("test/expressions/special1.py", @@ -6198,7 +6457,7 @@ describe("Grammar Tests", function() { expect(tokens[1][1].value).toBe(" "); expect(tokens[1][1].scopes).toEqual(["source.python","meta.function.python"]); expect(tokens[1][2].value).toBe("__class_getitem__"); - expect(tokens[1][2].scopes).toEqual(["source.python","meta.function.python","support.variable.magic.python"]); + expect(tokens[1][2].scopes).toEqual(["source.python","meta.function.python","support.function.magic.python"]); expect(tokens[1][3].value).toBe("("); expect(tokens[1][3].scopes).toEqual(["source.python","meta.function.python","meta.function.parameters.python","punctuation.definition.parameters.begin.python"]); expect(tokens[1][4].value).toBe(")"); @@ -6354,71 +6613,71 @@ describe("Grammar Tests", function() { expect(tokens[0][0].value).toBe("self"); expect(tokens[0][0].scopes).toEqual(["source.python","variable.language.special.self.python"]); expect(tokens[0][1].value).toBe("."); - expect(tokens[0][1].scopes).toEqual(["source.python","punctuation.separator.period.python"]); + expect(tokens[0][1].scopes).toEqual(["source.python","meta.member.access.python","punctuation.separator.period.python"]); expect(tokens[0][2].value).toBe("assertEqual"); - expect(tokens[0][2].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.generic.python"]); + expect(tokens[0][2].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.generic.python"]); expect(tokens[0][3].value).toBe("("); - expect(tokens[0][3].scopes).toEqual(["source.python","meta.function-call.python","punctuation.definition.arguments.begin.python"]); + expect(tokens[0][3].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","punctuation.definition.arguments.begin.python"]); expect(tokens[0][4].value).toBe("f"); - expect(tokens[0][4].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","meta.fstring.python","storage.type.string.python string.quoted.single.python string.interpolated.python"]); + expect(tokens[0][4].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","meta.fstring.python","storage.type.string.python string.quoted.single.python string.interpolated.python"]); expect(tokens[0][5].value).toBe("'"); - expect(tokens[0][5].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","meta.fstring.python","string.quoted.single.python string.interpolated.python punctuation.definition.string.begin.python"]); + expect(tokens[0][5].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","meta.fstring.python","string.quoted.single.python string.interpolated.python punctuation.definition.string.begin.python"]); expect(tokens[0][6].value).toBe("{"); - expect(tokens[0][6].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","meta.fstring.python","constant.character.format.placeholder.other.python"]); + expect(tokens[0][6].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","meta.fstring.python","constant.character.format.placeholder.other.python"]); expect(tokens[0][7].value).toBe("10"); - expect(tokens[0][7].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","meta.fstring.python","constant.numeric.dec.python"]); + expect(tokens[0][7].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","meta.fstring.python","constant.numeric.dec.python"]); expect(tokens[0][8].value).toBe(":"); - expect(tokens[0][8].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","meta.fstring.python","storage.type.format.python"]); + expect(tokens[0][8].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","meta.fstring.python","storage.type.format.python"]); expect(tokens[0][9].value).toBe("#"); - expect(tokens[0][9].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","meta.fstring.python","storage.type.format.python"]); + expect(tokens[0][9].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","meta.fstring.python","storage.type.format.python"]); expect(tokens[0][10].value).toBe("{"); - expect(tokens[0][10].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","meta.fstring.python","constant.character.format.placeholder.other.python"]); + expect(tokens[0][10].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","meta.fstring.python","constant.character.format.placeholder.other.python"]); expect(tokens[0][11].value).toBe("3"); - expect(tokens[0][11].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","meta.fstring.python","constant.numeric.dec.python"]); + expect(tokens[0][11].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","meta.fstring.python","constant.numeric.dec.python"]); expect(tokens[0][12].value).toBe(" "); - expect(tokens[0][12].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","meta.fstring.python"]); + expect(tokens[0][12].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","meta.fstring.python"]); expect(tokens[0][13].value).toBe("!="); - expect(tokens[0][13].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","meta.fstring.python","keyword.operator.comparison.python"]); + expect(tokens[0][13].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","meta.fstring.python","keyword.operator.comparison.python"]); expect(tokens[0][14].value).toBe(" "); - expect(tokens[0][14].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","meta.fstring.python"]); + expect(tokens[0][14].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","meta.fstring.python"]); expect(tokens[0][15].value).toBe("{"); - expect(tokens[0][15].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","meta.fstring.python","punctuation.definition.dict.begin.python"]); + expect(tokens[0][15].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","meta.fstring.python","punctuation.definition.dict.begin.python"]); expect(tokens[0][16].value).toBe("4"); - expect(tokens[0][16].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","meta.fstring.python","constant.numeric.dec.python"]); + expect(tokens[0][16].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","meta.fstring.python","constant.numeric.dec.python"]); expect(tokens[0][17].value).toBe(":"); - expect(tokens[0][17].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","meta.fstring.python","punctuation.separator.dict.python"]); + expect(tokens[0][17].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","meta.fstring.python","punctuation.separator.dict.python"]); expect(tokens[0][18].value).toBe("5"); - expect(tokens[0][18].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","meta.fstring.python","constant.numeric.dec.python"]); + expect(tokens[0][18].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","meta.fstring.python","constant.numeric.dec.python"]); expect(tokens[0][19].value).toBe("}"); - expect(tokens[0][19].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","meta.fstring.python","punctuation.definition.dict.end.python"]); + expect(tokens[0][19].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","meta.fstring.python","punctuation.definition.dict.end.python"]); expect(tokens[0][20].value).toBe(" "); - expect(tokens[0][20].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","meta.fstring.python"]); + expect(tokens[0][20].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","meta.fstring.python"]); expect(tokens[0][21].value).toBe("and"); - expect(tokens[0][21].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","meta.fstring.python","keyword.operator.logical.python"]); + expect(tokens[0][21].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","meta.fstring.python","keyword.operator.logical.python"]); expect(tokens[0][22].value).toBe(" "); - expect(tokens[0][22].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","meta.fstring.python"]); + expect(tokens[0][22].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","meta.fstring.python"]); expect(tokens[0][23].value).toBe("width"); - expect(tokens[0][23].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","meta.fstring.python"]); + expect(tokens[0][23].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","meta.fstring.python"]); expect(tokens[0][24].value).toBe("}"); - expect(tokens[0][24].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","meta.fstring.python","constant.character.format.placeholder.other.python"]); + expect(tokens[0][24].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","meta.fstring.python","constant.character.format.placeholder.other.python"]); expect(tokens[0][25].value).toBe("x"); - expect(tokens[0][25].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","meta.fstring.python","storage.type.format.python"]); + expect(tokens[0][25].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","meta.fstring.python","storage.type.format.python"]); expect(tokens[0][26].value).toBe("}"); - expect(tokens[0][26].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","meta.fstring.python","constant.character.format.placeholder.other.python"]); + expect(tokens[0][26].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","meta.fstring.python","constant.character.format.placeholder.other.python"]); expect(tokens[0][27].value).toBe("'"); - expect(tokens[0][27].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","meta.fstring.python","string.quoted.single.python string.interpolated.python punctuation.definition.string.end.python"]); + expect(tokens[0][27].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","meta.fstring.python","string.quoted.single.python string.interpolated.python punctuation.definition.string.end.python"]); expect(tokens[0][28].value).toBe(","); - expect(tokens[0][28].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","punctuation.separator.arguments.python"]); + expect(tokens[0][28].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","punctuation.separator.arguments.python"]); expect(tokens[0][29].value).toBe(" "); - expect(tokens[0][29].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python"]); + expect(tokens[0][29].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python"]); expect(tokens[0][30].value).toBe("'"); - expect(tokens[0][30].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.quoted.single.python","punctuation.definition.string.begin.python"]); + expect(tokens[0][30].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","string.quoted.single.python","punctuation.definition.string.begin.python"]); expect(tokens[0][31].value).toBe(" 0xa"); - expect(tokens[0][31].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.quoted.single.python"]); + expect(tokens[0][31].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","string.quoted.single.python"]); expect(tokens[0][32].value).toBe("'"); - expect(tokens[0][32].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.quoted.single.python","punctuation.definition.string.end.python"]); + expect(tokens[0][32].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","string.quoted.single.python","punctuation.definition.string.end.python"]); expect(tokens[0][33].value).toBe(")"); - expect(tokens[0][33].scopes).toEqual(["source.python","meta.function-call.python","punctuation.definition.arguments.end.python"]); + expect(tokens[0][33].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","punctuation.definition.arguments.end.python"]); }); it("test/fstrings/empty1.py", @@ -6468,49 +6727,323 @@ describe("Grammar Tests", function() { function() { tokens = grammar.tokenizeLines("rf\"{} { }\"\nrf\"\"\"{}\n{ }\n\"\"\"") expect(tokens[0][0].value).toBe("rf"); - expect(tokens[0][0].scopes).toEqual(["source.python","string.regexp.quoted.single.python string.interpolated.python","storage.type.string.python"]); + expect(tokens[0][0].scopes).toEqual(["source.python","meta.fstring.python","storage.type.string.python string.quoted.raw.single.python string.interpolated.python"]); expect(tokens[0][1].value).toBe("\""); - expect(tokens[0][1].scopes).toEqual(["source.python","string.regexp.quoted.single.python string.interpolated.python","punctuation.definition.string.begin.python"]); + expect(tokens[0][1].scopes).toEqual(["source.python","meta.fstring.python","string.quoted.raw.single.python punctuation.definition.string.begin.python"]); expect(tokens[0][2].value).toBe("{"); - expect(tokens[0][2].scopes).toEqual(["source.python","string.regexp.quoted.single.python string.interpolated.python","constant.character.format.placeholder.other.python"]); + expect(tokens[0][2].scopes).toEqual(["source.python","meta.fstring.python","constant.character.format.placeholder.other.python"]); expect(tokens[0][3].value).toBe("}"); - expect(tokens[0][3].scopes).toEqual(["source.python","string.regexp.quoted.single.python string.interpolated.python","constant.character.format.placeholder.other.python"]); + expect(tokens[0][3].scopes).toEqual(["source.python","meta.fstring.python","constant.character.format.placeholder.other.python"]); expect(tokens[0][4].value).toBe(" "); - expect(tokens[0][4].scopes).toEqual(["source.python","string.regexp.quoted.single.python string.interpolated.python"]); + expect(tokens[0][4].scopes).toEqual(["source.python","meta.fstring.python","string.quoted.raw.single.python string.interpolated.python"]); expect(tokens[0][5].value).toBe("{"); - expect(tokens[0][5].scopes).toEqual(["source.python","string.regexp.quoted.single.python string.interpolated.python","constant.character.format.placeholder.other.python"]); + expect(tokens[0][5].scopes).toEqual(["source.python","meta.fstring.python","constant.character.format.placeholder.other.python"]); expect(tokens[0][6].value).toBe(" "); - expect(tokens[0][6].scopes).toEqual(["source.python","string.regexp.quoted.single.python string.interpolated.python","invalid.illegal.brace.python"]); + expect(tokens[0][6].scopes).toEqual(["source.python","meta.fstring.python","invalid.illegal.brace.python"]); expect(tokens[0][7].value).toBe("}"); - expect(tokens[0][7].scopes).toEqual(["source.python","string.regexp.quoted.single.python string.interpolated.python","constant.character.format.placeholder.other.python"]); + expect(tokens[0][7].scopes).toEqual(["source.python","meta.fstring.python","constant.character.format.placeholder.other.python"]); expect(tokens[0][8].value).toBe("\""); - expect(tokens[0][8].scopes).toEqual(["source.python","string.regexp.quoted.single.python string.interpolated.python","punctuation.definition.string.end.python"]); + expect(tokens[0][8].scopes).toEqual(["source.python","meta.fstring.python","string.quoted.raw.single.python string.interpolated.python punctuation.definition.string.end.python"]); expect(tokens[1][0].value).toBe("rf"); - expect(tokens[1][0].scopes).toEqual(["source.python","string.regexp.quoted.multi.python string.interpolated.python","storage.type.string.python"]); + expect(tokens[1][0].scopes).toEqual(["source.python","meta.fstring.python","storage.type.string.python string.quoted.raw.multi.python string.interpolated.python"]); expect(tokens[1][1].value).toBe("\"\"\""); - expect(tokens[1][1].scopes).toEqual(["source.python","string.regexp.quoted.multi.python string.interpolated.python","punctuation.definition.string.begin.python"]); + expect(tokens[1][1].scopes).toEqual(["source.python","meta.fstring.python","string.quoted.raw.multi.python punctuation.definition.string.begin.python"]); expect(tokens[1][2].value).toBe("{"); - expect(tokens[1][2].scopes).toEqual(["source.python","string.regexp.quoted.multi.python string.interpolated.python","constant.character.format.placeholder.other.python"]); + expect(tokens[1][2].scopes).toEqual(["source.python","meta.fstring.python","constant.character.format.placeholder.other.python"]); expect(tokens[1][3].value).toBe("}"); - expect(tokens[1][3].scopes).toEqual(["source.python","string.regexp.quoted.multi.python string.interpolated.python","constant.character.format.placeholder.other.python"]); + expect(tokens[1][3].scopes).toEqual(["source.python","meta.fstring.python","constant.character.format.placeholder.other.python"]); + expect(tokens[1][4].value).toBe(""); + expect(tokens[1][4].scopes).toEqual(["source.python","meta.fstring.python","string.quoted.raw.multi.python string.interpolated.python"]); expect(tokens[2][0].value).toBe("{"); - expect(tokens[2][0].scopes).toEqual(["source.python","string.regexp.quoted.multi.python string.interpolated.python","constant.character.format.placeholder.other.python"]); + expect(tokens[2][0].scopes).toEqual(["source.python","meta.fstring.python","constant.character.format.placeholder.other.python"]); expect(tokens[2][1].value).toBe(" "); - expect(tokens[2][1].scopes).toEqual(["source.python","string.regexp.quoted.multi.python string.interpolated.python","invalid.illegal.brace.python"]); + expect(tokens[2][1].scopes).toEqual(["source.python","meta.fstring.python","invalid.illegal.brace.python"]); expect(tokens[2][2].value).toBe("}"); - expect(tokens[2][2].scopes).toEqual(["source.python","string.regexp.quoted.multi.python string.interpolated.python","constant.character.format.placeholder.other.python"]); + expect(tokens[2][2].scopes).toEqual(["source.python","meta.fstring.python","constant.character.format.placeholder.other.python"]); + expect(tokens[2][3].value).toBe(""); + expect(tokens[2][3].scopes).toEqual(["source.python","meta.fstring.python","string.quoted.raw.multi.python string.interpolated.python"]); expect(tokens[3][0].value).toBe("\"\"\""); - expect(tokens[3][0].scopes).toEqual(["source.python","string.regexp.quoted.multi.python string.interpolated.python","punctuation.definition.string.end.python"]); + expect(tokens[3][0].scopes).toEqual(["source.python","meta.fstring.python","string.quoted.raw.multi.python string.interpolated.python punctuation.definition.string.end.python"]); }); - it("test/fstrings/nested1.py", + it("test/fstrings/fraw1.py", function() { - tokens = grammar.tokenizeLines("f'''\n prefix {\n foo(f\"\"\"\n inner prefix\n { bar[\"q\"] + f'insane{42 + 9000}stuff{def aaa(): pass}111'}\n inner suffix\n \"\"\")\n } suffix\n'''") - expect(tokens[0][0].value).toBe("f"); - expect(tokens[0][0].scopes).toEqual(["source.python","meta.fstring.python","storage.type.string.python string.quoted.multi.python string.interpolated.python"]); - expect(tokens[0][1].value).toBe("'''"); - expect(tokens[0][1].scopes).toEqual(["source.python","meta.fstring.python","string.quoted.multi.python string.interpolated.python punctuation.definition.string.begin.python"]); - expect(tokens[0][2].value).toBe(""); + tokens = grammar.tokenizeLines("a = fr'[a-z]'\na = Fr'[a-z]'\na = rf'[a-z]'\na = rF'[a-z]'") + expect(tokens[0][0].value).toBe("a"); + expect(tokens[0][0].scopes).toEqual(["source.python"]); + expect(tokens[0][1].value).toBe(" "); + expect(tokens[0][1].scopes).toEqual(["source.python"]); + expect(tokens[0][2].value).toBe("="); + expect(tokens[0][2].scopes).toEqual(["source.python","keyword.operator.assignment.python"]); + expect(tokens[0][3].value).toBe(" "); + expect(tokens[0][3].scopes).toEqual(["source.python"]); + expect(tokens[0][4].value).toBe("fr"); + expect(tokens[0][4].scopes).toEqual(["source.python","meta.fstring.python","storage.type.string.python string.quoted.raw.single.python string.interpolated.python"]); + expect(tokens[0][5].value).toBe("'"); + expect(tokens[0][5].scopes).toEqual(["source.python","meta.fstring.python","string.quoted.raw.single.python punctuation.definition.string.begin.python"]); + expect(tokens[0][6].value).toBe("[a-z]"); + expect(tokens[0][6].scopes).toEqual(["source.python","meta.fstring.python","string.quoted.raw.single.python string.interpolated.python"]); + expect(tokens[0][7].value).toBe("'"); + expect(tokens[0][7].scopes).toEqual(["source.python","meta.fstring.python","string.quoted.raw.single.python string.interpolated.python punctuation.definition.string.end.python"]); + expect(tokens[1][0].value).toBe("a"); + expect(tokens[1][0].scopes).toEqual(["source.python"]); + expect(tokens[1][1].value).toBe(" "); + expect(tokens[1][1].scopes).toEqual(["source.python"]); + expect(tokens[1][2].value).toBe("="); + expect(tokens[1][2].scopes).toEqual(["source.python","keyword.operator.assignment.python"]); + expect(tokens[1][3].value).toBe(" "); + expect(tokens[1][3].scopes).toEqual(["source.python"]); + expect(tokens[1][4].value).toBe("Fr"); + expect(tokens[1][4].scopes).toEqual(["source.python","meta.fstring.python","storage.type.string.python string.quoted.raw.single.python string.interpolated.python"]); + expect(tokens[1][5].value).toBe("'"); + expect(tokens[1][5].scopes).toEqual(["source.python","meta.fstring.python","string.quoted.raw.single.python punctuation.definition.string.begin.python"]); + expect(tokens[1][6].value).toBe("[a-z]"); + expect(tokens[1][6].scopes).toEqual(["source.python","meta.fstring.python","string.quoted.raw.single.python string.interpolated.python"]); + expect(tokens[1][7].value).toBe("'"); + expect(tokens[1][7].scopes).toEqual(["source.python","meta.fstring.python","string.quoted.raw.single.python string.interpolated.python punctuation.definition.string.end.python"]); + expect(tokens[2][0].value).toBe("a"); + expect(tokens[2][0].scopes).toEqual(["source.python"]); + expect(tokens[2][1].value).toBe(" "); + expect(tokens[2][1].scopes).toEqual(["source.python"]); + expect(tokens[2][2].value).toBe("="); + expect(tokens[2][2].scopes).toEqual(["source.python","keyword.operator.assignment.python"]); + expect(tokens[2][3].value).toBe(" "); + expect(tokens[2][3].scopes).toEqual(["source.python"]); + expect(tokens[2][4].value).toBe("rf"); + expect(tokens[2][4].scopes).toEqual(["source.python","meta.fstring.python","storage.type.string.python string.quoted.raw.single.python string.interpolated.python"]); + expect(tokens[2][5].value).toBe("'"); + expect(tokens[2][5].scopes).toEqual(["source.python","meta.fstring.python","string.quoted.raw.single.python punctuation.definition.string.begin.python"]); + expect(tokens[2][6].value).toBe("[a-z]"); + expect(tokens[2][6].scopes).toEqual(["source.python","meta.fstring.python","string.quoted.raw.single.python string.interpolated.python"]); + expect(tokens[2][7].value).toBe("'"); + expect(tokens[2][7].scopes).toEqual(["source.python","meta.fstring.python","string.quoted.raw.single.python string.interpolated.python punctuation.definition.string.end.python"]); + expect(tokens[3][0].value).toBe("a"); + expect(tokens[3][0].scopes).toEqual(["source.python"]); + expect(tokens[3][1].value).toBe(" "); + expect(tokens[3][1].scopes).toEqual(["source.python"]); + expect(tokens[3][2].value).toBe("="); + expect(tokens[3][2].scopes).toEqual(["source.python","keyword.operator.assignment.python"]); + expect(tokens[3][3].value).toBe(" "); + expect(tokens[3][3].scopes).toEqual(["source.python"]); + expect(tokens[3][4].value).toBe("rF"); + expect(tokens[3][4].scopes).toEqual(["source.python","meta.fstring.python","storage.type.string.python string.quoted.raw.single.python string.interpolated.python"]); + expect(tokens[3][5].value).toBe("'"); + expect(tokens[3][5].scopes).toEqual(["source.python","meta.fstring.python","string.quoted.raw.single.python punctuation.definition.string.begin.python"]); + expect(tokens[3][6].value).toBe("[a-z]"); + expect(tokens[3][6].scopes).toEqual(["source.python","meta.fstring.python","string.quoted.raw.single.python string.interpolated.python"]); + expect(tokens[3][7].value).toBe("'"); + expect(tokens[3][7].scopes).toEqual(["source.python","meta.fstring.python","string.quoted.raw.single.python string.interpolated.python punctuation.definition.string.end.python"]); + }); + + it("test/fstrings/fraw2.py", + function() { + tokens = grammar.tokenizeLines("rf'fo{{2}}'\nrf\"fo{{2}}\"\nrf'''fo{{2}}'''\nrf\"\"\"fo{{2}}\"\"\"") + expect(tokens[0][0].value).toBe("rf"); + expect(tokens[0][0].scopes).toEqual(["source.python","meta.fstring.python","storage.type.string.python string.quoted.raw.single.python string.interpolated.python"]); + expect(tokens[0][1].value).toBe("'"); + expect(tokens[0][1].scopes).toEqual(["source.python","meta.fstring.python","string.quoted.raw.single.python punctuation.definition.string.begin.python"]); + expect(tokens[0][2].value).toBe("fo"); + expect(tokens[0][2].scopes).toEqual(["source.python","meta.fstring.python","string.quoted.raw.single.python string.interpolated.python"]); + expect(tokens[0][3].value).toBe("{{"); + expect(tokens[0][3].scopes).toEqual(["source.python","meta.fstring.python","constant.character.escape.python"]); + expect(tokens[0][4].value).toBe("2"); + expect(tokens[0][4].scopes).toEqual(["source.python","meta.fstring.python","string.quoted.raw.single.python string.interpolated.python"]); + expect(tokens[0][5].value).toBe("}}"); + expect(tokens[0][5].scopes).toEqual(["source.python","meta.fstring.python","constant.character.escape.python"]); + expect(tokens[0][6].value).toBe("'"); + expect(tokens[0][6].scopes).toEqual(["source.python","meta.fstring.python","string.quoted.raw.single.python string.interpolated.python punctuation.definition.string.end.python"]); + expect(tokens[1][0].value).toBe("rf"); + expect(tokens[1][0].scopes).toEqual(["source.python","meta.fstring.python","storage.type.string.python string.quoted.raw.single.python string.interpolated.python"]); + expect(tokens[1][1].value).toBe("\""); + expect(tokens[1][1].scopes).toEqual(["source.python","meta.fstring.python","string.quoted.raw.single.python punctuation.definition.string.begin.python"]); + expect(tokens[1][2].value).toBe("fo"); + expect(tokens[1][2].scopes).toEqual(["source.python","meta.fstring.python","string.quoted.raw.single.python string.interpolated.python"]); + expect(tokens[1][3].value).toBe("{{"); + expect(tokens[1][3].scopes).toEqual(["source.python","meta.fstring.python","constant.character.escape.python"]); + expect(tokens[1][4].value).toBe("2"); + expect(tokens[1][4].scopes).toEqual(["source.python","meta.fstring.python","string.quoted.raw.single.python string.interpolated.python"]); + expect(tokens[1][5].value).toBe("}}"); + expect(tokens[1][5].scopes).toEqual(["source.python","meta.fstring.python","constant.character.escape.python"]); + expect(tokens[1][6].value).toBe("\""); + expect(tokens[1][6].scopes).toEqual(["source.python","meta.fstring.python","string.quoted.raw.single.python string.interpolated.python punctuation.definition.string.end.python"]); + expect(tokens[2][0].value).toBe("rf"); + expect(tokens[2][0].scopes).toEqual(["source.python","meta.fstring.python","storage.type.string.python string.quoted.raw.multi.python string.interpolated.python"]); + expect(tokens[2][1].value).toBe("'''"); + expect(tokens[2][1].scopes).toEqual(["source.python","meta.fstring.python","string.quoted.raw.multi.python punctuation.definition.string.begin.python"]); + expect(tokens[2][2].value).toBe("fo"); + expect(tokens[2][2].scopes).toEqual(["source.python","meta.fstring.python","string.quoted.raw.multi.python string.interpolated.python"]); + expect(tokens[2][3].value).toBe("{{"); + expect(tokens[2][3].scopes).toEqual(["source.python","meta.fstring.python","constant.character.escape.python"]); + expect(tokens[2][4].value).toBe("2"); + expect(tokens[2][4].scopes).toEqual(["source.python","meta.fstring.python","string.quoted.raw.multi.python string.interpolated.python"]); + expect(tokens[2][5].value).toBe("}}"); + expect(tokens[2][5].scopes).toEqual(["source.python","meta.fstring.python","constant.character.escape.python"]); + expect(tokens[2][6].value).toBe("'''"); + expect(tokens[2][6].scopes).toEqual(["source.python","meta.fstring.python","string.quoted.raw.multi.python string.interpolated.python punctuation.definition.string.end.python"]); + expect(tokens[3][0].value).toBe("rf"); + expect(tokens[3][0].scopes).toEqual(["source.python","meta.fstring.python","storage.type.string.python string.quoted.raw.multi.python string.interpolated.python"]); + expect(tokens[3][1].value).toBe("\"\"\""); + expect(tokens[3][1].scopes).toEqual(["source.python","meta.fstring.python","string.quoted.raw.multi.python punctuation.definition.string.begin.python"]); + expect(tokens[3][2].value).toBe("fo"); + expect(tokens[3][2].scopes).toEqual(["source.python","meta.fstring.python","string.quoted.raw.multi.python string.interpolated.python"]); + expect(tokens[3][3].value).toBe("{{"); + expect(tokens[3][3].scopes).toEqual(["source.python","meta.fstring.python","constant.character.escape.python"]); + expect(tokens[3][4].value).toBe("2"); + expect(tokens[3][4].scopes).toEqual(["source.python","meta.fstring.python","string.quoted.raw.multi.python string.interpolated.python"]); + expect(tokens[3][5].value).toBe("}}"); + expect(tokens[3][5].scopes).toEqual(["source.python","meta.fstring.python","constant.character.escape.python"]); + expect(tokens[3][6].value).toBe("\"\"\""); + expect(tokens[3][6].scopes).toEqual(["source.python","meta.fstring.python","string.quoted.raw.multi.python string.interpolated.python punctuation.definition.string.end.python"]); + }); + + it("test/fstrings/fraw3.py", + function() { + tokens = grammar.tokenizeLines("rf'fo{2}'\nrf\"fo{2}\"\nrf'''fo{2}'''\nrf\"\"\"fo{2}\"\"\"") + expect(tokens[0][0].value).toBe("rf"); + expect(tokens[0][0].scopes).toEqual(["source.python","meta.fstring.python","storage.type.string.python string.quoted.raw.single.python string.interpolated.python"]); + expect(tokens[0][1].value).toBe("'"); + expect(tokens[0][1].scopes).toEqual(["source.python","meta.fstring.python","string.quoted.raw.single.python punctuation.definition.string.begin.python"]); + expect(tokens[0][2].value).toBe("fo"); + expect(tokens[0][2].scopes).toEqual(["source.python","meta.fstring.python","string.quoted.raw.single.python string.interpolated.python"]); + expect(tokens[0][3].value).toBe("{"); + expect(tokens[0][3].scopes).toEqual(["source.python","meta.fstring.python","constant.character.format.placeholder.other.python"]); + expect(tokens[0][4].value).toBe("2"); + expect(tokens[0][4].scopes).toEqual(["source.python","meta.fstring.python","constant.numeric.dec.python"]); + expect(tokens[0][5].value).toBe("}"); + expect(tokens[0][5].scopes).toEqual(["source.python","meta.fstring.python","constant.character.format.placeholder.other.python"]); + expect(tokens[0][6].value).toBe("'"); + expect(tokens[0][6].scopes).toEqual(["source.python","meta.fstring.python","string.quoted.raw.single.python string.interpolated.python punctuation.definition.string.end.python"]); + expect(tokens[1][0].value).toBe("rf"); + expect(tokens[1][0].scopes).toEqual(["source.python","meta.fstring.python","storage.type.string.python string.quoted.raw.single.python string.interpolated.python"]); + expect(tokens[1][1].value).toBe("\""); + expect(tokens[1][1].scopes).toEqual(["source.python","meta.fstring.python","string.quoted.raw.single.python punctuation.definition.string.begin.python"]); + expect(tokens[1][2].value).toBe("fo"); + expect(tokens[1][2].scopes).toEqual(["source.python","meta.fstring.python","string.quoted.raw.single.python string.interpolated.python"]); + expect(tokens[1][3].value).toBe("{"); + expect(tokens[1][3].scopes).toEqual(["source.python","meta.fstring.python","constant.character.format.placeholder.other.python"]); + expect(tokens[1][4].value).toBe("2"); + expect(tokens[1][4].scopes).toEqual(["source.python","meta.fstring.python","constant.numeric.dec.python"]); + expect(tokens[1][5].value).toBe("}"); + expect(tokens[1][5].scopes).toEqual(["source.python","meta.fstring.python","constant.character.format.placeholder.other.python"]); + expect(tokens[1][6].value).toBe("\""); + expect(tokens[1][6].scopes).toEqual(["source.python","meta.fstring.python","string.quoted.raw.single.python string.interpolated.python punctuation.definition.string.end.python"]); + expect(tokens[2][0].value).toBe("rf"); + expect(tokens[2][0].scopes).toEqual(["source.python","meta.fstring.python","storage.type.string.python string.quoted.raw.multi.python string.interpolated.python"]); + expect(tokens[2][1].value).toBe("'''"); + expect(tokens[2][1].scopes).toEqual(["source.python","meta.fstring.python","string.quoted.raw.multi.python punctuation.definition.string.begin.python"]); + expect(tokens[2][2].value).toBe("fo"); + expect(tokens[2][2].scopes).toEqual(["source.python","meta.fstring.python","string.quoted.raw.multi.python string.interpolated.python"]); + expect(tokens[2][3].value).toBe("{"); + expect(tokens[2][3].scopes).toEqual(["source.python","meta.fstring.python","constant.character.format.placeholder.other.python"]); + expect(tokens[2][4].value).toBe("2"); + expect(tokens[2][4].scopes).toEqual(["source.python","meta.fstring.python","constant.numeric.dec.python"]); + expect(tokens[2][5].value).toBe("}"); + expect(tokens[2][5].scopes).toEqual(["source.python","meta.fstring.python","constant.character.format.placeholder.other.python"]); + expect(tokens[2][6].value).toBe("'''"); + expect(tokens[2][6].scopes).toEqual(["source.python","meta.fstring.python","string.quoted.raw.multi.python string.interpolated.python punctuation.definition.string.end.python"]); + expect(tokens[3][0].value).toBe("rf"); + expect(tokens[3][0].scopes).toEqual(["source.python","meta.fstring.python","storage.type.string.python string.quoted.raw.multi.python string.interpolated.python"]); + expect(tokens[3][1].value).toBe("\"\"\""); + expect(tokens[3][1].scopes).toEqual(["source.python","meta.fstring.python","string.quoted.raw.multi.python punctuation.definition.string.begin.python"]); + expect(tokens[3][2].value).toBe("fo"); + expect(tokens[3][2].scopes).toEqual(["source.python","meta.fstring.python","string.quoted.raw.multi.python string.interpolated.python"]); + expect(tokens[3][3].value).toBe("{"); + expect(tokens[3][3].scopes).toEqual(["source.python","meta.fstring.python","constant.character.format.placeholder.other.python"]); + expect(tokens[3][4].value).toBe("2"); + expect(tokens[3][4].scopes).toEqual(["source.python","meta.fstring.python","constant.numeric.dec.python"]); + expect(tokens[3][5].value).toBe("}"); + expect(tokens[3][5].scopes).toEqual(["source.python","meta.fstring.python","constant.character.format.placeholder.other.python"]); + expect(tokens[3][6].value).toBe("\"\"\""); + expect(tokens[3][6].scopes).toEqual(["source.python","meta.fstring.python","string.quoted.raw.multi.python string.interpolated.python punctuation.definition.string.end.python"]); + }); + + it("test/fstrings/fraw4.py", + function() { + tokens = grammar.tokenizeLines("a = rf'fo{{{2}}}'\na = rf'fo{{{bar}}}'\na = rf'fo{{2}}'") + expect(tokens[0][0].value).toBe("a"); + expect(tokens[0][0].scopes).toEqual(["source.python"]); + expect(tokens[0][1].value).toBe(" "); + expect(tokens[0][1].scopes).toEqual(["source.python"]); + expect(tokens[0][2].value).toBe("="); + expect(tokens[0][2].scopes).toEqual(["source.python","keyword.operator.assignment.python"]); + expect(tokens[0][3].value).toBe(" "); + expect(tokens[0][3].scopes).toEqual(["source.python"]); + expect(tokens[0][4].value).toBe("rf"); + expect(tokens[0][4].scopes).toEqual(["source.python","meta.fstring.python","storage.type.string.python string.quoted.raw.single.python string.interpolated.python"]); + expect(tokens[0][5].value).toBe("'"); + expect(tokens[0][5].scopes).toEqual(["source.python","meta.fstring.python","string.quoted.raw.single.python punctuation.definition.string.begin.python"]); + expect(tokens[0][6].value).toBe("fo"); + expect(tokens[0][6].scopes).toEqual(["source.python","meta.fstring.python","string.quoted.raw.single.python string.interpolated.python"]); + expect(tokens[0][7].value).toBe("{{"); + expect(tokens[0][7].scopes).toEqual(["source.python","meta.fstring.python","constant.character.escape.python"]); + expect(tokens[0][8].value).toBe("{"); + expect(tokens[0][8].scopes).toEqual(["source.python","meta.fstring.python","constant.character.format.placeholder.other.python"]); + expect(tokens[0][9].value).toBe("2"); + expect(tokens[0][9].scopes).toEqual(["source.python","meta.fstring.python","constant.numeric.dec.python"]); + expect(tokens[0][10].value).toBe("}"); + expect(tokens[0][10].scopes).toEqual(["source.python","meta.fstring.python","constant.character.format.placeholder.other.python"]); + expect(tokens[0][11].value).toBe("}}"); + expect(tokens[0][11].scopes).toEqual(["source.python","meta.fstring.python","constant.character.escape.python"]); + expect(tokens[0][12].value).toBe("'"); + expect(tokens[0][12].scopes).toEqual(["source.python","meta.fstring.python","string.quoted.raw.single.python string.interpolated.python punctuation.definition.string.end.python"]); + expect(tokens[1][0].value).toBe("a"); + expect(tokens[1][0].scopes).toEqual(["source.python"]); + expect(tokens[1][1].value).toBe(" "); + expect(tokens[1][1].scopes).toEqual(["source.python"]); + expect(tokens[1][2].value).toBe("="); + expect(tokens[1][2].scopes).toEqual(["source.python","keyword.operator.assignment.python"]); + expect(tokens[1][3].value).toBe(" "); + expect(tokens[1][3].scopes).toEqual(["source.python"]); + expect(tokens[1][4].value).toBe("rf"); + expect(tokens[1][4].scopes).toEqual(["source.python","meta.fstring.python","storage.type.string.python string.quoted.raw.single.python string.interpolated.python"]); + expect(tokens[1][5].value).toBe("'"); + expect(tokens[1][5].scopes).toEqual(["source.python","meta.fstring.python","string.quoted.raw.single.python punctuation.definition.string.begin.python"]); + expect(tokens[1][6].value).toBe("fo"); + expect(tokens[1][6].scopes).toEqual(["source.python","meta.fstring.python","string.quoted.raw.single.python string.interpolated.python"]); + expect(tokens[1][7].value).toBe("{{"); + expect(tokens[1][7].scopes).toEqual(["source.python","meta.fstring.python","constant.character.escape.python"]); + expect(tokens[1][8].value).toBe("{"); + expect(tokens[1][8].scopes).toEqual(["source.python","meta.fstring.python","constant.character.format.placeholder.other.python"]); + expect(tokens[1][9].value).toBe("bar"); + expect(tokens[1][9].scopes).toEqual(["source.python","meta.fstring.python"]); + expect(tokens[1][10].value).toBe("}"); + expect(tokens[1][10].scopes).toEqual(["source.python","meta.fstring.python","constant.character.format.placeholder.other.python"]); + expect(tokens[1][11].value).toBe("}}"); + expect(tokens[1][11].scopes).toEqual(["source.python","meta.fstring.python","constant.character.escape.python"]); + expect(tokens[1][12].value).toBe("'"); + expect(tokens[1][12].scopes).toEqual(["source.python","meta.fstring.python","string.quoted.raw.single.python string.interpolated.python punctuation.definition.string.end.python"]); + expect(tokens[2][0].value).toBe("a"); + expect(tokens[2][0].scopes).toEqual(["source.python"]); + expect(tokens[2][1].value).toBe(" "); + expect(tokens[2][1].scopes).toEqual(["source.python"]); + expect(tokens[2][2].value).toBe("="); + expect(tokens[2][2].scopes).toEqual(["source.python","keyword.operator.assignment.python"]); + expect(tokens[2][3].value).toBe(" "); + expect(tokens[2][3].scopes).toEqual(["source.python"]); + expect(tokens[2][4].value).toBe("rf"); + expect(tokens[2][4].scopes).toEqual(["source.python","meta.fstring.python","storage.type.string.python string.quoted.raw.single.python string.interpolated.python"]); + expect(tokens[2][5].value).toBe("'"); + expect(tokens[2][5].scopes).toEqual(["source.python","meta.fstring.python","string.quoted.raw.single.python punctuation.definition.string.begin.python"]); + expect(tokens[2][6].value).toBe("fo"); + expect(tokens[2][6].scopes).toEqual(["source.python","meta.fstring.python","string.quoted.raw.single.python string.interpolated.python"]); + expect(tokens[2][7].value).toBe("{{"); + expect(tokens[2][7].scopes).toEqual(["source.python","meta.fstring.python","constant.character.escape.python"]); + expect(tokens[2][8].value).toBe("2"); + expect(tokens[2][8].scopes).toEqual(["source.python","meta.fstring.python","string.quoted.raw.single.python string.interpolated.python"]); + expect(tokens[2][9].value).toBe("}}"); + expect(tokens[2][9].scopes).toEqual(["source.python","meta.fstring.python","constant.character.escape.python"]); + expect(tokens[2][10].value).toBe("'"); + expect(tokens[2][10].scopes).toEqual(["source.python","meta.fstring.python","string.quoted.raw.single.python string.interpolated.python punctuation.definition.string.end.python"]); + }); + + it("test/fstrings/nested1.py", + function() { + tokens = grammar.tokenizeLines("f'''\n prefix {\n foo(f\"\"\"\n inner prefix\n { bar[\"q\"] + f'insane{42 + 9000}stuff{def aaa(): pass}111'}\n inner suffix\n \"\"\")\n } suffix\n'''") + expect(tokens[0][0].value).toBe("f"); + expect(tokens[0][0].scopes).toEqual(["source.python","meta.fstring.python","storage.type.string.python string.quoted.multi.python string.interpolated.python"]); + expect(tokens[0][1].value).toBe("'''"); + expect(tokens[0][1].scopes).toEqual(["source.python","meta.fstring.python","string.quoted.multi.python string.interpolated.python punctuation.definition.string.begin.python"]); + expect(tokens[0][2].value).toBe(""); expect(tokens[0][2].scopes).toEqual(["source.python","meta.fstring.python","string.quoted.multi.python string.interpolated.python"]); expect(tokens[1][0].value).toBe(" prefix "); expect(tokens[1][0].scopes).toEqual(["source.python","meta.fstring.python","string.quoted.multi.python string.interpolated.python"]); @@ -6537,7 +7070,7 @@ describe("Grammar Tests", function() { expect(tokens[4][2].value).toBe(" "); expect(tokens[4][2].scopes).toEqual(["source.python","meta.fstring.python","meta.function-call.python","meta.function-call.arguments.python","meta.fstring.python"]); expect(tokens[4][3].value).toBe("bar"); - expect(tokens[4][3].scopes).toEqual(["source.python","meta.fstring.python","meta.function-call.python","meta.function-call.arguments.python","meta.fstring.python","meta.item-access.python"]); + expect(tokens[4][3].scopes).toEqual(["source.python","meta.fstring.python","meta.function-call.python","meta.function-call.arguments.python","meta.fstring.python","meta.item-access.python","meta.indexed-name.python"]); expect(tokens[4][4].value).toBe("["); expect(tokens[4][4].scopes).toEqual(["source.python","meta.fstring.python","meta.function-call.python","meta.function-call.arguments.python","meta.fstring.python","meta.item-access.python","punctuation.definition.arguments.begin.python"]); expect(tokens[4][5].value).toBe("\""); @@ -6942,25 +7475,33 @@ describe("Grammar Tests", function() { expect(tokens[1][6].value).toBe("'"); expect(tokens[1][6].scopes).toEqual(["source.python","meta.fstring.python","string.quoted.single.python string.interpolated.python punctuation.definition.string.end.python"]); expect(tokens[2][0].value).toBe("rf"); - expect(tokens[2][0].scopes).toEqual(["source.python","string.regexp.quoted.single.python string.interpolated.python","storage.type.string.python"]); + expect(tokens[2][0].scopes).toEqual(["source.python","meta.fstring.python","storage.type.string.python string.quoted.raw.single.python string.interpolated.python"]); expect(tokens[2][1].value).toBe("'"); - expect(tokens[2][1].scopes).toEqual(["source.python","string.regexp.quoted.single.python string.interpolated.python","punctuation.definition.string.begin.python"]); + expect(tokens[2][1].scopes).toEqual(["source.python","meta.fstring.python","string.quoted.raw.single.python punctuation.definition.string.begin.python"]); expect(tokens[2][2].value).toBe("some "); - expect(tokens[2][2].scopes).toEqual(["source.python","string.regexp.quoted.single.python string.interpolated.python"]); - expect(tokens[2][3].value).toBe("{obj}"); - expect(tokens[2][3].scopes).toEqual(["source.python","string.regexp.quoted.single.python string.interpolated.python"]); - expect(tokens[2][4].value).toBe("'"); - expect(tokens[2][4].scopes).toEqual(["source.python","string.regexp.quoted.single.python string.interpolated.python","punctuation.definition.string.end.python"]); + expect(tokens[2][2].scopes).toEqual(["source.python","meta.fstring.python","string.quoted.raw.single.python string.interpolated.python"]); + expect(tokens[2][3].value).toBe("{"); + expect(tokens[2][3].scopes).toEqual(["source.python","meta.fstring.python","constant.character.format.placeholder.other.python"]); + expect(tokens[2][4].value).toBe("obj"); + expect(tokens[2][4].scopes).toEqual(["source.python","meta.fstring.python"]); + expect(tokens[2][5].value).toBe("}"); + expect(tokens[2][5].scopes).toEqual(["source.python","meta.fstring.python","constant.character.format.placeholder.other.python"]); + expect(tokens[2][6].value).toBe("'"); + expect(tokens[2][6].scopes).toEqual(["source.python","meta.fstring.python","string.quoted.raw.single.python string.interpolated.python punctuation.definition.string.end.python"]); expect(tokens[3][0].value).toBe("rF"); - expect(tokens[3][0].scopes).toEqual(["source.python","string.regexp.quoted.single.python string.interpolated.python","storage.type.string.python"]); + expect(tokens[3][0].scopes).toEqual(["source.python","meta.fstring.python","storage.type.string.python string.quoted.raw.single.python string.interpolated.python"]); expect(tokens[3][1].value).toBe("'"); - expect(tokens[3][1].scopes).toEqual(["source.python","string.regexp.quoted.single.python string.interpolated.python","punctuation.definition.string.begin.python"]); + expect(tokens[3][1].scopes).toEqual(["source.python","meta.fstring.python","string.quoted.raw.single.python punctuation.definition.string.begin.python"]); expect(tokens[3][2].value).toBe("some "); - expect(tokens[3][2].scopes).toEqual(["source.python","string.regexp.quoted.single.python string.interpolated.python"]); - expect(tokens[3][3].value).toBe("{obj}"); - expect(tokens[3][3].scopes).toEqual(["source.python","string.regexp.quoted.single.python string.interpolated.python"]); - expect(tokens[3][4].value).toBe("'"); - expect(tokens[3][4].scopes).toEqual(["source.python","string.regexp.quoted.single.python string.interpolated.python","punctuation.definition.string.end.python"]); + expect(tokens[3][2].scopes).toEqual(["source.python","meta.fstring.python","string.quoted.raw.single.python string.interpolated.python"]); + expect(tokens[3][3].value).toBe("{"); + expect(tokens[3][3].scopes).toEqual(["source.python","meta.fstring.python","constant.character.format.placeholder.other.python"]); + expect(tokens[3][4].value).toBe("obj"); + expect(tokens[3][4].scopes).toEqual(["source.python","meta.fstring.python"]); + expect(tokens[3][5].value).toBe("}"); + expect(tokens[3][5].scopes).toEqual(["source.python","meta.fstring.python","constant.character.format.placeholder.other.python"]); + expect(tokens[3][6].value).toBe("'"); + expect(tokens[3][6].scopes).toEqual(["source.python","meta.fstring.python","string.quoted.raw.single.python string.interpolated.python punctuation.definition.string.end.python"]); expect(tokens[4][0].value).toBe("Rf"); expect(tokens[4][0].scopes).toEqual(["source.python","meta.fstring.python","storage.type.string.python string.quoted.raw.single.python string.interpolated.python"]); expect(tokens[4][1].value).toBe("'"); @@ -6995,25 +7536,33 @@ describe("Grammar Tests", function() { function() { tokens = grammar.tokenizeLines("fr'some {obj}'\nFr'some {obj}'\nfR'some {obj}'\nFR'some {obj}'") expect(tokens[0][0].value).toBe("fr"); - expect(tokens[0][0].scopes).toEqual(["source.python","string.regexp.quoted.single.python string.interpolated.python","storage.type.string.python"]); + expect(tokens[0][0].scopes).toEqual(["source.python","meta.fstring.python","storage.type.string.python string.quoted.raw.single.python string.interpolated.python"]); expect(tokens[0][1].value).toBe("'"); - expect(tokens[0][1].scopes).toEqual(["source.python","string.regexp.quoted.single.python string.interpolated.python","punctuation.definition.string.begin.python"]); + expect(tokens[0][1].scopes).toEqual(["source.python","meta.fstring.python","string.quoted.raw.single.python punctuation.definition.string.begin.python"]); expect(tokens[0][2].value).toBe("some "); - expect(tokens[0][2].scopes).toEqual(["source.python","string.regexp.quoted.single.python string.interpolated.python"]); - expect(tokens[0][3].value).toBe("{obj}"); - expect(tokens[0][3].scopes).toEqual(["source.python","string.regexp.quoted.single.python string.interpolated.python"]); - expect(tokens[0][4].value).toBe("'"); - expect(tokens[0][4].scopes).toEqual(["source.python","string.regexp.quoted.single.python string.interpolated.python","punctuation.definition.string.end.python"]); + expect(tokens[0][2].scopes).toEqual(["source.python","meta.fstring.python","string.quoted.raw.single.python string.interpolated.python"]); + expect(tokens[0][3].value).toBe("{"); + expect(tokens[0][3].scopes).toEqual(["source.python","meta.fstring.python","constant.character.format.placeholder.other.python"]); + expect(tokens[0][4].value).toBe("obj"); + expect(tokens[0][4].scopes).toEqual(["source.python","meta.fstring.python"]); + expect(tokens[0][5].value).toBe("}"); + expect(tokens[0][5].scopes).toEqual(["source.python","meta.fstring.python","constant.character.format.placeholder.other.python"]); + expect(tokens[0][6].value).toBe("'"); + expect(tokens[0][6].scopes).toEqual(["source.python","meta.fstring.python","string.quoted.raw.single.python string.interpolated.python punctuation.definition.string.end.python"]); expect(tokens[1][0].value).toBe("Fr"); - expect(tokens[1][0].scopes).toEqual(["source.python","string.regexp.quoted.single.python string.interpolated.python","storage.type.string.python"]); + expect(tokens[1][0].scopes).toEqual(["source.python","meta.fstring.python","storage.type.string.python string.quoted.raw.single.python string.interpolated.python"]); expect(tokens[1][1].value).toBe("'"); - expect(tokens[1][1].scopes).toEqual(["source.python","string.regexp.quoted.single.python string.interpolated.python","punctuation.definition.string.begin.python"]); + expect(tokens[1][1].scopes).toEqual(["source.python","meta.fstring.python","string.quoted.raw.single.python punctuation.definition.string.begin.python"]); expect(tokens[1][2].value).toBe("some "); - expect(tokens[1][2].scopes).toEqual(["source.python","string.regexp.quoted.single.python string.interpolated.python"]); - expect(tokens[1][3].value).toBe("{obj}"); - expect(tokens[1][3].scopes).toEqual(["source.python","string.regexp.quoted.single.python string.interpolated.python"]); - expect(tokens[1][4].value).toBe("'"); - expect(tokens[1][4].scopes).toEqual(["source.python","string.regexp.quoted.single.python string.interpolated.python","punctuation.definition.string.end.python"]); + expect(tokens[1][2].scopes).toEqual(["source.python","meta.fstring.python","string.quoted.raw.single.python string.interpolated.python"]); + expect(tokens[1][3].value).toBe("{"); + expect(tokens[1][3].scopes).toEqual(["source.python","meta.fstring.python","constant.character.format.placeholder.other.python"]); + expect(tokens[1][4].value).toBe("obj"); + expect(tokens[1][4].scopes).toEqual(["source.python","meta.fstring.python"]); + expect(tokens[1][5].value).toBe("}"); + expect(tokens[1][5].scopes).toEqual(["source.python","meta.fstring.python","constant.character.format.placeholder.other.python"]); + expect(tokens[1][6].value).toBe("'"); + expect(tokens[1][6].scopes).toEqual(["source.python","meta.fstring.python","string.quoted.raw.single.python string.interpolated.python punctuation.definition.string.end.python"]); expect(tokens[2][0].value).toBe("fR"); expect(tokens[2][0].scopes).toEqual(["source.python","meta.fstring.python","storage.type.string.python string.quoted.raw.single.python string.interpolated.python"]); expect(tokens[2][1].value).toBe("'"); @@ -7419,6 +7968,37 @@ describe("Grammar Tests", function() { expect(tokens[2][20].scopes).toEqual(["source.python","comment.line.number-sign.python"]); }); + it("test/fstrings/simple10.py", + function() { + tokens = grammar.tokenizeLines("f'values: {a=} {b=!r}'") + expect(tokens[0][0].value).toBe("f"); + expect(tokens[0][0].scopes).toEqual(["source.python","meta.fstring.python","storage.type.string.python string.quoted.single.python string.interpolated.python"]); + expect(tokens[0][1].value).toBe("'"); + expect(tokens[0][1].scopes).toEqual(["source.python","meta.fstring.python","string.quoted.single.python string.interpolated.python punctuation.definition.string.begin.python"]); + expect(tokens[0][2].value).toBe("values: "); + expect(tokens[0][2].scopes).toEqual(["source.python","meta.fstring.python","string.quoted.single.python string.interpolated.python"]); + expect(tokens[0][3].value).toBe("{"); + expect(tokens[0][3].scopes).toEqual(["source.python","meta.fstring.python","constant.character.format.placeholder.other.python"]); + expect(tokens[0][4].value).toBe("a"); + expect(tokens[0][4].scopes).toEqual(["source.python","meta.fstring.python"]); + expect(tokens[0][5].value).toBe("="); + expect(tokens[0][5].scopes).toEqual(["source.python","meta.fstring.python","storage.type.format.python"]); + expect(tokens[0][6].value).toBe("}"); + expect(tokens[0][6].scopes).toEqual(["source.python","meta.fstring.python","constant.character.format.placeholder.other.python"]); + expect(tokens[0][7].value).toBe(" "); + expect(tokens[0][7].scopes).toEqual(["source.python","meta.fstring.python","string.quoted.single.python string.interpolated.python"]); + expect(tokens[0][8].value).toBe("{"); + expect(tokens[0][8].scopes).toEqual(["source.python","meta.fstring.python","constant.character.format.placeholder.other.python"]); + expect(tokens[0][9].value).toBe("b"); + expect(tokens[0][9].scopes).toEqual(["source.python","meta.fstring.python"]); + expect(tokens[0][10].value).toBe("=!r"); + expect(tokens[0][10].scopes).toEqual(["source.python","meta.fstring.python","storage.type.format.python"]); + expect(tokens[0][11].value).toBe("}"); + expect(tokens[0][11].scopes).toEqual(["source.python","meta.fstring.python","constant.character.format.placeholder.other.python"]); + expect(tokens[0][12].value).toBe("'"); + expect(tokens[0][12].scopes).toEqual(["source.python","meta.fstring.python","string.quoted.single.python string.interpolated.python punctuation.definition.string.end.python"]); + }); + it("test/fstrings/simple2.py", function() { tokens = grammar.tokenizeLines("a = f\"normal {{ normal }} normal } {10!r} normal {fo.__add__!s}\"") @@ -7463,9 +8043,9 @@ describe("Grammar Tests", function() { expect(tokens[0][19].value).toBe("fo"); expect(tokens[0][19].scopes).toEqual(["source.python","meta.fstring.python"]); expect(tokens[0][20].value).toBe("."); - expect(tokens[0][20].scopes).toEqual(["source.python","meta.fstring.python","punctuation.separator.period.python"]); + expect(tokens[0][20].scopes).toEqual(["source.python","meta.fstring.python","meta.member.access.python","punctuation.separator.period.python"]); expect(tokens[0][21].value).toBe("__add__"); - expect(tokens[0][21].scopes).toEqual(["source.python","meta.fstring.python","support.function.magic.python"]); + expect(tokens[0][21].scopes).toEqual(["source.python","meta.fstring.python","meta.member.access.python","support.function.magic.python"]); expect(tokens[0][22].value).toBe("!s"); expect(tokens[0][22].scopes).toEqual(["source.python","meta.fstring.python","storage.type.format.python"]); expect(tokens[0][23].value).toBe("}"); @@ -7917,7 +8497,7 @@ describe("Grammar Tests", function() { expect(tokens[3][12].value).toBe(" "); expect(tokens[3][12].scopes).toEqual(["source.python"]); expect(tokens[3][13].value).toBe("in"); - expect(tokens[3][13].scopes).toEqual(["source.python","keyword.operator.logical.python"]); + expect(tokens[3][13].scopes).toEqual(["source.python","keyword.control.flow.python"]); expect(tokens[3][14].value).toBe(" "); expect(tokens[3][14].scopes).toEqual(["source.python"]); expect(tokens[3][15].value).toBe("b"); @@ -8430,37 +9010,98 @@ describe("Grammar Tests", function() { expect(tokens[14][9].scopes).toEqual(["source.python","constant.numeric.dec.python"]); }); - it("test/functions/decl2.py", + it("test/functions/decl15.py", function() { - tokens = grammar.tokenizeLines("def result_annot(lambda, lambda=) -> qqq[None]:\n pass") + tokens = grammar.tokenizeLines("def showcase(a, b, /, c, d, *, e, f):\n return") expect(tokens[0][0].value).toBe("def"); expect(tokens[0][0].scopes).toEqual(["source.python","meta.function.python","storage.type.function.python"]); expect(tokens[0][1].value).toBe(" "); expect(tokens[0][1].scopes).toEqual(["source.python","meta.function.python"]); - expect(tokens[0][2].value).toBe("result_annot"); + expect(tokens[0][2].value).toBe("showcase"); expect(tokens[0][2].scopes).toEqual(["source.python","meta.function.python","entity.name.function.python"]); expect(tokens[0][3].value).toBe("("); expect(tokens[0][3].scopes).toEqual(["source.python","meta.function.python","meta.function.parameters.python","punctuation.definition.parameters.begin.python"]); - expect(tokens[0][4].value).toBe("lambda"); - expect(tokens[0][4].scopes).toEqual(["source.python","meta.function.python","meta.function.parameters.python","storage.type.function.lambda.python"]); - expect(tokens[0][5].value).toBe(", "); - expect(tokens[0][5].scopes).toEqual(["source.python","meta.function.python","meta.function.parameters.python"]); - expect(tokens[0][6].value).toBe("lambda"); - expect(tokens[0][6].scopes).toEqual(["source.python","meta.function.python","meta.function.parameters.python","keyword.control.flow.python"]); - expect(tokens[0][7].value).toBe("="); - expect(tokens[0][7].scopes).toEqual(["source.python","meta.function.python","meta.function.parameters.python","keyword.operator.python"]); - expect(tokens[0][8].value).toBe(")"); - expect(tokens[0][8].scopes).toEqual(["source.python","meta.function.python","meta.function.parameters.python","punctuation.definition.parameters.end.python"]); + expect(tokens[0][4].value).toBe("a"); + expect(tokens[0][4].scopes).toEqual(["source.python","meta.function.python","meta.function.parameters.python","variable.parameter.function.language.python"]); + expect(tokens[0][5].value).toBe(","); + expect(tokens[0][5].scopes).toEqual(["source.python","meta.function.python","meta.function.parameters.python","punctuation.separator.parameters.python"]); + expect(tokens[0][6].value).toBe(" "); + expect(tokens[0][6].scopes).toEqual(["source.python","meta.function.python","meta.function.parameters.python"]); + expect(tokens[0][7].value).toBe("b"); + expect(tokens[0][7].scopes).toEqual(["source.python","meta.function.python","meta.function.parameters.python","variable.parameter.function.language.python"]); + expect(tokens[0][8].value).toBe(","); + expect(tokens[0][8].scopes).toEqual(["source.python","meta.function.python","meta.function.parameters.python","punctuation.separator.parameters.python"]); expect(tokens[0][9].value).toBe(" "); - expect(tokens[0][9].scopes).toEqual(["source.python","meta.function.python"]); - expect(tokens[0][10].value).toBe("->"); - expect(tokens[0][10].scopes).toEqual(["source.python","meta.function.python","punctuation.separator.annotation.result.python"]); - expect(tokens[0][11].value).toBe(" "); - expect(tokens[0][11].scopes).toEqual(["source.python","meta.function.python"]); - expect(tokens[0][12].value).toBe("qqq"); - expect(tokens[0][12].scopes).toEqual(["source.python","meta.function.python","meta.item-access.python"]); - expect(tokens[0][13].value).toBe("["); - expect(tokens[0][13].scopes).toEqual(["source.python","meta.function.python","meta.item-access.python","punctuation.definition.arguments.begin.python"]); + expect(tokens[0][9].scopes).toEqual(["source.python","meta.function.python","meta.function.parameters.python"]); + expect(tokens[0][10].value).toBe("/"); + expect(tokens[0][10].scopes).toEqual(["source.python","meta.function.python","meta.function.parameters.python","keyword.operator.positional.parameter.python"]); + expect(tokens[0][11].value).toBe(", "); + expect(tokens[0][11].scopes).toEqual(["source.python","meta.function.python","meta.function.parameters.python"]); + expect(tokens[0][12].value).toBe("c"); + expect(tokens[0][12].scopes).toEqual(["source.python","meta.function.python","meta.function.parameters.python","variable.parameter.function.language.python"]); + expect(tokens[0][13].value).toBe(","); + expect(tokens[0][13].scopes).toEqual(["source.python","meta.function.python","meta.function.parameters.python","punctuation.separator.parameters.python"]); + expect(tokens[0][14].value).toBe(" "); + expect(tokens[0][14].scopes).toEqual(["source.python","meta.function.python","meta.function.parameters.python"]); + expect(tokens[0][15].value).toBe("d"); + expect(tokens[0][15].scopes).toEqual(["source.python","meta.function.python","meta.function.parameters.python","variable.parameter.function.language.python"]); + expect(tokens[0][16].value).toBe(","); + expect(tokens[0][16].scopes).toEqual(["source.python","meta.function.python","meta.function.parameters.python","punctuation.separator.parameters.python"]); + expect(tokens[0][17].value).toBe(" "); + expect(tokens[0][17].scopes).toEqual(["source.python","meta.function.python","meta.function.parameters.python"]); + expect(tokens[0][18].value).toBe("*"); + expect(tokens[0][18].scopes).toEqual(["source.python","meta.function.python","meta.function.parameters.python","keyword.operator.unpacking.parameter.python"]); + expect(tokens[0][19].value).toBe(", "); + expect(tokens[0][19].scopes).toEqual(["source.python","meta.function.python","meta.function.parameters.python"]); + expect(tokens[0][20].value).toBe("e"); + expect(tokens[0][20].scopes).toEqual(["source.python","meta.function.python","meta.function.parameters.python","variable.parameter.function.language.python"]); + expect(tokens[0][21].value).toBe(","); + expect(tokens[0][21].scopes).toEqual(["source.python","meta.function.python","meta.function.parameters.python","punctuation.separator.parameters.python"]); + expect(tokens[0][22].value).toBe(" "); + expect(tokens[0][22].scopes).toEqual(["source.python","meta.function.python","meta.function.parameters.python"]); + expect(tokens[0][23].value).toBe("f"); + expect(tokens[0][23].scopes).toEqual(["source.python","meta.function.python","meta.function.parameters.python","variable.parameter.function.language.python"]); + expect(tokens[0][24].value).toBe(")"); + expect(tokens[0][24].scopes).toEqual(["source.python","meta.function.python","meta.function.parameters.python","punctuation.definition.parameters.end.python"]); + expect(tokens[0][25].value).toBe(":"); + expect(tokens[0][25].scopes).toEqual(["source.python","meta.function.python","punctuation.section.function.begin.python"]); + expect(tokens[1][0].value).toBe(" "); + expect(tokens[1][0].scopes).toEqual(["source.python"]); + expect(tokens[1][1].value).toBe("return"); + expect(tokens[1][1].scopes).toEqual(["source.python","keyword.control.flow.python"]); + }); + + it("test/functions/decl2.py", + function() { + tokens = grammar.tokenizeLines("def result_annot(lambda, lambda=) -> qqq[None]:\n pass") + expect(tokens[0][0].value).toBe("def"); + expect(tokens[0][0].scopes).toEqual(["source.python","meta.function.python","storage.type.function.python"]); + expect(tokens[0][1].value).toBe(" "); + expect(tokens[0][1].scopes).toEqual(["source.python","meta.function.python"]); + expect(tokens[0][2].value).toBe("result_annot"); + expect(tokens[0][2].scopes).toEqual(["source.python","meta.function.python","entity.name.function.python"]); + expect(tokens[0][3].value).toBe("("); + expect(tokens[0][3].scopes).toEqual(["source.python","meta.function.python","meta.function.parameters.python","punctuation.definition.parameters.begin.python"]); + expect(tokens[0][4].value).toBe("lambda"); + expect(tokens[0][4].scopes).toEqual(["source.python","meta.function.python","meta.function.parameters.python","storage.type.function.lambda.python"]); + expect(tokens[0][5].value).toBe(", "); + expect(tokens[0][5].scopes).toEqual(["source.python","meta.function.python","meta.function.parameters.python"]); + expect(tokens[0][6].value).toBe("lambda"); + expect(tokens[0][6].scopes).toEqual(["source.python","meta.function.python","meta.function.parameters.python","keyword.control.flow.python"]); + expect(tokens[0][7].value).toBe("="); + expect(tokens[0][7].scopes).toEqual(["source.python","meta.function.python","meta.function.parameters.python","keyword.operator.python"]); + expect(tokens[0][8].value).toBe(")"); + expect(tokens[0][8].scopes).toEqual(["source.python","meta.function.python","meta.function.parameters.python","punctuation.definition.parameters.end.python"]); + expect(tokens[0][9].value).toBe(" "); + expect(tokens[0][9].scopes).toEqual(["source.python","meta.function.python"]); + expect(tokens[0][10].value).toBe("->"); + expect(tokens[0][10].scopes).toEqual(["source.python","meta.function.python","punctuation.separator.annotation.result.python"]); + expect(tokens[0][11].value).toBe(" "); + expect(tokens[0][11].scopes).toEqual(["source.python","meta.function.python"]); + expect(tokens[0][12].value).toBe("qqq"); + expect(tokens[0][12].scopes).toEqual(["source.python","meta.function.python","meta.item-access.python","meta.indexed-name.python"]); + expect(tokens[0][13].value).toBe("["); + expect(tokens[0][13].scopes).toEqual(["source.python","meta.function.python","meta.item-access.python","punctuation.definition.arguments.begin.python"]); expect(tokens[0][14].value).toBe("None"); expect(tokens[0][14].scopes).toEqual(["source.python","meta.function.python","meta.item-access.python","meta.item-access.arguments.python","constant.language.python"]); expect(tokens[0][15].value).toBe("]"); @@ -8664,7 +9305,7 @@ describe("Grammar Tests", function() { expect(tokens[4][7].value).toBe(" "); expect(tokens[4][7].scopes).toEqual(["source.python","meta.function.python","meta.function.parameters.python"]); expect(tokens[4][8].value).toBe("in"); - expect(tokens[4][8].scopes).toEqual(["source.python","meta.function.python","meta.function.parameters.python","keyword.operator.logical.python"]); + expect(tokens[4][8].scopes).toEqual(["source.python","meta.function.python","meta.function.parameters.python","keyword.control.flow.python"]); expect(tokens[5][0].value).toBe(" "); expect(tokens[5][0].scopes).toEqual(["source.python","meta.function.python","meta.function.parameters.python"]); expect(tokens[5][1].value).toBe("("); @@ -9363,7 +10004,7 @@ describe("Grammar Tests", function() { expect(tokens[2][0].value).toBe(" "); expect(tokens[2][0].scopes).toEqual(["source.python"]); expect(tokens[2][1].value).toBe("baz"); - expect(tokens[2][1].scopes).toEqual(["source.python","meta.item-access.python"]); + expect(tokens[2][1].scopes).toEqual(["source.python","meta.item-access.python","meta.indexed-name.python"]); expect(tokens[2][2].value).toBe("["); expect(tokens[2][2].scopes).toEqual(["source.python","meta.item-access.python","punctuation.definition.arguments.begin.python"]); expect(tokens[2][3].value).toBe("1"); @@ -9561,6 +10202,71 @@ describe("Grammar Tests", function() { expect(tokens[1][3].scopes).toEqual(["source.python","meta.function-call.python","punctuation.definition.arguments.end.python"]); }); + it("test/functions/lambda10.py", + function() { + tokens = grammar.tokenizeLines("showcase = lambda a, /, b, *, c: (a + b + c)") + expect(tokens[0][0].value).toBe("showcase"); + expect(tokens[0][0].scopes).toEqual(["source.python"]); + expect(tokens[0][1].value).toBe(" "); + expect(tokens[0][1].scopes).toEqual(["source.python"]); + expect(tokens[0][2].value).toBe("="); + expect(tokens[0][2].scopes).toEqual(["source.python","keyword.operator.assignment.python"]); + expect(tokens[0][3].value).toBe(" "); + expect(tokens[0][3].scopes).toEqual(["source.python"]); + expect(tokens[0][4].value).toBe("lambda"); + expect(tokens[0][4].scopes).toEqual(["source.python","meta.lambda-function.python","storage.type.function.lambda.python"]); + expect(tokens[0][5].value).toBe(" "); + expect(tokens[0][5].scopes).toEqual(["source.python","meta.lambda-function.python","meta.function.lambda.parameters.python"]); + expect(tokens[0][6].value).toBe("a"); + expect(tokens[0][6].scopes).toEqual(["source.python","meta.lambda-function.python","meta.function.lambda.parameters.python","variable.parameter.function.language.python"]); + expect(tokens[0][7].value).toBe(","); + expect(tokens[0][7].scopes).toEqual(["source.python","meta.lambda-function.python","meta.function.lambda.parameters.python","punctuation.separator.parameters.python"]); + expect(tokens[0][8].value).toBe(" "); + expect(tokens[0][8].scopes).toEqual(["source.python","meta.lambda-function.python","meta.function.lambda.parameters.python"]); + expect(tokens[0][9].value).toBe("/"); + expect(tokens[0][9].scopes).toEqual(["source.python","meta.lambda-function.python","meta.function.lambda.parameters.python","keyword.operator.positional.parameter.python"]); + expect(tokens[0][10].value).toBe(", "); + expect(tokens[0][10].scopes).toEqual(["source.python","meta.lambda-function.python","meta.function.lambda.parameters.python"]); + expect(tokens[0][11].value).toBe("b"); + expect(tokens[0][11].scopes).toEqual(["source.python","meta.lambda-function.python","meta.function.lambda.parameters.python","variable.parameter.function.language.python"]); + expect(tokens[0][12].value).toBe(","); + expect(tokens[0][12].scopes).toEqual(["source.python","meta.lambda-function.python","meta.function.lambda.parameters.python","punctuation.separator.parameters.python"]); + expect(tokens[0][13].value).toBe(" "); + expect(tokens[0][13].scopes).toEqual(["source.python","meta.lambda-function.python","meta.function.lambda.parameters.python"]); + expect(tokens[0][14].value).toBe("*"); + expect(tokens[0][14].scopes).toEqual(["source.python","meta.lambda-function.python","meta.function.lambda.parameters.python","keyword.operator.unpacking.parameter.python"]); + expect(tokens[0][15].value).toBe(", "); + expect(tokens[0][15].scopes).toEqual(["source.python","meta.lambda-function.python","meta.function.lambda.parameters.python"]); + expect(tokens[0][16].value).toBe("c"); + expect(tokens[0][16].scopes).toEqual(["source.python","meta.lambda-function.python","meta.function.lambda.parameters.python","variable.parameter.function.language.python"]); + expect(tokens[0][17].value).toBe(":"); + expect(tokens[0][17].scopes).toEqual(["source.python","meta.lambda-function.python","punctuation.section.function.lambda.begin.python"]); + expect(tokens[0][18].value).toBe(" "); + expect(tokens[0][18].scopes).toEqual(["source.python"]); + expect(tokens[0][19].value).toBe("("); + expect(tokens[0][19].scopes).toEqual(["source.python","punctuation.parenthesis.begin.python"]); + expect(tokens[0][20].value).toBe("a"); + expect(tokens[0][20].scopes).toEqual(["source.python"]); + expect(tokens[0][21].value).toBe(" "); + expect(tokens[0][21].scopes).toEqual(["source.python"]); + expect(tokens[0][22].value).toBe("+"); + expect(tokens[0][22].scopes).toEqual(["source.python","keyword.operator.arithmetic.python"]); + expect(tokens[0][23].value).toBe(" "); + expect(tokens[0][23].scopes).toEqual(["source.python"]); + expect(tokens[0][24].value).toBe("b"); + expect(tokens[0][24].scopes).toEqual(["source.python"]); + expect(tokens[0][25].value).toBe(" "); + expect(tokens[0][25].scopes).toEqual(["source.python"]); + expect(tokens[0][26].value).toBe("+"); + expect(tokens[0][26].scopes).toEqual(["source.python","keyword.operator.arithmetic.python"]); + expect(tokens[0][27].value).toBe(" "); + expect(tokens[0][27].scopes).toEqual(["source.python"]); + expect(tokens[0][28].value).toBe("c"); + expect(tokens[0][28].scopes).toEqual(["source.python"]); + expect(tokens[0][29].value).toBe(")"); + expect(tokens[0][29].scopes).toEqual(["source.python","punctuation.parenthesis.end.python"]); + }); + it("test/functions/lambda2.py", function() { tokens = grammar.tokenizeLines("lll(lambda=1)") @@ -10044,19 +10750,19 @@ describe("Grammar Tests", function() { expect(tokens[4][7].value).toBe(")"); expect(tokens[4][7].scopes).toEqual(["source.python","punctuation.parenthesis.end.python"]); expect(tokens[4][8].value).toBe("."); - expect(tokens[4][8].scopes).toEqual(["source.python","punctuation.separator.period.python"]); + expect(tokens[4][8].scopes).toEqual(["source.python","meta.member.access.python","punctuation.separator.period.python"]); expect(tokens[4][9].value).toBe("fuuuu"); - expect(tokens[4][9].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.generic.python"]); + expect(tokens[4][9].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.generic.python"]); expect(tokens[4][10].value).toBe("("); - expect(tokens[4][10].scopes).toEqual(["source.python","meta.function-call.python","punctuation.definition.arguments.begin.python"]); + expect(tokens[4][10].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","punctuation.definition.arguments.begin.python"]); expect(tokens[4][11].value).toBe("baz"); - expect(tokens[4][11].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","variable.parameter.function-call.python"]); + expect(tokens[4][11].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","variable.parameter.function-call.python"]); expect(tokens[4][12].value).toBe("="); - expect(tokens[4][12].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","keyword.operator.assignment.python"]); + expect(tokens[4][12].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","keyword.operator.assignment.python"]); expect(tokens[4][13].value).toBe("1"); - expect(tokens[4][13].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","constant.numeric.dec.python"]); + expect(tokens[4][13].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","constant.numeric.dec.python"]); expect(tokens[4][14].value).toBe(")"); - expect(tokens[4][14].scopes).toEqual(["source.python","meta.function-call.python","punctuation.definition.arguments.end.python"]); + expect(tokens[4][14].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","punctuation.definition.arguments.end.python"]); expect(tokens[5][0].value).toBe("#"); expect(tokens[5][0].scopes).toEqual(["source.python","comment.line.number-sign.python","punctuation.definition.comment.python"]); expect(tokens[5][1].value).toBe(" we recover just fine"); @@ -10425,9 +11131,9 @@ describe("Grammar Tests", function() { expect(tokens[0][15].scopes).toEqual(["source.python","string.regexp.quoted.multi.python","punctuation.definition.string.end.python"]); }); - it("test/regexp/fregexp1.py", + it("test/regexp/python1.py", function() { - tokens = grammar.tokenizeLines("a = fr'[a-z]'\na = Fr'[a-z]'\na = rf'[a-z]'\na = rF'[a-z]'") + tokens = grammar.tokenizeLines("a = r'[a-z]'\na = R'[a-z]'") expect(tokens[0][0].value).toBe("a"); expect(tokens[0][0].scopes).toEqual(["source.python"]); expect(tokens[0][1].value).toBe(" "); @@ -10436,22 +11142,22 @@ describe("Grammar Tests", function() { expect(tokens[0][2].scopes).toEqual(["source.python","keyword.operator.assignment.python"]); expect(tokens[0][3].value).toBe(" "); expect(tokens[0][3].scopes).toEqual(["source.python"]); - expect(tokens[0][4].value).toBe("fr"); - expect(tokens[0][4].scopes).toEqual(["source.python","string.regexp.quoted.single.python string.interpolated.python","storage.type.string.python"]); + expect(tokens[0][4].value).toBe("r"); + expect(tokens[0][4].scopes).toEqual(["source.python","string.regexp.quoted.single.python","storage.type.string.python"]); expect(tokens[0][5].value).toBe("'"); - expect(tokens[0][5].scopes).toEqual(["source.python","string.regexp.quoted.single.python string.interpolated.python","punctuation.definition.string.begin.python"]); + expect(tokens[0][5].scopes).toEqual(["source.python","string.regexp.quoted.single.python","punctuation.definition.string.begin.python"]); expect(tokens[0][6].value).toBe("["); - expect(tokens[0][6].scopes).toEqual(["source.python","string.regexp.quoted.single.python string.interpolated.python","meta.character.set.regexp","constant.other.set.regexp punctuation.character.set.begin.regexp"]); + expect(tokens[0][6].scopes).toEqual(["source.python","string.regexp.quoted.single.python","meta.character.set.regexp","constant.other.set.regexp punctuation.character.set.begin.regexp"]); expect(tokens[0][7].value).toBe("a"); - expect(tokens[0][7].scopes).toEqual(["source.python","string.regexp.quoted.single.python string.interpolated.python","meta.character.set.regexp","constant.character.set.regexp"]); + expect(tokens[0][7].scopes).toEqual(["source.python","string.regexp.quoted.single.python","meta.character.set.regexp","constant.character.set.regexp"]); expect(tokens[0][8].value).toBe("-"); - expect(tokens[0][8].scopes).toEqual(["source.python","string.regexp.quoted.single.python string.interpolated.python","meta.character.set.regexp","constant.character.set.regexp"]); + expect(tokens[0][8].scopes).toEqual(["source.python","string.regexp.quoted.single.python","meta.character.set.regexp","constant.character.set.regexp"]); expect(tokens[0][9].value).toBe("z"); - expect(tokens[0][9].scopes).toEqual(["source.python","string.regexp.quoted.single.python string.interpolated.python","meta.character.set.regexp","constant.character.set.regexp"]); + expect(tokens[0][9].scopes).toEqual(["source.python","string.regexp.quoted.single.python","meta.character.set.regexp","constant.character.set.regexp"]); expect(tokens[0][10].value).toBe("]"); - expect(tokens[0][10].scopes).toEqual(["source.python","string.regexp.quoted.single.python string.interpolated.python","meta.character.set.regexp","constant.other.set.regexp punctuation.character.set.end.regexp"]); + expect(tokens[0][10].scopes).toEqual(["source.python","string.regexp.quoted.single.python","meta.character.set.regexp","constant.other.set.regexp punctuation.character.set.end.regexp"]); expect(tokens[0][11].value).toBe("'"); - expect(tokens[0][11].scopes).toEqual(["source.python","string.regexp.quoted.single.python string.interpolated.python","punctuation.definition.string.end.python"]); + expect(tokens[0][11].scopes).toEqual(["source.python","string.regexp.quoted.single.python","punctuation.definition.string.end.python"]); expect(tokens[1][0].value).toBe("a"); expect(tokens[1][0].scopes).toEqual(["source.python"]); expect(tokens[1][1].value).toBe(" "); @@ -10460,165 +11166,19 @@ describe("Grammar Tests", function() { expect(tokens[1][2].scopes).toEqual(["source.python","keyword.operator.assignment.python"]); expect(tokens[1][3].value).toBe(" "); expect(tokens[1][3].scopes).toEqual(["source.python"]); - expect(tokens[1][4].value).toBe("Fr"); - expect(tokens[1][4].scopes).toEqual(["source.python","string.regexp.quoted.single.python string.interpolated.python","storage.type.string.python"]); + expect(tokens[1][4].value).toBe("R"); + expect(tokens[1][4].scopes).toEqual(["source.python","string.quoted.raw.single.python","storage.type.string.python"]); expect(tokens[1][5].value).toBe("'"); - expect(tokens[1][5].scopes).toEqual(["source.python","string.regexp.quoted.single.python string.interpolated.python","punctuation.definition.string.begin.python"]); - expect(tokens[1][6].value).toBe("["); - expect(tokens[1][6].scopes).toEqual(["source.python","string.regexp.quoted.single.python string.interpolated.python","meta.character.set.regexp","constant.other.set.regexp punctuation.character.set.begin.regexp"]); - expect(tokens[1][7].value).toBe("a"); - expect(tokens[1][7].scopes).toEqual(["source.python","string.regexp.quoted.single.python string.interpolated.python","meta.character.set.regexp","constant.character.set.regexp"]); - expect(tokens[1][8].value).toBe("-"); - expect(tokens[1][8].scopes).toEqual(["source.python","string.regexp.quoted.single.python string.interpolated.python","meta.character.set.regexp","constant.character.set.regexp"]); - expect(tokens[1][9].value).toBe("z"); - expect(tokens[1][9].scopes).toEqual(["source.python","string.regexp.quoted.single.python string.interpolated.python","meta.character.set.regexp","constant.character.set.regexp"]); - expect(tokens[1][10].value).toBe("]"); - expect(tokens[1][10].scopes).toEqual(["source.python","string.regexp.quoted.single.python string.interpolated.python","meta.character.set.regexp","constant.other.set.regexp punctuation.character.set.end.regexp"]); - expect(tokens[1][11].value).toBe("'"); - expect(tokens[1][11].scopes).toEqual(["source.python","string.regexp.quoted.single.python string.interpolated.python","punctuation.definition.string.end.python"]); - expect(tokens[2][0].value).toBe("a"); - expect(tokens[2][0].scopes).toEqual(["source.python"]); - expect(tokens[2][1].value).toBe(" "); - expect(tokens[2][1].scopes).toEqual(["source.python"]); - expect(tokens[2][2].value).toBe("="); - expect(tokens[2][2].scopes).toEqual(["source.python","keyword.operator.assignment.python"]); - expect(tokens[2][3].value).toBe(" "); - expect(tokens[2][3].scopes).toEqual(["source.python"]); - expect(tokens[2][4].value).toBe("rf"); - expect(tokens[2][4].scopes).toEqual(["source.python","string.regexp.quoted.single.python string.interpolated.python","storage.type.string.python"]); - expect(tokens[2][5].value).toBe("'"); - expect(tokens[2][5].scopes).toEqual(["source.python","string.regexp.quoted.single.python string.interpolated.python","punctuation.definition.string.begin.python"]); - expect(tokens[2][6].value).toBe("["); - expect(tokens[2][6].scopes).toEqual(["source.python","string.regexp.quoted.single.python string.interpolated.python","meta.character.set.regexp","constant.other.set.regexp punctuation.character.set.begin.regexp"]); - expect(tokens[2][7].value).toBe("a"); - expect(tokens[2][7].scopes).toEqual(["source.python","string.regexp.quoted.single.python string.interpolated.python","meta.character.set.regexp","constant.character.set.regexp"]); - expect(tokens[2][8].value).toBe("-"); - expect(tokens[2][8].scopes).toEqual(["source.python","string.regexp.quoted.single.python string.interpolated.python","meta.character.set.regexp","constant.character.set.regexp"]); - expect(tokens[2][9].value).toBe("z"); - expect(tokens[2][9].scopes).toEqual(["source.python","string.regexp.quoted.single.python string.interpolated.python","meta.character.set.regexp","constant.character.set.regexp"]); - expect(tokens[2][10].value).toBe("]"); - expect(tokens[2][10].scopes).toEqual(["source.python","string.regexp.quoted.single.python string.interpolated.python","meta.character.set.regexp","constant.other.set.regexp punctuation.character.set.end.regexp"]); - expect(tokens[2][11].value).toBe("'"); - expect(tokens[2][11].scopes).toEqual(["source.python","string.regexp.quoted.single.python string.interpolated.python","punctuation.definition.string.end.python"]); - expect(tokens[3][0].value).toBe("a"); - expect(tokens[3][0].scopes).toEqual(["source.python"]); - expect(tokens[3][1].value).toBe(" "); - expect(tokens[3][1].scopes).toEqual(["source.python"]); - expect(tokens[3][2].value).toBe("="); - expect(tokens[3][2].scopes).toEqual(["source.python","keyword.operator.assignment.python"]); - expect(tokens[3][3].value).toBe(" "); - expect(tokens[3][3].scopes).toEqual(["source.python"]); - expect(tokens[3][4].value).toBe("rF"); - expect(tokens[3][4].scopes).toEqual(["source.python","string.regexp.quoted.single.python string.interpolated.python","storage.type.string.python"]); - expect(tokens[3][5].value).toBe("'"); - expect(tokens[3][5].scopes).toEqual(["source.python","string.regexp.quoted.single.python string.interpolated.python","punctuation.definition.string.begin.python"]); - expect(tokens[3][6].value).toBe("["); - expect(tokens[3][6].scopes).toEqual(["source.python","string.regexp.quoted.single.python string.interpolated.python","meta.character.set.regexp","constant.other.set.regexp punctuation.character.set.begin.regexp"]); - expect(tokens[3][7].value).toBe("a"); - expect(tokens[3][7].scopes).toEqual(["source.python","string.regexp.quoted.single.python string.interpolated.python","meta.character.set.regexp","constant.character.set.regexp"]); - expect(tokens[3][8].value).toBe("-"); - expect(tokens[3][8].scopes).toEqual(["source.python","string.regexp.quoted.single.python string.interpolated.python","meta.character.set.regexp","constant.character.set.regexp"]); - expect(tokens[3][9].value).toBe("z"); - expect(tokens[3][9].scopes).toEqual(["source.python","string.regexp.quoted.single.python string.interpolated.python","meta.character.set.regexp","constant.character.set.regexp"]); - expect(tokens[3][10].value).toBe("]"); - expect(tokens[3][10].scopes).toEqual(["source.python","string.regexp.quoted.single.python string.interpolated.python","meta.character.set.regexp","constant.other.set.regexp punctuation.character.set.end.regexp"]); - expect(tokens[3][11].value).toBe("'"); - expect(tokens[3][11].scopes).toEqual(["source.python","string.regexp.quoted.single.python string.interpolated.python","punctuation.definition.string.end.python"]); - }); - - it("test/regexp/fregexp2.py", - function() { - tokens = grammar.tokenizeLines("rf'fo{{2}}'\nrf\"fo{{2}}\"\nrf'''fo{{2}}'''\nrf\"\"\"fo{{2}}\"\"\"") - expect(tokens[0][0].value).toBe("rf"); - expect(tokens[0][0].scopes).toEqual(["source.python","string.regexp.quoted.single.python string.interpolated.python","storage.type.string.python"]); - expect(tokens[0][1].value).toBe("'"); - expect(tokens[0][1].scopes).toEqual(["source.python","string.regexp.quoted.single.python string.interpolated.python","punctuation.definition.string.begin.python"]); - expect(tokens[0][2].value).toBe("fo"); - expect(tokens[0][2].scopes).toEqual(["source.python","string.regexp.quoted.single.python string.interpolated.python"]); - expect(tokens[0][3].value).toBe("{{2}}"); - expect(tokens[0][3].scopes).toEqual(["source.python","string.regexp.quoted.single.python string.interpolated.python","keyword.operator.quantifier.regexp"]); - expect(tokens[0][4].value).toBe("'"); - expect(tokens[0][4].scopes).toEqual(["source.python","string.regexp.quoted.single.python string.interpolated.python","punctuation.definition.string.end.python"]); - expect(tokens[1][0].value).toBe("rf"); - expect(tokens[1][0].scopes).toEqual(["source.python","string.regexp.quoted.single.python string.interpolated.python","storage.type.string.python"]); - expect(tokens[1][1].value).toBe("\""); - expect(tokens[1][1].scopes).toEqual(["source.python","string.regexp.quoted.single.python string.interpolated.python","punctuation.definition.string.begin.python"]); - expect(tokens[1][2].value).toBe("fo"); - expect(tokens[1][2].scopes).toEqual(["source.python","string.regexp.quoted.single.python string.interpolated.python"]); - expect(tokens[1][3].value).toBe("{{2}}"); - expect(tokens[1][3].scopes).toEqual(["source.python","string.regexp.quoted.single.python string.interpolated.python","keyword.operator.quantifier.regexp"]); - expect(tokens[1][4].value).toBe("\""); - expect(tokens[1][4].scopes).toEqual(["source.python","string.regexp.quoted.single.python string.interpolated.python","punctuation.definition.string.end.python"]); - expect(tokens[2][0].value).toBe("rf"); - expect(tokens[2][0].scopes).toEqual(["source.python","string.regexp.quoted.multi.python string.interpolated.python","storage.type.string.python"]); - expect(tokens[2][1].value).toBe("'''"); - expect(tokens[2][1].scopes).toEqual(["source.python","string.regexp.quoted.multi.python string.interpolated.python","punctuation.definition.string.begin.python"]); - expect(tokens[2][2].value).toBe("fo"); - expect(tokens[2][2].scopes).toEqual(["source.python","string.regexp.quoted.multi.python string.interpolated.python"]); - expect(tokens[2][3].value).toBe("{{2}}"); - expect(tokens[2][3].scopes).toEqual(["source.python","string.regexp.quoted.multi.python string.interpolated.python","keyword.operator.quantifier.regexp"]); - expect(tokens[2][4].value).toBe("'''"); - expect(tokens[2][4].scopes).toEqual(["source.python","string.regexp.quoted.multi.python string.interpolated.python","punctuation.definition.string.end.python"]); - expect(tokens[3][0].value).toBe("rf"); - expect(tokens[3][0].scopes).toEqual(["source.python","string.regexp.quoted.multi.python string.interpolated.python","storage.type.string.python"]); - expect(tokens[3][1].value).toBe("\"\"\""); - expect(tokens[3][1].scopes).toEqual(["source.python","string.regexp.quoted.multi.python string.interpolated.python","punctuation.definition.string.begin.python"]); - expect(tokens[3][2].value).toBe("fo"); - expect(tokens[3][2].scopes).toEqual(["source.python","string.regexp.quoted.multi.python string.interpolated.python"]); - expect(tokens[3][3].value).toBe("{{2}}"); - expect(tokens[3][3].scopes).toEqual(["source.python","string.regexp.quoted.multi.python string.interpolated.python","keyword.operator.quantifier.regexp"]); - expect(tokens[3][4].value).toBe("\"\"\""); - expect(tokens[3][4].scopes).toEqual(["source.python","string.regexp.quoted.multi.python string.interpolated.python","punctuation.definition.string.end.python"]); - }); - - it("test/regexp/fregexp3.py", - function() { - tokens = grammar.tokenizeLines("rf'fo{2}'\nrf\"fo{2}\"\nrf'''fo{2}'''\nrf\"\"\"fo{2}\"\"\"") - expect(tokens[0][0].value).toBe("rf"); - expect(tokens[0][0].scopes).toEqual(["source.python","string.regexp.quoted.single.python string.interpolated.python","storage.type.string.python"]); - expect(tokens[0][1].value).toBe("'"); - expect(tokens[0][1].scopes).toEqual(["source.python","string.regexp.quoted.single.python string.interpolated.python","punctuation.definition.string.begin.python"]); - expect(tokens[0][2].value).toBe("fo"); - expect(tokens[0][2].scopes).toEqual(["source.python","string.regexp.quoted.single.python string.interpolated.python"]); - expect(tokens[0][3].value).toBe("{2}"); - expect(tokens[0][3].scopes).toEqual(["source.python","string.regexp.quoted.single.python string.interpolated.python"]); - expect(tokens[0][4].value).toBe("'"); - expect(tokens[0][4].scopes).toEqual(["source.python","string.regexp.quoted.single.python string.interpolated.python","punctuation.definition.string.end.python"]); - expect(tokens[1][0].value).toBe("rf"); - expect(tokens[1][0].scopes).toEqual(["source.python","string.regexp.quoted.single.python string.interpolated.python","storage.type.string.python"]); - expect(tokens[1][1].value).toBe("\""); - expect(tokens[1][1].scopes).toEqual(["source.python","string.regexp.quoted.single.python string.interpolated.python","punctuation.definition.string.begin.python"]); - expect(tokens[1][2].value).toBe("fo"); - expect(tokens[1][2].scopes).toEqual(["source.python","string.regexp.quoted.single.python string.interpolated.python"]); - expect(tokens[1][3].value).toBe("{2}"); - expect(tokens[1][3].scopes).toEqual(["source.python","string.regexp.quoted.single.python string.interpolated.python"]); - expect(tokens[1][4].value).toBe("\""); - expect(tokens[1][4].scopes).toEqual(["source.python","string.regexp.quoted.single.python string.interpolated.python","punctuation.definition.string.end.python"]); - expect(tokens[2][0].value).toBe("rf"); - expect(tokens[2][0].scopes).toEqual(["source.python","string.regexp.quoted.multi.python string.interpolated.python","storage.type.string.python"]); - expect(tokens[2][1].value).toBe("'''"); - expect(tokens[2][1].scopes).toEqual(["source.python","string.regexp.quoted.multi.python string.interpolated.python","punctuation.definition.string.begin.python"]); - expect(tokens[2][2].value).toBe("fo"); - expect(tokens[2][2].scopes).toEqual(["source.python","string.regexp.quoted.multi.python string.interpolated.python"]); - expect(tokens[2][3].value).toBe("{2}"); - expect(tokens[2][3].scopes).toEqual(["source.python","string.regexp.quoted.multi.python string.interpolated.python"]); - expect(tokens[2][4].value).toBe("'''"); - expect(tokens[2][4].scopes).toEqual(["source.python","string.regexp.quoted.multi.python string.interpolated.python","punctuation.definition.string.end.python"]); - expect(tokens[3][0].value).toBe("rf"); - expect(tokens[3][0].scopes).toEqual(["source.python","string.regexp.quoted.multi.python string.interpolated.python","storage.type.string.python"]); - expect(tokens[3][1].value).toBe("\"\"\""); - expect(tokens[3][1].scopes).toEqual(["source.python","string.regexp.quoted.multi.python string.interpolated.python","punctuation.definition.string.begin.python"]); - expect(tokens[3][2].value).toBe("fo"); - expect(tokens[3][2].scopes).toEqual(["source.python","string.regexp.quoted.multi.python string.interpolated.python"]); - expect(tokens[3][3].value).toBe("{2}"); - expect(tokens[3][3].scopes).toEqual(["source.python","string.regexp.quoted.multi.python string.interpolated.python"]); - expect(tokens[3][4].value).toBe("\"\"\""); - expect(tokens[3][4].scopes).toEqual(["source.python","string.regexp.quoted.multi.python string.interpolated.python","punctuation.definition.string.end.python"]); + expect(tokens[1][5].scopes).toEqual(["source.python","string.quoted.raw.single.python","punctuation.definition.string.begin.python"]); + expect(tokens[1][6].value).toBe("[a-z]"); + expect(tokens[1][6].scopes).toEqual(["source.python","string.quoted.raw.single.python"]); + expect(tokens[1][7].value).toBe("'"); + expect(tokens[1][7].scopes).toEqual(["source.python","string.quoted.raw.single.python","punctuation.definition.string.end.python"]); }); - it("test/regexp/fregexp4.py", + it("test/regexp/python10.py", function() { - tokens = grammar.tokenizeLines("a = rf'fo{{2}}'\na = r'fo{{2}}'\na = r'fo{2}'") + tokens = grammar.tokenizeLines("a = r'(<\\' for\na = r\"(<\\\" for\na = r'[<\\' for\na = r\"[<\\\" for\na = r'(?=\\' for\na = r\"(?=\\\" for\na = r'(?P\\' for\na = r\"(?P\\\" for\na = r'(?\\' for\na = r\"(?P\\\" for\na = r'(?"); - expect(tokens[5][2].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","meta.named.regexp","entity.name.tag.named.group.regexp"]); + expect(tokens[5][2].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","meta.named.regexp","entity.name.tag.named.group.regexp"]); expect(tokens[5][3].value).toBe(" "); - expect(tokens[5][3].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","meta.named.regexp"]); + expect(tokens[5][3].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","meta.named.regexp"]); expect(tokens[5][4].value).toBe("#"); - expect(tokens[5][4].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","meta.named.regexp","comment.line.number-sign.python","punctuation.definition.comment.python"]); + expect(tokens[5][4].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","meta.named.regexp","comment.line.number-sign.python","punctuation.definition.comment.python"]); expect(tokens[5][5].value).toBe(" Start of group 'key'"); - expect(tokens[5][5].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","meta.named.regexp","comment.line.number-sign.python"]); + expect(tokens[5][5].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","meta.named.regexp","comment.line.number-sign.python"]); expect(tokens[6][0].value).toBe(" "); - expect(tokens[6][0].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","meta.named.regexp"]); + expect(tokens[6][0].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","meta.named.regexp"]); expect(tokens[6][1].value).toBe("["); - expect(tokens[6][1].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","meta.named.regexp","meta.character.set.regexp","constant.other.set.regexp punctuation.character.set.begin.regexp"]); + expect(tokens[6][1].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","meta.named.regexp","meta.character.set.regexp","constant.other.set.regexp punctuation.character.set.begin.regexp"]); expect(tokens[6][2].value).toBe("\"\"\""); - expect(tokens[6][2].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","punctuation.definition.string.end.python"]); + expect(tokens[6][2].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","punctuation.definition.string.end.python"]); expect(tokens[6][3].value).toBe(" "); - expect(tokens[6][3].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python"]); + expect(tokens[6][3].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python"]); expect(tokens[6][4].value).toBe("+"); - expect(tokens[6][4].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","keyword.operator.arithmetic.python"]); + expect(tokens[6][4].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","keyword.operator.arithmetic.python"]); expect(tokens[6][5].value).toBe(" "); - expect(tokens[6][5].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python"]); + expect(tokens[6][5].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python"]); expect(tokens[6][6].value).toBe("_LegalKeyChars"); - expect(tokens[6][6].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python"]); + expect(tokens[6][6].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python"]); expect(tokens[6][7].value).toBe(" "); - expect(tokens[6][7].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python"]); + expect(tokens[6][7].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python"]); expect(tokens[6][8].value).toBe("+"); - expect(tokens[6][8].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","keyword.operator.arithmetic.python"]); + expect(tokens[6][8].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","keyword.operator.arithmetic.python"]); expect(tokens[6][9].value).toBe(" "); - expect(tokens[6][9].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python"]); + expect(tokens[6][9].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python"]); expect(tokens[6][10].value).toBe("r"); - expect(tokens[6][10].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","storage.type.string.python"]); + expect(tokens[6][10].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","storage.type.string.python"]); expect(tokens[6][11].value).toBe("\"\"\""); - expect(tokens[6][11].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","punctuation.definition.string.begin.python"]); + expect(tokens[6][11].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","punctuation.definition.string.begin.python"]); expect(tokens[6][12].value).toBe("]"); - expect(tokens[6][12].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python"]); + expect(tokens[6][12].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python"]); expect(tokens[6][13].value).toBe("+?"); - expect(tokens[6][13].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","keyword.operator.quantifier.regexp"]); + expect(tokens[6][13].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","keyword.operator.quantifier.regexp"]); expect(tokens[6][14].value).toBe(" "); - expect(tokens[6][14].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python"]); + expect(tokens[6][14].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python"]); expect(tokens[6][15].value).toBe("#"); - expect(tokens[6][15].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","comment.line.number-sign.python","punctuation.definition.comment.python"]); + expect(tokens[6][15].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","comment.line.number-sign.python","punctuation.definition.comment.python"]); expect(tokens[6][16].value).toBe(" Any word of at least one letter"); - expect(tokens[6][16].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","comment.line.number-sign.python"]); + expect(tokens[6][16].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","comment.line.number-sign.python"]); expect(tokens[7][0].value).toBe(" ) "); - expect(tokens[7][0].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python"]); + expect(tokens[7][0].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python"]); expect(tokens[7][1].value).toBe("#"); - expect(tokens[7][1].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","comment.line.number-sign.python","punctuation.definition.comment.python"]); + expect(tokens[7][1].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","comment.line.number-sign.python","punctuation.definition.comment.python"]); expect(tokens[7][2].value).toBe(" End of group 'key'"); - expect(tokens[7][2].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","comment.line.number-sign.python"]); + expect(tokens[7][2].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","comment.line.number-sign.python"]); expect(tokens[8][0].value).toBe(" "); - expect(tokens[8][0].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python"]); + expect(tokens[8][0].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python"]); expect(tokens[8][1].value).toBe("("); - expect(tokens[8][1].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","punctuation.parenthesis.begin.regexp support.other.parenthesis.regexp"]); + expect(tokens[8][1].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","punctuation.parenthesis.begin.regexp support.other.parenthesis.regexp"]); expect(tokens[8][2].value).toBe(" "); - expect(tokens[8][2].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python"]); + expect(tokens[8][2].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python"]); expect(tokens[8][3].value).toBe("#"); - expect(tokens[8][3].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","comment.line.number-sign.python","punctuation.definition.comment.python"]); + expect(tokens[8][3].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","comment.line.number-sign.python","punctuation.definition.comment.python"]); expect(tokens[8][4].value).toBe(" Optional group: there may not be a value."); - expect(tokens[8][4].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","comment.line.number-sign.python"]); + expect(tokens[8][4].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","comment.line.number-sign.python"]); expect(tokens[9][0].value).toBe(" "); - expect(tokens[9][0].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python"]); + expect(tokens[9][0].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python"]); expect(tokens[9][1].value).toBe("\\s"); - expect(tokens[9][1].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","support.other.escape.special.regexp"]); + expect(tokens[9][1].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","support.other.escape.special.regexp"]); expect(tokens[9][2].value).toBe("*"); - expect(tokens[9][2].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","keyword.operator.quantifier.regexp"]); + expect(tokens[9][2].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","keyword.operator.quantifier.regexp"]); expect(tokens[9][3].value).toBe("="); - expect(tokens[9][3].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python"]); + expect(tokens[9][3].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python"]); expect(tokens[9][4].value).toBe("\\s"); - expect(tokens[9][4].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","support.other.escape.special.regexp"]); + expect(tokens[9][4].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","support.other.escape.special.regexp"]); expect(tokens[9][5].value).toBe("*"); - expect(tokens[9][5].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","keyword.operator.quantifier.regexp"]); + expect(tokens[9][5].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","keyword.operator.quantifier.regexp"]); expect(tokens[9][6].value).toBe(" "); - expect(tokens[9][6].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python"]); + expect(tokens[9][6].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python"]); expect(tokens[9][7].value).toBe("#"); - expect(tokens[9][7].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","comment.line.number-sign.python","punctuation.definition.comment.python"]); + expect(tokens[9][7].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","comment.line.number-sign.python","punctuation.definition.comment.python"]); expect(tokens[9][8].value).toBe(" Equal Sign"); - expect(tokens[9][8].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","comment.line.number-sign.python"]); + expect(tokens[9][8].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","comment.line.number-sign.python"]); expect(tokens[10][0].value).toBe(" "); - expect(tokens[10][0].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python"]); + expect(tokens[10][0].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python"]); expect(tokens[10][1].value).toBe("("); - expect(tokens[10][1].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","meta.named.regexp","punctuation.parenthesis.named.begin.regexp support.other.parenthesis.regexp"]); + expect(tokens[10][1].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","meta.named.regexp","punctuation.parenthesis.named.begin.regexp support.other.parenthesis.regexp"]); expect(tokens[10][2].value).toBe("?P"); - expect(tokens[10][2].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","meta.named.regexp","entity.name.tag.named.group.regexp"]); + expect(tokens[10][2].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","meta.named.regexp","entity.name.tag.named.group.regexp"]); expect(tokens[10][3].value).toBe(" "); - expect(tokens[10][3].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","meta.named.regexp"]); + expect(tokens[10][3].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","meta.named.regexp"]); expect(tokens[10][4].value).toBe("#"); - expect(tokens[10][4].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","meta.named.regexp","comment.line.number-sign.python","punctuation.definition.comment.python"]); + expect(tokens[10][4].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","meta.named.regexp","comment.line.number-sign.python","punctuation.definition.comment.python"]); expect(tokens[10][5].value).toBe(" Start of group 'val'"); - expect(tokens[10][5].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","meta.named.regexp","comment.line.number-sign.python"]); + expect(tokens[10][5].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","meta.named.regexp","comment.line.number-sign.python"]); expect(tokens[11][0].value).toBe(" \""); - expect(tokens[11][0].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","meta.named.regexp"]); + expect(tokens[11][0].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","meta.named.regexp"]); expect(tokens[11][1].value).toBe("(?:"); - expect(tokens[11][1].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","meta.named.regexp","punctuation.parenthesis.non-capturing.begin.regexp support.other.parenthesis.regexp"]); + expect(tokens[11][1].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","meta.named.regexp","punctuation.parenthesis.non-capturing.begin.regexp support.other.parenthesis.regexp"]); expect(tokens[11][2].value).toBe("["); - expect(tokens[11][2].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","meta.named.regexp","meta.character.set.regexp","constant.other.set.regexp punctuation.character.set.begin.regexp"]); + expect(tokens[11][2].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","meta.named.regexp","meta.character.set.regexp","constant.other.set.regexp punctuation.character.set.begin.regexp"]); expect(tokens[11][3].value).toBe("^"); - expect(tokens[11][3].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","meta.named.regexp","meta.character.set.regexp","keyword.operator.negation.regexp"]); + expect(tokens[11][3].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","meta.named.regexp","meta.character.set.regexp","keyword.operator.negation.regexp"]); expect(tokens[11][4].value).toBe("\\\\"); - expect(tokens[11][4].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","meta.named.regexp","meta.character.set.regexp","constant.character.escape.regexp"]); + expect(tokens[11][4].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","meta.named.regexp","meta.character.set.regexp","constant.character.escape.regexp"]); expect(tokens[11][5].value).toBe("\""); - expect(tokens[11][5].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","meta.named.regexp","meta.character.set.regexp","constant.character.set.regexp"]); + expect(tokens[11][5].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","meta.named.regexp","meta.character.set.regexp","constant.character.set.regexp"]); expect(tokens[11][6].value).toBe("]"); - expect(tokens[11][6].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","meta.named.regexp","meta.character.set.regexp","constant.other.set.regexp punctuation.character.set.end.regexp"]); + expect(tokens[11][6].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","meta.named.regexp","meta.character.set.regexp","constant.other.set.regexp punctuation.character.set.end.regexp"]); expect(tokens[11][7].value).toBe("|"); - expect(tokens[11][7].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","meta.named.regexp","keyword.operator.disjunction.regexp"]); + expect(tokens[11][7].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","meta.named.regexp","keyword.operator.disjunction.regexp"]); expect(tokens[11][8].value).toBe("\\\\"); - expect(tokens[11][8].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","meta.named.regexp","constant.character.escape.regexp"]); + expect(tokens[11][8].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","meta.named.regexp","constant.character.escape.regexp"]); expect(tokens[11][9].value).toBe("."); - expect(tokens[11][9].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","meta.named.regexp","support.other.match.any.regexp"]); + expect(tokens[11][9].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","meta.named.regexp","support.other.match.any.regexp"]); expect(tokens[11][10].value).toBe(")"); - expect(tokens[11][10].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","meta.named.regexp","punctuation.parenthesis.non-capturing.end.regexp support.other.parenthesis.regexp"]); + expect(tokens[11][10].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","meta.named.regexp","punctuation.parenthesis.non-capturing.end.regexp support.other.parenthesis.regexp"]); expect(tokens[11][11].value).toBe("*"); - expect(tokens[11][11].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","meta.named.regexp","keyword.operator.quantifier.regexp"]); + expect(tokens[11][11].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","meta.named.regexp","keyword.operator.quantifier.regexp"]); expect(tokens[11][12].value).toBe("\" "); - expect(tokens[11][12].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","meta.named.regexp"]); + expect(tokens[11][12].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","meta.named.regexp"]); expect(tokens[11][13].value).toBe("#"); - expect(tokens[11][13].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","meta.named.regexp","comment.line.number-sign.python","punctuation.definition.comment.python"]); + expect(tokens[11][13].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","meta.named.regexp","comment.line.number-sign.python","punctuation.definition.comment.python"]); expect(tokens[11][14].value).toBe(" Any doublequoted string"); - expect(tokens[11][14].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","meta.named.regexp","comment.line.number-sign.python"]); + expect(tokens[11][14].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","meta.named.regexp","comment.line.number-sign.python"]); expect(tokens[12][0].value).toBe(" "); - expect(tokens[12][0].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","meta.named.regexp"]); + expect(tokens[12][0].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","meta.named.regexp"]); expect(tokens[12][1].value).toBe("|"); - expect(tokens[12][1].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","meta.named.regexp","keyword.operator.disjunction.regexp"]); + expect(tokens[12][1].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","meta.named.regexp","keyword.operator.disjunction.regexp"]); expect(tokens[12][2].value).toBe(" "); - expect(tokens[12][2].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","meta.named.regexp"]); + expect(tokens[12][2].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","meta.named.regexp"]); expect(tokens[12][3].value).toBe("#"); - expect(tokens[12][3].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","meta.named.regexp","comment.line.number-sign.python","punctuation.definition.comment.python"]); + expect(tokens[12][3].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","meta.named.regexp","comment.line.number-sign.python","punctuation.definition.comment.python"]); expect(tokens[12][4].value).toBe(" or"); - expect(tokens[12][4].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","meta.named.regexp","comment.line.number-sign.python"]); + expect(tokens[12][4].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","meta.named.regexp","comment.line.number-sign.python"]); expect(tokens[13][0].value).toBe(" "); - expect(tokens[13][0].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","meta.named.regexp"]); + expect(tokens[13][0].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","meta.named.regexp"]); expect(tokens[13][1].value).toBe("\\w"); - expect(tokens[13][1].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","meta.named.regexp","support.other.escape.special.regexp"]); + expect(tokens[13][1].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","meta.named.regexp","support.other.escape.special.regexp"]); expect(tokens[13][2].value).toBe("{3}"); - expect(tokens[13][2].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","meta.named.regexp","keyword.operator.quantifier.regexp"]); + expect(tokens[13][2].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","meta.named.regexp","keyword.operator.quantifier.regexp"]); expect(tokens[13][3].value).toBe(","); - expect(tokens[13][3].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","meta.named.regexp"]); + expect(tokens[13][3].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","meta.named.regexp"]); expect(tokens[13][4].value).toBe("\\s"); - expect(tokens[13][4].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","meta.named.regexp","support.other.escape.special.regexp"]); + expect(tokens[13][4].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","meta.named.regexp","support.other.escape.special.regexp"]); expect(tokens[13][5].value).toBe("["); - expect(tokens[13][5].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","meta.named.regexp","meta.character.set.regexp","constant.other.set.regexp punctuation.character.set.begin.regexp"]); + expect(tokens[13][5].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","meta.named.regexp","meta.character.set.regexp","constant.other.set.regexp punctuation.character.set.begin.regexp"]); expect(tokens[13][6].value).toBe("\\w"); - expect(tokens[13][6].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","meta.named.regexp","meta.character.set.regexp","support.other.escape.special.regexp"]); + expect(tokens[13][6].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","meta.named.regexp","meta.character.set.regexp","support.other.escape.special.regexp"]); expect(tokens[13][7].value).toBe("\\d"); - expect(tokens[13][7].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","meta.named.regexp","meta.character.set.regexp","support.other.escape.special.regexp"]); + expect(tokens[13][7].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","meta.named.regexp","meta.character.set.regexp","support.other.escape.special.regexp"]); expect(tokens[13][8].value).toBe("\\s"); - expect(tokens[13][8].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","meta.named.regexp","meta.character.set.regexp","support.other.escape.special.regexp"]); + expect(tokens[13][8].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","meta.named.regexp","meta.character.set.regexp","support.other.escape.special.regexp"]); expect(tokens[13][9].value).toBe("-"); - expect(tokens[13][9].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","meta.named.regexp","meta.character.set.regexp","constant.character.set.regexp"]); + expect(tokens[13][9].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","meta.named.regexp","meta.character.set.regexp","constant.character.set.regexp"]); expect(tokens[13][10].value).toBe("]"); - expect(tokens[13][10].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","meta.named.regexp","meta.character.set.regexp","constant.other.set.regexp punctuation.character.set.end.regexp"]); + expect(tokens[13][10].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","meta.named.regexp","meta.character.set.regexp","constant.other.set.regexp punctuation.character.set.end.regexp"]); expect(tokens[13][11].value).toBe("{9,11}"); - expect(tokens[13][11].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","meta.named.regexp","keyword.operator.quantifier.regexp"]); + expect(tokens[13][11].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","meta.named.regexp","keyword.operator.quantifier.regexp"]); expect(tokens[13][12].value).toBe("\\s"); - expect(tokens[13][12].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","meta.named.regexp","support.other.escape.special.regexp"]); + expect(tokens[13][12].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","meta.named.regexp","support.other.escape.special.regexp"]); expect(tokens[13][13].value).toBe("["); - expect(tokens[13][13].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","meta.named.regexp","meta.character.set.regexp","constant.other.set.regexp punctuation.character.set.begin.regexp"]); + expect(tokens[13][13].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","meta.named.regexp","meta.character.set.regexp","constant.other.set.regexp punctuation.character.set.begin.regexp"]); expect(tokens[13][14].value).toBe("\\d"); - expect(tokens[13][14].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","meta.named.regexp","meta.character.set.regexp","support.other.escape.special.regexp"]); + expect(tokens[13][14].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","meta.named.regexp","meta.character.set.regexp","support.other.escape.special.regexp"]); expect(tokens[13][15].value).toBe(":"); - expect(tokens[13][15].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","meta.named.regexp","meta.character.set.regexp","constant.character.set.regexp"]); + expect(tokens[13][15].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","meta.named.regexp","meta.character.set.regexp","constant.character.set.regexp"]); expect(tokens[13][16].value).toBe("]"); - expect(tokens[13][16].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","meta.named.regexp","meta.character.set.regexp","constant.other.set.regexp punctuation.character.set.end.regexp"]); + expect(tokens[13][16].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","meta.named.regexp","meta.character.set.regexp","constant.other.set.regexp punctuation.character.set.end.regexp"]); expect(tokens[13][17].value).toBe("{8}"); - expect(tokens[13][17].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","meta.named.regexp","keyword.operator.quantifier.regexp"]); + expect(tokens[13][17].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","meta.named.regexp","keyword.operator.quantifier.regexp"]); expect(tokens[13][18].value).toBe("\\s"); - expect(tokens[13][18].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","meta.named.regexp","support.other.escape.special.regexp"]); + expect(tokens[13][18].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","meta.named.regexp","support.other.escape.special.regexp"]); expect(tokens[13][19].value).toBe("GMT "); - expect(tokens[13][19].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","meta.named.regexp"]); + expect(tokens[13][19].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","meta.named.regexp"]); expect(tokens[13][20].value).toBe("#"); - expect(tokens[13][20].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","meta.named.regexp","comment.line.number-sign.python","punctuation.definition.comment.python"]); + expect(tokens[13][20].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","meta.named.regexp","comment.line.number-sign.python","punctuation.definition.comment.python"]); expect(tokens[13][21].value).toBe(" Special case for \"expires\" attr"); - expect(tokens[13][21].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","meta.named.regexp","comment.line.number-sign.python"]); + expect(tokens[13][21].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","meta.named.regexp","comment.line.number-sign.python"]); expect(tokens[14][0].value).toBe(" "); - expect(tokens[14][0].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","meta.named.regexp"]); + expect(tokens[14][0].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","meta.named.regexp"]); expect(tokens[14][1].value).toBe("|"); - expect(tokens[14][1].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","meta.named.regexp","keyword.operator.disjunction.regexp"]); + expect(tokens[14][1].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","meta.named.regexp","keyword.operator.disjunction.regexp"]); expect(tokens[14][2].value).toBe(" "); - expect(tokens[14][2].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","meta.named.regexp"]); + expect(tokens[14][2].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","meta.named.regexp"]); expect(tokens[14][3].value).toBe("#"); - expect(tokens[14][3].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","meta.named.regexp","comment.line.number-sign.python","punctuation.definition.comment.python"]); + expect(tokens[14][3].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","meta.named.regexp","comment.line.number-sign.python","punctuation.definition.comment.python"]); expect(tokens[14][4].value).toBe(" or"); - expect(tokens[14][4].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","meta.named.regexp","comment.line.number-sign.python"]); + expect(tokens[14][4].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","meta.named.regexp","comment.line.number-sign.python"]); expect(tokens[15][0].value).toBe(" "); - expect(tokens[15][0].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","meta.named.regexp"]); + expect(tokens[15][0].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","meta.named.regexp"]); expect(tokens[15][1].value).toBe("["); - expect(tokens[15][1].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","meta.named.regexp","meta.character.set.regexp","constant.other.set.regexp punctuation.character.set.begin.regexp"]); + expect(tokens[15][1].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","meta.named.regexp","meta.character.set.regexp","constant.other.set.regexp punctuation.character.set.begin.regexp"]); expect(tokens[15][2].value).toBe("\"\"\""); - expect(tokens[15][2].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","punctuation.definition.string.end.python"]); + expect(tokens[15][2].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","punctuation.definition.string.end.python"]); expect(tokens[15][3].value).toBe(" "); - expect(tokens[15][3].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python"]); + expect(tokens[15][3].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python"]); expect(tokens[15][4].value).toBe("+"); - expect(tokens[15][4].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","keyword.operator.arithmetic.python"]); + expect(tokens[15][4].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","keyword.operator.arithmetic.python"]); expect(tokens[15][5].value).toBe(" "); - expect(tokens[15][5].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python"]); + expect(tokens[15][5].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python"]); expect(tokens[15][6].value).toBe("_LegalValueChars"); - expect(tokens[15][6].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python"]); + expect(tokens[15][6].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python"]); expect(tokens[15][7].value).toBe(" "); - expect(tokens[15][7].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python"]); + expect(tokens[15][7].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python"]); expect(tokens[15][8].value).toBe("+"); - expect(tokens[15][8].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","keyword.operator.arithmetic.python"]); + expect(tokens[15][8].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","keyword.operator.arithmetic.python"]); expect(tokens[15][9].value).toBe(" "); - expect(tokens[15][9].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python"]); + expect(tokens[15][9].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python"]); expect(tokens[15][10].value).toBe("r"); - expect(tokens[15][10].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","storage.type.string.python"]); + expect(tokens[15][10].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","storage.type.string.python"]); expect(tokens[15][11].value).toBe("\"\"\""); - expect(tokens[15][11].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","punctuation.definition.string.begin.python"]); + expect(tokens[15][11].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","punctuation.definition.string.begin.python"]); expect(tokens[15][12].value).toBe("]"); - expect(tokens[15][12].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python"]); + expect(tokens[15][12].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python"]); expect(tokens[15][13].value).toBe("*"); - expect(tokens[15][13].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","keyword.operator.quantifier.regexp"]); + expect(tokens[15][13].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","keyword.operator.quantifier.regexp"]); expect(tokens[15][14].value).toBe(" "); - expect(tokens[15][14].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python"]); + expect(tokens[15][14].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python"]); expect(tokens[15][15].value).toBe("#"); - expect(tokens[15][15].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","comment.line.number-sign.python","punctuation.definition.comment.python"]); + expect(tokens[15][15].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","comment.line.number-sign.python","punctuation.definition.comment.python"]); expect(tokens[15][16].value).toBe(" Any word or empty string"); - expect(tokens[15][16].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","comment.line.number-sign.python"]); + expect(tokens[15][16].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","comment.line.number-sign.python"]); expect(tokens[16][0].value).toBe(" ) "); - expect(tokens[16][0].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python"]); + expect(tokens[16][0].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python"]); expect(tokens[16][1].value).toBe("#"); - expect(tokens[16][1].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","comment.line.number-sign.python","punctuation.definition.comment.python"]); + expect(tokens[16][1].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","comment.line.number-sign.python","punctuation.definition.comment.python"]); expect(tokens[16][2].value).toBe(" End of group 'val'"); - expect(tokens[16][2].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","comment.line.number-sign.python"]); + expect(tokens[16][2].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","comment.line.number-sign.python"]); expect(tokens[17][0].value).toBe(" )"); - expect(tokens[17][0].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python"]); + expect(tokens[17][0].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python"]); expect(tokens[17][1].value).toBe("?"); - expect(tokens[17][1].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","keyword.operator.quantifier.regexp"]); + expect(tokens[17][1].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","keyword.operator.quantifier.regexp"]); expect(tokens[17][2].value).toBe(" "); - expect(tokens[17][2].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python"]); + expect(tokens[17][2].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python"]); expect(tokens[17][3].value).toBe("#"); - expect(tokens[17][3].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","comment.line.number-sign.python","punctuation.definition.comment.python"]); + expect(tokens[17][3].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","comment.line.number-sign.python","punctuation.definition.comment.python"]); expect(tokens[17][4].value).toBe(" End of optional value group"); - expect(tokens[17][4].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","comment.line.number-sign.python"]); + expect(tokens[17][4].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","comment.line.number-sign.python"]); expect(tokens[18][0].value).toBe(" "); - expect(tokens[18][0].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python"]); + expect(tokens[18][0].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python"]); expect(tokens[18][1].value).toBe("\\s"); - expect(tokens[18][1].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","support.other.escape.special.regexp"]); + expect(tokens[18][1].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","support.other.escape.special.regexp"]); expect(tokens[18][2].value).toBe("*"); - expect(tokens[18][2].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","keyword.operator.quantifier.regexp"]); + expect(tokens[18][2].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","keyword.operator.quantifier.regexp"]); expect(tokens[18][3].value).toBe(" "); - expect(tokens[18][3].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python"]); + expect(tokens[18][3].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python"]); expect(tokens[18][4].value).toBe("#"); - expect(tokens[18][4].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","comment.line.number-sign.python","punctuation.definition.comment.python"]); + expect(tokens[18][4].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","comment.line.number-sign.python","punctuation.definition.comment.python"]); expect(tokens[18][5].value).toBe(" Any number of spaces."); - expect(tokens[18][5].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","comment.line.number-sign.python"]); + expect(tokens[18][5].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","comment.line.number-sign.python"]); expect(tokens[19][0].value).toBe(" "); - expect(tokens[19][0].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python"]); + expect(tokens[19][0].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python"]); expect(tokens[19][1].value).toBe("("); - expect(tokens[19][1].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","punctuation.parenthesis.begin.regexp support.other.parenthesis.regexp"]); + expect(tokens[19][1].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","punctuation.parenthesis.begin.regexp support.other.parenthesis.regexp"]); expect(tokens[19][2].value).toBe("\\s"); - expect(tokens[19][2].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","support.other.escape.special.regexp"]); + expect(tokens[19][2].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","support.other.escape.special.regexp"]); expect(tokens[19][3].value).toBe("+"); - expect(tokens[19][3].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","keyword.operator.quantifier.regexp"]); + expect(tokens[19][3].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","keyword.operator.quantifier.regexp"]); expect(tokens[19][4].value).toBe("|"); - expect(tokens[19][4].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","keyword.operator.disjunction.regexp"]); + expect(tokens[19][4].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","keyword.operator.disjunction.regexp"]); expect(tokens[19][5].value).toBe(";"); - expect(tokens[19][5].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python"]); + expect(tokens[19][5].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python"]); expect(tokens[19][6].value).toBe("|"); - expect(tokens[19][6].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","keyword.operator.disjunction.regexp"]); + expect(tokens[19][6].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","keyword.operator.disjunction.regexp"]); expect(tokens[19][7].value).toBe("$"); - expect(tokens[19][7].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","support.other.match.end.regexp"]); + expect(tokens[19][7].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","support.other.match.end.regexp"]); expect(tokens[19][8].value).toBe(")"); - expect(tokens[19][8].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","punctuation.parenthesis.end.regexp support.other.parenthesis.regexp"]); + expect(tokens[19][8].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","punctuation.parenthesis.end.regexp support.other.parenthesis.regexp"]); expect(tokens[19][9].value).toBe(" "); - expect(tokens[19][9].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python"]); + expect(tokens[19][9].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python"]); expect(tokens[19][10].value).toBe("#"); - expect(tokens[19][10].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","comment.line.number-sign.python","punctuation.definition.comment.python"]); + expect(tokens[19][10].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","comment.line.number-sign.python","punctuation.definition.comment.python"]); expect(tokens[19][11].value).toBe(" Ending either at space, semicolon, or EOS."); - expect(tokens[19][11].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","comment.line.number-sign.python"]); + expect(tokens[19][11].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","comment.line.number-sign.python"]); expect(tokens[20][0].value).toBe(" "); - expect(tokens[20][0].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python"]); + expect(tokens[20][0].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python"]); expect(tokens[20][1].value).toBe("\"\"\""); - expect(tokens[20][1].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","punctuation.definition.string.end.python"]); + expect(tokens[20][1].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","string.regexp.quoted.multi.python","punctuation.definition.string.end.python"]); expect(tokens[20][2].value).toBe(","); - expect(tokens[20][2].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","punctuation.separator.arguments.python"]); + expect(tokens[20][2].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","punctuation.separator.arguments.python"]); expect(tokens[20][3].value).toBe(" "); - expect(tokens[20][3].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python"]); + expect(tokens[20][3].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python"]); expect(tokens[20][4].value).toBe("re"); - expect(tokens[20][4].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python"]); + expect(tokens[20][4].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python"]); expect(tokens[20][5].value).toBe("."); - expect(tokens[20][5].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","punctuation.separator.period.python"]); + expect(tokens[20][5].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","meta.member.access.python","punctuation.separator.period.python"]); expect(tokens[20][6].value).toBe("ASCII"); - expect(tokens[20][6].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","constant.other.caps.python"]); + expect(tokens[20][6].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","meta.member.access.python","constant.other.caps.python"]); expect(tokens[20][7].value).toBe(")"); - expect(tokens[20][7].scopes).toEqual(["source.python","meta.function-call.python","punctuation.definition.arguments.end.python"]); + expect(tokens[20][7].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","punctuation.definition.arguments.end.python"]); expect(tokens[20][8].value).toBe(" "); expect(tokens[20][8].scopes).toEqual(["source.python"]); expect(tokens[20][9].value).toBe("#"); @@ -12045,7 +12387,7 @@ describe("Grammar Tests", function() { expect(tokens[1][2].value).toBe(" "); expect(tokens[1][2].scopes).toEqual(["source.python"]); expect(tokens[1][3].value).toBe("List"); - expect(tokens[1][3].scopes).toEqual(["source.python","meta.item-access.python"]); + expect(tokens[1][3].scopes).toEqual(["source.python","meta.item-access.python","meta.indexed-name.python"]); expect(tokens[1][4].value).toBe("["); expect(tokens[1][4].scopes).toEqual(["source.python","meta.item-access.python","punctuation.definition.arguments.begin.python"]); expect(tokens[1][5].value).toBe("int"); @@ -12094,7 +12436,7 @@ describe("Grammar Tests", function() { expect(tokens[0][9].value).toBe(" "); expect(tokens[0][9].scopes).toEqual(["source.python"]); expect(tokens[0][10].value).toBe("in"); - expect(tokens[0][10].scopes).toEqual(["source.python","keyword.operator.logical.python"]); + expect(tokens[0][10].scopes).toEqual(["source.python","keyword.control.flow.python"]); expect(tokens[0][11].value).toBe(" "); expect(tokens[0][11].scopes).toEqual(["source.python"]); expect(tokens[0][12].value).toBe("b"); @@ -12119,6 +12461,154 @@ describe("Grammar Tests", function() { expect(tokens[3][3].scopes).toEqual(["source.python","constant.numeric.dec.python"]); }); + it("test/statements/for2.py", + function() { + tokens = grammar.tokenizeLines("forvariable = None\nfor a, b, c, invariable in [2 in q, 2 in w]:\n pass") + expect(tokens[0][0].value).toBe("forvariable"); + expect(tokens[0][0].scopes).toEqual(["source.python"]); + expect(tokens[0][1].value).toBe(" "); + expect(tokens[0][1].scopes).toEqual(["source.python"]); + expect(tokens[0][2].value).toBe("="); + expect(tokens[0][2].scopes).toEqual(["source.python","keyword.operator.assignment.python"]); + expect(tokens[0][3].value).toBe(" "); + expect(tokens[0][3].scopes).toEqual(["source.python"]); + expect(tokens[0][4].value).toBe("None"); + expect(tokens[0][4].scopes).toEqual(["source.python","constant.language.python"]); + expect(tokens[1][0].value).toBe("for"); + expect(tokens[1][0].scopes).toEqual(["source.python","keyword.control.flow.python"]); + expect(tokens[1][1].value).toBe(" "); + expect(tokens[1][1].scopes).toEqual(["source.python"]); + expect(tokens[1][2].value).toBe("a"); + expect(tokens[1][2].scopes).toEqual(["source.python"]); + expect(tokens[1][3].value).toBe(","); + expect(tokens[1][3].scopes).toEqual(["source.python","punctuation.separator.element.python"]); + expect(tokens[1][4].value).toBe(" "); + expect(tokens[1][4].scopes).toEqual(["source.python"]); + expect(tokens[1][5].value).toBe("b"); + expect(tokens[1][5].scopes).toEqual(["source.python"]); + expect(tokens[1][6].value).toBe(","); + expect(tokens[1][6].scopes).toEqual(["source.python","punctuation.separator.element.python"]); + expect(tokens[1][7].value).toBe(" "); + expect(tokens[1][7].scopes).toEqual(["source.python"]); + expect(tokens[1][8].value).toBe("c"); + expect(tokens[1][8].scopes).toEqual(["source.python"]); + expect(tokens[1][9].value).toBe(","); + expect(tokens[1][9].scopes).toEqual(["source.python","punctuation.separator.element.python"]); + expect(tokens[1][10].value).toBe(" "); + expect(tokens[1][10].scopes).toEqual(["source.python"]); + expect(tokens[1][11].value).toBe("invariable"); + expect(tokens[1][11].scopes).toEqual(["source.python"]); + expect(tokens[1][12].value).toBe(" "); + expect(tokens[1][12].scopes).toEqual(["source.python"]); + expect(tokens[1][13].value).toBe("in"); + expect(tokens[1][13].scopes).toEqual(["source.python","keyword.control.flow.python"]); + expect(tokens[1][14].value).toBe(" "); + expect(tokens[1][14].scopes).toEqual(["source.python"]); + expect(tokens[1][15].value).toBe("["); + expect(tokens[1][15].scopes).toEqual(["source.python","punctuation.definition.list.begin.python"]); + expect(tokens[1][16].value).toBe("2"); + expect(tokens[1][16].scopes).toEqual(["source.python","constant.numeric.dec.python"]); + expect(tokens[1][17].value).toBe(" "); + expect(tokens[1][17].scopes).toEqual(["source.python"]); + expect(tokens[1][18].value).toBe("in"); + expect(tokens[1][18].scopes).toEqual(["source.python","keyword.operator.logical.python"]); + expect(tokens[1][19].value).toBe(" "); + expect(tokens[1][19].scopes).toEqual(["source.python"]); + expect(tokens[1][20].value).toBe("q"); + expect(tokens[1][20].scopes).toEqual(["source.python"]); + expect(tokens[1][21].value).toBe(","); + expect(tokens[1][21].scopes).toEqual(["source.python","punctuation.separator.element.python"]); + expect(tokens[1][22].value).toBe(" "); + expect(tokens[1][22].scopes).toEqual(["source.python"]); + expect(tokens[1][23].value).toBe("2"); + expect(tokens[1][23].scopes).toEqual(["source.python","constant.numeric.dec.python"]); + expect(tokens[1][24].value).toBe(" "); + expect(tokens[1][24].scopes).toEqual(["source.python"]); + expect(tokens[1][25].value).toBe("in"); + expect(tokens[1][25].scopes).toEqual(["source.python","keyword.operator.logical.python"]); + expect(tokens[1][26].value).toBe(" "); + expect(tokens[1][26].scopes).toEqual(["source.python"]); + expect(tokens[1][27].value).toBe("w"); + expect(tokens[1][27].scopes).toEqual(["source.python"]); + expect(tokens[1][28].value).toBe("]"); + expect(tokens[1][28].scopes).toEqual(["source.python","punctuation.definition.list.end.python"]); + expect(tokens[1][29].value).toBe(":"); + expect(tokens[1][29].scopes).toEqual(["source.python","punctuation.separator.colon.python"]); + expect(tokens[2][0].value).toBe(" "); + expect(tokens[2][0].scopes).toEqual(["source.python"]); + expect(tokens[2][1].value).toBe("pass"); + expect(tokens[2][1].scopes).toEqual(["source.python","keyword.control.flow.python"]); + }); + + it("test/statements/for3.py", + function() { + tokens = grammar.tokenizeLines("for(a, b), c, invariable in[2 in q, 2 in w]:\n pass") + expect(tokens[0][0].value).toBe("for"); + expect(tokens[0][0].scopes).toEqual(["source.python","keyword.control.flow.python"]); + expect(tokens[0][1].value).toBe("("); + expect(tokens[0][1].scopes).toEqual(["source.python","punctuation.parenthesis.begin.python"]); + expect(tokens[0][2].value).toBe("a"); + expect(tokens[0][2].scopes).toEqual(["source.python"]); + expect(tokens[0][3].value).toBe(","); + expect(tokens[0][3].scopes).toEqual(["source.python","punctuation.separator.element.python"]); + expect(tokens[0][4].value).toBe(" "); + expect(tokens[0][4].scopes).toEqual(["source.python"]); + expect(tokens[0][5].value).toBe("b"); + expect(tokens[0][5].scopes).toEqual(["source.python"]); + expect(tokens[0][6].value).toBe(")"); + expect(tokens[0][6].scopes).toEqual(["source.python","punctuation.parenthesis.end.python"]); + expect(tokens[0][7].value).toBe(","); + expect(tokens[0][7].scopes).toEqual(["source.python","punctuation.separator.element.python"]); + expect(tokens[0][8].value).toBe(" "); + expect(tokens[0][8].scopes).toEqual(["source.python"]); + expect(tokens[0][9].value).toBe("c"); + expect(tokens[0][9].scopes).toEqual(["source.python"]); + expect(tokens[0][10].value).toBe(","); + expect(tokens[0][10].scopes).toEqual(["source.python","punctuation.separator.element.python"]); + expect(tokens[0][11].value).toBe(" "); + expect(tokens[0][11].scopes).toEqual(["source.python"]); + expect(tokens[0][12].value).toBe("invariable"); + expect(tokens[0][12].scopes).toEqual(["source.python"]); + expect(tokens[0][13].value).toBe(" "); + expect(tokens[0][13].scopes).toEqual(["source.python"]); + expect(tokens[0][14].value).toBe("in"); + expect(tokens[0][14].scopes).toEqual(["source.python","keyword.control.flow.python"]); + expect(tokens[0][15].value).toBe("["); + expect(tokens[0][15].scopes).toEqual(["source.python","punctuation.definition.list.begin.python"]); + expect(tokens[0][16].value).toBe("2"); + expect(tokens[0][16].scopes).toEqual(["source.python","constant.numeric.dec.python"]); + expect(tokens[0][17].value).toBe(" "); + expect(tokens[0][17].scopes).toEqual(["source.python"]); + expect(tokens[0][18].value).toBe("in"); + expect(tokens[0][18].scopes).toEqual(["source.python","keyword.operator.logical.python"]); + expect(tokens[0][19].value).toBe(" "); + expect(tokens[0][19].scopes).toEqual(["source.python"]); + expect(tokens[0][20].value).toBe("q"); + expect(tokens[0][20].scopes).toEqual(["source.python"]); + expect(tokens[0][21].value).toBe(","); + expect(tokens[0][21].scopes).toEqual(["source.python","punctuation.separator.element.python"]); + expect(tokens[0][22].value).toBe(" "); + expect(tokens[0][22].scopes).toEqual(["source.python"]); + expect(tokens[0][23].value).toBe("2"); + expect(tokens[0][23].scopes).toEqual(["source.python","constant.numeric.dec.python"]); + expect(tokens[0][24].value).toBe(" "); + expect(tokens[0][24].scopes).toEqual(["source.python"]); + expect(tokens[0][25].value).toBe("in"); + expect(tokens[0][25].scopes).toEqual(["source.python","keyword.operator.logical.python"]); + expect(tokens[0][26].value).toBe(" "); + expect(tokens[0][26].scopes).toEqual(["source.python"]); + expect(tokens[0][27].value).toBe("w"); + expect(tokens[0][27].scopes).toEqual(["source.python"]); + expect(tokens[0][28].value).toBe("]"); + expect(tokens[0][28].scopes).toEqual(["source.python","punctuation.definition.list.end.python"]); + expect(tokens[0][29].value).toBe(":"); + expect(tokens[0][29].scopes).toEqual(["source.python","punctuation.separator.colon.python"]); + expect(tokens[1][0].value).toBe(" "); + expect(tokens[1][0].scopes).toEqual(["source.python"]); + expect(tokens[1][1].value).toBe("pass"); + expect(tokens[1][1].scopes).toEqual(["source.python","keyword.control.flow.python"]); + }); + it("test/statements/from1.py", function() { tokens = grammar.tokenizeLines("from ... import foo as bar\nraise Exception('done') from exc\nyield from foo") @@ -12512,9 +13002,9 @@ describe("Grammar Tests", function() { expect(tokens[3][0].value).toBe("foo"); expect(tokens[3][0].scopes).toEqual(["source.python"]); expect(tokens[3][1].value).toBe("."); - expect(tokens[3][1].scopes).toEqual(["source.python","punctuation.separator.period.python"]); + expect(tokens[3][1].scopes).toEqual(["source.python","meta.member.access.python","punctuation.separator.period.python"]); expect(tokens[3][2].value).toBe("import"); - expect(tokens[3][2].scopes).toEqual(["source.python","keyword.control.import.python"]); + expect(tokens[3][2].scopes).toEqual(["source.python","meta.member.access.python","keyword.control.import.python"]); expect(tokens[4][0].value).toBe(""); expect(tokens[4][0].scopes).toEqual(["source.python"]); expect(tokens[5][0].value).toBe("raise"); @@ -12801,6 +13291,1087 @@ describe("Grammar Tests", function() { expect(tokens[8][11].scopes).toEqual(["source.python","constant.language.python"]); }); + it("test/statements/match1.py", + function() { + tokens = grammar.tokenizeLines("def foo(status):\n match status:\n case 404:\n return \"Not found\"\n case 401 | 403:\n return \"Not allowed\"\n case _:\n return \"Something's wrong with the internet\"") + expect(tokens[0][0].value).toBe("def"); + expect(tokens[0][0].scopes).toEqual(["source.python","meta.function.python","storage.type.function.python"]); + expect(tokens[0][1].value).toBe(" "); + expect(tokens[0][1].scopes).toEqual(["source.python","meta.function.python"]); + expect(tokens[0][2].value).toBe("foo"); + expect(tokens[0][2].scopes).toEqual(["source.python","meta.function.python","entity.name.function.python"]); + expect(tokens[0][3].value).toBe("("); + expect(tokens[0][3].scopes).toEqual(["source.python","meta.function.python","meta.function.parameters.python","punctuation.definition.parameters.begin.python"]); + expect(tokens[0][4].value).toBe("status"); + expect(tokens[0][4].scopes).toEqual(["source.python","meta.function.python","meta.function.parameters.python","variable.parameter.function.language.python"]); + expect(tokens[0][5].value).toBe(")"); + expect(tokens[0][5].scopes).toEqual(["source.python","meta.function.python","meta.function.parameters.python","punctuation.definition.parameters.end.python"]); + expect(tokens[0][6].value).toBe(":"); + expect(tokens[0][6].scopes).toEqual(["source.python","meta.function.python","punctuation.section.function.begin.python"]); + expect(tokens[1][0].value).toBe(" "); + expect(tokens[1][0].scopes).toEqual(["source.python"]); + expect(tokens[1][1].value).toBe("match"); + expect(tokens[1][1].scopes).toEqual(["source.python","keyword.control.flow.python"]); + expect(tokens[1][2].value).toBe(" "); + expect(tokens[1][2].scopes).toEqual(["source.python"]); + expect(tokens[1][3].value).toBe("status"); + expect(tokens[1][3].scopes).toEqual(["source.python"]); + expect(tokens[1][4].value).toBe(":"); + expect(tokens[1][4].scopes).toEqual(["source.python","punctuation.separator.colon.python"]); + expect(tokens[2][0].value).toBe(" "); + expect(tokens[2][0].scopes).toEqual(["source.python"]); + expect(tokens[2][1].value).toBe("case"); + expect(tokens[2][1].scopes).toEqual(["source.python","keyword.control.flow.python"]); + expect(tokens[2][2].value).toBe(" "); + expect(tokens[2][2].scopes).toEqual(["source.python"]); + expect(tokens[2][3].value).toBe("404"); + expect(tokens[2][3].scopes).toEqual(["source.python","constant.numeric.dec.python"]); + expect(tokens[2][4].value).toBe(":"); + expect(tokens[2][4].scopes).toEqual(["source.python","punctuation.separator.colon.python"]); + expect(tokens[3][0].value).toBe(" "); + expect(tokens[3][0].scopes).toEqual(["source.python"]); + expect(tokens[3][1].value).toBe("return"); + expect(tokens[3][1].scopes).toEqual(["source.python","keyword.control.flow.python"]); + expect(tokens[3][2].value).toBe(" "); + expect(tokens[3][2].scopes).toEqual(["source.python"]); + expect(tokens[3][3].value).toBe("\""); + expect(tokens[3][3].scopes).toEqual(["source.python","string.quoted.single.python","punctuation.definition.string.begin.python"]); + expect(tokens[3][4].value).toBe("Not found"); + expect(tokens[3][4].scopes).toEqual(["source.python","string.quoted.single.python"]); + expect(tokens[3][5].value).toBe("\""); + expect(tokens[3][5].scopes).toEqual(["source.python","string.quoted.single.python","punctuation.definition.string.end.python"]); + expect(tokens[4][0].value).toBe(" "); + expect(tokens[4][0].scopes).toEqual(["source.python"]); + expect(tokens[4][1].value).toBe("case"); + expect(tokens[4][1].scopes).toEqual(["source.python","keyword.control.flow.python"]); + expect(tokens[4][2].value).toBe(" "); + expect(tokens[4][2].scopes).toEqual(["source.python"]); + expect(tokens[4][3].value).toBe("401"); + expect(tokens[4][3].scopes).toEqual(["source.python","constant.numeric.dec.python"]); + expect(tokens[4][4].value).toBe(" "); + expect(tokens[4][4].scopes).toEqual(["source.python"]); + expect(tokens[4][5].value).toBe("|"); + expect(tokens[4][5].scopes).toEqual(["source.python","keyword.operator.bitwise.python"]); + expect(tokens[4][6].value).toBe(" "); + expect(tokens[4][6].scopes).toEqual(["source.python"]); + expect(tokens[4][7].value).toBe("403"); + expect(tokens[4][7].scopes).toEqual(["source.python","constant.numeric.dec.python"]); + expect(tokens[4][8].value).toBe(":"); + expect(tokens[4][8].scopes).toEqual(["source.python","punctuation.separator.colon.python"]); + expect(tokens[5][0].value).toBe(" "); + expect(tokens[5][0].scopes).toEqual(["source.python"]); + expect(tokens[5][1].value).toBe("return"); + expect(tokens[5][1].scopes).toEqual(["source.python","keyword.control.flow.python"]); + expect(tokens[5][2].value).toBe(" "); + expect(tokens[5][2].scopes).toEqual(["source.python"]); + expect(tokens[5][3].value).toBe("\""); + expect(tokens[5][3].scopes).toEqual(["source.python","string.quoted.single.python","punctuation.definition.string.begin.python"]); + expect(tokens[5][4].value).toBe("Not allowed"); + expect(tokens[5][4].scopes).toEqual(["source.python","string.quoted.single.python"]); + expect(tokens[5][5].value).toBe("\""); + expect(tokens[5][5].scopes).toEqual(["source.python","string.quoted.single.python","punctuation.definition.string.end.python"]); + expect(tokens[6][0].value).toBe(" "); + expect(tokens[6][0].scopes).toEqual(["source.python"]); + expect(tokens[6][1].value).toBe("case"); + expect(tokens[6][1].scopes).toEqual(["source.python","keyword.control.flow.python"]); + expect(tokens[6][2].value).toBe(" "); + expect(tokens[6][2].scopes).toEqual(["source.python"]); + expect(tokens[6][3].value).toBe("_"); + expect(tokens[6][3].scopes).toEqual(["source.python"]); + expect(tokens[6][4].value).toBe(":"); + expect(tokens[6][4].scopes).toEqual(["source.python","punctuation.separator.colon.python"]); + expect(tokens[7][0].value).toBe(" "); + expect(tokens[7][0].scopes).toEqual(["source.python"]); + expect(tokens[7][1].value).toBe("return"); + expect(tokens[7][1].scopes).toEqual(["source.python","keyword.control.flow.python"]); + expect(tokens[7][2].value).toBe(" "); + expect(tokens[7][2].scopes).toEqual(["source.python"]); + expect(tokens[7][3].value).toBe("\""); + expect(tokens[7][3].scopes).toEqual(["source.python","string.quoted.single.python","punctuation.definition.string.begin.python"]); + expect(tokens[7][4].value).toBe("Something's wrong with the internet"); + expect(tokens[7][4].scopes).toEqual(["source.python","string.quoted.single.python"]); + expect(tokens[7][5].value).toBe("\""); + expect(tokens[7][5].scopes).toEqual(["source.python","string.quoted.single.python","punctuation.definition.string.end.python"]); + }); + + it("test/statements/match2.py", + function() { + tokens = grammar.tokenizeLines("match point:\n case Point(x=0, y=0):\n print(\"Origin is the point's location.\")\n case Point(x=0, y=y):\n print(f\"The point is on the y-axis.\")\n case Point(x=x, y=0):\n print(f\"The point is on the x-axis.\")\n case Point():\n print(\"The point is located somewhere else on the plane.\")\n case _:\n print(\"Not a point\")") + expect(tokens[0][0].value).toBe("match"); + expect(tokens[0][0].scopes).toEqual(["source.python","keyword.control.flow.python"]); + expect(tokens[0][1].value).toBe(" "); + expect(tokens[0][1].scopes).toEqual(["source.python"]); + expect(tokens[0][2].value).toBe("point"); + expect(tokens[0][2].scopes).toEqual(["source.python"]); + expect(tokens[0][3].value).toBe(":"); + expect(tokens[0][3].scopes).toEqual(["source.python","punctuation.separator.colon.python"]); + expect(tokens[1][0].value).toBe(" "); + expect(tokens[1][0].scopes).toEqual(["source.python"]); + expect(tokens[1][1].value).toBe("case"); + expect(tokens[1][1].scopes).toEqual(["source.python","keyword.control.flow.python"]); + expect(tokens[1][2].value).toBe(" "); + expect(tokens[1][2].scopes).toEqual(["source.python"]); + expect(tokens[1][3].value).toBe("Point"); + expect(tokens[1][3].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.generic.python"]); + expect(tokens[1][4].value).toBe("("); + expect(tokens[1][4].scopes).toEqual(["source.python","meta.function-call.python","punctuation.definition.arguments.begin.python"]); + expect(tokens[1][5].value).toBe("x"); + expect(tokens[1][5].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","variable.parameter.function-call.python"]); + expect(tokens[1][6].value).toBe("="); + expect(tokens[1][6].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","keyword.operator.assignment.python"]); + expect(tokens[1][7].value).toBe("0"); + expect(tokens[1][7].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","constant.numeric.dec.python"]); + expect(tokens[1][8].value).toBe(","); + expect(tokens[1][8].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","punctuation.separator.arguments.python"]); + expect(tokens[1][9].value).toBe(" "); + expect(tokens[1][9].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python"]); + expect(tokens[1][10].value).toBe("y"); + expect(tokens[1][10].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","variable.parameter.function-call.python"]); + expect(tokens[1][11].value).toBe("="); + expect(tokens[1][11].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","keyword.operator.assignment.python"]); + expect(tokens[1][12].value).toBe("0"); + expect(tokens[1][12].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","constant.numeric.dec.python"]); + expect(tokens[1][13].value).toBe(")"); + expect(tokens[1][13].scopes).toEqual(["source.python","meta.function-call.python","punctuation.definition.arguments.end.python"]); + expect(tokens[1][14].value).toBe(":"); + expect(tokens[1][14].scopes).toEqual(["source.python","punctuation.separator.colon.python"]); + expect(tokens[2][0].value).toBe(" "); + expect(tokens[2][0].scopes).toEqual(["source.python"]); + expect(tokens[2][1].value).toBe("print"); + expect(tokens[2][1].scopes).toEqual(["source.python","meta.function-call.python","support.function.builtin.python"]); + expect(tokens[2][2].value).toBe("("); + expect(tokens[2][2].scopes).toEqual(["source.python","meta.function-call.python","punctuation.definition.arguments.begin.python"]); + expect(tokens[2][3].value).toBe("\""); + expect(tokens[2][3].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.quoted.single.python","punctuation.definition.string.begin.python"]); + expect(tokens[2][4].value).toBe("Origin is the point's location."); + expect(tokens[2][4].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.quoted.single.python"]); + expect(tokens[2][5].value).toBe("\""); + expect(tokens[2][5].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.quoted.single.python","punctuation.definition.string.end.python"]); + expect(tokens[2][6].value).toBe(")"); + expect(tokens[2][6].scopes).toEqual(["source.python","meta.function-call.python","punctuation.definition.arguments.end.python"]); + expect(tokens[3][0].value).toBe(" "); + expect(tokens[3][0].scopes).toEqual(["source.python"]); + expect(tokens[3][1].value).toBe("case"); + expect(tokens[3][1].scopes).toEqual(["source.python","keyword.control.flow.python"]); + expect(tokens[3][2].value).toBe(" "); + expect(tokens[3][2].scopes).toEqual(["source.python"]); + expect(tokens[3][3].value).toBe("Point"); + expect(tokens[3][3].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.generic.python"]); + expect(tokens[3][4].value).toBe("("); + expect(tokens[3][4].scopes).toEqual(["source.python","meta.function-call.python","punctuation.definition.arguments.begin.python"]); + expect(tokens[3][5].value).toBe("x"); + expect(tokens[3][5].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","variable.parameter.function-call.python"]); + expect(tokens[3][6].value).toBe("="); + expect(tokens[3][6].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","keyword.operator.assignment.python"]); + expect(tokens[3][7].value).toBe("0"); + expect(tokens[3][7].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","constant.numeric.dec.python"]); + expect(tokens[3][8].value).toBe(","); + expect(tokens[3][8].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","punctuation.separator.arguments.python"]); + expect(tokens[3][9].value).toBe(" "); + expect(tokens[3][9].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python"]); + expect(tokens[3][10].value).toBe("y"); + expect(tokens[3][10].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","variable.parameter.function-call.python"]); + expect(tokens[3][11].value).toBe("="); + expect(tokens[3][11].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","keyword.operator.assignment.python"]); + expect(tokens[3][12].value).toBe("y"); + expect(tokens[3][12].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python"]); + expect(tokens[3][13].value).toBe(")"); + expect(tokens[3][13].scopes).toEqual(["source.python","meta.function-call.python","punctuation.definition.arguments.end.python"]); + expect(tokens[3][14].value).toBe(":"); + expect(tokens[3][14].scopes).toEqual(["source.python","punctuation.separator.colon.python"]); + expect(tokens[4][0].value).toBe(" "); + expect(tokens[4][0].scopes).toEqual(["source.python"]); + expect(tokens[4][1].value).toBe("print"); + expect(tokens[4][1].scopes).toEqual(["source.python","meta.function-call.python","support.function.builtin.python"]); + expect(tokens[4][2].value).toBe("("); + expect(tokens[4][2].scopes).toEqual(["source.python","meta.function-call.python","punctuation.definition.arguments.begin.python"]); + expect(tokens[4][3].value).toBe("f"); + expect(tokens[4][3].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","meta.fstring.python","storage.type.string.python string.quoted.single.python string.interpolated.python"]); + expect(tokens[4][4].value).toBe("\""); + expect(tokens[4][4].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","meta.fstring.python","string.quoted.single.python string.interpolated.python punctuation.definition.string.begin.python"]); + expect(tokens[4][5].value).toBe("The point is on the y-axis."); + expect(tokens[4][5].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","meta.fstring.python","string.quoted.single.python string.interpolated.python"]); + expect(tokens[4][6].value).toBe("\""); + expect(tokens[4][6].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","meta.fstring.python","string.quoted.single.python string.interpolated.python punctuation.definition.string.end.python"]); + expect(tokens[4][7].value).toBe(")"); + expect(tokens[4][7].scopes).toEqual(["source.python","meta.function-call.python","punctuation.definition.arguments.end.python"]); + expect(tokens[5][0].value).toBe(" "); + expect(tokens[5][0].scopes).toEqual(["source.python"]); + expect(tokens[5][1].value).toBe("case"); + expect(tokens[5][1].scopes).toEqual(["source.python","keyword.control.flow.python"]); + expect(tokens[5][2].value).toBe(" "); + expect(tokens[5][2].scopes).toEqual(["source.python"]); + expect(tokens[5][3].value).toBe("Point"); + expect(tokens[5][3].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.generic.python"]); + expect(tokens[5][4].value).toBe("("); + expect(tokens[5][4].scopes).toEqual(["source.python","meta.function-call.python","punctuation.definition.arguments.begin.python"]); + expect(tokens[5][5].value).toBe("x"); + expect(tokens[5][5].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","variable.parameter.function-call.python"]); + expect(tokens[5][6].value).toBe("="); + expect(tokens[5][6].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","keyword.operator.assignment.python"]); + expect(tokens[5][7].value).toBe("x"); + expect(tokens[5][7].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python"]); + expect(tokens[5][8].value).toBe(","); + expect(tokens[5][8].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","punctuation.separator.arguments.python"]); + expect(tokens[5][9].value).toBe(" "); + expect(tokens[5][9].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python"]); + expect(tokens[5][10].value).toBe("y"); + expect(tokens[5][10].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","variable.parameter.function-call.python"]); + expect(tokens[5][11].value).toBe("="); + expect(tokens[5][11].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","keyword.operator.assignment.python"]); + expect(tokens[5][12].value).toBe("0"); + expect(tokens[5][12].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","constant.numeric.dec.python"]); + expect(tokens[5][13].value).toBe(")"); + expect(tokens[5][13].scopes).toEqual(["source.python","meta.function-call.python","punctuation.definition.arguments.end.python"]); + expect(tokens[5][14].value).toBe(":"); + expect(tokens[5][14].scopes).toEqual(["source.python","punctuation.separator.colon.python"]); + expect(tokens[6][0].value).toBe(" "); + expect(tokens[6][0].scopes).toEqual(["source.python"]); + expect(tokens[6][1].value).toBe("print"); + expect(tokens[6][1].scopes).toEqual(["source.python","meta.function-call.python","support.function.builtin.python"]); + expect(tokens[6][2].value).toBe("("); + expect(tokens[6][2].scopes).toEqual(["source.python","meta.function-call.python","punctuation.definition.arguments.begin.python"]); + expect(tokens[6][3].value).toBe("f"); + expect(tokens[6][3].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","meta.fstring.python","storage.type.string.python string.quoted.single.python string.interpolated.python"]); + expect(tokens[6][4].value).toBe("\""); + expect(tokens[6][4].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","meta.fstring.python","string.quoted.single.python string.interpolated.python punctuation.definition.string.begin.python"]); + expect(tokens[6][5].value).toBe("The point is on the x-axis."); + expect(tokens[6][5].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","meta.fstring.python","string.quoted.single.python string.interpolated.python"]); + expect(tokens[6][6].value).toBe("\""); + expect(tokens[6][6].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","meta.fstring.python","string.quoted.single.python string.interpolated.python punctuation.definition.string.end.python"]); + expect(tokens[6][7].value).toBe(")"); + expect(tokens[6][7].scopes).toEqual(["source.python","meta.function-call.python","punctuation.definition.arguments.end.python"]); + expect(tokens[7][0].value).toBe(" "); + expect(tokens[7][0].scopes).toEqual(["source.python"]); + expect(tokens[7][1].value).toBe("case"); + expect(tokens[7][1].scopes).toEqual(["source.python","keyword.control.flow.python"]); + expect(tokens[7][2].value).toBe(" "); + expect(tokens[7][2].scopes).toEqual(["source.python"]); + expect(tokens[7][3].value).toBe("Point"); + expect(tokens[7][3].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.generic.python"]); + expect(tokens[7][4].value).toBe("("); + expect(tokens[7][4].scopes).toEqual(["source.python","meta.function-call.python","punctuation.definition.arguments.begin.python"]); + expect(tokens[7][5].value).toBe(")"); + expect(tokens[7][5].scopes).toEqual(["source.python","meta.function-call.python","punctuation.definition.arguments.end.python"]); + expect(tokens[7][6].value).toBe(":"); + expect(tokens[7][6].scopes).toEqual(["source.python","punctuation.separator.colon.python"]); + expect(tokens[8][0].value).toBe(" "); + expect(tokens[8][0].scopes).toEqual(["source.python"]); + expect(tokens[8][1].value).toBe("print"); + expect(tokens[8][1].scopes).toEqual(["source.python","meta.function-call.python","support.function.builtin.python"]); + expect(tokens[8][2].value).toBe("("); + expect(tokens[8][2].scopes).toEqual(["source.python","meta.function-call.python","punctuation.definition.arguments.begin.python"]); + expect(tokens[8][3].value).toBe("\""); + expect(tokens[8][3].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.quoted.single.python","punctuation.definition.string.begin.python"]); + expect(tokens[8][4].value).toBe("The point is located somewhere else on the plane."); + expect(tokens[8][4].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.quoted.single.python"]); + expect(tokens[8][5].value).toBe("\""); + expect(tokens[8][5].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.quoted.single.python","punctuation.definition.string.end.python"]); + expect(tokens[8][6].value).toBe(")"); + expect(tokens[8][6].scopes).toEqual(["source.python","meta.function-call.python","punctuation.definition.arguments.end.python"]); + expect(tokens[9][0].value).toBe(" "); + expect(tokens[9][0].scopes).toEqual(["source.python"]); + expect(tokens[9][1].value).toBe("case"); + expect(tokens[9][1].scopes).toEqual(["source.python","keyword.control.flow.python"]); + expect(tokens[9][2].value).toBe(" "); + expect(tokens[9][2].scopes).toEqual(["source.python"]); + expect(tokens[9][3].value).toBe("_"); + expect(tokens[9][3].scopes).toEqual(["source.python"]); + expect(tokens[9][4].value).toBe(":"); + expect(tokens[9][4].scopes).toEqual(["source.python","punctuation.separator.colon.python"]); + expect(tokens[10][0].value).toBe(" "); + expect(tokens[10][0].scopes).toEqual(["source.python"]); + expect(tokens[10][1].value).toBe("print"); + expect(tokens[10][1].scopes).toEqual(["source.python","meta.function-call.python","support.function.builtin.python"]); + expect(tokens[10][2].value).toBe("("); + expect(tokens[10][2].scopes).toEqual(["source.python","meta.function-call.python","punctuation.definition.arguments.begin.python"]); + expect(tokens[10][3].value).toBe("\""); + expect(tokens[10][3].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.quoted.single.python","punctuation.definition.string.begin.python"]); + expect(tokens[10][4].value).toBe("Not a point"); + expect(tokens[10][4].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.quoted.single.python"]); + expect(tokens[10][5].value).toBe("\""); + expect(tokens[10][5].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.quoted.single.python","punctuation.definition.string.end.python"]); + expect(tokens[10][6].value).toBe(")"); + expect(tokens[10][6].scopes).toEqual(["source.python","meta.function-call.python","punctuation.definition.arguments.end.python"]); + }); + + it("test/statements/match3.py", + function() { + tokens = grammar.tokenizeLines("match points:\n case []:\n print(\"No points in the list.\")\n case [Point(0, 0)]:\n print(\"The origin is the only point in the list.\")\n case [Point(x, y)]:\n print(f\"A single point is in the list.\")\n case [Point(0, y1), Point(0, y2)]:\n print(f\"Two points on the Y axis are in the list.\")\n case _:\n print(\"Something else is found in the list.\")") + expect(tokens[0][0].value).toBe("match"); + expect(tokens[0][0].scopes).toEqual(["source.python","keyword.control.flow.python"]); + expect(tokens[0][1].value).toBe(" "); + expect(tokens[0][1].scopes).toEqual(["source.python"]); + expect(tokens[0][2].value).toBe("points"); + expect(tokens[0][2].scopes).toEqual(["source.python"]); + expect(tokens[0][3].value).toBe(":"); + expect(tokens[0][3].scopes).toEqual(["source.python","punctuation.separator.colon.python"]); + expect(tokens[1][0].value).toBe(" "); + expect(tokens[1][0].scopes).toEqual(["source.python"]); + expect(tokens[1][1].value).toBe("case"); + expect(tokens[1][1].scopes).toEqual(["source.python","keyword.control.flow.python"]); + expect(tokens[1][2].value).toBe(" "); + expect(tokens[1][2].scopes).toEqual(["source.python"]); + expect(tokens[1][3].value).toBe("["); + expect(tokens[1][3].scopes).toEqual(["source.python","punctuation.definition.list.begin.python"]); + expect(tokens[1][4].value).toBe("]"); + expect(tokens[1][4].scopes).toEqual(["source.python","punctuation.definition.list.end.python"]); + expect(tokens[1][5].value).toBe(":"); + expect(tokens[1][5].scopes).toEqual(["source.python","punctuation.separator.colon.python"]); + expect(tokens[2][0].value).toBe(" "); + expect(tokens[2][0].scopes).toEqual(["source.python"]); + expect(tokens[2][1].value).toBe("print"); + expect(tokens[2][1].scopes).toEqual(["source.python","meta.function-call.python","support.function.builtin.python"]); + expect(tokens[2][2].value).toBe("("); + expect(tokens[2][2].scopes).toEqual(["source.python","meta.function-call.python","punctuation.definition.arguments.begin.python"]); + expect(tokens[2][3].value).toBe("\""); + expect(tokens[2][3].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.quoted.single.python","punctuation.definition.string.begin.python"]); + expect(tokens[2][4].value).toBe("No points in the list."); + expect(tokens[2][4].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.quoted.single.python"]); + expect(tokens[2][5].value).toBe("\""); + expect(tokens[2][5].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.quoted.single.python","punctuation.definition.string.end.python"]); + expect(tokens[2][6].value).toBe(")"); + expect(tokens[2][6].scopes).toEqual(["source.python","meta.function-call.python","punctuation.definition.arguments.end.python"]); + expect(tokens[3][0].value).toBe(" "); + expect(tokens[3][0].scopes).toEqual(["source.python"]); + expect(tokens[3][1].value).toBe("case"); + expect(tokens[3][1].scopes).toEqual(["source.python","keyword.control.flow.python"]); + expect(tokens[3][2].value).toBe(" "); + expect(tokens[3][2].scopes).toEqual(["source.python"]); + expect(tokens[3][3].value).toBe("["); + expect(tokens[3][3].scopes).toEqual(["source.python","punctuation.definition.list.begin.python"]); + expect(tokens[3][4].value).toBe("Point"); + expect(tokens[3][4].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.generic.python"]); + expect(tokens[3][5].value).toBe("("); + expect(tokens[3][5].scopes).toEqual(["source.python","meta.function-call.python","punctuation.definition.arguments.begin.python"]); + expect(tokens[3][6].value).toBe("0"); + expect(tokens[3][6].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","constant.numeric.dec.python"]); + expect(tokens[3][7].value).toBe(","); + expect(tokens[3][7].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","punctuation.separator.arguments.python"]); + expect(tokens[3][8].value).toBe(" "); + expect(tokens[3][8].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python"]); + expect(tokens[3][9].value).toBe("0"); + expect(tokens[3][9].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","constant.numeric.dec.python"]); + expect(tokens[3][10].value).toBe(")"); + expect(tokens[3][10].scopes).toEqual(["source.python","meta.function-call.python","punctuation.definition.arguments.end.python"]); + expect(tokens[3][11].value).toBe("]"); + expect(tokens[3][11].scopes).toEqual(["source.python","punctuation.definition.list.end.python"]); + expect(tokens[3][12].value).toBe(":"); + expect(tokens[3][12].scopes).toEqual(["source.python","punctuation.separator.colon.python"]); + expect(tokens[4][0].value).toBe(" "); + expect(tokens[4][0].scopes).toEqual(["source.python"]); + expect(tokens[4][1].value).toBe("print"); + expect(tokens[4][1].scopes).toEqual(["source.python","meta.function-call.python","support.function.builtin.python"]); + expect(tokens[4][2].value).toBe("("); + expect(tokens[4][2].scopes).toEqual(["source.python","meta.function-call.python","punctuation.definition.arguments.begin.python"]); + expect(tokens[4][3].value).toBe("\""); + expect(tokens[4][3].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.quoted.single.python","punctuation.definition.string.begin.python"]); + expect(tokens[4][4].value).toBe("The origin is the only point in the list."); + expect(tokens[4][4].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.quoted.single.python"]); + expect(tokens[4][5].value).toBe("\""); + expect(tokens[4][5].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.quoted.single.python","punctuation.definition.string.end.python"]); + expect(tokens[4][6].value).toBe(")"); + expect(tokens[4][6].scopes).toEqual(["source.python","meta.function-call.python","punctuation.definition.arguments.end.python"]); + expect(tokens[5][0].value).toBe(" "); + expect(tokens[5][0].scopes).toEqual(["source.python"]); + expect(tokens[5][1].value).toBe("case"); + expect(tokens[5][1].scopes).toEqual(["source.python","keyword.control.flow.python"]); + expect(tokens[5][2].value).toBe(" "); + expect(tokens[5][2].scopes).toEqual(["source.python"]); + expect(tokens[5][3].value).toBe("["); + expect(tokens[5][3].scopes).toEqual(["source.python","punctuation.definition.list.begin.python"]); + expect(tokens[5][4].value).toBe("Point"); + expect(tokens[5][4].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.generic.python"]); + expect(tokens[5][5].value).toBe("("); + expect(tokens[5][5].scopes).toEqual(["source.python","meta.function-call.python","punctuation.definition.arguments.begin.python"]); + expect(tokens[5][6].value).toBe("x"); + expect(tokens[5][6].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python"]); + expect(tokens[5][7].value).toBe(","); + expect(tokens[5][7].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","punctuation.separator.arguments.python"]); + expect(tokens[5][8].value).toBe(" "); + expect(tokens[5][8].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python"]); + expect(tokens[5][9].value).toBe("y"); + expect(tokens[5][9].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python"]); + expect(tokens[5][10].value).toBe(")"); + expect(tokens[5][10].scopes).toEqual(["source.python","meta.function-call.python","punctuation.definition.arguments.end.python"]); + expect(tokens[5][11].value).toBe("]"); + expect(tokens[5][11].scopes).toEqual(["source.python","punctuation.definition.list.end.python"]); + expect(tokens[5][12].value).toBe(":"); + expect(tokens[5][12].scopes).toEqual(["source.python","punctuation.separator.colon.python"]); + expect(tokens[6][0].value).toBe(" "); + expect(tokens[6][0].scopes).toEqual(["source.python"]); + expect(tokens[6][1].value).toBe("print"); + expect(tokens[6][1].scopes).toEqual(["source.python","meta.function-call.python","support.function.builtin.python"]); + expect(tokens[6][2].value).toBe("("); + expect(tokens[6][2].scopes).toEqual(["source.python","meta.function-call.python","punctuation.definition.arguments.begin.python"]); + expect(tokens[6][3].value).toBe("f"); + expect(tokens[6][3].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","meta.fstring.python","storage.type.string.python string.quoted.single.python string.interpolated.python"]); + expect(tokens[6][4].value).toBe("\""); + expect(tokens[6][4].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","meta.fstring.python","string.quoted.single.python string.interpolated.python punctuation.definition.string.begin.python"]); + expect(tokens[6][5].value).toBe("A single point is in the list."); + expect(tokens[6][5].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","meta.fstring.python","string.quoted.single.python string.interpolated.python"]); + expect(tokens[6][6].value).toBe("\""); + expect(tokens[6][6].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","meta.fstring.python","string.quoted.single.python string.interpolated.python punctuation.definition.string.end.python"]); + expect(tokens[6][7].value).toBe(")"); + expect(tokens[6][7].scopes).toEqual(["source.python","meta.function-call.python","punctuation.definition.arguments.end.python"]); + expect(tokens[7][0].value).toBe(" "); + expect(tokens[7][0].scopes).toEqual(["source.python"]); + expect(tokens[7][1].value).toBe("case"); + expect(tokens[7][1].scopes).toEqual(["source.python","keyword.control.flow.python"]); + expect(tokens[7][2].value).toBe(" "); + expect(tokens[7][2].scopes).toEqual(["source.python"]); + expect(tokens[7][3].value).toBe("["); + expect(tokens[7][3].scopes).toEqual(["source.python","punctuation.definition.list.begin.python"]); + expect(tokens[7][4].value).toBe("Point"); + expect(tokens[7][4].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.generic.python"]); + expect(tokens[7][5].value).toBe("("); + expect(tokens[7][5].scopes).toEqual(["source.python","meta.function-call.python","punctuation.definition.arguments.begin.python"]); + expect(tokens[7][6].value).toBe("0"); + expect(tokens[7][6].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","constant.numeric.dec.python"]); + expect(tokens[7][7].value).toBe(","); + expect(tokens[7][7].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","punctuation.separator.arguments.python"]); + expect(tokens[7][8].value).toBe(" "); + expect(tokens[7][8].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python"]); + expect(tokens[7][9].value).toBe("y1"); + expect(tokens[7][9].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python"]); + expect(tokens[7][10].value).toBe(")"); + expect(tokens[7][10].scopes).toEqual(["source.python","meta.function-call.python","punctuation.definition.arguments.end.python"]); + expect(tokens[7][11].value).toBe(","); + expect(tokens[7][11].scopes).toEqual(["source.python","punctuation.separator.element.python"]); + expect(tokens[7][12].value).toBe(" "); + expect(tokens[7][12].scopes).toEqual(["source.python"]); + expect(tokens[7][13].value).toBe("Point"); + expect(tokens[7][13].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.generic.python"]); + expect(tokens[7][14].value).toBe("("); + expect(tokens[7][14].scopes).toEqual(["source.python","meta.function-call.python","punctuation.definition.arguments.begin.python"]); + expect(tokens[7][15].value).toBe("0"); + expect(tokens[7][15].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","constant.numeric.dec.python"]); + expect(tokens[7][16].value).toBe(","); + expect(tokens[7][16].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","punctuation.separator.arguments.python"]); + expect(tokens[7][17].value).toBe(" "); + expect(tokens[7][17].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python"]); + expect(tokens[7][18].value).toBe("y2"); + expect(tokens[7][18].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python"]); + expect(tokens[7][19].value).toBe(")"); + expect(tokens[7][19].scopes).toEqual(["source.python","meta.function-call.python","punctuation.definition.arguments.end.python"]); + expect(tokens[7][20].value).toBe("]"); + expect(tokens[7][20].scopes).toEqual(["source.python","punctuation.definition.list.end.python"]); + expect(tokens[7][21].value).toBe(":"); + expect(tokens[7][21].scopes).toEqual(["source.python","punctuation.separator.colon.python"]); + expect(tokens[8][0].value).toBe(" "); + expect(tokens[8][0].scopes).toEqual(["source.python"]); + expect(tokens[8][1].value).toBe("print"); + expect(tokens[8][1].scopes).toEqual(["source.python","meta.function-call.python","support.function.builtin.python"]); + expect(tokens[8][2].value).toBe("("); + expect(tokens[8][2].scopes).toEqual(["source.python","meta.function-call.python","punctuation.definition.arguments.begin.python"]); + expect(tokens[8][3].value).toBe("f"); + expect(tokens[8][3].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","meta.fstring.python","storage.type.string.python string.quoted.single.python string.interpolated.python"]); + expect(tokens[8][4].value).toBe("\""); + expect(tokens[8][4].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","meta.fstring.python","string.quoted.single.python string.interpolated.python punctuation.definition.string.begin.python"]); + expect(tokens[8][5].value).toBe("Two points on the Y axis are in the list."); + expect(tokens[8][5].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","meta.fstring.python","string.quoted.single.python string.interpolated.python"]); + expect(tokens[8][6].value).toBe("\""); + expect(tokens[8][6].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","meta.fstring.python","string.quoted.single.python string.interpolated.python punctuation.definition.string.end.python"]); + expect(tokens[8][7].value).toBe(")"); + expect(tokens[8][7].scopes).toEqual(["source.python","meta.function-call.python","punctuation.definition.arguments.end.python"]); + expect(tokens[9][0].value).toBe(" "); + expect(tokens[9][0].scopes).toEqual(["source.python"]); + expect(tokens[9][1].value).toBe("case"); + expect(tokens[9][1].scopes).toEqual(["source.python","keyword.control.flow.python"]); + expect(tokens[9][2].value).toBe(" "); + expect(tokens[9][2].scopes).toEqual(["source.python"]); + expect(tokens[9][3].value).toBe("_"); + expect(tokens[9][3].scopes).toEqual(["source.python"]); + expect(tokens[9][4].value).toBe(":"); + expect(tokens[9][4].scopes).toEqual(["source.python","punctuation.separator.colon.python"]); + expect(tokens[10][0].value).toBe(" "); + expect(tokens[10][0].scopes).toEqual(["source.python"]); + expect(tokens[10][1].value).toBe("print"); + expect(tokens[10][1].scopes).toEqual(["source.python","meta.function-call.python","support.function.builtin.python"]); + expect(tokens[10][2].value).toBe("("); + expect(tokens[10][2].scopes).toEqual(["source.python","meta.function-call.python","punctuation.definition.arguments.begin.python"]); + expect(tokens[10][3].value).toBe("\""); + expect(tokens[10][3].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.quoted.single.python","punctuation.definition.string.begin.python"]); + expect(tokens[10][4].value).toBe("Something else is found in the list."); + expect(tokens[10][4].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.quoted.single.python"]); + expect(tokens[10][5].value).toBe("\""); + expect(tokens[10][5].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","string.quoted.single.python","punctuation.definition.string.end.python"]); + expect(tokens[10][6].value).toBe(")"); + expect(tokens[10][6].scopes).toEqual(["source.python","meta.function-call.python","punctuation.definition.arguments.end.python"]); + }); + + it("test/statements/match4.py", + function() { + tokens = grammar.tokenizeLines("match point:\n case Point(x, y) if x == y:\n print(f\"The point is located on the diagonal Y=X.\")\n case Point(x, y):\n print(f\"Point is not on the diagonal.\")") + expect(tokens[0][0].value).toBe("match"); + expect(tokens[0][0].scopes).toEqual(["source.python","keyword.control.flow.python"]); + expect(tokens[0][1].value).toBe(" "); + expect(tokens[0][1].scopes).toEqual(["source.python"]); + expect(tokens[0][2].value).toBe("point"); + expect(tokens[0][2].scopes).toEqual(["source.python"]); + expect(tokens[0][3].value).toBe(":"); + expect(tokens[0][3].scopes).toEqual(["source.python","punctuation.separator.colon.python"]); + expect(tokens[1][0].value).toBe(" "); + expect(tokens[1][0].scopes).toEqual(["source.python"]); + expect(tokens[1][1].value).toBe("case"); + expect(tokens[1][1].scopes).toEqual(["source.python","keyword.control.flow.python"]); + expect(tokens[1][2].value).toBe(" "); + expect(tokens[1][2].scopes).toEqual(["source.python"]); + expect(tokens[1][3].value).toBe("Point"); + expect(tokens[1][3].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.generic.python"]); + expect(tokens[1][4].value).toBe("("); + expect(tokens[1][4].scopes).toEqual(["source.python","meta.function-call.python","punctuation.definition.arguments.begin.python"]); + expect(tokens[1][5].value).toBe("x"); + expect(tokens[1][5].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python"]); + expect(tokens[1][6].value).toBe(","); + expect(tokens[1][6].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","punctuation.separator.arguments.python"]); + expect(tokens[1][7].value).toBe(" "); + expect(tokens[1][7].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python"]); + expect(tokens[1][8].value).toBe("y"); + expect(tokens[1][8].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python"]); + expect(tokens[1][9].value).toBe(")"); + expect(tokens[1][9].scopes).toEqual(["source.python","meta.function-call.python","punctuation.definition.arguments.end.python"]); + expect(tokens[1][10].value).toBe(" "); + expect(tokens[1][10].scopes).toEqual(["source.python"]); + expect(tokens[1][11].value).toBe("if"); + expect(tokens[1][11].scopes).toEqual(["source.python","keyword.control.flow.python"]); + expect(tokens[1][12].value).toBe(" "); + expect(tokens[1][12].scopes).toEqual(["source.python"]); + expect(tokens[1][13].value).toBe("x"); + expect(tokens[1][13].scopes).toEqual(["source.python"]); + expect(tokens[1][14].value).toBe(" "); + expect(tokens[1][14].scopes).toEqual(["source.python"]); + expect(tokens[1][15].value).toBe("=="); + expect(tokens[1][15].scopes).toEqual(["source.python","keyword.operator.comparison.python"]); + expect(tokens[1][16].value).toBe(" "); + expect(tokens[1][16].scopes).toEqual(["source.python"]); + expect(tokens[1][17].value).toBe("y"); + expect(tokens[1][17].scopes).toEqual(["source.python"]); + expect(tokens[1][18].value).toBe(":"); + expect(tokens[1][18].scopes).toEqual(["source.python","punctuation.separator.colon.python"]); + expect(tokens[2][0].value).toBe(" "); + expect(tokens[2][0].scopes).toEqual(["source.python"]); + expect(tokens[2][1].value).toBe("print"); + expect(tokens[2][1].scopes).toEqual(["source.python","meta.function-call.python","support.function.builtin.python"]); + expect(tokens[2][2].value).toBe("("); + expect(tokens[2][2].scopes).toEqual(["source.python","meta.function-call.python","punctuation.definition.arguments.begin.python"]); + expect(tokens[2][3].value).toBe("f"); + expect(tokens[2][3].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","meta.fstring.python","storage.type.string.python string.quoted.single.python string.interpolated.python"]); + expect(tokens[2][4].value).toBe("\""); + expect(tokens[2][4].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","meta.fstring.python","string.quoted.single.python string.interpolated.python punctuation.definition.string.begin.python"]); + expect(tokens[2][5].value).toBe("The point is located on the diagonal Y=X."); + expect(tokens[2][5].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","meta.fstring.python","string.quoted.single.python string.interpolated.python"]); + expect(tokens[2][6].value).toBe("\""); + expect(tokens[2][6].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","meta.fstring.python","string.quoted.single.python string.interpolated.python punctuation.definition.string.end.python"]); + expect(tokens[2][7].value).toBe(")"); + expect(tokens[2][7].scopes).toEqual(["source.python","meta.function-call.python","punctuation.definition.arguments.end.python"]); + expect(tokens[3][0].value).toBe(" "); + expect(tokens[3][0].scopes).toEqual(["source.python"]); + expect(tokens[3][1].value).toBe("case"); + expect(tokens[3][1].scopes).toEqual(["source.python","keyword.control.flow.python"]); + expect(tokens[3][2].value).toBe(" "); + expect(tokens[3][2].scopes).toEqual(["source.python"]); + expect(tokens[3][3].value).toBe("Point"); + expect(tokens[3][3].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.generic.python"]); + expect(tokens[3][4].value).toBe("("); + expect(tokens[3][4].scopes).toEqual(["source.python","meta.function-call.python","punctuation.definition.arguments.begin.python"]); + expect(tokens[3][5].value).toBe("x"); + expect(tokens[3][5].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python"]); + expect(tokens[3][6].value).toBe(","); + expect(tokens[3][6].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","punctuation.separator.arguments.python"]); + expect(tokens[3][7].value).toBe(" "); + expect(tokens[3][7].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python"]); + expect(tokens[3][8].value).toBe("y"); + expect(tokens[3][8].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python"]); + expect(tokens[3][9].value).toBe(")"); + expect(tokens[3][9].scopes).toEqual(["source.python","meta.function-call.python","punctuation.definition.arguments.end.python"]); + expect(tokens[3][10].value).toBe(":"); + expect(tokens[3][10].scopes).toEqual(["source.python","punctuation.separator.colon.python"]); + expect(tokens[4][0].value).toBe(" "); + expect(tokens[4][0].scopes).toEqual(["source.python"]); + expect(tokens[4][1].value).toBe("print"); + expect(tokens[4][1].scopes).toEqual(["source.python","meta.function-call.python","support.function.builtin.python"]); + expect(tokens[4][2].value).toBe("("); + expect(tokens[4][2].scopes).toEqual(["source.python","meta.function-call.python","punctuation.definition.arguments.begin.python"]); + expect(tokens[4][3].value).toBe("f"); + expect(tokens[4][3].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","meta.fstring.python","storage.type.string.python string.quoted.single.python string.interpolated.python"]); + expect(tokens[4][4].value).toBe("\""); + expect(tokens[4][4].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","meta.fstring.python","string.quoted.single.python string.interpolated.python punctuation.definition.string.begin.python"]); + expect(tokens[4][5].value).toBe("Point is not on the diagonal."); + expect(tokens[4][5].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","meta.fstring.python","string.quoted.single.python string.interpolated.python"]); + expect(tokens[4][6].value).toBe("\""); + expect(tokens[4][6].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","meta.fstring.python","string.quoted.single.python string.interpolated.python punctuation.definition.string.end.python"]); + expect(tokens[4][7].value).toBe(")"); + expect(tokens[4][7].scopes).toEqual(["source.python","meta.function-call.python","punctuation.definition.arguments.end.python"]); + }); + + it("test/statements/match5.py", + function() { + tokens = grammar.tokenizeLines("match command.split() if command else ['default']:\n ... # Other cases\n case [\"north\"] | [\"go\", \"north\"]:\n ... # handle case\n case [\"get\", obj] | [\"pick\", \"up\", *other] | [\"pick\", obj, \"up\"]:\n ... # handle case") + expect(tokens[0][0].value).toBe("match"); + expect(tokens[0][0].scopes).toEqual(["source.python","keyword.control.flow.python"]); + expect(tokens[0][1].value).toBe(" "); + expect(tokens[0][1].scopes).toEqual(["source.python"]); + expect(tokens[0][2].value).toBe("command"); + expect(tokens[0][2].scopes).toEqual(["source.python"]); + expect(tokens[0][3].value).toBe("."); + expect(tokens[0][3].scopes).toEqual(["source.python","meta.member.access.python","punctuation.separator.period.python"]); + expect(tokens[0][4].value).toBe("split"); + expect(tokens[0][4].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.generic.python"]); + expect(tokens[0][5].value).toBe("("); + expect(tokens[0][5].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","punctuation.definition.arguments.begin.python"]); + expect(tokens[0][6].value).toBe(")"); + expect(tokens[0][6].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","punctuation.definition.arguments.end.python"]); + expect(tokens[0][7].value).toBe(" "); + expect(tokens[0][7].scopes).toEqual(["source.python"]); + expect(tokens[0][8].value).toBe("if"); + expect(tokens[0][8].scopes).toEqual(["source.python","keyword.control.flow.python"]); + expect(tokens[0][9].value).toBe(" "); + expect(tokens[0][9].scopes).toEqual(["source.python"]); + expect(tokens[0][10].value).toBe("command"); + expect(tokens[0][10].scopes).toEqual(["source.python"]); + expect(tokens[0][11].value).toBe(" "); + expect(tokens[0][11].scopes).toEqual(["source.python"]); + expect(tokens[0][12].value).toBe("else"); + expect(tokens[0][12].scopes).toEqual(["source.python","keyword.control.flow.python"]); + expect(tokens[0][13].value).toBe(" "); + expect(tokens[0][13].scopes).toEqual(["source.python"]); + expect(tokens[0][14].value).toBe("["); + expect(tokens[0][14].scopes).toEqual(["source.python","punctuation.definition.list.begin.python"]); + expect(tokens[0][15].value).toBe("'"); + expect(tokens[0][15].scopes).toEqual(["source.python","string.quoted.single.python","punctuation.definition.string.begin.python"]); + expect(tokens[0][16].value).toBe("default"); + expect(tokens[0][16].scopes).toEqual(["source.python","string.quoted.single.python"]); + expect(tokens[0][17].value).toBe("'"); + expect(tokens[0][17].scopes).toEqual(["source.python","string.quoted.single.python","punctuation.definition.string.end.python"]); + expect(tokens[0][18].value).toBe("]"); + expect(tokens[0][18].scopes).toEqual(["source.python","punctuation.definition.list.end.python"]); + expect(tokens[0][19].value).toBe(":"); + expect(tokens[0][19].scopes).toEqual(["source.python","punctuation.separator.colon.python"]); + expect(tokens[1][0].value).toBe(" "); + expect(tokens[1][0].scopes).toEqual(["source.python"]); + expect(tokens[1][1].value).toBe("..."); + expect(tokens[1][1].scopes).toEqual(["source.python","constant.other.ellipsis.python"]); + expect(tokens[1][2].value).toBe(" "); + expect(tokens[1][2].scopes).toEqual(["source.python"]); + expect(tokens[1][3].value).toBe("#"); + expect(tokens[1][3].scopes).toEqual(["source.python","comment.line.number-sign.python","punctuation.definition.comment.python"]); + expect(tokens[1][4].value).toBe(" Other cases"); + expect(tokens[1][4].scopes).toEqual(["source.python","comment.line.number-sign.python"]); + expect(tokens[2][0].value).toBe(" "); + expect(tokens[2][0].scopes).toEqual(["source.python"]); + expect(tokens[2][1].value).toBe("case"); + expect(tokens[2][1].scopes).toEqual(["source.python","keyword.control.flow.python"]); + expect(tokens[2][2].value).toBe(" "); + expect(tokens[2][2].scopes).toEqual(["source.python"]); + expect(tokens[2][3].value).toBe("["); + expect(tokens[2][3].scopes).toEqual(["source.python","punctuation.definition.list.begin.python"]); + expect(tokens[2][4].value).toBe("\""); + expect(tokens[2][4].scopes).toEqual(["source.python","string.quoted.single.python","punctuation.definition.string.begin.python"]); + expect(tokens[2][5].value).toBe("north"); + expect(tokens[2][5].scopes).toEqual(["source.python","string.quoted.single.python"]); + expect(tokens[2][6].value).toBe("\""); + expect(tokens[2][6].scopes).toEqual(["source.python","string.quoted.single.python","punctuation.definition.string.end.python"]); + expect(tokens[2][7].value).toBe("]"); + expect(tokens[2][7].scopes).toEqual(["source.python","punctuation.definition.list.end.python"]); + expect(tokens[2][8].value).toBe(" "); + expect(tokens[2][8].scopes).toEqual(["source.python"]); + expect(tokens[2][9].value).toBe("|"); + expect(tokens[2][9].scopes).toEqual(["source.python","keyword.operator.bitwise.python"]); + expect(tokens[2][10].value).toBe(" "); + expect(tokens[2][10].scopes).toEqual(["source.python"]); + expect(tokens[2][11].value).toBe("["); + expect(tokens[2][11].scopes).toEqual(["source.python","punctuation.definition.list.begin.python"]); + expect(tokens[2][12].value).toBe("\""); + expect(tokens[2][12].scopes).toEqual(["source.python","string.quoted.single.python","punctuation.definition.string.begin.python"]); + expect(tokens[2][13].value).toBe("go"); + expect(tokens[2][13].scopes).toEqual(["source.python","string.quoted.single.python"]); + expect(tokens[2][14].value).toBe("\""); + expect(tokens[2][14].scopes).toEqual(["source.python","string.quoted.single.python","punctuation.definition.string.end.python"]); + expect(tokens[2][15].value).toBe(","); + expect(tokens[2][15].scopes).toEqual(["source.python","punctuation.separator.element.python"]); + expect(tokens[2][16].value).toBe(" "); + expect(tokens[2][16].scopes).toEqual(["source.python"]); + expect(tokens[2][17].value).toBe("\""); + expect(tokens[2][17].scopes).toEqual(["source.python","string.quoted.single.python","punctuation.definition.string.begin.python"]); + expect(tokens[2][18].value).toBe("north"); + expect(tokens[2][18].scopes).toEqual(["source.python","string.quoted.single.python"]); + expect(tokens[2][19].value).toBe("\""); + expect(tokens[2][19].scopes).toEqual(["source.python","string.quoted.single.python","punctuation.definition.string.end.python"]); + expect(tokens[2][20].value).toBe("]"); + expect(tokens[2][20].scopes).toEqual(["source.python","punctuation.definition.list.end.python"]); + expect(tokens[2][21].value).toBe(":"); + expect(tokens[2][21].scopes).toEqual(["source.python","punctuation.separator.colon.python"]); + expect(tokens[3][0].value).toBe(" "); + expect(tokens[3][0].scopes).toEqual(["source.python"]); + expect(tokens[3][1].value).toBe("..."); + expect(tokens[3][1].scopes).toEqual(["source.python","constant.other.ellipsis.python"]); + expect(tokens[3][2].value).toBe(" "); + expect(tokens[3][2].scopes).toEqual(["source.python"]); + expect(tokens[3][3].value).toBe("#"); + expect(tokens[3][3].scopes).toEqual(["source.python","comment.line.number-sign.python","punctuation.definition.comment.python"]); + expect(tokens[3][4].value).toBe(" handle case"); + expect(tokens[3][4].scopes).toEqual(["source.python","comment.line.number-sign.python"]); + expect(tokens[4][0].value).toBe(" "); + expect(tokens[4][0].scopes).toEqual(["source.python"]); + expect(tokens[4][1].value).toBe("case"); + expect(tokens[4][1].scopes).toEqual(["source.python","keyword.control.flow.python"]); + expect(tokens[4][2].value).toBe(" "); + expect(tokens[4][2].scopes).toEqual(["source.python"]); + expect(tokens[4][3].value).toBe("["); + expect(tokens[4][3].scopes).toEqual(["source.python","punctuation.definition.list.begin.python"]); + expect(tokens[4][4].value).toBe("\""); + expect(tokens[4][4].scopes).toEqual(["source.python","string.quoted.single.python","punctuation.definition.string.begin.python"]); + expect(tokens[4][5].value).toBe("get"); + expect(tokens[4][5].scopes).toEqual(["source.python","string.quoted.single.python"]); + expect(tokens[4][6].value).toBe("\""); + expect(tokens[4][6].scopes).toEqual(["source.python","string.quoted.single.python","punctuation.definition.string.end.python"]); + expect(tokens[4][7].value).toBe(","); + expect(tokens[4][7].scopes).toEqual(["source.python","punctuation.separator.element.python"]); + expect(tokens[4][8].value).toBe(" "); + expect(tokens[4][8].scopes).toEqual(["source.python"]); + expect(tokens[4][9].value).toBe("obj"); + expect(tokens[4][9].scopes).toEqual(["source.python"]); + expect(tokens[4][10].value).toBe("]"); + expect(tokens[4][10].scopes).toEqual(["source.python","punctuation.definition.list.end.python"]); + expect(tokens[4][11].value).toBe(" "); + expect(tokens[4][11].scopes).toEqual(["source.python"]); + expect(tokens[4][12].value).toBe("|"); + expect(tokens[4][12].scopes).toEqual(["source.python","keyword.operator.bitwise.python"]); + expect(tokens[4][13].value).toBe(" "); + expect(tokens[4][13].scopes).toEqual(["source.python"]); + expect(tokens[4][14].value).toBe("["); + expect(tokens[4][14].scopes).toEqual(["source.python","punctuation.definition.list.begin.python"]); + expect(tokens[4][15].value).toBe("\""); + expect(tokens[4][15].scopes).toEqual(["source.python","string.quoted.single.python","punctuation.definition.string.begin.python"]); + expect(tokens[4][16].value).toBe("pick"); + expect(tokens[4][16].scopes).toEqual(["source.python","string.quoted.single.python"]); + expect(tokens[4][17].value).toBe("\""); + expect(tokens[4][17].scopes).toEqual(["source.python","string.quoted.single.python","punctuation.definition.string.end.python"]); + expect(tokens[4][18].value).toBe(","); + expect(tokens[4][18].scopes).toEqual(["source.python","punctuation.separator.element.python"]); + expect(tokens[4][19].value).toBe(" "); + expect(tokens[4][19].scopes).toEqual(["source.python"]); + expect(tokens[4][20].value).toBe("\""); + expect(tokens[4][20].scopes).toEqual(["source.python","string.quoted.single.python","punctuation.definition.string.begin.python"]); + expect(tokens[4][21].value).toBe("up"); + expect(tokens[4][21].scopes).toEqual(["source.python","string.quoted.single.python"]); + expect(tokens[4][22].value).toBe("\""); + expect(tokens[4][22].scopes).toEqual(["source.python","string.quoted.single.python","punctuation.definition.string.end.python"]); + expect(tokens[4][23].value).toBe(","); + expect(tokens[4][23].scopes).toEqual(["source.python","punctuation.separator.element.python"]); + expect(tokens[4][24].value).toBe(" "); + expect(tokens[4][24].scopes).toEqual(["source.python"]); + expect(tokens[4][25].value).toBe("*"); + expect(tokens[4][25].scopes).toEqual(["source.python","keyword.operator.arithmetic.python"]); + expect(tokens[4][26].value).toBe("other"); + expect(tokens[4][26].scopes).toEqual(["source.python"]); + expect(tokens[4][27].value).toBe("]"); + expect(tokens[4][27].scopes).toEqual(["source.python","punctuation.definition.list.end.python"]); + expect(tokens[4][28].value).toBe(" "); + expect(tokens[4][28].scopes).toEqual(["source.python"]); + expect(tokens[4][29].value).toBe("|"); + expect(tokens[4][29].scopes).toEqual(["source.python","keyword.operator.bitwise.python"]); + expect(tokens[4][30].value).toBe(" "); + expect(tokens[4][30].scopes).toEqual(["source.python"]); + expect(tokens[4][31].value).toBe("["); + expect(tokens[4][31].scopes).toEqual(["source.python","punctuation.definition.list.begin.python"]); + expect(tokens[4][32].value).toBe("\""); + expect(tokens[4][32].scopes).toEqual(["source.python","string.quoted.single.python","punctuation.definition.string.begin.python"]); + expect(tokens[4][33].value).toBe("pick"); + expect(tokens[4][33].scopes).toEqual(["source.python","string.quoted.single.python"]); + expect(tokens[4][34].value).toBe("\""); + expect(tokens[4][34].scopes).toEqual(["source.python","string.quoted.single.python","punctuation.definition.string.end.python"]); + expect(tokens[4][35].value).toBe(","); + expect(tokens[4][35].scopes).toEqual(["source.python","punctuation.separator.element.python"]); + expect(tokens[4][36].value).toBe(" "); + expect(tokens[4][36].scopes).toEqual(["source.python"]); + expect(tokens[4][37].value).toBe("obj"); + expect(tokens[4][37].scopes).toEqual(["source.python"]); + expect(tokens[4][38].value).toBe(","); + expect(tokens[4][38].scopes).toEqual(["source.python","punctuation.separator.element.python"]); + expect(tokens[4][39].value).toBe(" "); + expect(tokens[4][39].scopes).toEqual(["source.python"]); + expect(tokens[4][40].value).toBe("\""); + expect(tokens[4][40].scopes).toEqual(["source.python","string.quoted.single.python","punctuation.definition.string.begin.python"]); + expect(tokens[4][41].value).toBe("up"); + expect(tokens[4][41].scopes).toEqual(["source.python","string.quoted.single.python"]); + expect(tokens[4][42].value).toBe("\""); + expect(tokens[4][42].scopes).toEqual(["source.python","string.quoted.single.python","punctuation.definition.string.end.python"]); + expect(tokens[4][43].value).toBe("]"); + expect(tokens[4][43].scopes).toEqual(["source.python","punctuation.definition.list.end.python"]); + expect(tokens[4][44].value).toBe(":"); + expect(tokens[4][44].scopes).toEqual(["source.python","punctuation.separator.colon.python"]); + expect(tokens[5][0].value).toBe(" "); + expect(tokens[5][0].scopes).toEqual(["source.python"]); + expect(tokens[5][1].value).toBe("..."); + expect(tokens[5][1].scopes).toEqual(["source.python","constant.other.ellipsis.python"]); + expect(tokens[5][2].value).toBe(" "); + expect(tokens[5][2].scopes).toEqual(["source.python"]); + expect(tokens[5][3].value).toBe("#"); + expect(tokens[5][3].scopes).toEqual(["source.python","comment.line.number-sign.python","punctuation.definition.comment.python"]); + expect(tokens[5][4].value).toBe(" handle case"); + expect(tokens[5][4].scopes).toEqual(["source.python","comment.line.number-sign.python"]); + }); + + it("test/statements/match6.py", + function() { + tokens = grammar.tokenizeLines("match (foo + bar):\n ... # cases\nmatch [foo, bar]:\n ... # cases\nmatch {foo, bar}:\n ... # cases") + expect(tokens[0][0].value).toBe("match"); + expect(tokens[0][0].scopes).toEqual(["source.python","keyword.control.flow.python"]); + expect(tokens[0][1].value).toBe(" "); + expect(tokens[0][1].scopes).toEqual(["source.python"]); + expect(tokens[0][2].value).toBe("("); + expect(tokens[0][2].scopes).toEqual(["source.python","punctuation.parenthesis.begin.python"]); + expect(tokens[0][3].value).toBe("foo"); + expect(tokens[0][3].scopes).toEqual(["source.python"]); + expect(tokens[0][4].value).toBe(" "); + expect(tokens[0][4].scopes).toEqual(["source.python"]); + expect(tokens[0][5].value).toBe("+"); + expect(tokens[0][5].scopes).toEqual(["source.python","keyword.operator.arithmetic.python"]); + expect(tokens[0][6].value).toBe(" "); + expect(tokens[0][6].scopes).toEqual(["source.python"]); + expect(tokens[0][7].value).toBe("bar"); + expect(tokens[0][7].scopes).toEqual(["source.python"]); + expect(tokens[0][8].value).toBe(")"); + expect(tokens[0][8].scopes).toEqual(["source.python","punctuation.parenthesis.end.python"]); + expect(tokens[0][9].value).toBe(":"); + expect(tokens[0][9].scopes).toEqual(["source.python","punctuation.separator.colon.python"]); + expect(tokens[1][0].value).toBe(" "); + expect(tokens[1][0].scopes).toEqual(["source.python"]); + expect(tokens[1][1].value).toBe("..."); + expect(tokens[1][1].scopes).toEqual(["source.python","constant.other.ellipsis.python"]); + expect(tokens[1][2].value).toBe(" "); + expect(tokens[1][2].scopes).toEqual(["source.python"]); + expect(tokens[1][3].value).toBe("#"); + expect(tokens[1][3].scopes).toEqual(["source.python","comment.line.number-sign.python","punctuation.definition.comment.python"]); + expect(tokens[1][4].value).toBe(" cases"); + expect(tokens[1][4].scopes).toEqual(["source.python","comment.line.number-sign.python"]); + expect(tokens[2][0].value).toBe("match"); + expect(tokens[2][0].scopes).toEqual(["source.python","keyword.control.flow.python"]); + expect(tokens[2][1].value).toBe(" "); + expect(tokens[2][1].scopes).toEqual(["source.python"]); + expect(tokens[2][2].value).toBe("["); + expect(tokens[2][2].scopes).toEqual(["source.python","punctuation.definition.list.begin.python"]); + expect(tokens[2][3].value).toBe("foo"); + expect(tokens[2][3].scopes).toEqual(["source.python"]); + expect(tokens[2][4].value).toBe(","); + expect(tokens[2][4].scopes).toEqual(["source.python","punctuation.separator.element.python"]); + expect(tokens[2][5].value).toBe(" "); + expect(tokens[2][5].scopes).toEqual(["source.python"]); + expect(tokens[2][6].value).toBe("bar"); + expect(tokens[2][6].scopes).toEqual(["source.python"]); + expect(tokens[2][7].value).toBe("]"); + expect(tokens[2][7].scopes).toEqual(["source.python","punctuation.definition.list.end.python"]); + expect(tokens[2][8].value).toBe(":"); + expect(tokens[2][8].scopes).toEqual(["source.python","punctuation.separator.colon.python"]); + expect(tokens[3][0].value).toBe(" "); + expect(tokens[3][0].scopes).toEqual(["source.python"]); + expect(tokens[3][1].value).toBe("..."); + expect(tokens[3][1].scopes).toEqual(["source.python","constant.other.ellipsis.python"]); + expect(tokens[3][2].value).toBe(" "); + expect(tokens[3][2].scopes).toEqual(["source.python"]); + expect(tokens[3][3].value).toBe("#"); + expect(tokens[3][3].scopes).toEqual(["source.python","comment.line.number-sign.python","punctuation.definition.comment.python"]); + expect(tokens[3][4].value).toBe(" cases"); + expect(tokens[3][4].scopes).toEqual(["source.python","comment.line.number-sign.python"]); + expect(tokens[4][0].value).toBe("match"); + expect(tokens[4][0].scopes).toEqual(["source.python","keyword.control.flow.python"]); + expect(tokens[4][1].value).toBe(" "); + expect(tokens[4][1].scopes).toEqual(["source.python"]); + expect(tokens[4][2].value).toBe("{"); + expect(tokens[4][2].scopes).toEqual(["source.python","punctuation.definition.dict.begin.python"]); + expect(tokens[4][3].value).toBe("foo"); + expect(tokens[4][3].scopes).toEqual(["source.python"]); + expect(tokens[4][4].value).toBe(","); + expect(tokens[4][4].scopes).toEqual(["source.python","punctuation.separator.element.python"]); + expect(tokens[4][5].value).toBe(" "); + expect(tokens[4][5].scopes).toEqual(["source.python"]); + expect(tokens[4][6].value).toBe("bar"); + expect(tokens[4][6].scopes).toEqual(["source.python"]); + expect(tokens[4][7].value).toBe("}"); + expect(tokens[4][7].scopes).toEqual(["source.python","punctuation.definition.dict.end.python"]); + expect(tokens[4][8].value).toBe(":"); + expect(tokens[4][8].scopes).toEqual(["source.python","punctuation.separator.colon.python"]); + expect(tokens[5][0].value).toBe(" "); + expect(tokens[5][0].scopes).toEqual(["source.python"]); + expect(tokens[5][1].value).toBe("..."); + expect(tokens[5][1].scopes).toEqual(["source.python","constant.other.ellipsis.python"]); + expect(tokens[5][2].value).toBe(" "); + expect(tokens[5][2].scopes).toEqual(["source.python"]); + expect(tokens[5][3].value).toBe("#"); + expect(tokens[5][3].scopes).toEqual(["source.python","comment.line.number-sign.python","punctuation.definition.comment.python"]); + expect(tokens[5][4].value).toBe(" cases"); + expect(tokens[5][4].scopes).toEqual(["source.python","comment.line.number-sign.python"]); + }); + + it("test/statements/match7.py", + function() { + tokens = grammar.tokenizeLines("match 'prefix' + foo:\n ... # cases\nmatch \"prefix\" + foo:\n ... # cases\nmatch f'prefix{foo}':\n ... # cases\nmatch f\"prefix{foo}\":\n ... # cases\nmatch -foo:\n ... # cases\nmatch not foo:\n ... # cases") + expect(tokens[0][0].value).toBe("match"); + expect(tokens[0][0].scopes).toEqual(["source.python","keyword.control.flow.python"]); + expect(tokens[0][1].value).toBe(" "); + expect(tokens[0][1].scopes).toEqual(["source.python"]); + expect(tokens[0][2].value).toBe("'"); + expect(tokens[0][2].scopes).toEqual(["source.python","string.quoted.single.python","punctuation.definition.string.begin.python"]); + expect(tokens[0][3].value).toBe("prefix"); + expect(tokens[0][3].scopes).toEqual(["source.python","string.quoted.single.python"]); + expect(tokens[0][4].value).toBe("'"); + expect(tokens[0][4].scopes).toEqual(["source.python","string.quoted.single.python","punctuation.definition.string.end.python"]); + expect(tokens[0][5].value).toBe(" "); + expect(tokens[0][5].scopes).toEqual(["source.python"]); + expect(tokens[0][6].value).toBe("+"); + expect(tokens[0][6].scopes).toEqual(["source.python","keyword.operator.arithmetic.python"]); + expect(tokens[0][7].value).toBe(" "); + expect(tokens[0][7].scopes).toEqual(["source.python"]); + expect(tokens[0][8].value).toBe("foo"); + expect(tokens[0][8].scopes).toEqual(["source.python"]); + expect(tokens[0][9].value).toBe(":"); + expect(tokens[0][9].scopes).toEqual(["source.python","punctuation.separator.colon.python"]); + expect(tokens[1][0].value).toBe(" "); + expect(tokens[1][0].scopes).toEqual(["source.python"]); + expect(tokens[1][1].value).toBe("..."); + expect(tokens[1][1].scopes).toEqual(["source.python","constant.other.ellipsis.python"]); + expect(tokens[1][2].value).toBe(" "); + expect(tokens[1][2].scopes).toEqual(["source.python"]); + expect(tokens[1][3].value).toBe("#"); + expect(tokens[1][3].scopes).toEqual(["source.python","comment.line.number-sign.python","punctuation.definition.comment.python"]); + expect(tokens[1][4].value).toBe(" cases"); + expect(tokens[1][4].scopes).toEqual(["source.python","comment.line.number-sign.python"]); + expect(tokens[2][0].value).toBe("match"); + expect(tokens[2][0].scopes).toEqual(["source.python","keyword.control.flow.python"]); + expect(tokens[2][1].value).toBe(" "); + expect(tokens[2][1].scopes).toEqual(["source.python"]); + expect(tokens[2][2].value).toBe("\""); + expect(tokens[2][2].scopes).toEqual(["source.python","string.quoted.single.python","punctuation.definition.string.begin.python"]); + expect(tokens[2][3].value).toBe("prefix"); + expect(tokens[2][3].scopes).toEqual(["source.python","string.quoted.single.python"]); + expect(tokens[2][4].value).toBe("\""); + expect(tokens[2][4].scopes).toEqual(["source.python","string.quoted.single.python","punctuation.definition.string.end.python"]); + expect(tokens[2][5].value).toBe(" "); + expect(tokens[2][5].scopes).toEqual(["source.python"]); + expect(tokens[2][6].value).toBe("+"); + expect(tokens[2][6].scopes).toEqual(["source.python","keyword.operator.arithmetic.python"]); + expect(tokens[2][7].value).toBe(" "); + expect(tokens[2][7].scopes).toEqual(["source.python"]); + expect(tokens[2][8].value).toBe("foo"); + expect(tokens[2][8].scopes).toEqual(["source.python"]); + expect(tokens[2][9].value).toBe(":"); + expect(tokens[2][9].scopes).toEqual(["source.python","punctuation.separator.colon.python"]); + expect(tokens[3][0].value).toBe(" "); + expect(tokens[3][0].scopes).toEqual(["source.python"]); + expect(tokens[3][1].value).toBe("..."); + expect(tokens[3][1].scopes).toEqual(["source.python","constant.other.ellipsis.python"]); + expect(tokens[3][2].value).toBe(" "); + expect(tokens[3][2].scopes).toEqual(["source.python"]); + expect(tokens[3][3].value).toBe("#"); + expect(tokens[3][3].scopes).toEqual(["source.python","comment.line.number-sign.python","punctuation.definition.comment.python"]); + expect(tokens[3][4].value).toBe(" cases"); + expect(tokens[3][4].scopes).toEqual(["source.python","comment.line.number-sign.python"]); + expect(tokens[4][0].value).toBe("match"); + expect(tokens[4][0].scopes).toEqual(["source.python","keyword.control.flow.python"]); + expect(tokens[4][1].value).toBe(" "); + expect(tokens[4][1].scopes).toEqual(["source.python"]); + expect(tokens[4][2].value).toBe("f"); + expect(tokens[4][2].scopes).toEqual(["source.python","meta.fstring.python","storage.type.string.python string.quoted.single.python string.interpolated.python"]); + expect(tokens[4][3].value).toBe("'"); + expect(tokens[4][3].scopes).toEqual(["source.python","meta.fstring.python","string.quoted.single.python string.interpolated.python punctuation.definition.string.begin.python"]); + expect(tokens[4][4].value).toBe("prefix"); + expect(tokens[4][4].scopes).toEqual(["source.python","meta.fstring.python","string.quoted.single.python string.interpolated.python"]); + expect(tokens[4][5].value).toBe("{"); + expect(tokens[4][5].scopes).toEqual(["source.python","meta.fstring.python","constant.character.format.placeholder.other.python"]); + expect(tokens[4][6].value).toBe("foo"); + expect(tokens[4][6].scopes).toEqual(["source.python","meta.fstring.python"]); + expect(tokens[4][7].value).toBe("}"); + expect(tokens[4][7].scopes).toEqual(["source.python","meta.fstring.python","constant.character.format.placeholder.other.python"]); + expect(tokens[4][8].value).toBe("'"); + expect(tokens[4][8].scopes).toEqual(["source.python","meta.fstring.python","string.quoted.single.python string.interpolated.python punctuation.definition.string.end.python"]); + expect(tokens[4][9].value).toBe(":"); + expect(tokens[4][9].scopes).toEqual(["source.python","punctuation.separator.colon.python"]); + expect(tokens[5][0].value).toBe(" "); + expect(tokens[5][0].scopes).toEqual(["source.python"]); + expect(tokens[5][1].value).toBe("..."); + expect(tokens[5][1].scopes).toEqual(["source.python","constant.other.ellipsis.python"]); + expect(tokens[5][2].value).toBe(" "); + expect(tokens[5][2].scopes).toEqual(["source.python"]); + expect(tokens[5][3].value).toBe("#"); + expect(tokens[5][3].scopes).toEqual(["source.python","comment.line.number-sign.python","punctuation.definition.comment.python"]); + expect(tokens[5][4].value).toBe(" cases"); + expect(tokens[5][4].scopes).toEqual(["source.python","comment.line.number-sign.python"]); + expect(tokens[6][0].value).toBe("match"); + expect(tokens[6][0].scopes).toEqual(["source.python","keyword.control.flow.python"]); + expect(tokens[6][1].value).toBe(" "); + expect(tokens[6][1].scopes).toEqual(["source.python"]); + expect(tokens[6][2].value).toBe("f"); + expect(tokens[6][2].scopes).toEqual(["source.python","meta.fstring.python","storage.type.string.python string.quoted.single.python string.interpolated.python"]); + expect(tokens[6][3].value).toBe("\""); + expect(tokens[6][3].scopes).toEqual(["source.python","meta.fstring.python","string.quoted.single.python string.interpolated.python punctuation.definition.string.begin.python"]); + expect(tokens[6][4].value).toBe("prefix"); + expect(tokens[6][4].scopes).toEqual(["source.python","meta.fstring.python","string.quoted.single.python string.interpolated.python"]); + expect(tokens[6][5].value).toBe("{"); + expect(tokens[6][5].scopes).toEqual(["source.python","meta.fstring.python","constant.character.format.placeholder.other.python"]); + expect(tokens[6][6].value).toBe("foo"); + expect(tokens[6][6].scopes).toEqual(["source.python","meta.fstring.python"]); + expect(tokens[6][7].value).toBe("}"); + expect(tokens[6][7].scopes).toEqual(["source.python","meta.fstring.python","constant.character.format.placeholder.other.python"]); + expect(tokens[6][8].value).toBe("\""); + expect(tokens[6][8].scopes).toEqual(["source.python","meta.fstring.python","string.quoted.single.python string.interpolated.python punctuation.definition.string.end.python"]); + expect(tokens[6][9].value).toBe(":"); + expect(tokens[6][9].scopes).toEqual(["source.python","punctuation.separator.colon.python"]); + expect(tokens[7][0].value).toBe(" "); + expect(tokens[7][0].scopes).toEqual(["source.python"]); + expect(tokens[7][1].value).toBe("..."); + expect(tokens[7][1].scopes).toEqual(["source.python","constant.other.ellipsis.python"]); + expect(tokens[7][2].value).toBe(" "); + expect(tokens[7][2].scopes).toEqual(["source.python"]); + expect(tokens[7][3].value).toBe("#"); + expect(tokens[7][3].scopes).toEqual(["source.python","comment.line.number-sign.python","punctuation.definition.comment.python"]); + expect(tokens[7][4].value).toBe(" cases"); + expect(tokens[7][4].scopes).toEqual(["source.python","comment.line.number-sign.python"]); + expect(tokens[8][0].value).toBe("match"); + expect(tokens[8][0].scopes).toEqual(["source.python","keyword.control.flow.python"]); + expect(tokens[8][1].value).toBe(" "); + expect(tokens[8][1].scopes).toEqual(["source.python"]); + expect(tokens[8][2].value).toBe("-"); + expect(tokens[8][2].scopes).toEqual(["source.python","keyword.operator.arithmetic.python"]); + expect(tokens[8][3].value).toBe("foo"); + expect(tokens[8][3].scopes).toEqual(["source.python"]); + expect(tokens[8][4].value).toBe(":"); + expect(tokens[8][4].scopes).toEqual(["source.python","punctuation.separator.colon.python"]); + expect(tokens[9][0].value).toBe(" "); + expect(tokens[9][0].scopes).toEqual(["source.python"]); + expect(tokens[9][1].value).toBe("..."); + expect(tokens[9][1].scopes).toEqual(["source.python","constant.other.ellipsis.python"]); + expect(tokens[9][2].value).toBe(" "); + expect(tokens[9][2].scopes).toEqual(["source.python"]); + expect(tokens[9][3].value).toBe("#"); + expect(tokens[9][3].scopes).toEqual(["source.python","comment.line.number-sign.python","punctuation.definition.comment.python"]); + expect(tokens[9][4].value).toBe(" cases"); + expect(tokens[9][4].scopes).toEqual(["source.python","comment.line.number-sign.python"]); + expect(tokens[10][0].value).toBe("match"); + expect(tokens[10][0].scopes).toEqual(["source.python","keyword.control.flow.python"]); + expect(tokens[10][1].value).toBe(" "); + expect(tokens[10][1].scopes).toEqual(["source.python"]); + expect(tokens[10][2].value).toBe("not"); + expect(tokens[10][2].scopes).toEqual(["source.python","keyword.operator.logical.python"]); + expect(tokens[10][3].value).toBe(" "); + expect(tokens[10][3].scopes).toEqual(["source.python"]); + expect(tokens[10][4].value).toBe("foo"); + expect(tokens[10][4].scopes).toEqual(["source.python"]); + expect(tokens[10][5].value).toBe(":"); + expect(tokens[10][5].scopes).toEqual(["source.python","punctuation.separator.colon.python"]); + expect(tokens[11][0].value).toBe(" "); + expect(tokens[11][0].scopes).toEqual(["source.python"]); + expect(tokens[11][1].value).toBe("..."); + expect(tokens[11][1].scopes).toEqual(["source.python","constant.other.ellipsis.python"]); + expect(tokens[11][2].value).toBe(" "); + expect(tokens[11][2].scopes).toEqual(["source.python"]); + expect(tokens[11][3].value).toBe("#"); + expect(tokens[11][3].scopes).toEqual(["source.python","comment.line.number-sign.python","punctuation.definition.comment.python"]); + expect(tokens[11][4].value).toBe(" cases"); + expect(tokens[11][4].scopes).toEqual(["source.python","comment.line.number-sign.python"]); + }); + it("test/statements/nonlocal1.py", function() { tokens = grammar.tokenizeLines("nonlocal a, b, c") @@ -13200,7 +14771,7 @@ describe("Grammar Tests", function() { expect(tokens[2][21].value).toBe(" "); expect(tokens[2][21].scopes).toEqual(["source.python"]); expect(tokens[2][22].value).toBe("in"); - expect(tokens[2][22].scopes).toEqual(["source.python","keyword.operator.logical.python"]); + expect(tokens[2][22].scopes).toEqual(["source.python","keyword.control.flow.python"]); expect(tokens[2][23].value).toBe(" "); expect(tokens[2][23].scopes).toEqual(["source.python"]); expect(tokens[2][24].value).toBe("foo"); @@ -13275,11 +14846,11 @@ describe("Grammar Tests", function() { expect(tokens[2][9].value).toBe("\""); expect(tokens[2][9].scopes).toEqual(["source.python","string.quoted.single.python","punctuation.definition.string.end.python"]); expect(tokens[2][10].value).toBe("."); - expect(tokens[2][10].scopes).toEqual(["source.python","punctuation.separator.period.python"]); + expect(tokens[2][10].scopes).toEqual(["source.python","meta.member.access.python","punctuation.separator.period.python"]); expect(tokens[2][11].value).toBe("format"); - expect(tokens[2][11].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.generic.python"]); + expect(tokens[2][11].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.generic.python"]); expect(tokens[2][12].value).toBe("("); - expect(tokens[2][12].scopes).toEqual(["source.python","meta.function-call.python","punctuation.definition.arguments.begin.python"]); + expect(tokens[2][12].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","punctuation.definition.arguments.begin.python"]); }); it("test/strings/bytes1.py", @@ -13321,7 +14892,7 @@ describe("Grammar Tests", function() { function() { tokens = grammar.tokenizeLines("a[1] = b'''\nmultiline 'binary' string \\\n\n \\xf1 \\u1234aaaa \\U1234aaaa\n\n \\N{BLACK SPADE SUIT}\n'''") expect(tokens[0][0].value).toBe("a"); - expect(tokens[0][0].scopes).toEqual(["source.python","meta.item-access.python"]); + expect(tokens[0][0].scopes).toEqual(["source.python","meta.item-access.python","meta.indexed-name.python"]); expect(tokens[0][1].value).toBe("["); expect(tokens[0][1].scopes).toEqual(["source.python","meta.item-access.python","punctuation.definition.arguments.begin.python"]); expect(tokens[0][2].value).toBe("1"); @@ -13856,19 +15427,19 @@ describe("Grammar Tests", function() { expect(tokens[0][17].value).toBe("\""); expect(tokens[0][17].scopes).toEqual(["source.python","string.quoted.single.python","punctuation.definition.string.end.python"]); expect(tokens[0][18].value).toBe("."); - expect(tokens[0][18].scopes).toEqual(["source.python","punctuation.separator.period.python"]); + expect(tokens[0][18].scopes).toEqual(["source.python","meta.member.access.python","punctuation.separator.period.python"]); expect(tokens[0][19].value).toBe("format"); - expect(tokens[0][19].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.generic.python"]); + expect(tokens[0][19].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.generic.python"]); expect(tokens[0][20].value).toBe("("); - expect(tokens[0][20].scopes).toEqual(["source.python","meta.function-call.python","punctuation.definition.arguments.begin.python"]); + expect(tokens[0][20].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","punctuation.definition.arguments.begin.python"]); expect(tokens[0][21].value).toBe("fo"); - expect(tokens[0][21].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","variable.parameter.function-call.python"]); + expect(tokens[0][21].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","variable.parameter.function-call.python"]); expect(tokens[0][22].value).toBe("="); - expect(tokens[0][22].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","keyword.operator.assignment.python"]); + expect(tokens[0][22].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","keyword.operator.assignment.python"]); expect(tokens[0][23].value).toBe("1"); - expect(tokens[0][23].scopes).toEqual(["source.python","meta.function-call.python","meta.function-call.arguments.python","constant.numeric.dec.python"]); + expect(tokens[0][23].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","meta.function-call.arguments.python","constant.numeric.dec.python"]); expect(tokens[0][24].value).toBe(")"); - expect(tokens[0][24].scopes).toEqual(["source.python","meta.function-call.python","punctuation.definition.arguments.end.python"]); + expect(tokens[0][24].scopes).toEqual(["source.python","meta.member.access.python","meta.function-call.python","punctuation.definition.arguments.end.python"]); }); it("test/strings/format3.py", diff --git a/test/builtins/builtins3.py b/test/builtins/builtins3.py index 02ccb5af..f1f90d9c 100644 --- a/test/builtins/builtins3.py +++ b/test/builtins/builtins3.py @@ -40,6 +40,9 @@ some.__prepare__ some.__package__ some.__traceback__ +some.__closure__ +some.__globals__ +some.__match_args__ some.__notspecial__ @@ -60,127 +63,136 @@ ' : punctuation.definition.string.end.python, source.python, string.quoted.single.python ] : punctuation.definition.list.end.python, source.python some : source.python -. : punctuation.separator.period.python, source.python -__bases__ : source.python, support.variable.magic.python +. : meta.member.access.python, punctuation.separator.period.python, source.python +__bases__ : meta.member.access.python, source.python, support.variable.magic.python some : source.python -. : punctuation.separator.period.python, source.python -__class__ : source.python, support.variable.magic.python +. : meta.member.access.python, punctuation.separator.period.python, source.python +__class__ : meta.member.access.python, source.python, support.variable.magic.python assert : keyword.control.flow.python, source.python : source.python __debug__ : source.python, support.variable.magic.python __builtins__ : source.python, support.variable.magic.python __builtins__ : source.python, support.variable.magic.python -. : punctuation.separator.period.python, source.python -len : source.python +. : meta.member.access.python, punctuation.separator.period.python, source.python +len : meta.attribute.python, meta.member.access.python, source.python print : meta.function-call.python, source.python, support.function.builtin.python ( : meta.function-call.python, punctuation.definition.arguments.begin.python, source.python __builtins__ : meta.function-call.arguments.python, meta.function-call.python, source.python, support.variable.magic.python ) : meta.function-call.python, punctuation.definition.arguments.end.python, source.python some : source.python -. : punctuation.separator.period.python, source.python -__dict__ : source.python, support.variable.magic.python +. : meta.member.access.python, punctuation.separator.period.python, source.python +__dict__ : meta.member.access.python, source.python, support.variable.magic.python some : source.python -. : punctuation.separator.period.python, source.python -__doc__ : source.python, support.variable.magic.python +. : meta.member.access.python, punctuation.separator.period.python, source.python +__doc__ : meta.member.access.python, source.python, support.variable.magic.python some : source.python -. : punctuation.separator.period.python, source.python -__file__ : source.python, support.variable.magic.python +. : meta.member.access.python, punctuation.separator.period.python, source.python +__file__ : meta.member.access.python, source.python, support.variable.magic.python some : source.python -. : punctuation.separator.period.python, source.python -__members__ : source.python, support.variable.magic.python +. : meta.member.access.python, punctuation.separator.period.python, source.python +__members__ : meta.member.access.python, source.python, support.variable.magic.python some : source.python -. : punctuation.separator.period.python, source.python -__metaclass__ : source.python, support.variable.magic.python +. : meta.member.access.python, punctuation.separator.period.python, source.python +__metaclass__ : meta.member.access.python, source.python, support.variable.magic.python some : source.python -. : punctuation.separator.period.python, source.python -__methods__ : source.python, support.variable.magic.python +. : meta.member.access.python, punctuation.separator.period.python, source.python +__methods__ : meta.member.access.python, source.python, support.variable.magic.python some : source.python -. : punctuation.separator.period.python, source.python -__module__ : source.python, support.variable.magic.python +. : meta.member.access.python, punctuation.separator.period.python, source.python +__module__ : meta.member.access.python, source.python, support.variable.magic.python some : source.python -. : punctuation.separator.period.python, source.python -__mro__ : source.python, support.variable.magic.python +. : meta.member.access.python, punctuation.separator.period.python, source.python +__mro__ : meta.member.access.python, source.python, support.variable.magic.python some : source.python -. : punctuation.separator.period.python, source.python -__name__ : source.python, support.variable.magic.python +. : meta.member.access.python, punctuation.separator.period.python, source.python +__name__ : meta.member.access.python, source.python, support.variable.magic.python some : source.python -. : punctuation.separator.period.python, source.python -__slots__ : source.python, support.variable.magic.python +. : meta.member.access.python, punctuation.separator.period.python, source.python +__slots__ : meta.member.access.python, source.python, support.variable.magic.python some : source.python -. : punctuation.separator.period.python, source.python -__subclasses__ : source.python, support.variable.magic.python +. : meta.member.access.python, punctuation.separator.period.python, source.python +__subclasses__ : meta.member.access.python, source.python, support.variable.magic.python some : source.python -. : punctuation.separator.period.python, source.python -__version__ : source.python, support.variable.magic.python +. : meta.member.access.python, punctuation.separator.period.python, source.python +__version__ : meta.member.access.python, source.python, support.variable.magic.python some : source.python -. : punctuation.separator.period.python, source.python -__weakref__ : source.python, support.variable.magic.python +. : meta.member.access.python, punctuation.separator.period.python, source.python +__weakref__ : meta.member.access.python, source.python, support.variable.magic.python some : source.python -. : punctuation.separator.period.python, source.python -__qualname__ : source.python, support.variable.magic.python +. : meta.member.access.python, punctuation.separator.period.python, source.python +__qualname__ : meta.member.access.python, source.python, support.variable.magic.python some : source.python -. : punctuation.separator.period.python, source.python -__code__ : source.python, support.variable.magic.python +. : meta.member.access.python, punctuation.separator.period.python, source.python +__code__ : meta.member.access.python, source.python, support.variable.magic.python some : source.python -. : punctuation.separator.period.python, source.python -__wrapped__ : source.python, support.variable.magic.python +. : meta.member.access.python, punctuation.separator.period.python, source.python +__wrapped__ : meta.member.access.python, source.python, support.variable.magic.python some : source.python -. : punctuation.separator.period.python, source.python -__signature__ : source.python, support.variable.magic.python +. : meta.member.access.python, punctuation.separator.period.python, source.python +__signature__ : meta.member.access.python, source.python, support.variable.magic.python some : source.python -. : punctuation.separator.period.python, source.python -__defaults__ : source.python, support.variable.magic.python +. : meta.member.access.python, punctuation.separator.period.python, source.python +__defaults__ : meta.member.access.python, source.python, support.variable.magic.python some : source.python -. : punctuation.separator.period.python, source.python -__func__ : source.python, support.variable.magic.python +. : meta.member.access.python, punctuation.separator.period.python, source.python +__func__ : meta.member.access.python, source.python, support.variable.magic.python some : source.python -. : punctuation.separator.period.python, source.python -__self__ : source.python, support.variable.magic.python +. : meta.member.access.python, punctuation.separator.period.python, source.python +__self__ : meta.member.access.python, source.python, support.variable.magic.python some : source.python -. : punctuation.separator.period.python, source.python -__kwdefaults__ : source.python, support.variable.magic.python +. : meta.member.access.python, punctuation.separator.period.python, source.python +__kwdefaults__ : meta.member.access.python, source.python, support.variable.magic.python some : source.python -. : punctuation.separator.period.python, source.python -__matmul__ : source.python, support.function.magic.python +. : meta.member.access.python, punctuation.separator.period.python, source.python +__matmul__ : meta.member.access.python, source.python, support.function.magic.python some : source.python -. : punctuation.separator.period.python, source.python -__imatmul__ : source.python, support.function.magic.python +. : meta.member.access.python, punctuation.separator.period.python, source.python +__imatmul__ : meta.member.access.python, source.python, support.function.magic.python some : source.python -. : punctuation.separator.period.python, source.python -__rmatmul__ : source.python, support.function.magic.python +. : meta.member.access.python, punctuation.separator.period.python, source.python +__rmatmul__ : meta.member.access.python, source.python, support.function.magic.python some : source.python -. : punctuation.separator.period.python, source.python -__annotations__ : source.python, support.variable.magic.python +. : meta.member.access.python, punctuation.separator.period.python, source.python +__annotations__ : meta.member.access.python, source.python, support.variable.magic.python some : source.python -. : punctuation.separator.period.python, source.python -__init_subclass__ : source.python, support.function.magic.python +. : meta.member.access.python, punctuation.separator.period.python, source.python +__init_subclass__ : meta.member.access.python, source.python, support.function.magic.python some : source.python -. : punctuation.separator.period.python, source.python -__set_name__ : source.python, support.function.magic.python +. : meta.member.access.python, punctuation.separator.period.python, source.python +__set_name__ : meta.member.access.python, source.python, support.function.magic.python some : source.python -. : punctuation.separator.period.python, source.python -__fspath__ : source.python, support.function.magic.python +. : meta.member.access.python, punctuation.separator.period.python, source.python +__fspath__ : meta.member.access.python, source.python, support.function.magic.python some : source.python -. : punctuation.separator.period.python, source.python -__classcell__ : source.python, support.variable.magic.python +. : meta.member.access.python, punctuation.separator.period.python, source.python +__classcell__ : meta.member.access.python, source.python, support.variable.magic.python some : source.python -. : punctuation.separator.period.python, source.python -__bytes__ : source.python, support.function.magic.python +. : meta.member.access.python, punctuation.separator.period.python, source.python +__bytes__ : meta.member.access.python, source.python, support.function.magic.python some : source.python -. : punctuation.separator.period.python, source.python -__spec__ : source.python, support.variable.magic.python +. : meta.member.access.python, punctuation.separator.period.python, source.python +__spec__ : meta.member.access.python, source.python, support.variable.magic.python some : source.python -. : punctuation.separator.period.python, source.python -__path__ : source.python, support.variable.magic.python +. : meta.member.access.python, punctuation.separator.period.python, source.python +__path__ : meta.member.access.python, source.python, support.variable.magic.python some : source.python -. : punctuation.separator.period.python, source.python -__prepare__ : source.python, support.function.magic.python +. : meta.member.access.python, punctuation.separator.period.python, source.python +__prepare__ : meta.member.access.python, source.python, support.function.magic.python some : source.python -. : punctuation.separator.period.python, source.python -__package__ : source.python, support.variable.magic.python +. : meta.member.access.python, punctuation.separator.period.python, source.python +__package__ : meta.member.access.python, source.python, support.variable.magic.python some : source.python -. : punctuation.separator.period.python, source.python -__traceback__ : source.python, support.variable.magic.python +. : meta.member.access.python, punctuation.separator.period.python, source.python +__traceback__ : meta.member.access.python, source.python, support.variable.magic.python some : source.python -. : punctuation.separator.period.python, source.python -__notspecial__ : source.python +. : meta.member.access.python, punctuation.separator.period.python, source.python +__closure__ : meta.member.access.python, source.python, support.variable.magic.python +some : source.python +. : meta.member.access.python, punctuation.separator.period.python, source.python +__globals__ : meta.member.access.python, source.python, support.variable.magic.python +some : source.python +. : meta.member.access.python, punctuation.separator.period.python, source.python +__match_args__ : meta.member.access.python, source.python, support.variable.magic.python +some : source.python +. : meta.member.access.python, punctuation.separator.period.python, source.python +__notspecial__ : meta.attribute.python, meta.member.access.python, source.python diff --git a/test/builtins/builtins4.py b/test/builtins/builtins4.py index b8f3401b..d126c0bf 100644 --- a/test/builtins/builtins4.py +++ b/test/builtins/builtins4.py @@ -7,21 +7,22 @@ + some : source.python -. : punctuation.separator.period.python, source.python -int : source.python +. : meta.member.access.python, punctuation.separator.period.python, source.python +int : meta.attribute.python, meta.member.access.python, source.python some : source.python -. : punctuation.separator.period.python, source.python -sum : source.python +. : meta.member.access.python, punctuation.separator.period.python, source.python +sum : meta.attribute.python, meta.member.access.python, source.python some : source.python -. : punctuation.separator.period.python, source.python -super : source.python +. : meta.member.access.python, punctuation.separator.period.python, source.python +super : meta.attribute.python, meta.member.access.python, source.python some : source.python -. : punctuation.separator.period.python, source.python -unicode : source.python +. : meta.member.access.python, punctuation.separator.period.python, source.python +unicode : meta.attribute.python, meta.member.access.python, source.python some : source.python -. : punctuation.separator.period.python, source.python -foo : source.python +. : meta.member.access.python, punctuation.separator.period.python, source.python +foo : meta.attribute.python, meta.member.access.python, source.python some : source.python -. : punctuation.separator.period.python, source.python -Exception : source.python +. : meta.member.access.python, punctuation.separator.period.python, source.python +Exception : meta.attribute.python, meta.member.access.python, source.python diff --git a/test/builtins/builtins5.py b/test/builtins/builtins5.py index 674df37f..af3db3e5 100644 --- a/test/builtins/builtins5.py +++ b/test/builtins/builtins5.py @@ -7,20 +7,21 @@ + some : source.python -. : punctuation.separator.period.python, source.python - : source.python -True : keyword.illegal.name.python, source.python +. : meta.member.access.python, punctuation.separator.period.python, source.python + : meta.member.access.python, source.python +True : keyword.illegal.name.python, meta.member.access.python, source.python some : source.python -. : punctuation.separator.period.python, source.python - : source.python -\ : punctuation.separator.continuation.line.python, source.python - : source.python - : source.python -True : keyword.illegal.name.python, source.python +. : meta.member.access.python, punctuation.separator.period.python, source.python + : meta.member.access.python, source.python +\ : meta.member.access.python, punctuation.separator.continuation.line.python, source.python + : meta.member.access.python, source.python + : meta.member.access.python, source.python +True : keyword.illegal.name.python, meta.member.access.python, source.python True : constant.language.python, source.python some : source.python -. : punctuation.separator.period.python, source.python - : source.python - : source.python -True : keyword.illegal.name.python, source.python +. : meta.member.access.python, punctuation.separator.period.python, source.python + : meta.member.access.python, source.python + : meta.member.access.python, source.python +True : keyword.illegal.name.python, meta.member.access.python, source.python diff --git a/test/builtins/builtins7.py b/test/builtins/builtins7.py index eb02d7fb..6d23b2b7 100644 --- a/test/builtins/builtins7.py +++ b/test/builtins/builtins7.py @@ -1,4 +1,6 @@ breakpoint() +aiter() +anext() @@ -6,3 +8,9 @@ breakpoint : meta.function-call.python, source.python, support.function.builtin.python ( : meta.function-call.python, punctuation.definition.arguments.begin.python, source.python ) : meta.function-call.python, punctuation.definition.arguments.end.python, source.python +aiter : meta.function-call.python, source.python, support.function.builtin.python +( : meta.function-call.python, punctuation.definition.arguments.begin.python, source.python +) : meta.function-call.python, punctuation.definition.arguments.end.python, source.python +anext : meta.function-call.python, source.python, support.function.builtin.python +( : meta.function-call.python, punctuation.definition.arguments.begin.python, source.python +) : meta.function-call.python, punctuation.definition.arguments.end.python, source.python diff --git a/test/calls/call1.py b/test/calls/call1.py index aab3f9f7..86f32acb 100644 --- a/test/calls/call1.py +++ b/test/calls/call1.py @@ -2,6 +2,7 @@ + some_call : meta.function-call.generic.python, meta.function-call.python, source.python ( : meta.function-call.python, punctuation.definition.arguments.begin.python, source.python A : meta.function-call.arguments.python, meta.function-call.python, source.python @@ -10,7 +11,7 @@ b : meta.function-call.arguments.python, meta.function-call.python, source.python , : meta.function-call.arguments.python, meta.function-call.python, punctuation.separator.arguments.python, source.python : meta.function-call.arguments.python, meta.function-call.python, source.python -c : meta.function-call.arguments.python, meta.function-call.python, meta.item-access.python, source.python +c : meta.function-call.arguments.python, meta.function-call.python, meta.indexed-name.python, meta.item-access.python, source.python [ : meta.function-call.arguments.python, meta.function-call.python, meta.item-access.python, punctuation.definition.arguments.begin.python, source.python 1 : constant.numeric.dec.python, meta.function-call.arguments.python, meta.function-call.python, meta.item-access.arguments.python, meta.item-access.python, source.python ] : meta.function-call.arguments.python, meta.function-call.python, meta.item-access.python, punctuation.definition.arguments.end.python, source.python diff --git a/test/calls/call11.py b/test/calls/call11.py new file mode 100644 index 00000000..3695fc57 --- /dev/null +++ b/test/calls/call11.py @@ -0,0 +1,44 @@ +id = Field[uuid.UUID] ( + uuid.UUID, + inheritable=False, + simpledelta=False, + allow_ddl_set=True, +) + + + + + +id : source.python, support.function.builtin.python + : source.python += : keyword.operator.assignment.python, source.python + : source.python +Field : meta.indexed-name.python, meta.item-access.python, source.python +[ : meta.item-access.python, punctuation.definition.arguments.begin.python, source.python +uuid : meta.item-access.arguments.python, meta.item-access.python, source.python +. : meta.item-access.arguments.python, meta.item-access.python, meta.member.access.python, punctuation.separator.period.python, source.python +UUID : constant.other.caps.python, meta.item-access.arguments.python, meta.item-access.python, meta.member.access.python, source.python +] : meta.item-access.python, punctuation.definition.arguments.end.python, source.python + : source.python +( : punctuation.definition.arguments.begin.python, source.python + : meta.function-call.arguments.python, source.python +uuid : meta.function-call.arguments.python, source.python +. : meta.function-call.arguments.python, meta.member.access.python, punctuation.separator.period.python, source.python +UUID : constant.other.caps.python, meta.function-call.arguments.python, meta.member.access.python, source.python +, : meta.function-call.arguments.python, punctuation.separator.arguments.python, source.python + : meta.function-call.arguments.python, source.python +inheritable : meta.function-call.arguments.python, source.python, variable.parameter.function-call.python += : keyword.operator.assignment.python, meta.function-call.arguments.python, source.python +False : constant.language.python, meta.function-call.arguments.python, source.python +, : meta.function-call.arguments.python, punctuation.separator.arguments.python, source.python + : meta.function-call.arguments.python, source.python +simpledelta : meta.function-call.arguments.python, source.python, variable.parameter.function-call.python += : keyword.operator.assignment.python, meta.function-call.arguments.python, source.python +False : constant.language.python, meta.function-call.arguments.python, source.python +, : meta.function-call.arguments.python, punctuation.separator.arguments.python, source.python + : meta.function-call.arguments.python, source.python +allow_ddl_set : meta.function-call.arguments.python, source.python, variable.parameter.function-call.python += : keyword.operator.assignment.python, meta.function-call.arguments.python, source.python +True : constant.language.python, meta.function-call.arguments.python, source.python +, : meta.function-call.arguments.python, punctuation.separator.arguments.python, source.python +) : punctuation.definition.arguments.end.python, source.python diff --git a/test/calls/call3.py b/test/calls/call3.py index 3e5bca3d..3eb5ff59 100644 --- a/test/calls/call3.py +++ b/test/calls/call3.py @@ -4,17 +4,18 @@ + foo : source.python -. : punctuation.separator.period.python, source.python -class : keyword.control.flow.python, meta.function-call.python, source.python -( : meta.function-call.python, punctuation.definition.arguments.begin.python, source.python -a : meta.function-call.arguments.python, meta.function-call.python, source.python -) : meta.function-call.python, punctuation.definition.arguments.end.python, source.python +. : meta.member.access.python, punctuation.separator.period.python, source.python +class : keyword.control.flow.python, meta.function-call.python, meta.member.access.python, source.python +( : meta.function-call.python, meta.member.access.python, punctuation.definition.arguments.begin.python, source.python +a : meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, source.python +) : meta.function-call.python, meta.member.access.python, punctuation.definition.arguments.end.python, source.python foo : source.python -. : punctuation.separator.period.python, source.python -and : keyword.control.flow.python, meta.function-call.python, source.python -( : meta.function-call.python, punctuation.definition.arguments.begin.python, source.python -) : meta.function-call.python, punctuation.definition.arguments.end.python, source.python +. : meta.member.access.python, punctuation.separator.period.python, source.python +and : keyword.control.flow.python, meta.function-call.python, meta.member.access.python, source.python +( : meta.function-call.python, meta.member.access.python, punctuation.definition.arguments.begin.python, source.python +) : meta.function-call.python, meta.member.access.python, punctuation.definition.arguments.end.python, source.python foo : source.python -. : punctuation.separator.period.python, source.python -if : keyword.control.flow.python, source.python +. : meta.member.access.python, punctuation.separator.period.python, source.python +if : keyword.control.flow.python, meta.member.access.python, source.python diff --git a/test/calls/call4.py b/test/calls/call4.py index a2976601..6da33186 100644 --- a/test/calls/call4.py +++ b/test/calls/call4.py @@ -4,9 +4,10 @@ + foo : source.python -. : punctuation.separator.period.python, source.python -1 : source.python +. : meta.member.access.python, punctuation.separator.period.python, source.python +1 : meta.member.access.python, source.python foo : meta.function-call.generic.python, meta.function-call.python, source.python ( : meta.function-call.python, punctuation.definition.arguments.begin.python, source.python bar : meta.function-call.arguments.python, meta.function-call.python, source.python, variable.parameter.function-call.python @@ -19,13 +20,13 @@ sam : meta.function-call.arguments.python, meta.function-call.python, source.python ) : meta.function-call.python, punctuation.definition.arguments.end.python, source.python foo : source.python -. : punctuation.separator.period.python, source.python -None : keyword.illegal.name.python, source.python +. : meta.member.access.python, punctuation.separator.period.python, source.python +None : keyword.illegal.name.python, meta.member.access.python, source.python : source.python and : keyword.operator.logical.python, source.python : source.python foo : source.python -. : punctuation.separator.period.python, source.python -None : keyword.illegal.name.python, source.python -. : punctuation.separator.period.python, source.python -baz : source.python +. : meta.member.access.python, punctuation.separator.period.python, source.python +None : keyword.illegal.name.python, meta.member.access.python, source.python +. : meta.member.access.python, punctuation.separator.period.python, source.python +baz : meta.attribute.python, meta.member.access.python, source.python diff --git a/test/calls/call7.py b/test/calls/call7.py index b0b00f05..97cf7ee9 100644 --- a/test/calls/call7.py +++ b/test/calls/call7.py @@ -7,43 +7,44 @@ + foo : source.python -. : punctuation.separator.period.python, source.python -__class__ : meta.function-call.python, source.python, support.variable.magic.python - : meta.function-call.python, source.python -( : meta.function-call.python, punctuation.definition.arguments.begin.python, source.python -foo : meta.function-call.arguments.python, meta.function-call.python, source.python, variable.parameter.function-call.python -= : keyword.operator.assignment.python, meta.function-call.arguments.python, meta.function-call.python, source.python -bar : meta.function-call.arguments.python, meta.function-call.python, source.python -) : meta.function-call.python, punctuation.definition.arguments.end.python, source.python +. : meta.member.access.python, punctuation.separator.period.python, source.python +__class__ : meta.function-call.python, meta.member.access.python, source.python, support.variable.magic.python + : meta.function-call.python, meta.member.access.python, source.python +( : meta.function-call.python, meta.member.access.python, punctuation.definition.arguments.begin.python, source.python +foo : meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, source.python, variable.parameter.function-call.python += : keyword.operator.assignment.python, meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, source.python +bar : meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, source.python +) : meta.function-call.python, meta.member.access.python, punctuation.definition.arguments.end.python, source.python foo : source.python -. : punctuation.separator.period.python, source.python -__class__ : meta.function-call.python, source.python, support.variable.magic.python -( : meta.function-call.python, punctuation.definition.arguments.begin.python, source.python -foo : meta.function-call.arguments.python, meta.function-call.python, source.python, variable.parameter.function-call.python -= : keyword.operator.assignment.python, meta.function-call.arguments.python, meta.function-call.python, source.python -bar : meta.function-call.arguments.python, meta.function-call.python, source.python -) : meta.function-call.python, punctuation.definition.arguments.end.python, source.python +. : meta.member.access.python, punctuation.separator.period.python, source.python +__class__ : meta.function-call.python, meta.member.access.python, source.python, support.variable.magic.python +( : meta.function-call.python, meta.member.access.python, punctuation.definition.arguments.begin.python, source.python +foo : meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, source.python, variable.parameter.function-call.python += : keyword.operator.assignment.python, meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, source.python +bar : meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, source.python +) : meta.function-call.python, meta.member.access.python, punctuation.definition.arguments.end.python, source.python foo : source.python -. : punctuation.separator.period.python, source.python -__add__ : meta.function-call.python, source.python, support.function.magic.python - : meta.function-call.python, source.python -( : meta.function-call.python, punctuation.definition.arguments.begin.python, source.python -foo : meta.function-call.arguments.python, meta.function-call.python, source.python, variable.parameter.function-call.python -= : keyword.operator.assignment.python, meta.function-call.arguments.python, meta.function-call.python, source.python -bar : meta.function-call.arguments.python, meta.function-call.python, source.python -) : meta.function-call.python, punctuation.definition.arguments.end.python, source.python +. : meta.member.access.python, punctuation.separator.period.python, source.python +__add__ : meta.function-call.python, meta.member.access.python, source.python, support.function.magic.python + : meta.function-call.python, meta.member.access.python, source.python +( : meta.function-call.python, meta.member.access.python, punctuation.definition.arguments.begin.python, source.python +foo : meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, source.python, variable.parameter.function-call.python += : keyword.operator.assignment.python, meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, source.python +bar : meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, source.python +) : meta.function-call.python, meta.member.access.python, punctuation.definition.arguments.end.python, source.python foo : source.python -. : punctuation.separator.period.python, source.python -__add__ : meta.function-call.python, source.python, support.function.magic.python -( : meta.function-call.python, punctuation.definition.arguments.begin.python, source.python -foo : meta.function-call.arguments.python, meta.function-call.python, source.python, variable.parameter.function-call.python -= : keyword.operator.assignment.python, meta.function-call.arguments.python, meta.function-call.python, source.python -bar : meta.function-call.arguments.python, meta.function-call.python, source.python -) : meta.function-call.python, punctuation.definition.arguments.end.python, source.python +. : meta.member.access.python, punctuation.separator.period.python, source.python +__add__ : meta.function-call.python, meta.member.access.python, source.python, support.function.magic.python +( : meta.function-call.python, meta.member.access.python, punctuation.definition.arguments.begin.python, source.python +foo : meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, source.python, variable.parameter.function-call.python += : keyword.operator.assignment.python, meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, source.python +bar : meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, source.python +) : meta.function-call.python, meta.member.access.python, punctuation.definition.arguments.end.python, source.python : source.python foo : source.python -. : punctuation.separator.period.python, source.python -__class__ : source.python, support.variable.magic.python +. : meta.member.access.python, punctuation.separator.period.python, source.python +__class__ : meta.member.access.python, source.python, support.variable.magic.python : source.python 1 : constant.numeric.dec.python, source.python diff --git a/test/calls/call8.py b/test/calls/call8.py index 471a64d3..0b78f3d3 100644 --- a/test/calls/call8.py +++ b/test/calls/call8.py @@ -5,41 +5,42 @@ + foo : source.python -. : punctuation.separator.period.python, source.python - : source.python -__class__ : meta.function-call.python, source.python, support.variable.magic.python -( : meta.function-call.python, punctuation.definition.arguments.begin.python, source.python -foo : meta.function-call.arguments.python, meta.function-call.python, source.python, variable.parameter.function-call.python -= : keyword.operator.assignment.python, meta.function-call.arguments.python, meta.function-call.python, source.python -bar : meta.function-call.arguments.python, meta.function-call.python, source.python -) : meta.function-call.python, punctuation.definition.arguments.end.python, source.python +. : meta.member.access.python, punctuation.separator.period.python, source.python + : meta.member.access.python, source.python +__class__ : meta.function-call.python, meta.member.access.python, source.python, support.variable.magic.python +( : meta.function-call.python, meta.member.access.python, punctuation.definition.arguments.begin.python, source.python +foo : meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, source.python, variable.parameter.function-call.python += : keyword.operator.assignment.python, meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, source.python +bar : meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, source.python +) : meta.function-call.python, meta.member.access.python, punctuation.definition.arguments.end.python, source.python foo : source.python -. : punctuation.separator.period.python, source.python - : source.python -__class__ : meta.function-call.python, source.python, support.variable.magic.python - : meta.function-call.python, source.python -( : meta.function-call.python, punctuation.definition.arguments.begin.python, source.python -foo : meta.function-call.arguments.python, meta.function-call.python, source.python, variable.parameter.function-call.python -= : keyword.operator.assignment.python, meta.function-call.arguments.python, meta.function-call.python, source.python -bar : meta.function-call.arguments.python, meta.function-call.python, source.python -) : meta.function-call.python, punctuation.definition.arguments.end.python, source.python +. : meta.member.access.python, punctuation.separator.period.python, source.python + : meta.member.access.python, source.python +__class__ : meta.function-call.python, meta.member.access.python, source.python, support.variable.magic.python + : meta.function-call.python, meta.member.access.python, source.python +( : meta.function-call.python, meta.member.access.python, punctuation.definition.arguments.begin.python, source.python +foo : meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, source.python, variable.parameter.function-call.python += : keyword.operator.assignment.python, meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, source.python +bar : meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, source.python +) : meta.function-call.python, meta.member.access.python, punctuation.definition.arguments.end.python, source.python foo : source.python -. : punctuation.separator.period.python, source.python - : source.python -__add__ : meta.function-call.python, source.python, support.function.magic.python - : meta.function-call.python, source.python -( : meta.function-call.python, punctuation.definition.arguments.begin.python, source.python -foo : meta.function-call.arguments.python, meta.function-call.python, source.python, variable.parameter.function-call.python -= : keyword.operator.assignment.python, meta.function-call.arguments.python, meta.function-call.python, source.python -bar : meta.function-call.arguments.python, meta.function-call.python, source.python -) : meta.function-call.python, punctuation.definition.arguments.end.python, source.python +. : meta.member.access.python, punctuation.separator.period.python, source.python + : meta.member.access.python, source.python +__add__ : meta.function-call.python, meta.member.access.python, source.python, support.function.magic.python + : meta.function-call.python, meta.member.access.python, source.python +( : meta.function-call.python, meta.member.access.python, punctuation.definition.arguments.begin.python, source.python +foo : meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, source.python, variable.parameter.function-call.python += : keyword.operator.assignment.python, meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, source.python +bar : meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, source.python +) : meta.function-call.python, meta.member.access.python, punctuation.definition.arguments.end.python, source.python foo : source.python -. : punctuation.separator.period.python, source.python - : source.python -__add__ : meta.function-call.python, source.python, support.function.magic.python -( : meta.function-call.python, punctuation.definition.arguments.begin.python, source.python -foo : meta.function-call.arguments.python, meta.function-call.python, source.python, variable.parameter.function-call.python -= : keyword.operator.assignment.python, meta.function-call.arguments.python, meta.function-call.python, source.python -bar : meta.function-call.arguments.python, meta.function-call.python, source.python -) : meta.function-call.python, punctuation.definition.arguments.end.python, source.python +. : meta.member.access.python, punctuation.separator.period.python, source.python + : meta.member.access.python, source.python +__add__ : meta.function-call.python, meta.member.access.python, source.python, support.function.magic.python +( : meta.function-call.python, meta.member.access.python, punctuation.definition.arguments.begin.python, source.python +foo : meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, source.python, variable.parameter.function-call.python += : keyword.operator.assignment.python, meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, source.python +bar : meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, source.python +) : meta.function-call.python, meta.member.access.python, punctuation.definition.arguments.end.python, source.python diff --git a/test/calls/print1.py b/test/calls/print1.py index c5f3e7f7..9339060e 100644 --- a/test/calls/print1.py +++ b/test/calls/print1.py @@ -11,6 +11,7 @@ + print : source.python, support.function.builtin.python : source.python " : punctuation.definition.string.begin.python, source.python, string.quoted.single.python @@ -55,8 +56,8 @@ : source.python >> : keyword.operator.bitwise.python, source.python sys : source.python -. : punctuation.separator.period.python, source.python -stderr : source.python +. : meta.member.access.python, punctuation.separator.period.python, source.python +stderr : meta.attribute.python, meta.member.access.python, source.python , : punctuation.separator.element.python, source.python : source.python " : punctuation.definition.string.begin.python, source.python, string.quoted.single.python @@ -72,8 +73,8 @@ file : meta.function-call.arguments.python, meta.function-call.python, source.python, variable.parameter.function-call.python = : keyword.operator.assignment.python, meta.function-call.arguments.python, meta.function-call.python, source.python sys : meta.function-call.arguments.python, meta.function-call.python, source.python -. : meta.function-call.arguments.python, meta.function-call.python, punctuation.separator.period.python, source.python -stderr : meta.function-call.arguments.python, meta.function-call.python, source.python +. : meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, punctuation.separator.period.python, source.python +stderr : meta.attribute.python, meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, source.python ) : meta.function-call.python, punctuation.definition.arguments.end.python, source.python print : meta.function-call.python, source.python, support.function.builtin.python : meta.function-call.python, source.python diff --git a/test/classes/class11.py b/test/classes/class11.py index bad00706..4cb0b927 100644 --- a/test/classes/class11.py +++ b/test/classes/class11.py @@ -10,6 +10,7 @@ def __init__(self, a, b=1): + class : meta.class.python, source.python, storage.type.class.python : meta.class.python, source.python F : entity.name.type.class.python, meta.class.python, source.python @@ -32,16 +33,16 @@ def : meta.function.python, source.python, storage.type.function.pytho : : meta.function.python, punctuation.section.function.begin.python, source.python : source.python self : source.python, variable.language.special.self.python -. : punctuation.separator.period.python, source.python -a : source.python +. : meta.member.access.python, punctuation.separator.period.python, source.python +a : meta.attribute.python, meta.member.access.python, source.python : source.python = : keyword.operator.assignment.python, source.python : source.python a : source.python : source.python self : source.python, variable.language.special.self.python -. : punctuation.separator.period.python, source.python -b : source.python +. : meta.member.access.python, punctuation.separator.period.python, source.python +b : meta.attribute.python, meta.member.access.python, source.python : source.python = : keyword.operator.assignment.python, source.python : source.python @@ -57,18 +58,18 @@ def : meta.function.python, source.python, storage.type.function.pytho ) : meta.function-call.python, punctuation.definition.arguments.end.python, source.python : source.python a : source.python -. : punctuation.separator.period.python, source.python -self : source.python +. : meta.member.access.python, punctuation.separator.period.python, source.python +self : meta.attribute.python, meta.member.access.python, source.python : source.python = : keyword.operator.assignment.python, source.python : source.python 1 : constant.numeric.dec.python, source.python : source.python a : source.python -. : punctuation.separator.period.python, source.python -self : source.python -. : punctuation.separator.period.python, source.python -bar : source.python +. : meta.member.access.python, punctuation.separator.period.python, source.python +self : meta.attribute.python, meta.member.access.python, source.python +. : meta.member.access.python, punctuation.separator.period.python, source.python +bar : meta.attribute.python, meta.member.access.python, source.python : source.python = : keyword.operator.assignment.python, source.python : source.python diff --git a/test/classes/class12.py b/test/classes/class12.py index e0e7fb7d..838a1bb2 100644 --- a/test/classes/class12.py +++ b/test/classes/class12.py @@ -12,6 +12,7 @@ def meth(cls, a, b=1): + class : meta.class.python, source.python, storage.type.class.python : meta.class.python, source.python F : entity.name.type.class.python, meta.class.python, source.python @@ -37,16 +38,16 @@ def : meta.function.python, source.python, storage.type.function.pytho : : meta.function.python, punctuation.section.function.begin.python, source.python : source.python cls : source.python, variable.language.special.cls.python -. : punctuation.separator.period.python, source.python -a : source.python +. : meta.member.access.python, punctuation.separator.period.python, source.python +a : meta.attribute.python, meta.member.access.python, source.python : source.python = : keyword.operator.assignment.python, source.python : source.python a : source.python : source.python cls : source.python, variable.language.special.cls.python -. : punctuation.separator.period.python, source.python -b : source.python +. : meta.member.access.python, punctuation.separator.period.python, source.python +b : meta.attribute.python, meta.member.access.python, source.python : source.python = : keyword.operator.assignment.python, source.python : source.python @@ -68,18 +69,18 @@ def : meta.function.python, source.python, storage.type.function.pytho 1 : constant.numeric.dec.python, source.python : source.python a : source.python -. : punctuation.separator.period.python, source.python -cls : source.python +. : meta.member.access.python, punctuation.separator.period.python, source.python +cls : meta.attribute.python, meta.member.access.python, source.python : source.python = : keyword.operator.assignment.python, source.python : source.python 1 : constant.numeric.dec.python, source.python : source.python a : source.python -. : punctuation.separator.period.python, source.python -cls : source.python -. : punctuation.separator.period.python, source.python -__name__ : source.python, support.variable.magic.python +. : meta.member.access.python, punctuation.separator.period.python, source.python +cls : meta.attribute.python, meta.member.access.python, source.python +. : meta.member.access.python, punctuation.separator.period.python, source.python +__name__ : meta.member.access.python, source.python, support.variable.magic.python : source.python cls : meta.item-access.python, source.python, variable.language.special.cls.python [ : meta.item-access.python, punctuation.definition.arguments.begin.python, source.python diff --git a/test/classes/class14.py b/test/classes/class14.py index 706969f9..45455895 100644 --- a/test/classes/class14.py +++ b/test/classes/class14.py @@ -3,26 +3,27 @@ class F(f.Exception, f.type, Exception, Exception.a, b=Exception): + class : meta.class.python, source.python, storage.type.class.python : meta.class.python, source.python F : entity.name.type.class.python, meta.class.python, source.python ( : meta.class.inheritance.python, meta.class.python, punctuation.definition.inheritance.begin.python, source.python f : entity.other.inherited-class.python, meta.class.inheritance.python, meta.class.python, source.python -. : meta.class.inheritance.python, meta.class.python, punctuation.separator.period.python, source.python -Exception : entity.other.inherited-class.python, meta.class.inheritance.python, meta.class.python, source.python +. : meta.class.inheritance.python, meta.class.python, meta.member.access.python, punctuation.separator.period.python, source.python +Exception : entity.other.inherited-class.python, meta.class.inheritance.python, meta.class.python, meta.member.access.python, source.python , : meta.class.inheritance.python, meta.class.python, punctuation.separator.inheritance.python, source.python : meta.class.inheritance.python, meta.class.python, source.python f : entity.other.inherited-class.python, meta.class.inheritance.python, meta.class.python, source.python -. : meta.class.inheritance.python, meta.class.python, punctuation.separator.period.python, source.python -type : entity.other.inherited-class.python, meta.class.inheritance.python, meta.class.python, source.python +. : meta.class.inheritance.python, meta.class.python, meta.member.access.python, punctuation.separator.period.python, source.python +type : entity.other.inherited-class.python, meta.class.inheritance.python, meta.class.python, meta.member.access.python, source.python , : meta.class.inheritance.python, meta.class.python, punctuation.separator.inheritance.python, source.python : meta.class.inheritance.python, meta.class.python, source.python Exception : meta.class.inheritance.python, meta.class.python, source.python, support.type.exception.python , : meta.class.inheritance.python, meta.class.python, punctuation.separator.inheritance.python, source.python : meta.class.inheritance.python, meta.class.python, source.python Exception : meta.class.inheritance.python, meta.class.python, source.python, support.type.exception.python -. : meta.class.inheritance.python, meta.class.python, punctuation.separator.period.python, source.python -a : entity.other.inherited-class.python, meta.class.inheritance.python, meta.class.python, source.python +. : meta.class.inheritance.python, meta.class.python, meta.member.access.python, punctuation.separator.period.python, source.python +a : entity.other.inherited-class.python, meta.class.inheritance.python, meta.class.python, meta.member.access.python, source.python , : meta.class.inheritance.python, meta.class.python, punctuation.separator.inheritance.python, source.python : meta.class.inheritance.python, meta.class.python, source.python b : entity.other.inherited-class.python, meta.class.inheritance.python, meta.class.python, source.python, variable.parameter.class.python diff --git a/test/classes/class2.py b/test/classes/class2.py index 32b5a2dc..1f15e252 100644 --- a/test/classes/class2.py +++ b/test/classes/class2.py @@ -5,6 +5,7 @@ class Spam(Foo.Bar, Bar.name={'very': 'odd'}): + @ : entity.name.function.decorator.python, meta.function.decorator.python, punctuation.definition.decorator.python, source.python dec : entity.name.function.decorator.python, meta.function.decorator.python, source.python # : comment.line.number-sign.python, punctuation.definition.comment.python, source.python @@ -14,13 +15,13 @@ class : meta.class.python, source.python, storage.type.class.python Spam : entity.name.type.class.python, meta.class.python, source.python ( : meta.class.inheritance.python, meta.class.python, punctuation.definition.inheritance.begin.python, source.python Foo : entity.other.inherited-class.python, meta.class.inheritance.python, meta.class.python, source.python -. : meta.class.inheritance.python, meta.class.python, punctuation.separator.period.python, source.python -Bar : entity.other.inherited-class.python, meta.class.inheritance.python, meta.class.python, source.python +. : meta.class.inheritance.python, meta.class.python, meta.member.access.python, punctuation.separator.period.python, source.python +Bar : entity.other.inherited-class.python, meta.class.inheritance.python, meta.class.python, meta.member.access.python, source.python , : meta.class.inheritance.python, meta.class.python, punctuation.separator.inheritance.python, source.python : meta.class.inheritance.python, meta.class.python, source.python Bar : entity.other.inherited-class.python, meta.class.inheritance.python, meta.class.python, source.python -. : meta.class.inheritance.python, meta.class.python, punctuation.separator.period.python, source.python -name : entity.other.inherited-class.python, meta.class.inheritance.python, meta.class.python, source.python +. : meta.class.inheritance.python, meta.class.python, meta.member.access.python, punctuation.separator.period.python, source.python +name : entity.other.inherited-class.python, meta.class.inheritance.python, meta.class.python, meta.member.access.python, source.python = : keyword.operator.assignment.python, meta.class.inheritance.python, meta.class.python, source.python { : meta.class.inheritance.python, meta.class.python, punctuation.definition.dict.begin.python, source.python ' : meta.class.inheritance.python, meta.class.python, punctuation.definition.string.begin.python, source.python, string.quoted.single.python diff --git a/test/classes/class9.py b/test/classes/class9.py index bbf24feb..a4ea943f 100644 --- a/test/classes/class9.py +++ b/test/classes/class9.py @@ -1,5 +1,6 @@ class Foo: __slots__ = () + __match_args__ = ('key', 'name') @@ -13,4 +14,19 @@ class : meta.class.python, source.python, storage.type.class.python = : keyword.operator.assignment.python, source.python : source.python ( : punctuation.parenthesis.begin.python, source.python +) : punctuation.parenthesis.end.python, source.python + : source.python +__match_args__ : source.python, support.variable.magic.python + : source.python += : keyword.operator.assignment.python, source.python + : source.python +( : punctuation.parenthesis.begin.python, source.python +' : punctuation.definition.string.begin.python, source.python, string.quoted.single.python +key : source.python, string.quoted.single.python +' : punctuation.definition.string.end.python, source.python, string.quoted.single.python +, : punctuation.separator.element.python, source.python + : source.python +' : punctuation.definition.string.begin.python, source.python, string.quoted.single.python +name : source.python, string.quoted.single.python +' : punctuation.definition.string.end.python, source.python, string.quoted.single.python ) : punctuation.parenthesis.end.python, source.python diff --git a/test/classes/super1.py b/test/classes/super1.py index 1840ed9b..709205c4 100644 --- a/test/classes/super1.py +++ b/test/classes/super1.py @@ -30,39 +30,39 @@ def : meta.function.python, source.python, storage.type.function.pytho super : meta.function-call.python, source.python, support.type.python ( : meta.function-call.python, punctuation.definition.arguments.begin.python, source.python ) : meta.function-call.python, punctuation.definition.arguments.end.python, source.python -. : punctuation.separator.period.python, source.python -__init__ : meta.function-call.python, source.python, support.function.magic.python -( : meta.function-call.python, punctuation.definition.arguments.begin.python, source.python -foo : meta.function-call.arguments.python, meta.function-call.python, source.python, variable.parameter.function-call.python -= : keyword.operator.assignment.python, meta.function-call.arguments.python, meta.function-call.python, source.python -1 : constant.numeric.dec.python, meta.function-call.arguments.python, meta.function-call.python, source.python -) : meta.function-call.python, punctuation.definition.arguments.end.python, source.python +. : meta.member.access.python, punctuation.separator.period.python, source.python +__init__ : meta.function-call.python, meta.member.access.python, source.python, support.function.magic.python +( : meta.function-call.python, meta.member.access.python, punctuation.definition.arguments.begin.python, source.python +foo : meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, source.python, variable.parameter.function-call.python += : keyword.operator.assignment.python, meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, source.python +1 : constant.numeric.dec.python, meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, source.python +) : meta.function-call.python, meta.member.access.python, punctuation.definition.arguments.end.python, source.python : source.python super : meta.function-call.python, source.python, support.type.python ( : meta.function-call.python, punctuation.definition.arguments.begin.python, source.python ) : meta.function-call.python, punctuation.definition.arguments.end.python, source.python -. : punctuation.separator.period.python, source.python - : source.python -__init__ : meta.function-call.python, source.python, support.function.magic.python -( : meta.function-call.python, punctuation.definition.arguments.begin.python, source.python -foo : meta.function-call.arguments.python, meta.function-call.python, source.python, variable.parameter.function-call.python -= : keyword.operator.assignment.python, meta.function-call.arguments.python, meta.function-call.python, source.python -1 : constant.numeric.dec.python, meta.function-call.arguments.python, meta.function-call.python, source.python -) : meta.function-call.python, punctuation.definition.arguments.end.python, source.python +. : meta.member.access.python, punctuation.separator.period.python, source.python + : meta.member.access.python, source.python +__init__ : meta.function-call.python, meta.member.access.python, source.python, support.function.magic.python +( : meta.function-call.python, meta.member.access.python, punctuation.definition.arguments.begin.python, source.python +foo : meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, source.python, variable.parameter.function-call.python += : keyword.operator.assignment.python, meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, source.python +1 : constant.numeric.dec.python, meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, source.python +) : meta.function-call.python, meta.member.access.python, punctuation.definition.arguments.end.python, source.python : source.python super : meta.function-call.python, source.python, support.type.python ( : meta.function-call.python, punctuation.definition.arguments.begin.python, source.python ) : meta.function-call.python, punctuation.definition.arguments.end.python, source.python -. : punctuation.separator.period.python, source.python - : source.python -\ : punctuation.separator.continuation.line.python, source.python - : source.python -__init__ : meta.function-call.python, source.python, support.function.magic.python -( : meta.function-call.python, punctuation.definition.arguments.begin.python, source.python -foo : meta.function-call.arguments.python, meta.function-call.python, source.python, variable.parameter.function-call.python -= : keyword.operator.assignment.python, meta.function-call.arguments.python, meta.function-call.python, source.python -1 : constant.numeric.dec.python, meta.function-call.arguments.python, meta.function-call.python, source.python -) : meta.function-call.python, punctuation.definition.arguments.end.python, source.python +. : meta.member.access.python, punctuation.separator.period.python, source.python + : meta.member.access.python, source.python +\ : meta.member.access.python, punctuation.separator.continuation.line.python, source.python + : meta.member.access.python, source.python +__init__ : meta.function-call.python, meta.member.access.python, source.python, support.function.magic.python +( : meta.function-call.python, meta.member.access.python, punctuation.definition.arguments.begin.python, source.python +foo : meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, source.python, variable.parameter.function-call.python += : keyword.operator.assignment.python, meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, source.python +1 : constant.numeric.dec.python, meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, source.python +) : meta.function-call.python, meta.member.access.python, punctuation.definition.arguments.end.python, source.python : source.python __init__ : meta.function-call.python, source.python, support.function.magic.python ( : meta.function-call.python, punctuation.definition.arguments.begin.python, source.python @@ -73,13 +73,13 @@ def : meta.function.python, source.python, storage.type.function.pytho : source.python : source.python foo : source.python -. : punctuation.separator.period.python, source.python -__init__ : meta.function-call.python, source.python, support.function.magic.python -( : meta.function-call.python, punctuation.definition.arguments.begin.python, source.python -bar : meta.function-call.arguments.python, meta.function-call.python, source.python, variable.parameter.function-call.python -= : keyword.operator.assignment.python, meta.function-call.arguments.python, meta.function-call.python, source.python -1 : constant.numeric.dec.python, meta.function-call.arguments.python, meta.function-call.python, source.python -) : meta.function-call.python, punctuation.definition.arguments.end.python, source.python +. : meta.member.access.python, punctuation.separator.period.python, source.python +__init__ : meta.function-call.python, meta.member.access.python, source.python, support.function.magic.python +( : meta.function-call.python, meta.member.access.python, punctuation.definition.arguments.begin.python, source.python +bar : meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, source.python, variable.parameter.function-call.python += : keyword.operator.assignment.python, meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, source.python +1 : constant.numeric.dec.python, meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, source.python +) : meta.function-call.python, meta.member.access.python, punctuation.definition.arguments.end.python, source.python : source.python __init__ : meta.function-call.python, source.python, support.function.magic.python ( : meta.function-call.python, punctuation.definition.arguments.begin.python, source.python diff --git a/test/expressions/const1.py b/test/expressions/const1.py index e59a19be..5288d71a 100644 --- a/test/expressions/const1.py +++ b/test/expressions/const1.py @@ -3,6 +3,7 @@ + QQQQ : constant.other.caps.python, source.python : source.python QQQQ_123 : constant.other.caps.python, source.python @@ -12,27 +13,27 @@ PROTOCOL_v2 : constant.other.caps.python, source.python : source.python QQQ : constant.other.caps.python, source.python -. : punctuation.separator.period.python, source.python -bar : source.python +. : meta.member.access.python, punctuation.separator.period.python, source.python +bar : meta.attribute.python, meta.member.access.python, source.python : source.python baz : source.python -. : punctuation.separator.period.python, source.python -AA_a : constant.other.caps.python, source.python +. : meta.member.access.python, punctuation.separator.period.python, source.python +AA_a : constant.other.caps.python, meta.member.access.python, source.python : source.python _AAA : constant.other.caps.python, source.python : source.python foo : source.python -. : punctuation.separator.period.python, source.python -_AAA : constant.other.caps.python, source.python +. : meta.member.access.python, punctuation.separator.period.python, source.python +_AAA : constant.other.caps.python, meta.member.access.python, source.python QQQq : source.python : source.python QQQq123 : source.python : source.python self : source.python, variable.language.special.self.python -. : punctuation.separator.period.python, source.python -FOOO : meta.function-call.generic.python, meta.function-call.python, source.python -( : meta.function-call.python, punctuation.definition.arguments.begin.python, source.python -) : meta.function-call.python, punctuation.definition.arguments.end.python, source.python +. : meta.member.access.python, punctuation.separator.period.python, source.python +FOOO : meta.function-call.generic.python, meta.function-call.python, meta.member.access.python, source.python +( : meta.function-call.python, meta.member.access.python, punctuation.definition.arguments.begin.python, source.python +) : meta.function-call.python, meta.member.access.python, punctuation.definition.arguments.end.python, source.python : source.python _ : source.python : source.python diff --git a/test/expressions/expr10.py b/test/expressions/expr10.py index 501fb475..df5f1165 100644 --- a/test/expressions/expr10.py +++ b/test/expressions/expr10.py @@ -5,6 +5,7 @@ + a : source.python : source.python = : keyword.operator.assignment.python, source.python @@ -32,5 +33,5 @@ ... : constant.other.ellipsis.python, source.python ) : punctuation.parenthesis.end.python, source.python ... : constant.other.ellipsis.python, source.python -. : punctuation.separator.period.python, source.python -__class__ : source.python, support.variable.magic.python +. : meta.member.access.python, punctuation.separator.period.python, source.python +__class__ : meta.member.access.python, source.python, support.variable.magic.python diff --git a/test/expressions/expr11.py b/test/expressions/expr11.py index 142ff621..de8e348c 100644 --- a/test/expressions/expr11.py +++ b/test/expressions/expr11.py @@ -2,15 +2,16 @@ + a : source.python : source.python = : keyword.operator.assignment.python, source.python : source.python self : source.python, variable.language.special.self.python -. : punctuation.separator.period.python, source.python -some_list : meta.item-access.python, source.python -[ : meta.item-access.python, punctuation.definition.arguments.begin.python, source.python -1 : constant.numeric.dec.python, meta.item-access.arguments.python, meta.item-access.python, source.python -: : meta.item-access.arguments.python, meta.item-access.python, punctuation.separator.slice.python, source.python -2 : constant.numeric.dec.python, meta.item-access.arguments.python, meta.item-access.python, source.python -] : meta.item-access.python, punctuation.definition.arguments.end.python, source.python +. : meta.member.access.python, punctuation.separator.period.python, source.python +some_list : meta.indexed-name.python, meta.item-access.python, meta.member.access.python, source.python +[ : meta.item-access.python, meta.member.access.python, punctuation.definition.arguments.begin.python, source.python +1 : constant.numeric.dec.python, meta.item-access.arguments.python, meta.item-access.python, meta.member.access.python, source.python +: : meta.item-access.arguments.python, meta.item-access.python, meta.member.access.python, punctuation.separator.slice.python, source.python +2 : constant.numeric.dec.python, meta.item-access.arguments.python, meta.item-access.python, meta.member.access.python, source.python +] : meta.item-access.python, meta.member.access.python, punctuation.definition.arguments.end.python, source.python diff --git a/test/expressions/expr15.py b/test/expressions/expr15.py index 2815cdae..4038218a 100644 --- a/test/expressions/expr15.py +++ b/test/expressions/expr15.py @@ -2,6 +2,7 @@ + foofrom : source.python -. : punctuation.separator.period.python, source.python -something : source.python +. : meta.member.access.python, punctuation.separator.period.python, source.python +something : meta.attribute.python, meta.member.access.python, source.python diff --git a/test/expressions/expr18.py b/test/expressions/expr18.py index 8326520f..6e9413bf 100644 --- a/test/expressions/expr18.py +++ b/test/expressions/expr18.py @@ -3,9 +3,10 @@ + a : source.python -. : punctuation.separator.period.python, source.python -Exception : source.python +. : meta.member.access.python, punctuation.separator.period.python, source.python +Exception : meta.attribute.python, meta.member.access.python, source.python Exception : source.python, support.type.exception.python -. : punctuation.separator.period.python, source.python -a : source.python +. : meta.member.access.python, punctuation.separator.period.python, source.python +a : meta.attribute.python, meta.member.access.python, source.python diff --git a/test/expressions/expr19.py b/test/expressions/expr19.py index 45dd0e8e..4a4a3a5b 100644 --- a/test/expressions/expr19.py +++ b/test/expressions/expr19.py @@ -11,40 +11,41 @@ + a : source.python -. : punctuation.separator.period.python, source.python - : source.python +. : meta.member.access.python, punctuation.separator.period.python, source.python + : meta.member.access.python, source.python # : comment.line.number-sign.python, punctuation.definition.comment.python, source.python foo : comment.line.number-sign.python, source.python a : source.python -. : punctuation.separator.period.python, source.python - : source.python +. : meta.member.access.python, punctuation.separator.period.python, source.python + : meta.member.access.python, source.python # : comment.line.number-sign.python, punctuation.definition.comment.python, source.python foo : comment.line.number-sign.python, source.python a : source.python -. : punctuation.separator.period.python, source.python - : source.python -\ : punctuation.separator.continuation.line.python, source.python - : source.python +. : meta.member.access.python, punctuation.separator.period.python, source.python + : meta.member.access.python, source.python +\ : meta.member.access.python, punctuation.separator.continuation.line.python, source.python + : meta.member.access.python, source.python # : comment.line.number-sign.python, punctuation.definition.comment.python, source.python foo : comment.line.number-sign.python, source.python a : source.python -. : punctuation.separator.period.python, source.python - : source.python +. : meta.member.access.python, punctuation.separator.period.python, source.python + : meta.member.access.python, source.python ' : punctuation.definition.string.begin.python, source.python, string.quoted.single.python bar : source.python, string.quoted.single.python ' : punctuation.definition.string.end.python, source.python, string.quoted.single.python a : source.python -. : punctuation.separator.period.python, source.python - : source.python +. : meta.member.access.python, punctuation.separator.period.python, source.python + : meta.member.access.python, source.python ' : punctuation.definition.string.begin.python, source.python, string.quoted.docstring.single.python bar : source.python, string.quoted.docstring.single.python ' : punctuation.definition.string.end.python, source.python, string.quoted.docstring.single.python a : source.python -. : punctuation.separator.period.python, source.python - : source.python -\ : punctuation.separator.continuation.line.python, source.python - : source.python -' : punctuation.definition.string.begin.python, source.python, string.quoted.single.python -bar : source.python, string.quoted.single.python -' : punctuation.definition.string.end.python, source.python, string.quoted.single.python +. : meta.member.access.python, punctuation.separator.period.python, source.python + : meta.member.access.python, source.python +\ : meta.member.access.python, punctuation.separator.continuation.line.python, source.python + : meta.member.access.python, source.python +' : meta.member.access.python, punctuation.definition.string.begin.python, source.python, string.quoted.single.python +bar : meta.member.access.python, source.python, string.quoted.single.python +' : meta.member.access.python, punctuation.definition.string.end.python, source.python, string.quoted.single.python diff --git a/test/expressions/expr21.py b/test/expressions/expr21.py new file mode 100644 index 00000000..59556710 --- /dev/null +++ b/test/expressions/expr21.py @@ -0,0 +1,39 @@ +while chunk := file.read(8192): + process(chunk) + y0 = (y1 := f(x)) + + + +while : keyword.control.flow.python, source.python + : source.python +chunk : source.python + : source.python +:= : keyword.operator.assignment.python, source.python + : source.python +file : source.python, variable.legacy.builtin.python +. : meta.member.access.python, punctuation.separator.period.python, source.python +read : meta.function-call.generic.python, meta.function-call.python, meta.member.access.python, source.python +( : meta.function-call.python, meta.member.access.python, punctuation.definition.arguments.begin.python, source.python +8192 : constant.numeric.dec.python, meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, source.python +) : meta.function-call.python, meta.member.access.python, punctuation.definition.arguments.end.python, source.python +: : punctuation.separator.colon.python, source.python + : source.python +process : meta.function-call.generic.python, meta.function-call.python, source.python +( : meta.function-call.python, punctuation.definition.arguments.begin.python, source.python +chunk : meta.function-call.arguments.python, meta.function-call.python, source.python +) : meta.function-call.python, punctuation.definition.arguments.end.python, source.python + : source.python +y0 : source.python + : source.python += : keyword.operator.assignment.python, source.python + : source.python +( : punctuation.parenthesis.begin.python, source.python +y1 : source.python + : source.python +:= : keyword.operator.assignment.python, source.python + : source.python +f : meta.function-call.generic.python, meta.function-call.python, source.python +( : meta.function-call.python, punctuation.definition.arguments.begin.python, source.python +x : meta.function-call.arguments.python, meta.function-call.python, source.python +) : meta.function-call.python, punctuation.definition.arguments.end.python, source.python +) : punctuation.parenthesis.end.python, source.python diff --git a/test/expressions/expr22.py b/test/expressions/expr22.py new file mode 100644 index 00000000..7c03f542 --- /dev/null +++ b/test/expressions/expr22.py @@ -0,0 +1,33 @@ +match = 13 +case = 12 +if case == 4: + return match * 5 + + + +match : source.python + : source.python += : keyword.operator.assignment.python, source.python + : source.python +13 : constant.numeric.dec.python, source.python +case : source.python + : source.python += : keyword.operator.assignment.python, source.python + : source.python +12 : constant.numeric.dec.python, source.python +if : keyword.control.flow.python, source.python + : source.python +case : source.python + : source.python +== : keyword.operator.comparison.python, source.python + : source.python +4 : constant.numeric.dec.python, source.python +: : punctuation.separator.colon.python, source.python + : source.python +return : keyword.control.flow.python, source.python + : source.python +match : source.python + : source.python +* : keyword.operator.arithmetic.python, source.python + : source.python +5 : constant.numeric.dec.python, source.python diff --git a/test/expressions/expr4.py b/test/expressions/expr4.py index 6795c76d..ac5e5ddc 100644 --- a/test/expressions/expr4.py +++ b/test/expressions/expr4.py @@ -13,7 +13,7 @@ : source.python i : source.python : source.python -in : keyword.operator.logical.python, source.python +in : keyword.control.flow.python, source.python : source.python range : meta.function-call.python, source.python, support.function.builtin.python ( : meta.function-call.python, punctuation.definition.arguments.begin.python, source.python diff --git a/test/expressions/expr7.py b/test/expressions/expr7.py index 936af9e8..8bfa1704 100644 --- a/test/expressions/expr7.py +++ b/test/expressions/expr7.py @@ -2,18 +2,19 @@ + a : source.python -. : punctuation.separator.period.python, source.python -True : keyword.illegal.name.python, source.python +. : meta.member.access.python, punctuation.separator.period.python, source.python +True : keyword.illegal.name.python, meta.member.access.python, source.python : source.python = : keyword.operator.assignment.python, source.python : source.python b : source.python -. : punctuation.separator.period.python, source.python -False : keyword.illegal.name.python, source.python +. : meta.member.access.python, punctuation.separator.period.python, source.python +False : keyword.illegal.name.python, meta.member.access.python, source.python : source.python = : keyword.operator.assignment.python, source.python : source.python d : source.python -. : punctuation.separator.period.python, source.python -None : keyword.illegal.name.python, source.python +. : meta.member.access.python, punctuation.separator.period.python, source.python +None : keyword.illegal.name.python, meta.member.access.python, source.python diff --git a/test/expressions/keywords.py b/test/expressions/keywords.py index 6ff1d516..7c14d5c2 100644 --- a/test/expressions/keywords.py +++ b/test/expressions/keywords.py @@ -1,9 +1,11 @@ -as async await continue del assert break finally for +as async await continue del assert break finally from elif else if import except pass raise return try while with nonlocal global class def +for + as : keyword.control.import.python, source.python @@ -21,8 +23,6 @@ break : keyword.control.flow.python, source.python : source.python finally : keyword.control.flow.python, source.python - : source.python -for : keyword.control.flow.python, source.python from : keyword.control.import.python, source.python : source.python elif : keyword.control.flow.python, source.python @@ -52,3 +52,5 @@ : source.python class : source.python, storage.type.class.python def : source.python, storage.type.function.python + : source.python +for : keyword.control.flow.python, source.python diff --git a/test/expressions/special2.py b/test/expressions/special2.py index 2f360985..727d664f 100644 --- a/test/expressions/special2.py +++ b/test/expressions/special2.py @@ -7,7 +7,7 @@ def __class_getitem__(): pass __post_init__ : source.python, support.variable.magic.python def : meta.function.python, source.python, storage.type.function.python : meta.function.python, source.python -__class_getitem__ : meta.function.python, source.python, support.variable.magic.python +__class_getitem__ : meta.function.python, source.python, support.function.magic.python ( : meta.function.parameters.python, meta.function.python, punctuation.definition.parameters.begin.python, source.python ) : meta.function.parameters.python, meta.function.python, punctuation.definition.parameters.end.python, source.python : : meta.function.python, punctuation.section.function.begin.python, source.python diff --git a/test/fstrings/comment4.py b/test/fstrings/comment4.py index f070cdd0..66943523 100644 --- a/test/fstrings/comment4.py +++ b/test/fstrings/comment4.py @@ -4,36 +4,36 @@ self : source.python, variable.language.special.self.python -. : punctuation.separator.period.python, source.python -assertEqual : meta.function-call.generic.python, meta.function-call.python, source.python -( : meta.function-call.python, punctuation.definition.arguments.begin.python, source.python -f : meta.fstring.python, meta.function-call.arguments.python, meta.function-call.python, source.python, storage.type.string.python, string.interpolated.python, string.quoted.single.python -' : meta.fstring.python, meta.function-call.arguments.python, meta.function-call.python, punctuation.definition.string.begin.python, source.python, string.interpolated.python, string.quoted.single.python -{ : constant.character.format.placeholder.other.python, meta.fstring.python, meta.function-call.arguments.python, meta.function-call.python, source.python -10 : constant.numeric.dec.python, meta.fstring.python, meta.function-call.arguments.python, meta.function-call.python, source.python -: : meta.fstring.python, meta.function-call.arguments.python, meta.function-call.python, source.python, storage.type.format.python -# : meta.fstring.python, meta.function-call.arguments.python, meta.function-call.python, source.python, storage.type.format.python -{ : constant.character.format.placeholder.other.python, meta.fstring.python, meta.function-call.arguments.python, meta.function-call.python, source.python -3 : constant.numeric.dec.python, meta.fstring.python, meta.function-call.arguments.python, meta.function-call.python, source.python - : meta.fstring.python, meta.function-call.arguments.python, meta.function-call.python, source.python -!= : keyword.operator.comparison.python, meta.fstring.python, meta.function-call.arguments.python, meta.function-call.python, source.python - : meta.fstring.python, meta.function-call.arguments.python, meta.function-call.python, source.python -{ : meta.fstring.python, meta.function-call.arguments.python, meta.function-call.python, punctuation.definition.dict.begin.python, source.python -4 : constant.numeric.dec.python, meta.fstring.python, meta.function-call.arguments.python, meta.function-call.python, source.python -: : meta.fstring.python, meta.function-call.arguments.python, meta.function-call.python, punctuation.separator.dict.python, source.python -5 : constant.numeric.dec.python, meta.fstring.python, meta.function-call.arguments.python, meta.function-call.python, source.python -} : meta.fstring.python, meta.function-call.arguments.python, meta.function-call.python, punctuation.definition.dict.end.python, source.python - : meta.fstring.python, meta.function-call.arguments.python, meta.function-call.python, source.python -and : keyword.operator.logical.python, meta.fstring.python, meta.function-call.arguments.python, meta.function-call.python, source.python - : meta.fstring.python, meta.function-call.arguments.python, meta.function-call.python, source.python -width : meta.fstring.python, meta.function-call.arguments.python, meta.function-call.python, source.python -} : constant.character.format.placeholder.other.python, meta.fstring.python, meta.function-call.arguments.python, meta.function-call.python, source.python -x : meta.fstring.python, meta.function-call.arguments.python, meta.function-call.python, source.python, storage.type.format.python -} : constant.character.format.placeholder.other.python, meta.fstring.python, meta.function-call.arguments.python, meta.function-call.python, source.python -' : meta.fstring.python, meta.function-call.arguments.python, meta.function-call.python, punctuation.definition.string.end.python, source.python, string.interpolated.python, string.quoted.single.python -, : meta.function-call.arguments.python, meta.function-call.python, punctuation.separator.arguments.python, source.python - : meta.function-call.arguments.python, meta.function-call.python, source.python -' : meta.function-call.arguments.python, meta.function-call.python, punctuation.definition.string.begin.python, source.python, string.quoted.single.python - 0xa : meta.function-call.arguments.python, meta.function-call.python, source.python, string.quoted.single.python -' : meta.function-call.arguments.python, meta.function-call.python, punctuation.definition.string.end.python, source.python, string.quoted.single.python -) : meta.function-call.python, punctuation.definition.arguments.end.python, source.python +. : meta.member.access.python, punctuation.separator.period.python, source.python +assertEqual : meta.function-call.generic.python, meta.function-call.python, meta.member.access.python, source.python +( : meta.function-call.python, meta.member.access.python, punctuation.definition.arguments.begin.python, source.python +f : meta.fstring.python, meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, source.python, storage.type.string.python, string.interpolated.python, string.quoted.single.python +' : meta.fstring.python, meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, punctuation.definition.string.begin.python, source.python, string.interpolated.python, string.quoted.single.python +{ : constant.character.format.placeholder.other.python, meta.fstring.python, meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, source.python +10 : constant.numeric.dec.python, meta.fstring.python, meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, source.python +: : meta.fstring.python, meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, source.python, storage.type.format.python +# : meta.fstring.python, meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, source.python, storage.type.format.python +{ : constant.character.format.placeholder.other.python, meta.fstring.python, meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, source.python +3 : constant.numeric.dec.python, meta.fstring.python, meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, source.python + : meta.fstring.python, meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, source.python +!= : keyword.operator.comparison.python, meta.fstring.python, meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, source.python + : meta.fstring.python, meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, source.python +{ : meta.fstring.python, meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, punctuation.definition.dict.begin.python, source.python +4 : constant.numeric.dec.python, meta.fstring.python, meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, source.python +: : meta.fstring.python, meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, punctuation.separator.dict.python, source.python +5 : constant.numeric.dec.python, meta.fstring.python, meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, source.python +} : meta.fstring.python, meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, punctuation.definition.dict.end.python, source.python + : meta.fstring.python, meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, source.python +and : keyword.operator.logical.python, meta.fstring.python, meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, source.python + : meta.fstring.python, meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, source.python +width : meta.fstring.python, meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, source.python +} : constant.character.format.placeholder.other.python, meta.fstring.python, meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, source.python +x : meta.fstring.python, meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, source.python, storage.type.format.python +} : constant.character.format.placeholder.other.python, meta.fstring.python, meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, source.python +' : meta.fstring.python, meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, punctuation.definition.string.end.python, source.python, string.interpolated.python, string.quoted.single.python +, : meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, punctuation.separator.arguments.python, source.python + : meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, source.python +' : meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, punctuation.definition.string.begin.python, source.python, string.quoted.single.python + 0xa : meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, source.python, string.quoted.single.python +' : meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, punctuation.definition.string.end.python, source.python, string.quoted.single.python +) : meta.function-call.python, meta.member.access.python, punctuation.definition.arguments.end.python, source.python diff --git a/test/fstrings/empty2.py b/test/fstrings/empty2.py index 77dc9087..9a007e14 100644 --- a/test/fstrings/empty2.py +++ b/test/fstrings/empty2.py @@ -7,20 +7,22 @@ -rf : source.python, storage.type.string.python, string.interpolated.python, string.regexp.quoted.single.python -" : punctuation.definition.string.begin.python, source.python, string.interpolated.python, string.regexp.quoted.single.python -{ : constant.character.format.placeholder.other.python, source.python, string.interpolated.python, string.regexp.quoted.single.python -} : constant.character.format.placeholder.other.python, source.python, string.interpolated.python, string.regexp.quoted.single.python - : source.python, string.interpolated.python, string.regexp.quoted.single.python -{ : constant.character.format.placeholder.other.python, source.python, string.interpolated.python, string.regexp.quoted.single.python - : invalid.illegal.brace.python, source.python, string.interpolated.python, string.regexp.quoted.single.python -} : constant.character.format.placeholder.other.python, source.python, string.interpolated.python, string.regexp.quoted.single.python -" : punctuation.definition.string.end.python, source.python, string.interpolated.python, string.regexp.quoted.single.python -rf : source.python, storage.type.string.python, string.interpolated.python, string.regexp.quoted.multi.python -""" : punctuation.definition.string.begin.python, source.python, string.interpolated.python, string.regexp.quoted.multi.python -{ : constant.character.format.placeholder.other.python, source.python, string.interpolated.python, string.regexp.quoted.multi.python -} : constant.character.format.placeholder.other.python, source.python, string.interpolated.python, string.regexp.quoted.multi.python -{ : constant.character.format.placeholder.other.python, source.python, string.interpolated.python, string.regexp.quoted.multi.python - : invalid.illegal.brace.python, source.python, string.interpolated.python, string.regexp.quoted.multi.python -} : constant.character.format.placeholder.other.python, source.python, string.interpolated.python, string.regexp.quoted.multi.python -""" : punctuation.definition.string.end.python, source.python, string.interpolated.python, string.regexp.quoted.multi.python +rf : meta.fstring.python, source.python, storage.type.string.python, string.interpolated.python, string.quoted.raw.single.python +" : meta.fstring.python, punctuation.definition.string.begin.python, source.python, string.quoted.raw.single.python +{ : constant.character.format.placeholder.other.python, meta.fstring.python, source.python +} : constant.character.format.placeholder.other.python, meta.fstring.python, source.python + : meta.fstring.python, source.python, string.interpolated.python, string.quoted.raw.single.python +{ : constant.character.format.placeholder.other.python, meta.fstring.python, source.python + : invalid.illegal.brace.python, meta.fstring.python, source.python +} : constant.character.format.placeholder.other.python, meta.fstring.python, source.python +" : meta.fstring.python, punctuation.definition.string.end.python, source.python, string.interpolated.python, string.quoted.raw.single.python +rf : meta.fstring.python, source.python, storage.type.string.python, string.interpolated.python, string.quoted.raw.multi.python +""" : meta.fstring.python, punctuation.definition.string.begin.python, source.python, string.quoted.raw.multi.python +{ : constant.character.format.placeholder.other.python, meta.fstring.python, source.python +} : constant.character.format.placeholder.other.python, meta.fstring.python, source.python + : meta.fstring.python, source.python, string.interpolated.python, string.quoted.raw.multi.python +{ : constant.character.format.placeholder.other.python, meta.fstring.python, source.python + : invalid.illegal.brace.python, meta.fstring.python, source.python +} : constant.character.format.placeholder.other.python, meta.fstring.python, source.python + : meta.fstring.python, source.python, string.interpolated.python, string.quoted.raw.multi.python +""" : meta.fstring.python, punctuation.definition.string.end.python, source.python, string.interpolated.python, string.quoted.raw.multi.python diff --git a/test/fstrings/fraw1.py b/test/fstrings/fraw1.py new file mode 100644 index 00000000..31e2196e --- /dev/null +++ b/test/fstrings/fraw1.py @@ -0,0 +1,40 @@ +a = fr'[a-z]' +a = Fr'[a-z]' +a = rf'[a-z]' +a = rF'[a-z]' + + + + +a : source.python + : source.python += : keyword.operator.assignment.python, source.python + : source.python +fr : meta.fstring.python, source.python, storage.type.string.python, string.interpolated.python, string.quoted.raw.single.python +' : meta.fstring.python, punctuation.definition.string.begin.python, source.python, string.quoted.raw.single.python +[a-z] : meta.fstring.python, source.python, string.interpolated.python, string.quoted.raw.single.python +' : meta.fstring.python, punctuation.definition.string.end.python, source.python, string.interpolated.python, string.quoted.raw.single.python +a : source.python + : source.python += : keyword.operator.assignment.python, source.python + : source.python +Fr : meta.fstring.python, source.python, storage.type.string.python, string.interpolated.python, string.quoted.raw.single.python +' : meta.fstring.python, punctuation.definition.string.begin.python, source.python, string.quoted.raw.single.python +[a-z] : meta.fstring.python, source.python, string.interpolated.python, string.quoted.raw.single.python +' : meta.fstring.python, punctuation.definition.string.end.python, source.python, string.interpolated.python, string.quoted.raw.single.python +a : source.python + : source.python += : keyword.operator.assignment.python, source.python + : source.python +rf : meta.fstring.python, source.python, storage.type.string.python, string.interpolated.python, string.quoted.raw.single.python +' : meta.fstring.python, punctuation.definition.string.begin.python, source.python, string.quoted.raw.single.python +[a-z] : meta.fstring.python, source.python, string.interpolated.python, string.quoted.raw.single.python +' : meta.fstring.python, punctuation.definition.string.end.python, source.python, string.interpolated.python, string.quoted.raw.single.python +a : source.python + : source.python += : keyword.operator.assignment.python, source.python + : source.python +rF : meta.fstring.python, source.python, storage.type.string.python, string.interpolated.python, string.quoted.raw.single.python +' : meta.fstring.python, punctuation.definition.string.begin.python, source.python, string.quoted.raw.single.python +[a-z] : meta.fstring.python, source.python, string.interpolated.python, string.quoted.raw.single.python +' : meta.fstring.python, punctuation.definition.string.end.python, source.python, string.interpolated.python, string.quoted.raw.single.python diff --git a/test/fstrings/fraw2.py b/test/fstrings/fraw2.py new file mode 100644 index 00000000..df0a2fed --- /dev/null +++ b/test/fstrings/fraw2.py @@ -0,0 +1,36 @@ +rf'fo{{2}}' +rf"fo{{2}}" +rf'''fo{{2}}''' +rf"""fo{{2}}""" + + + + +rf : meta.fstring.python, source.python, storage.type.string.python, string.interpolated.python, string.quoted.raw.single.python +' : meta.fstring.python, punctuation.definition.string.begin.python, source.python, string.quoted.raw.single.python +fo : meta.fstring.python, source.python, string.interpolated.python, string.quoted.raw.single.python +{{ : constant.character.escape.python, meta.fstring.python, source.python +2 : meta.fstring.python, source.python, string.interpolated.python, string.quoted.raw.single.python +}} : constant.character.escape.python, meta.fstring.python, source.python +' : meta.fstring.python, punctuation.definition.string.end.python, source.python, string.interpolated.python, string.quoted.raw.single.python +rf : meta.fstring.python, source.python, storage.type.string.python, string.interpolated.python, string.quoted.raw.single.python +" : meta.fstring.python, punctuation.definition.string.begin.python, source.python, string.quoted.raw.single.python +fo : meta.fstring.python, source.python, string.interpolated.python, string.quoted.raw.single.python +{{ : constant.character.escape.python, meta.fstring.python, source.python +2 : meta.fstring.python, source.python, string.interpolated.python, string.quoted.raw.single.python +}} : constant.character.escape.python, meta.fstring.python, source.python +" : meta.fstring.python, punctuation.definition.string.end.python, source.python, string.interpolated.python, string.quoted.raw.single.python +rf : meta.fstring.python, source.python, storage.type.string.python, string.interpolated.python, string.quoted.raw.multi.python +''' : meta.fstring.python, punctuation.definition.string.begin.python, source.python, string.quoted.raw.multi.python +fo : meta.fstring.python, source.python, string.interpolated.python, string.quoted.raw.multi.python +{{ : constant.character.escape.python, meta.fstring.python, source.python +2 : meta.fstring.python, source.python, string.interpolated.python, string.quoted.raw.multi.python +}} : constant.character.escape.python, meta.fstring.python, source.python +''' : meta.fstring.python, punctuation.definition.string.end.python, source.python, string.interpolated.python, string.quoted.raw.multi.python +rf : meta.fstring.python, source.python, storage.type.string.python, string.interpolated.python, string.quoted.raw.multi.python +""" : meta.fstring.python, punctuation.definition.string.begin.python, source.python, string.quoted.raw.multi.python +fo : meta.fstring.python, source.python, string.interpolated.python, string.quoted.raw.multi.python +{{ : constant.character.escape.python, meta.fstring.python, source.python +2 : meta.fstring.python, source.python, string.interpolated.python, string.quoted.raw.multi.python +}} : constant.character.escape.python, meta.fstring.python, source.python +""" : meta.fstring.python, punctuation.definition.string.end.python, source.python, string.interpolated.python, string.quoted.raw.multi.python diff --git a/test/fstrings/fraw3.py b/test/fstrings/fraw3.py new file mode 100644 index 00000000..da1a6aff --- /dev/null +++ b/test/fstrings/fraw3.py @@ -0,0 +1,36 @@ +rf'fo{2}' +rf"fo{2}" +rf'''fo{2}''' +rf"""fo{2}""" + + + + +rf : meta.fstring.python, source.python, storage.type.string.python, string.interpolated.python, string.quoted.raw.single.python +' : meta.fstring.python, punctuation.definition.string.begin.python, source.python, string.quoted.raw.single.python +fo : meta.fstring.python, source.python, string.interpolated.python, string.quoted.raw.single.python +{ : constant.character.format.placeholder.other.python, meta.fstring.python, source.python +2 : constant.numeric.dec.python, meta.fstring.python, source.python +} : constant.character.format.placeholder.other.python, meta.fstring.python, source.python +' : meta.fstring.python, punctuation.definition.string.end.python, source.python, string.interpolated.python, string.quoted.raw.single.python +rf : meta.fstring.python, source.python, storage.type.string.python, string.interpolated.python, string.quoted.raw.single.python +" : meta.fstring.python, punctuation.definition.string.begin.python, source.python, string.quoted.raw.single.python +fo : meta.fstring.python, source.python, string.interpolated.python, string.quoted.raw.single.python +{ : constant.character.format.placeholder.other.python, meta.fstring.python, source.python +2 : constant.numeric.dec.python, meta.fstring.python, source.python +} : constant.character.format.placeholder.other.python, meta.fstring.python, source.python +" : meta.fstring.python, punctuation.definition.string.end.python, source.python, string.interpolated.python, string.quoted.raw.single.python +rf : meta.fstring.python, source.python, storage.type.string.python, string.interpolated.python, string.quoted.raw.multi.python +''' : meta.fstring.python, punctuation.definition.string.begin.python, source.python, string.quoted.raw.multi.python +fo : meta.fstring.python, source.python, string.interpolated.python, string.quoted.raw.multi.python +{ : constant.character.format.placeholder.other.python, meta.fstring.python, source.python +2 : constant.numeric.dec.python, meta.fstring.python, source.python +} : constant.character.format.placeholder.other.python, meta.fstring.python, source.python +''' : meta.fstring.python, punctuation.definition.string.end.python, source.python, string.interpolated.python, string.quoted.raw.multi.python +rf : meta.fstring.python, source.python, storage.type.string.python, string.interpolated.python, string.quoted.raw.multi.python +""" : meta.fstring.python, punctuation.definition.string.begin.python, source.python, string.quoted.raw.multi.python +fo : meta.fstring.python, source.python, string.interpolated.python, string.quoted.raw.multi.python +{ : constant.character.format.placeholder.other.python, meta.fstring.python, source.python +2 : constant.numeric.dec.python, meta.fstring.python, source.python +} : constant.character.format.placeholder.other.python, meta.fstring.python, source.python +""" : meta.fstring.python, punctuation.definition.string.end.python, source.python, string.interpolated.python, string.quoted.raw.multi.python diff --git a/test/fstrings/fraw4.py b/test/fstrings/fraw4.py new file mode 100644 index 00000000..2bf2d465 --- /dev/null +++ b/test/fstrings/fraw4.py @@ -0,0 +1,45 @@ +a = rf'fo{{{2}}}' +a = rf'fo{{{bar}}}' +a = rf'fo{{2}}' + + + + + +a : source.python + : source.python += : keyword.operator.assignment.python, source.python + : source.python +rf : meta.fstring.python, source.python, storage.type.string.python, string.interpolated.python, string.quoted.raw.single.python +' : meta.fstring.python, punctuation.definition.string.begin.python, source.python, string.quoted.raw.single.python +fo : meta.fstring.python, source.python, string.interpolated.python, string.quoted.raw.single.python +{{ : constant.character.escape.python, meta.fstring.python, source.python +{ : constant.character.format.placeholder.other.python, meta.fstring.python, source.python +2 : constant.numeric.dec.python, meta.fstring.python, source.python +} : constant.character.format.placeholder.other.python, meta.fstring.python, source.python +}} : constant.character.escape.python, meta.fstring.python, source.python +' : meta.fstring.python, punctuation.definition.string.end.python, source.python, string.interpolated.python, string.quoted.raw.single.python +a : source.python + : source.python += : keyword.operator.assignment.python, source.python + : source.python +rf : meta.fstring.python, source.python, storage.type.string.python, string.interpolated.python, string.quoted.raw.single.python +' : meta.fstring.python, punctuation.definition.string.begin.python, source.python, string.quoted.raw.single.python +fo : meta.fstring.python, source.python, string.interpolated.python, string.quoted.raw.single.python +{{ : constant.character.escape.python, meta.fstring.python, source.python +{ : constant.character.format.placeholder.other.python, meta.fstring.python, source.python +bar : meta.fstring.python, source.python +} : constant.character.format.placeholder.other.python, meta.fstring.python, source.python +}} : constant.character.escape.python, meta.fstring.python, source.python +' : meta.fstring.python, punctuation.definition.string.end.python, source.python, string.interpolated.python, string.quoted.raw.single.python +a : source.python + : source.python += : keyword.operator.assignment.python, source.python + : source.python +rf : meta.fstring.python, source.python, storage.type.string.python, string.interpolated.python, string.quoted.raw.single.python +' : meta.fstring.python, punctuation.definition.string.begin.python, source.python, string.quoted.raw.single.python +fo : meta.fstring.python, source.python, string.interpolated.python, string.quoted.raw.single.python +{{ : constant.character.escape.python, meta.fstring.python, source.python +2 : meta.fstring.python, source.python, string.interpolated.python, string.quoted.raw.single.python +}} : constant.character.escape.python, meta.fstring.python, source.python +' : meta.fstring.python, punctuation.definition.string.end.python, source.python, string.interpolated.python, string.quoted.raw.single.python diff --git a/test/fstrings/nested1.py b/test/fstrings/nested1.py index d7d1c8bf..91f15907 100644 --- a/test/fstrings/nested1.py +++ b/test/fstrings/nested1.py @@ -26,7 +26,7 @@ : meta.fstring.python, meta.function-call.arguments.python, meta.function-call.python, source.python, string.interpolated.python, string.quoted.multi.python { : constant.character.format.placeholder.other.python, meta.fstring.python, meta.function-call.arguments.python, meta.function-call.python, source.python : meta.fstring.python, meta.function-call.arguments.python, meta.function-call.python, source.python -bar : meta.fstring.python, meta.function-call.arguments.python, meta.function-call.python, meta.item-access.python, source.python +bar : meta.fstring.python, meta.function-call.arguments.python, meta.function-call.python, meta.indexed-name.python, meta.item-access.python, source.python [ : meta.fstring.python, meta.function-call.arguments.python, meta.function-call.python, meta.item-access.python, punctuation.definition.arguments.begin.python, source.python " : meta.fstring.python, meta.function-call.arguments.python, meta.function-call.python, meta.item-access.arguments.python, meta.item-access.python, punctuation.definition.string.begin.python, source.python, string.quoted.single.python q : meta.fstring.python, meta.function-call.arguments.python, meta.function-call.python, meta.item-access.arguments.python, meta.item-access.python, source.python, string.quoted.single.python diff --git a/test/fstrings/prefixes2.py b/test/fstrings/prefixes2.py index 861d2b66..78ee4246 100644 --- a/test/fstrings/prefixes2.py +++ b/test/fstrings/prefixes2.py @@ -22,16 +22,20 @@ obj : meta.fstring.python, source.python } : constant.character.format.placeholder.other.python, meta.fstring.python, source.python ' : meta.fstring.python, punctuation.definition.string.end.python, source.python, string.interpolated.python, string.quoted.single.python -rf : source.python, storage.type.string.python, string.interpolated.python, string.regexp.quoted.single.python -' : punctuation.definition.string.begin.python, source.python, string.interpolated.python, string.regexp.quoted.single.python -some : source.python, string.interpolated.python, string.regexp.quoted.single.python -{obj} : source.python, string.interpolated.python, string.regexp.quoted.single.python -' : punctuation.definition.string.end.python, source.python, string.interpolated.python, string.regexp.quoted.single.python -rF : source.python, storage.type.string.python, string.interpolated.python, string.regexp.quoted.single.python -' : punctuation.definition.string.begin.python, source.python, string.interpolated.python, string.regexp.quoted.single.python -some : source.python, string.interpolated.python, string.regexp.quoted.single.python -{obj} : source.python, string.interpolated.python, string.regexp.quoted.single.python -' : punctuation.definition.string.end.python, source.python, string.interpolated.python, string.regexp.quoted.single.python +rf : meta.fstring.python, source.python, storage.type.string.python, string.interpolated.python, string.quoted.raw.single.python +' : meta.fstring.python, punctuation.definition.string.begin.python, source.python, string.quoted.raw.single.python +some : meta.fstring.python, source.python, string.interpolated.python, string.quoted.raw.single.python +{ : constant.character.format.placeholder.other.python, meta.fstring.python, source.python +obj : meta.fstring.python, source.python +} : constant.character.format.placeholder.other.python, meta.fstring.python, source.python +' : meta.fstring.python, punctuation.definition.string.end.python, source.python, string.interpolated.python, string.quoted.raw.single.python +rF : meta.fstring.python, source.python, storage.type.string.python, string.interpolated.python, string.quoted.raw.single.python +' : meta.fstring.python, punctuation.definition.string.begin.python, source.python, string.quoted.raw.single.python +some : meta.fstring.python, source.python, string.interpolated.python, string.quoted.raw.single.python +{ : constant.character.format.placeholder.other.python, meta.fstring.python, source.python +obj : meta.fstring.python, source.python +} : constant.character.format.placeholder.other.python, meta.fstring.python, source.python +' : meta.fstring.python, punctuation.definition.string.end.python, source.python, string.interpolated.python, string.quoted.raw.single.python Rf : meta.fstring.python, source.python, storage.type.string.python, string.interpolated.python, string.quoted.raw.single.python ' : meta.fstring.python, punctuation.definition.string.begin.python, source.python, string.quoted.raw.single.python some : meta.fstring.python, source.python, string.interpolated.python, string.quoted.raw.single.python diff --git a/test/fstrings/prefixes3.py b/test/fstrings/prefixes3.py index 200fa896..46d12ffb 100644 --- a/test/fstrings/prefixes3.py +++ b/test/fstrings/prefixes3.py @@ -6,16 +6,20 @@ -fr : source.python, storage.type.string.python, string.interpolated.python, string.regexp.quoted.single.python -' : punctuation.definition.string.begin.python, source.python, string.interpolated.python, string.regexp.quoted.single.python -some : source.python, string.interpolated.python, string.regexp.quoted.single.python -{obj} : source.python, string.interpolated.python, string.regexp.quoted.single.python -' : punctuation.definition.string.end.python, source.python, string.interpolated.python, string.regexp.quoted.single.python -Fr : source.python, storage.type.string.python, string.interpolated.python, string.regexp.quoted.single.python -' : punctuation.definition.string.begin.python, source.python, string.interpolated.python, string.regexp.quoted.single.python -some : source.python, string.interpolated.python, string.regexp.quoted.single.python -{obj} : source.python, string.interpolated.python, string.regexp.quoted.single.python -' : punctuation.definition.string.end.python, source.python, string.interpolated.python, string.regexp.quoted.single.python +fr : meta.fstring.python, source.python, storage.type.string.python, string.interpolated.python, string.quoted.raw.single.python +' : meta.fstring.python, punctuation.definition.string.begin.python, source.python, string.quoted.raw.single.python +some : meta.fstring.python, source.python, string.interpolated.python, string.quoted.raw.single.python +{ : constant.character.format.placeholder.other.python, meta.fstring.python, source.python +obj : meta.fstring.python, source.python +} : constant.character.format.placeholder.other.python, meta.fstring.python, source.python +' : meta.fstring.python, punctuation.definition.string.end.python, source.python, string.interpolated.python, string.quoted.raw.single.python +Fr : meta.fstring.python, source.python, storage.type.string.python, string.interpolated.python, string.quoted.raw.single.python +' : meta.fstring.python, punctuation.definition.string.begin.python, source.python, string.quoted.raw.single.python +some : meta.fstring.python, source.python, string.interpolated.python, string.quoted.raw.single.python +{ : constant.character.format.placeholder.other.python, meta.fstring.python, source.python +obj : meta.fstring.python, source.python +} : constant.character.format.placeholder.other.python, meta.fstring.python, source.python +' : meta.fstring.python, punctuation.definition.string.end.python, source.python, string.interpolated.python, string.quoted.raw.single.python fR : meta.fstring.python, source.python, storage.type.string.python, string.interpolated.python, string.quoted.raw.single.python ' : meta.fstring.python, punctuation.definition.string.begin.python, source.python, string.quoted.raw.single.python some : meta.fstring.python, source.python, string.interpolated.python, string.quoted.raw.single.python diff --git a/test/fstrings/simple10.py b/test/fstrings/simple10.py new file mode 100644 index 00000000..ae793021 --- /dev/null +++ b/test/fstrings/simple10.py @@ -0,0 +1,18 @@ +f'values: {a=} {b=!r}' + + + + +f : meta.fstring.python, source.python, storage.type.string.python, string.interpolated.python, string.quoted.single.python +' : meta.fstring.python, punctuation.definition.string.begin.python, source.python, string.interpolated.python, string.quoted.single.python +values: : meta.fstring.python, source.python, string.interpolated.python, string.quoted.single.python +{ : constant.character.format.placeholder.other.python, meta.fstring.python, source.python +a : meta.fstring.python, source.python += : meta.fstring.python, source.python, storage.type.format.python +} : constant.character.format.placeholder.other.python, meta.fstring.python, source.python + : meta.fstring.python, source.python, string.interpolated.python, string.quoted.single.python +{ : constant.character.format.placeholder.other.python, meta.fstring.python, source.python +b : meta.fstring.python, source.python +=!r : meta.fstring.python, source.python, storage.type.format.python +} : constant.character.format.placeholder.other.python, meta.fstring.python, source.python +' : meta.fstring.python, punctuation.definition.string.end.python, source.python, string.interpolated.python, string.quoted.single.python diff --git a/test/fstrings/simple2.py b/test/fstrings/simple2.py index 48ce0dcd..e4e1ff37 100644 --- a/test/fstrings/simple2.py +++ b/test/fstrings/simple2.py @@ -2,6 +2,7 @@ + a : source.python : source.python = : keyword.operator.assignment.python, source.python @@ -22,8 +23,8 @@ normal : meta.fstring.python, source.python, string.interpolated.python, string.quoted.single.python { : constant.character.format.placeholder.other.python, meta.fstring.python, source.python fo : meta.fstring.python, source.python -. : meta.fstring.python, punctuation.separator.period.python, source.python -__add__ : meta.fstring.python, source.python, support.function.magic.python +. : meta.fstring.python, meta.member.access.python, punctuation.separator.period.python, source.python +__add__ : meta.fstring.python, meta.member.access.python, source.python, support.function.magic.python !s : meta.fstring.python, source.python, storage.type.format.python } : constant.character.format.placeholder.other.python, meta.fstring.python, source.python " : meta.fstring.python, punctuation.definition.string.end.python, source.python, string.interpolated.python, string.quoted.single.python diff --git a/test/functions/async1.py b/test/functions/async1.py index d6a5546b..0218fafd 100644 --- a/test/functions/async1.py +++ b/test/functions/async1.py @@ -36,7 +36,7 @@ def : meta.function.python, source.python, storage.type.function.pytho : source.python c : source.python : source.python -in : keyword.operator.logical.python, source.python +in : keyword.control.flow.python, source.python : source.python b : source.python : : punctuation.separator.colon.python, source.python diff --git a/test/functions/decl15.py b/test/functions/decl15.py new file mode 100644 index 00000000..7f5c4ecc --- /dev/null +++ b/test/functions/decl15.py @@ -0,0 +1,34 @@ +def showcase(a, b, /, c, d, *, e, f): + return + + + + +def : meta.function.python, source.python, storage.type.function.python + : meta.function.python, source.python +showcase : entity.name.function.python, meta.function.python, source.python +( : meta.function.parameters.python, meta.function.python, punctuation.definition.parameters.begin.python, source.python +a : meta.function.parameters.python, meta.function.python, source.python, variable.parameter.function.language.python +, : meta.function.parameters.python, meta.function.python, punctuation.separator.parameters.python, source.python + : meta.function.parameters.python, meta.function.python, source.python +b : meta.function.parameters.python, meta.function.python, source.python, variable.parameter.function.language.python +, : meta.function.parameters.python, meta.function.python, punctuation.separator.parameters.python, source.python + : meta.function.parameters.python, meta.function.python, source.python +/ : keyword.operator.positional.parameter.python, meta.function.parameters.python, meta.function.python, source.python +, : meta.function.parameters.python, meta.function.python, source.python +c : meta.function.parameters.python, meta.function.python, source.python, variable.parameter.function.language.python +, : meta.function.parameters.python, meta.function.python, punctuation.separator.parameters.python, source.python + : meta.function.parameters.python, meta.function.python, source.python +d : meta.function.parameters.python, meta.function.python, source.python, variable.parameter.function.language.python +, : meta.function.parameters.python, meta.function.python, punctuation.separator.parameters.python, source.python + : meta.function.parameters.python, meta.function.python, source.python +* : keyword.operator.unpacking.parameter.python, meta.function.parameters.python, meta.function.python, source.python +, : meta.function.parameters.python, meta.function.python, source.python +e : meta.function.parameters.python, meta.function.python, source.python, variable.parameter.function.language.python +, : meta.function.parameters.python, meta.function.python, punctuation.separator.parameters.python, source.python + : meta.function.parameters.python, meta.function.python, source.python +f : meta.function.parameters.python, meta.function.python, source.python, variable.parameter.function.language.python +) : meta.function.parameters.python, meta.function.python, punctuation.definition.parameters.end.python, source.python +: : meta.function.python, punctuation.section.function.begin.python, source.python + : source.python +return : keyword.control.flow.python, source.python diff --git a/test/functions/decl2.py b/test/functions/decl2.py index 7da74fcb..f858ea26 100644 --- a/test/functions/decl2.py +++ b/test/functions/decl2.py @@ -2,6 +2,8 @@ def result_annot(lambda, lambda=) -> qqq[None]: pass + + def : meta.function.python, source.python, storage.type.function.python : meta.function.python, source.python result_annot : entity.name.function.python, meta.function.python, source.python @@ -14,7 +16,7 @@ def : meta.function.python, source.python, storage.type.function.pytho : meta.function.python, source.python -> : meta.function.python, punctuation.separator.annotation.result.python, source.python : meta.function.python, source.python -qqq : meta.function.python, meta.item-access.python, source.python +qqq : meta.function.python, meta.indexed-name.python, meta.item-access.python, source.python [ : meta.function.python, meta.item-access.python, punctuation.definition.arguments.begin.python, source.python None : constant.language.python, meta.function.python, meta.item-access.arguments.python, meta.item-access.python, source.python ] : meta.function.python, meta.item-access.python, punctuation.definition.arguments.end.python, source.python diff --git a/test/functions/decl4.py b/test/functions/decl4.py index f3b40fe5..5a452ea4 100644 --- a/test/functions/decl4.py +++ b/test/functions/decl4.py @@ -38,7 +38,7 @@ def : meta.function.python, source.python, storage.type.function.pytho : meta.function.parameters.python, meta.function.python, source.python val : meta.function.parameters.python, meta.function.python, source.python : meta.function.parameters.python, meta.function.python, source.python -in : keyword.operator.logical.python, meta.function.parameters.python, meta.function.python, source.python +in : keyword.control.flow.python, meta.function.parameters.python, meta.function.python, source.python : meta.function.parameters.python, meta.function.python, source.python ( : meta.function.parameters.python, meta.function.python, punctuation.parenthesis.begin.python, source.python x : meta.function.parameters.python, meta.function.python, source.python diff --git a/test/functions/decorators6.py b/test/functions/decorators6.py index 8a167cad..5c9b4289 100644 --- a/test/functions/decorators6.py +++ b/test/functions/decorators6.py @@ -6,6 +6,8 @@ def foo(): pass + + @ : entity.name.function.decorator.python, meta.function.decorator.python, punctuation.definition.decorator.python, source.python a : entity.name.function.decorator.python, meta.function.decorator.python, source.python . : entity.name.function.decorator.python, meta.function.decorator.python, punctuation.separator.period.python, source.python @@ -29,7 +31,7 @@ def foo(): pass ) : meta.function.decorator.python, punctuation.definition.arguments.end.python, source.python . \ : invalid.illegal.decorator.python, meta.function.decorator.python, source.python : source.python -baz : meta.item-access.python, source.python +baz : meta.indexed-name.python, meta.item-access.python, source.python [ : meta.item-access.python, punctuation.definition.arguments.begin.python, source.python 1 : constant.numeric.dec.python, meta.item-access.arguments.python, meta.item-access.python, source.python : : meta.item-access.arguments.python, meta.item-access.python, punctuation.separator.slice.python, source.python diff --git a/test/functions/lambda10.py b/test/functions/lambda10.py new file mode 100644 index 00000000..c033ac71 --- /dev/null +++ b/test/functions/lambda10.py @@ -0,0 +1,35 @@ +showcase = lambda a, /, b, *, c: (a + b + c) + + + + +showcase : source.python + : source.python += : keyword.operator.assignment.python, source.python + : source.python +lambda : meta.lambda-function.python, source.python, storage.type.function.lambda.python + : meta.function.lambda.parameters.python, meta.lambda-function.python, source.python +a : meta.function.lambda.parameters.python, meta.lambda-function.python, source.python, variable.parameter.function.language.python +, : meta.function.lambda.parameters.python, meta.lambda-function.python, punctuation.separator.parameters.python, source.python + : meta.function.lambda.parameters.python, meta.lambda-function.python, source.python +/ : keyword.operator.positional.parameter.python, meta.function.lambda.parameters.python, meta.lambda-function.python, source.python +, : meta.function.lambda.parameters.python, meta.lambda-function.python, source.python +b : meta.function.lambda.parameters.python, meta.lambda-function.python, source.python, variable.parameter.function.language.python +, : meta.function.lambda.parameters.python, meta.lambda-function.python, punctuation.separator.parameters.python, source.python + : meta.function.lambda.parameters.python, meta.lambda-function.python, source.python +* : keyword.operator.unpacking.parameter.python, meta.function.lambda.parameters.python, meta.lambda-function.python, source.python +, : meta.function.lambda.parameters.python, meta.lambda-function.python, source.python +c : meta.function.lambda.parameters.python, meta.lambda-function.python, source.python, variable.parameter.function.language.python +: : meta.lambda-function.python, punctuation.section.function.lambda.begin.python, source.python + : source.python +( : punctuation.parenthesis.begin.python, source.python +a : source.python + : source.python ++ : keyword.operator.arithmetic.python, source.python + : source.python +b : source.python + : source.python ++ : keyword.operator.arithmetic.python, source.python + : source.python +c : source.python +) : punctuation.parenthesis.end.python, source.python diff --git a/test/illegals/illegal1.py b/test/illegals/illegal1.py index 6010bc4f..5ee9654d 100644 --- a/test/illegals/illegal1.py +++ b/test/illegals/illegal1.py @@ -9,6 +9,7 @@ def f(): pass + -> : invalid.illegal.annotation.python, source.python def : meta.function.python, source.python, storage.type.function.python : meta.function.python, source.python @@ -28,13 +29,13 @@ def : meta.function.python, source.python, storage.type.function.pytho .class : source.python, string.quoted.single.python ' : punctuation.definition.string.end.python, source.python, string.quoted.single.python ) : punctuation.parenthesis.end.python, source.python -. : punctuation.separator.period.python, source.python -fuuuu : meta.function-call.generic.python, meta.function-call.python, source.python -( : meta.function-call.python, punctuation.definition.arguments.begin.python, source.python -baz : meta.function-call.arguments.python, meta.function-call.python, source.python, variable.parameter.function-call.python -= : keyword.operator.assignment.python, meta.function-call.arguments.python, meta.function-call.python, source.python -1 : constant.numeric.dec.python, meta.function-call.arguments.python, meta.function-call.python, source.python -) : meta.function-call.python, punctuation.definition.arguments.end.python, source.python +. : meta.member.access.python, punctuation.separator.period.python, source.python +fuuuu : meta.function-call.generic.python, meta.function-call.python, meta.member.access.python, source.python +( : meta.function-call.python, meta.member.access.python, punctuation.definition.arguments.begin.python, source.python +baz : meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, source.python, variable.parameter.function-call.python += : keyword.operator.assignment.python, meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, source.python +1 : constant.numeric.dec.python, meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, source.python +) : meta.function-call.python, meta.member.access.python, punctuation.definition.arguments.end.python, source.python # : comment.line.number-sign.python, punctuation.definition.comment.python, source.python we recover just fine : comment.line.number-sign.python, source.python b : source.python diff --git a/test/regexp/fregexp1.py b/test/regexp/fregexp1.py deleted file mode 100644 index 9e77d66b..00000000 --- a/test/regexp/fregexp1.py +++ /dev/null @@ -1,56 +0,0 @@ -a = fr'[a-z]' -a = Fr'[a-z]' -a = rf'[a-z]' -a = rF'[a-z]' - - - - -a : source.python - : source.python -= : keyword.operator.assignment.python, source.python - : source.python -fr : source.python, storage.type.string.python, string.interpolated.python, string.regexp.quoted.single.python -' : punctuation.definition.string.begin.python, source.python, string.interpolated.python, string.regexp.quoted.single.python -[ : constant.other.set.regexp, meta.character.set.regexp, punctuation.character.set.begin.regexp, source.python, string.interpolated.python, string.regexp.quoted.single.python -a : constant.character.set.regexp, meta.character.set.regexp, source.python, string.interpolated.python, string.regexp.quoted.single.python -- : constant.character.set.regexp, meta.character.set.regexp, source.python, string.interpolated.python, string.regexp.quoted.single.python -z : constant.character.set.regexp, meta.character.set.regexp, source.python, string.interpolated.python, string.regexp.quoted.single.python -] : constant.other.set.regexp, meta.character.set.regexp, punctuation.character.set.end.regexp, source.python, string.interpolated.python, string.regexp.quoted.single.python -' : punctuation.definition.string.end.python, source.python, string.interpolated.python, string.regexp.quoted.single.python -a : source.python - : source.python -= : keyword.operator.assignment.python, source.python - : source.python -Fr : source.python, storage.type.string.python, string.interpolated.python, string.regexp.quoted.single.python -' : punctuation.definition.string.begin.python, source.python, string.interpolated.python, string.regexp.quoted.single.python -[ : constant.other.set.regexp, meta.character.set.regexp, punctuation.character.set.begin.regexp, source.python, string.interpolated.python, string.regexp.quoted.single.python -a : constant.character.set.regexp, meta.character.set.regexp, source.python, string.interpolated.python, string.regexp.quoted.single.python -- : constant.character.set.regexp, meta.character.set.regexp, source.python, string.interpolated.python, string.regexp.quoted.single.python -z : constant.character.set.regexp, meta.character.set.regexp, source.python, string.interpolated.python, string.regexp.quoted.single.python -] : constant.other.set.regexp, meta.character.set.regexp, punctuation.character.set.end.regexp, source.python, string.interpolated.python, string.regexp.quoted.single.python -' : punctuation.definition.string.end.python, source.python, string.interpolated.python, string.regexp.quoted.single.python -a : source.python - : source.python -= : keyword.operator.assignment.python, source.python - : source.python -rf : source.python, storage.type.string.python, string.interpolated.python, string.regexp.quoted.single.python -' : punctuation.definition.string.begin.python, source.python, string.interpolated.python, string.regexp.quoted.single.python -[ : constant.other.set.regexp, meta.character.set.regexp, punctuation.character.set.begin.regexp, source.python, string.interpolated.python, string.regexp.quoted.single.python -a : constant.character.set.regexp, meta.character.set.regexp, source.python, string.interpolated.python, string.regexp.quoted.single.python -- : constant.character.set.regexp, meta.character.set.regexp, source.python, string.interpolated.python, string.regexp.quoted.single.python -z : constant.character.set.regexp, meta.character.set.regexp, source.python, string.interpolated.python, string.regexp.quoted.single.python -] : constant.other.set.regexp, meta.character.set.regexp, punctuation.character.set.end.regexp, source.python, string.interpolated.python, string.regexp.quoted.single.python -' : punctuation.definition.string.end.python, source.python, string.interpolated.python, string.regexp.quoted.single.python -a : source.python - : source.python -= : keyword.operator.assignment.python, source.python - : source.python -rF : source.python, storage.type.string.python, string.interpolated.python, string.regexp.quoted.single.python -' : punctuation.definition.string.begin.python, source.python, string.interpolated.python, string.regexp.quoted.single.python -[ : constant.other.set.regexp, meta.character.set.regexp, punctuation.character.set.begin.regexp, source.python, string.interpolated.python, string.regexp.quoted.single.python -a : constant.character.set.regexp, meta.character.set.regexp, source.python, string.interpolated.python, string.regexp.quoted.single.python -- : constant.character.set.regexp, meta.character.set.regexp, source.python, string.interpolated.python, string.regexp.quoted.single.python -z : constant.character.set.regexp, meta.character.set.regexp, source.python, string.interpolated.python, string.regexp.quoted.single.python -] : constant.other.set.regexp, meta.character.set.regexp, punctuation.character.set.end.regexp, source.python, string.interpolated.python, string.regexp.quoted.single.python -' : punctuation.definition.string.end.python, source.python, string.interpolated.python, string.regexp.quoted.single.python diff --git a/test/regexp/fregexp2.py b/test/regexp/fregexp2.py deleted file mode 100644 index 72eccc28..00000000 --- a/test/regexp/fregexp2.py +++ /dev/null @@ -1,28 +0,0 @@ -rf'fo{{2}}' -rf"fo{{2}}" -rf'''fo{{2}}''' -rf"""fo{{2}}""" - - - - -rf : source.python, storage.type.string.python, string.interpolated.python, string.regexp.quoted.single.python -' : punctuation.definition.string.begin.python, source.python, string.interpolated.python, string.regexp.quoted.single.python -fo : source.python, string.interpolated.python, string.regexp.quoted.single.python -{{2}} : keyword.operator.quantifier.regexp, source.python, string.interpolated.python, string.regexp.quoted.single.python -' : punctuation.definition.string.end.python, source.python, string.interpolated.python, string.regexp.quoted.single.python -rf : source.python, storage.type.string.python, string.interpolated.python, string.regexp.quoted.single.python -" : punctuation.definition.string.begin.python, source.python, string.interpolated.python, string.regexp.quoted.single.python -fo : source.python, string.interpolated.python, string.regexp.quoted.single.python -{{2}} : keyword.operator.quantifier.regexp, source.python, string.interpolated.python, string.regexp.quoted.single.python -" : punctuation.definition.string.end.python, source.python, string.interpolated.python, string.regexp.quoted.single.python -rf : source.python, storage.type.string.python, string.interpolated.python, string.regexp.quoted.multi.python -''' : punctuation.definition.string.begin.python, source.python, string.interpolated.python, string.regexp.quoted.multi.python -fo : source.python, string.interpolated.python, string.regexp.quoted.multi.python -{{2}} : keyword.operator.quantifier.regexp, source.python, string.interpolated.python, string.regexp.quoted.multi.python -''' : punctuation.definition.string.end.python, source.python, string.interpolated.python, string.regexp.quoted.multi.python -rf : source.python, storage.type.string.python, string.interpolated.python, string.regexp.quoted.multi.python -""" : punctuation.definition.string.begin.python, source.python, string.interpolated.python, string.regexp.quoted.multi.python -fo : source.python, string.interpolated.python, string.regexp.quoted.multi.python -{{2}} : keyword.operator.quantifier.regexp, source.python, string.interpolated.python, string.regexp.quoted.multi.python -""" : punctuation.definition.string.end.python, source.python, string.interpolated.python, string.regexp.quoted.multi.python diff --git a/test/regexp/fregexp3.py b/test/regexp/fregexp3.py deleted file mode 100644 index ede8a6c3..00000000 --- a/test/regexp/fregexp3.py +++ /dev/null @@ -1,28 +0,0 @@ -rf'fo{2}' -rf"fo{2}" -rf'''fo{2}''' -rf"""fo{2}""" - - - - -rf : source.python, storage.type.string.python, string.interpolated.python, string.regexp.quoted.single.python -' : punctuation.definition.string.begin.python, source.python, string.interpolated.python, string.regexp.quoted.single.python -fo : source.python, string.interpolated.python, string.regexp.quoted.single.python -{2} : source.python, string.interpolated.python, string.regexp.quoted.single.python -' : punctuation.definition.string.end.python, source.python, string.interpolated.python, string.regexp.quoted.single.python -rf : source.python, storage.type.string.python, string.interpolated.python, string.regexp.quoted.single.python -" : punctuation.definition.string.begin.python, source.python, string.interpolated.python, string.regexp.quoted.single.python -fo : source.python, string.interpolated.python, string.regexp.quoted.single.python -{2} : source.python, string.interpolated.python, string.regexp.quoted.single.python -" : punctuation.definition.string.end.python, source.python, string.interpolated.python, string.regexp.quoted.single.python -rf : source.python, storage.type.string.python, string.interpolated.python, string.regexp.quoted.multi.python -''' : punctuation.definition.string.begin.python, source.python, string.interpolated.python, string.regexp.quoted.multi.python -fo : source.python, string.interpolated.python, string.regexp.quoted.multi.python -{2} : source.python, string.interpolated.python, string.regexp.quoted.multi.python -''' : punctuation.definition.string.end.python, source.python, string.interpolated.python, string.regexp.quoted.multi.python -rf : source.python, storage.type.string.python, string.interpolated.python, string.regexp.quoted.multi.python -""" : punctuation.definition.string.begin.python, source.python, string.interpolated.python, string.regexp.quoted.multi.python -fo : source.python, string.interpolated.python, string.regexp.quoted.multi.python -{2} : source.python, string.interpolated.python, string.regexp.quoted.multi.python -""" : punctuation.definition.string.end.python, source.python, string.interpolated.python, string.regexp.quoted.multi.python diff --git a/test/regexp/fregexp4.py b/test/regexp/fregexp4.py deleted file mode 100644 index 5b707ad3..00000000 --- a/test/regexp/fregexp4.py +++ /dev/null @@ -1,36 +0,0 @@ -a = rf'fo{{2}}' -a = r'fo{{2}}' -a = r'fo{2}' - - - - - -a : source.python - : source.python -= : keyword.operator.assignment.python, source.python - : source.python -rf : source.python, storage.type.string.python, string.interpolated.python, string.regexp.quoted.single.python -' : punctuation.definition.string.begin.python, source.python, string.interpolated.python, string.regexp.quoted.single.python -fo : source.python, string.interpolated.python, string.regexp.quoted.single.python -{{2}} : keyword.operator.quantifier.regexp, source.python, string.interpolated.python, string.regexp.quoted.single.python -' : punctuation.definition.string.end.python, source.python, string.interpolated.python, string.regexp.quoted.single.python -a : source.python - : source.python -= : keyword.operator.assignment.python, source.python - : source.python -r : source.python, storage.type.string.python, string.regexp.quoted.single.python -' : punctuation.definition.string.begin.python, source.python, string.regexp.quoted.single.python -fo{ : source.python, string.regexp.quoted.single.python -{2} : keyword.operator.quantifier.regexp, source.python, string.regexp.quoted.single.python -} : source.python, string.regexp.quoted.single.python -' : punctuation.definition.string.end.python, source.python, string.regexp.quoted.single.python -a : source.python - : source.python -= : keyword.operator.assignment.python, source.python - : source.python -r : source.python, storage.type.string.python, string.regexp.quoted.single.python -' : punctuation.definition.string.begin.python, source.python, string.regexp.quoted.single.python -fo : source.python, string.regexp.quoted.single.python -{2} : keyword.operator.quantifier.regexp, source.python, string.regexp.quoted.single.python -' : punctuation.definition.string.end.python, source.python, string.regexp.quoted.single.python diff --git a/test/regexp/fregexp5.py b/test/regexp/fregexp5.py deleted file mode 100644 index 0d339e27..00000000 --- a/test/regexp/fregexp5.py +++ /dev/null @@ -1,26 +0,0 @@ -a = rf'{{foo}}' -a = r'\{foo\}' - - - - -a : source.python - : source.python -= : keyword.operator.assignment.python, source.python - : source.python -rf : source.python, storage.type.string.python, string.interpolated.python, string.regexp.quoted.single.python -' : punctuation.definition.string.begin.python, source.python, string.interpolated.python, string.regexp.quoted.single.python -{{ : constant.character.escape.python, source.python, string.interpolated.python, string.regexp.quoted.single.python -foo : source.python, string.interpolated.python, string.regexp.quoted.single.python -}} : constant.character.escape.python, source.python, string.interpolated.python, string.regexp.quoted.single.python -' : punctuation.definition.string.end.python, source.python, string.interpolated.python, string.regexp.quoted.single.python -a : source.python - : source.python -= : keyword.operator.assignment.python, source.python - : source.python -r : source.python, storage.type.string.python, string.regexp.quoted.single.python -' : punctuation.definition.string.begin.python, source.python, string.regexp.quoted.single.python -\{ : constant.character.escape.regexp, source.python, string.regexp.quoted.single.python -foo : source.python, string.regexp.quoted.single.python -\} : constant.character.escape.regexp, source.python, string.regexp.quoted.single.python -' : punctuation.definition.string.end.python, source.python, string.regexp.quoted.single.python diff --git a/test/regexp/fregexp6.py b/test/regexp/fregexp6.py deleted file mode 100644 index a51311d0..00000000 --- a/test/regexp/fregexp6.py +++ /dev/null @@ -1,39 +0,0 @@ -a = rf'fo{{{2}}}' -a = rf'fo{{{bar}}}' -a = rf'fo{{2}}' - - - - - -a : source.python - : source.python -= : keyword.operator.assignment.python, source.python - : source.python -rf : source.python, storage.type.string.python, string.interpolated.python, string.regexp.quoted.single.python -' : punctuation.definition.string.begin.python, source.python, string.interpolated.python, string.regexp.quoted.single.python -fo : source.python, string.interpolated.python, string.regexp.quoted.single.python -{{ : constant.character.escape.python, source.python, string.interpolated.python, string.regexp.quoted.single.python -{2} : source.python, string.interpolated.python, string.regexp.quoted.single.python -}} : constant.character.escape.python, source.python, string.interpolated.python, string.regexp.quoted.single.python -' : punctuation.definition.string.end.python, source.python, string.interpolated.python, string.regexp.quoted.single.python -a : source.python - : source.python -= : keyword.operator.assignment.python, source.python - : source.python -rf : source.python, storage.type.string.python, string.interpolated.python, string.regexp.quoted.single.python -' : punctuation.definition.string.begin.python, source.python, string.interpolated.python, string.regexp.quoted.single.python -fo : source.python, string.interpolated.python, string.regexp.quoted.single.python -{{ : constant.character.escape.python, source.python, string.interpolated.python, string.regexp.quoted.single.python -{bar} : source.python, string.interpolated.python, string.regexp.quoted.single.python -}} : constant.character.escape.python, source.python, string.interpolated.python, string.regexp.quoted.single.python -' : punctuation.definition.string.end.python, source.python, string.interpolated.python, string.regexp.quoted.single.python -a : source.python - : source.python -= : keyword.operator.assignment.python, source.python - : source.python -rf : source.python, storage.type.string.python, string.interpolated.python, string.regexp.quoted.single.python -' : punctuation.definition.string.begin.python, source.python, string.interpolated.python, string.regexp.quoted.single.python -fo : source.python, string.interpolated.python, string.regexp.quoted.single.python -{{2}} : keyword.operator.quantifier.regexp, source.python, string.interpolated.python, string.regexp.quoted.single.python -' : punctuation.definition.string.end.python, source.python, string.interpolated.python, string.regexp.quoted.single.python diff --git a/test/regexp/python8.py b/test/regexp/python8.py index f0babc73..ba72a7be 100644 --- a/test/regexp/python8.py +++ b/test/regexp/python8.py @@ -22,6 +22,7 @@ + # : comment.line.number-sign.python, punctuation.definition.comment.python, source.python And now something fun! : comment.line.number-sign.python, source.python : source.python @@ -30,166 +31,166 @@ = : keyword.operator.assignment.python, source.python : source.python re : source.python -. : punctuation.separator.period.python, source.python -compile : meta.function-call.generic.python, meta.function-call.python, source.python -( : meta.function-call.python, punctuation.definition.arguments.begin.python, source.python -r : meta.function-call.arguments.python, meta.function-call.python, source.python, storage.type.string.python, string.regexp.quoted.multi.python -""" : meta.function-call.arguments.python, meta.function-call.python, punctuation.definition.string.begin.python, source.python, string.regexp.quoted.multi.python - : meta.function-call.arguments.python, meta.function-call.python, source.python, string.regexp.quoted.multi.python -(?x) : meta.function-call.arguments.python, meta.function-call.python, source.python, storage.modifier.flag.regexp, string.regexp.quoted.multi.python - : meta.function-call.arguments.python, meta.function-call.python, source.python, string.regexp.quoted.multi.python -# : comment.line.number-sign.python, meta.function-call.arguments.python, meta.function-call.python, punctuation.definition.comment.python, source.python, string.regexp.quoted.multi.python - This is a verbose pattern : comment.line.number-sign.python, meta.function-call.arguments.python, meta.function-call.python, source.python, string.regexp.quoted.multi.python - : meta.function-call.arguments.python, meta.function-call.python, source.python, string.regexp.quoted.multi.python -\s : meta.function-call.arguments.python, meta.function-call.python, source.python, string.regexp.quoted.multi.python, support.other.escape.special.regexp -* : keyword.operator.quantifier.regexp, meta.function-call.arguments.python, meta.function-call.python, source.python, string.regexp.quoted.multi.python - : meta.function-call.arguments.python, meta.function-call.python, source.python, string.regexp.quoted.multi.python -# : comment.line.number-sign.python, meta.function-call.arguments.python, meta.function-call.python, punctuation.definition.comment.python, source.python, string.regexp.quoted.multi.python - Optional whitespace at start of cookie : comment.line.number-sign.python, meta.function-call.arguments.python, meta.function-call.python, source.python, string.regexp.quoted.multi.python - : meta.function-call.arguments.python, meta.function-call.python, source.python, string.regexp.quoted.multi.python -( : meta.function-call.arguments.python, meta.function-call.python, meta.named.regexp, punctuation.parenthesis.named.begin.regexp, source.python, string.regexp.quoted.multi.python, support.other.parenthesis.regexp -?P : entity.name.tag.named.group.regexp, meta.function-call.arguments.python, meta.function-call.python, meta.named.regexp, source.python, string.regexp.quoted.multi.python - : meta.function-call.arguments.python, meta.function-call.python, meta.named.regexp, source.python, string.regexp.quoted.multi.python -# : comment.line.number-sign.python, meta.function-call.arguments.python, meta.function-call.python, meta.named.regexp, punctuation.definition.comment.python, source.python, string.regexp.quoted.multi.python - Start of group 'key' : comment.line.number-sign.python, meta.function-call.arguments.python, meta.function-call.python, meta.named.regexp, source.python, string.regexp.quoted.multi.python - : meta.function-call.arguments.python, meta.function-call.python, meta.named.regexp, source.python, string.regexp.quoted.multi.python -[ : constant.other.set.regexp, meta.character.set.regexp, meta.function-call.arguments.python, meta.function-call.python, meta.named.regexp, punctuation.character.set.begin.regexp, source.python, string.regexp.quoted.multi.python -""" : meta.function-call.arguments.python, meta.function-call.python, punctuation.definition.string.end.python, source.python, string.regexp.quoted.multi.python - : meta.function-call.arguments.python, meta.function-call.python, source.python -+ : keyword.operator.arithmetic.python, meta.function-call.arguments.python, meta.function-call.python, source.python - : meta.function-call.arguments.python, meta.function-call.python, source.python -_LegalKeyChars : meta.function-call.arguments.python, meta.function-call.python, source.python - : meta.function-call.arguments.python, meta.function-call.python, source.python -+ : keyword.operator.arithmetic.python, meta.function-call.arguments.python, meta.function-call.python, source.python - : meta.function-call.arguments.python, meta.function-call.python, source.python -r : meta.function-call.arguments.python, meta.function-call.python, source.python, storage.type.string.python, string.regexp.quoted.multi.python -""" : meta.function-call.arguments.python, meta.function-call.python, punctuation.definition.string.begin.python, source.python, string.regexp.quoted.multi.python -] : meta.function-call.arguments.python, meta.function-call.python, source.python, string.regexp.quoted.multi.python -+? : keyword.operator.quantifier.regexp, meta.function-call.arguments.python, meta.function-call.python, source.python, string.regexp.quoted.multi.python - : meta.function-call.arguments.python, meta.function-call.python, source.python, string.regexp.quoted.multi.python -# : comment.line.number-sign.python, meta.function-call.arguments.python, meta.function-call.python, punctuation.definition.comment.python, source.python, string.regexp.quoted.multi.python - Any word of at least one letter : comment.line.number-sign.python, meta.function-call.arguments.python, meta.function-call.python, source.python, string.regexp.quoted.multi.python - ) : meta.function-call.arguments.python, meta.function-call.python, source.python, string.regexp.quoted.multi.python -# : comment.line.number-sign.python, meta.function-call.arguments.python, meta.function-call.python, punctuation.definition.comment.python, source.python, string.regexp.quoted.multi.python - End of group 'key' : comment.line.number-sign.python, meta.function-call.arguments.python, meta.function-call.python, source.python, string.regexp.quoted.multi.python - : meta.function-call.arguments.python, meta.function-call.python, source.python, string.regexp.quoted.multi.python -( : meta.function-call.arguments.python, meta.function-call.python, punctuation.parenthesis.begin.regexp, source.python, string.regexp.quoted.multi.python, support.other.parenthesis.regexp - : meta.function-call.arguments.python, meta.function-call.python, source.python, string.regexp.quoted.multi.python -# : comment.line.number-sign.python, meta.function-call.arguments.python, meta.function-call.python, punctuation.definition.comment.python, source.python, string.regexp.quoted.multi.python - Optional group: there may not be a value. : comment.line.number-sign.python, meta.function-call.arguments.python, meta.function-call.python, source.python, string.regexp.quoted.multi.python - : meta.function-call.arguments.python, meta.function-call.python, source.python, string.regexp.quoted.multi.python -\s : meta.function-call.arguments.python, meta.function-call.python, source.python, string.regexp.quoted.multi.python, support.other.escape.special.regexp -* : keyword.operator.quantifier.regexp, meta.function-call.arguments.python, meta.function-call.python, source.python, string.regexp.quoted.multi.python -= : meta.function-call.arguments.python, meta.function-call.python, source.python, string.regexp.quoted.multi.python -\s : meta.function-call.arguments.python, meta.function-call.python, source.python, string.regexp.quoted.multi.python, support.other.escape.special.regexp -* : keyword.operator.quantifier.regexp, meta.function-call.arguments.python, meta.function-call.python, source.python, string.regexp.quoted.multi.python - : meta.function-call.arguments.python, meta.function-call.python, source.python, string.regexp.quoted.multi.python -# : comment.line.number-sign.python, meta.function-call.arguments.python, meta.function-call.python, punctuation.definition.comment.python, source.python, string.regexp.quoted.multi.python - Equal Sign : comment.line.number-sign.python, meta.function-call.arguments.python, meta.function-call.python, source.python, string.regexp.quoted.multi.python - : meta.function-call.arguments.python, meta.function-call.python, source.python, string.regexp.quoted.multi.python -( : meta.function-call.arguments.python, meta.function-call.python, meta.named.regexp, punctuation.parenthesis.named.begin.regexp, source.python, string.regexp.quoted.multi.python, support.other.parenthesis.regexp -?P : entity.name.tag.named.group.regexp, meta.function-call.arguments.python, meta.function-call.python, meta.named.regexp, source.python, string.regexp.quoted.multi.python - : meta.function-call.arguments.python, meta.function-call.python, meta.named.regexp, source.python, string.regexp.quoted.multi.python -# : comment.line.number-sign.python, meta.function-call.arguments.python, meta.function-call.python, meta.named.regexp, punctuation.definition.comment.python, source.python, string.regexp.quoted.multi.python - Start of group 'val' : comment.line.number-sign.python, meta.function-call.arguments.python, meta.function-call.python, meta.named.regexp, source.python, string.regexp.quoted.multi.python - " : meta.function-call.arguments.python, meta.function-call.python, meta.named.regexp, source.python, string.regexp.quoted.multi.python -(?: : meta.function-call.arguments.python, meta.function-call.python, meta.named.regexp, punctuation.parenthesis.non-capturing.begin.regexp, source.python, string.regexp.quoted.multi.python, support.other.parenthesis.regexp -[ : constant.other.set.regexp, meta.character.set.regexp, meta.function-call.arguments.python, meta.function-call.python, meta.named.regexp, punctuation.character.set.begin.regexp, source.python, string.regexp.quoted.multi.python -^ : keyword.operator.negation.regexp, meta.character.set.regexp, meta.function-call.arguments.python, meta.function-call.python, meta.named.regexp, source.python, string.regexp.quoted.multi.python -\\ : constant.character.escape.regexp, meta.character.set.regexp, meta.function-call.arguments.python, meta.function-call.python, meta.named.regexp, source.python, string.regexp.quoted.multi.python -" : constant.character.set.regexp, meta.character.set.regexp, meta.function-call.arguments.python, meta.function-call.python, meta.named.regexp, source.python, string.regexp.quoted.multi.python -] : constant.other.set.regexp, meta.character.set.regexp, meta.function-call.arguments.python, meta.function-call.python, meta.named.regexp, punctuation.character.set.end.regexp, source.python, string.regexp.quoted.multi.python -| : keyword.operator.disjunction.regexp, meta.function-call.arguments.python, meta.function-call.python, meta.named.regexp, source.python, string.regexp.quoted.multi.python -\\ : constant.character.escape.regexp, meta.function-call.arguments.python, meta.function-call.python, meta.named.regexp, source.python, string.regexp.quoted.multi.python -. : meta.function-call.arguments.python, meta.function-call.python, meta.named.regexp, source.python, string.regexp.quoted.multi.python, support.other.match.any.regexp -) : meta.function-call.arguments.python, meta.function-call.python, meta.named.regexp, punctuation.parenthesis.non-capturing.end.regexp, source.python, string.regexp.quoted.multi.python, support.other.parenthesis.regexp -* : keyword.operator.quantifier.regexp, meta.function-call.arguments.python, meta.function-call.python, meta.named.regexp, source.python, string.regexp.quoted.multi.python -" : meta.function-call.arguments.python, meta.function-call.python, meta.named.regexp, source.python, string.regexp.quoted.multi.python -# : comment.line.number-sign.python, meta.function-call.arguments.python, meta.function-call.python, meta.named.regexp, punctuation.definition.comment.python, source.python, string.regexp.quoted.multi.python - Any doublequoted string : comment.line.number-sign.python, meta.function-call.arguments.python, meta.function-call.python, meta.named.regexp, source.python, string.regexp.quoted.multi.python - : meta.function-call.arguments.python, meta.function-call.python, meta.named.regexp, source.python, string.regexp.quoted.multi.python -| : keyword.operator.disjunction.regexp, meta.function-call.arguments.python, meta.function-call.python, meta.named.regexp, source.python, string.regexp.quoted.multi.python - : meta.function-call.arguments.python, meta.function-call.python, meta.named.regexp, source.python, string.regexp.quoted.multi.python -# : comment.line.number-sign.python, meta.function-call.arguments.python, meta.function-call.python, meta.named.regexp, punctuation.definition.comment.python, source.python, string.regexp.quoted.multi.python - or : comment.line.number-sign.python, meta.function-call.arguments.python, meta.function-call.python, meta.named.regexp, source.python, string.regexp.quoted.multi.python - : meta.function-call.arguments.python, meta.function-call.python, meta.named.regexp, source.python, string.regexp.quoted.multi.python -\w : meta.function-call.arguments.python, meta.function-call.python, meta.named.regexp, source.python, string.regexp.quoted.multi.python, support.other.escape.special.regexp -{3} : keyword.operator.quantifier.regexp, meta.function-call.arguments.python, meta.function-call.python, meta.named.regexp, source.python, string.regexp.quoted.multi.python -, : meta.function-call.arguments.python, meta.function-call.python, meta.named.regexp, source.python, string.regexp.quoted.multi.python -\s : meta.function-call.arguments.python, meta.function-call.python, meta.named.regexp, source.python, string.regexp.quoted.multi.python, support.other.escape.special.regexp -[ : constant.other.set.regexp, meta.character.set.regexp, meta.function-call.arguments.python, meta.function-call.python, meta.named.regexp, punctuation.character.set.begin.regexp, source.python, string.regexp.quoted.multi.python -\w : meta.character.set.regexp, meta.function-call.arguments.python, meta.function-call.python, meta.named.regexp, source.python, string.regexp.quoted.multi.python, support.other.escape.special.regexp -\d : meta.character.set.regexp, meta.function-call.arguments.python, meta.function-call.python, meta.named.regexp, source.python, string.regexp.quoted.multi.python, support.other.escape.special.regexp -\s : meta.character.set.regexp, meta.function-call.arguments.python, meta.function-call.python, meta.named.regexp, source.python, string.regexp.quoted.multi.python, support.other.escape.special.regexp -- : constant.character.set.regexp, meta.character.set.regexp, meta.function-call.arguments.python, meta.function-call.python, meta.named.regexp, source.python, string.regexp.quoted.multi.python -] : constant.other.set.regexp, meta.character.set.regexp, meta.function-call.arguments.python, meta.function-call.python, meta.named.regexp, punctuation.character.set.end.regexp, source.python, string.regexp.quoted.multi.python -{9,11} : keyword.operator.quantifier.regexp, meta.function-call.arguments.python, meta.function-call.python, meta.named.regexp, source.python, string.regexp.quoted.multi.python -\s : meta.function-call.arguments.python, meta.function-call.python, meta.named.regexp, source.python, string.regexp.quoted.multi.python, support.other.escape.special.regexp -[ : constant.other.set.regexp, meta.character.set.regexp, meta.function-call.arguments.python, meta.function-call.python, meta.named.regexp, punctuation.character.set.begin.regexp, source.python, string.regexp.quoted.multi.python -\d : meta.character.set.regexp, meta.function-call.arguments.python, meta.function-call.python, meta.named.regexp, source.python, string.regexp.quoted.multi.python, support.other.escape.special.regexp -: : constant.character.set.regexp, meta.character.set.regexp, meta.function-call.arguments.python, meta.function-call.python, meta.named.regexp, source.python, string.regexp.quoted.multi.python -] : constant.other.set.regexp, meta.character.set.regexp, meta.function-call.arguments.python, meta.function-call.python, meta.named.regexp, punctuation.character.set.end.regexp, source.python, string.regexp.quoted.multi.python -{8} : keyword.operator.quantifier.regexp, meta.function-call.arguments.python, meta.function-call.python, meta.named.regexp, source.python, string.regexp.quoted.multi.python -\s : meta.function-call.arguments.python, meta.function-call.python, meta.named.regexp, source.python, string.regexp.quoted.multi.python, support.other.escape.special.regexp -GMT : meta.function-call.arguments.python, meta.function-call.python, meta.named.regexp, source.python, string.regexp.quoted.multi.python -# : comment.line.number-sign.python, meta.function-call.arguments.python, meta.function-call.python, meta.named.regexp, punctuation.definition.comment.python, source.python, string.regexp.quoted.multi.python - Special case for "expires" attr : comment.line.number-sign.python, meta.function-call.arguments.python, meta.function-call.python, meta.named.regexp, source.python, string.regexp.quoted.multi.python - : meta.function-call.arguments.python, meta.function-call.python, meta.named.regexp, source.python, string.regexp.quoted.multi.python -| : keyword.operator.disjunction.regexp, meta.function-call.arguments.python, meta.function-call.python, meta.named.regexp, source.python, string.regexp.quoted.multi.python - : meta.function-call.arguments.python, meta.function-call.python, meta.named.regexp, source.python, string.regexp.quoted.multi.python -# : comment.line.number-sign.python, meta.function-call.arguments.python, meta.function-call.python, meta.named.regexp, punctuation.definition.comment.python, source.python, string.regexp.quoted.multi.python - or : comment.line.number-sign.python, meta.function-call.arguments.python, meta.function-call.python, meta.named.regexp, source.python, string.regexp.quoted.multi.python - : meta.function-call.arguments.python, meta.function-call.python, meta.named.regexp, source.python, string.regexp.quoted.multi.python -[ : constant.other.set.regexp, meta.character.set.regexp, meta.function-call.arguments.python, meta.function-call.python, meta.named.regexp, punctuation.character.set.begin.regexp, source.python, string.regexp.quoted.multi.python -""" : meta.function-call.arguments.python, meta.function-call.python, punctuation.definition.string.end.python, source.python, string.regexp.quoted.multi.python - : meta.function-call.arguments.python, meta.function-call.python, source.python -+ : keyword.operator.arithmetic.python, meta.function-call.arguments.python, meta.function-call.python, source.python - : meta.function-call.arguments.python, meta.function-call.python, source.python -_LegalValueChars : meta.function-call.arguments.python, meta.function-call.python, source.python - : meta.function-call.arguments.python, meta.function-call.python, source.python -+ : keyword.operator.arithmetic.python, meta.function-call.arguments.python, meta.function-call.python, source.python - : meta.function-call.arguments.python, meta.function-call.python, source.python -r : meta.function-call.arguments.python, meta.function-call.python, source.python, storage.type.string.python, string.regexp.quoted.multi.python -""" : meta.function-call.arguments.python, meta.function-call.python, punctuation.definition.string.begin.python, source.python, string.regexp.quoted.multi.python -] : meta.function-call.arguments.python, meta.function-call.python, source.python, string.regexp.quoted.multi.python -* : keyword.operator.quantifier.regexp, meta.function-call.arguments.python, meta.function-call.python, source.python, string.regexp.quoted.multi.python - : meta.function-call.arguments.python, meta.function-call.python, source.python, string.regexp.quoted.multi.python -# : comment.line.number-sign.python, meta.function-call.arguments.python, meta.function-call.python, punctuation.definition.comment.python, source.python, string.regexp.quoted.multi.python - Any word or empty string : comment.line.number-sign.python, meta.function-call.arguments.python, meta.function-call.python, source.python, string.regexp.quoted.multi.python - ) : meta.function-call.arguments.python, meta.function-call.python, source.python, string.regexp.quoted.multi.python -# : comment.line.number-sign.python, meta.function-call.arguments.python, meta.function-call.python, punctuation.definition.comment.python, source.python, string.regexp.quoted.multi.python - End of group 'val' : comment.line.number-sign.python, meta.function-call.arguments.python, meta.function-call.python, source.python, string.regexp.quoted.multi.python - ) : meta.function-call.arguments.python, meta.function-call.python, source.python, string.regexp.quoted.multi.python -? : keyword.operator.quantifier.regexp, meta.function-call.arguments.python, meta.function-call.python, source.python, string.regexp.quoted.multi.python - : meta.function-call.arguments.python, meta.function-call.python, source.python, string.regexp.quoted.multi.python -# : comment.line.number-sign.python, meta.function-call.arguments.python, meta.function-call.python, punctuation.definition.comment.python, source.python, string.regexp.quoted.multi.python - End of optional value group : comment.line.number-sign.python, meta.function-call.arguments.python, meta.function-call.python, source.python, string.regexp.quoted.multi.python - : meta.function-call.arguments.python, meta.function-call.python, source.python, string.regexp.quoted.multi.python -\s : meta.function-call.arguments.python, meta.function-call.python, source.python, string.regexp.quoted.multi.python, support.other.escape.special.regexp -* : keyword.operator.quantifier.regexp, meta.function-call.arguments.python, meta.function-call.python, source.python, string.regexp.quoted.multi.python - : meta.function-call.arguments.python, meta.function-call.python, source.python, string.regexp.quoted.multi.python -# : comment.line.number-sign.python, meta.function-call.arguments.python, meta.function-call.python, punctuation.definition.comment.python, source.python, string.regexp.quoted.multi.python - Any number of spaces. : comment.line.number-sign.python, meta.function-call.arguments.python, meta.function-call.python, source.python, string.regexp.quoted.multi.python - : meta.function-call.arguments.python, meta.function-call.python, source.python, string.regexp.quoted.multi.python -( : meta.function-call.arguments.python, meta.function-call.python, punctuation.parenthesis.begin.regexp, source.python, string.regexp.quoted.multi.python, support.other.parenthesis.regexp -\s : meta.function-call.arguments.python, meta.function-call.python, source.python, string.regexp.quoted.multi.python, support.other.escape.special.regexp -+ : keyword.operator.quantifier.regexp, meta.function-call.arguments.python, meta.function-call.python, source.python, string.regexp.quoted.multi.python -| : keyword.operator.disjunction.regexp, meta.function-call.arguments.python, meta.function-call.python, source.python, string.regexp.quoted.multi.python -; : meta.function-call.arguments.python, meta.function-call.python, source.python, string.regexp.quoted.multi.python -| : keyword.operator.disjunction.regexp, meta.function-call.arguments.python, meta.function-call.python, source.python, string.regexp.quoted.multi.python -$ : meta.function-call.arguments.python, meta.function-call.python, source.python, string.regexp.quoted.multi.python, support.other.match.end.regexp -) : meta.function-call.arguments.python, meta.function-call.python, punctuation.parenthesis.end.regexp, source.python, string.regexp.quoted.multi.python, support.other.parenthesis.regexp - : meta.function-call.arguments.python, meta.function-call.python, source.python, string.regexp.quoted.multi.python -# : comment.line.number-sign.python, meta.function-call.arguments.python, meta.function-call.python, punctuation.definition.comment.python, source.python, string.regexp.quoted.multi.python - Ending either at space, semicolon, or EOS. : comment.line.number-sign.python, meta.function-call.arguments.python, meta.function-call.python, source.python, string.regexp.quoted.multi.python - : meta.function-call.arguments.python, meta.function-call.python, source.python, string.regexp.quoted.multi.python -""" : meta.function-call.arguments.python, meta.function-call.python, punctuation.definition.string.end.python, source.python, string.regexp.quoted.multi.python -, : meta.function-call.arguments.python, meta.function-call.python, punctuation.separator.arguments.python, source.python - : meta.function-call.arguments.python, meta.function-call.python, source.python -re : meta.function-call.arguments.python, meta.function-call.python, source.python -. : meta.function-call.arguments.python, meta.function-call.python, punctuation.separator.period.python, source.python -ASCII : constant.other.caps.python, meta.function-call.arguments.python, meta.function-call.python, source.python -) : meta.function-call.python, punctuation.definition.arguments.end.python, source.python +. : meta.member.access.python, punctuation.separator.period.python, source.python +compile : meta.function-call.generic.python, meta.function-call.python, meta.member.access.python, source.python +( : meta.function-call.python, meta.member.access.python, punctuation.definition.arguments.begin.python, source.python +r : meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, source.python, storage.type.string.python, string.regexp.quoted.multi.python +""" : meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, punctuation.definition.string.begin.python, source.python, string.regexp.quoted.multi.python + : meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, source.python, string.regexp.quoted.multi.python +(?x) : meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, source.python, storage.modifier.flag.regexp, string.regexp.quoted.multi.python + : meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, source.python, string.regexp.quoted.multi.python +# : comment.line.number-sign.python, meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, punctuation.definition.comment.python, source.python, string.regexp.quoted.multi.python + This is a verbose pattern : comment.line.number-sign.python, meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, source.python, string.regexp.quoted.multi.python + : meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, source.python, string.regexp.quoted.multi.python +\s : meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, source.python, string.regexp.quoted.multi.python, support.other.escape.special.regexp +* : keyword.operator.quantifier.regexp, meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, source.python, string.regexp.quoted.multi.python + : meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, source.python, string.regexp.quoted.multi.python +# : comment.line.number-sign.python, meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, punctuation.definition.comment.python, source.python, string.regexp.quoted.multi.python + Optional whitespace at start of cookie : comment.line.number-sign.python, meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, source.python, string.regexp.quoted.multi.python + : meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, source.python, string.regexp.quoted.multi.python +( : meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, meta.named.regexp, punctuation.parenthesis.named.begin.regexp, source.python, string.regexp.quoted.multi.python, support.other.parenthesis.regexp +?P : entity.name.tag.named.group.regexp, meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, meta.named.regexp, source.python, string.regexp.quoted.multi.python + : meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, meta.named.regexp, source.python, string.regexp.quoted.multi.python +# : comment.line.number-sign.python, meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, meta.named.regexp, punctuation.definition.comment.python, source.python, string.regexp.quoted.multi.python + Start of group 'key' : comment.line.number-sign.python, meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, meta.named.regexp, source.python, string.regexp.quoted.multi.python + : meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, meta.named.regexp, source.python, string.regexp.quoted.multi.python +[ : constant.other.set.regexp, meta.character.set.regexp, meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, meta.named.regexp, punctuation.character.set.begin.regexp, source.python, string.regexp.quoted.multi.python +""" : meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, punctuation.definition.string.end.python, source.python, string.regexp.quoted.multi.python + : meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, source.python ++ : keyword.operator.arithmetic.python, meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, source.python + : meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, source.python +_LegalKeyChars : meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, source.python + : meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, source.python ++ : keyword.operator.arithmetic.python, meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, source.python + : meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, source.python +r : meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, source.python, storage.type.string.python, string.regexp.quoted.multi.python +""" : meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, punctuation.definition.string.begin.python, source.python, string.regexp.quoted.multi.python +] : meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, source.python, string.regexp.quoted.multi.python ++? : keyword.operator.quantifier.regexp, meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, source.python, string.regexp.quoted.multi.python + : meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, source.python, string.regexp.quoted.multi.python +# : comment.line.number-sign.python, meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, punctuation.definition.comment.python, source.python, string.regexp.quoted.multi.python + Any word of at least one letter : comment.line.number-sign.python, meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, source.python, string.regexp.quoted.multi.python + ) : meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, source.python, string.regexp.quoted.multi.python +# : comment.line.number-sign.python, meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, punctuation.definition.comment.python, source.python, string.regexp.quoted.multi.python + End of group 'key' : comment.line.number-sign.python, meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, source.python, string.regexp.quoted.multi.python + : meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, source.python, string.regexp.quoted.multi.python +( : meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, punctuation.parenthesis.begin.regexp, source.python, string.regexp.quoted.multi.python, support.other.parenthesis.regexp + : meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, source.python, string.regexp.quoted.multi.python +# : comment.line.number-sign.python, meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, punctuation.definition.comment.python, source.python, string.regexp.quoted.multi.python + Optional group: there may not be a value. : comment.line.number-sign.python, meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, source.python, string.regexp.quoted.multi.python + : meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, source.python, string.regexp.quoted.multi.python +\s : meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, source.python, string.regexp.quoted.multi.python, support.other.escape.special.regexp +* : keyword.operator.quantifier.regexp, meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, source.python, string.regexp.quoted.multi.python += : meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, source.python, string.regexp.quoted.multi.python +\s : meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, source.python, string.regexp.quoted.multi.python, support.other.escape.special.regexp +* : keyword.operator.quantifier.regexp, meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, source.python, string.regexp.quoted.multi.python + : meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, source.python, string.regexp.quoted.multi.python +# : comment.line.number-sign.python, meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, punctuation.definition.comment.python, source.python, string.regexp.quoted.multi.python + Equal Sign : comment.line.number-sign.python, meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, source.python, string.regexp.quoted.multi.python + : meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, source.python, string.regexp.quoted.multi.python +( : meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, meta.named.regexp, punctuation.parenthesis.named.begin.regexp, source.python, string.regexp.quoted.multi.python, support.other.parenthesis.regexp +?P : entity.name.tag.named.group.regexp, meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, meta.named.regexp, source.python, string.regexp.quoted.multi.python + : meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, meta.named.regexp, source.python, string.regexp.quoted.multi.python +# : comment.line.number-sign.python, meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, meta.named.regexp, punctuation.definition.comment.python, source.python, string.regexp.quoted.multi.python + Start of group 'val' : comment.line.number-sign.python, meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, meta.named.regexp, source.python, string.regexp.quoted.multi.python + " : meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, meta.named.regexp, source.python, string.regexp.quoted.multi.python +(?: : meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, meta.named.regexp, punctuation.parenthesis.non-capturing.begin.regexp, source.python, string.regexp.quoted.multi.python, support.other.parenthesis.regexp +[ : constant.other.set.regexp, meta.character.set.regexp, meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, meta.named.regexp, punctuation.character.set.begin.regexp, source.python, string.regexp.quoted.multi.python +^ : keyword.operator.negation.regexp, meta.character.set.regexp, meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, meta.named.regexp, source.python, string.regexp.quoted.multi.python +\\ : constant.character.escape.regexp, meta.character.set.regexp, meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, meta.named.regexp, source.python, string.regexp.quoted.multi.python +" : constant.character.set.regexp, meta.character.set.regexp, meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, meta.named.regexp, source.python, string.regexp.quoted.multi.python +] : constant.other.set.regexp, meta.character.set.regexp, meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, meta.named.regexp, punctuation.character.set.end.regexp, source.python, string.regexp.quoted.multi.python +| : keyword.operator.disjunction.regexp, meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, meta.named.regexp, source.python, string.regexp.quoted.multi.python +\\ : constant.character.escape.regexp, meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, meta.named.regexp, source.python, string.regexp.quoted.multi.python +. : meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, meta.named.regexp, source.python, string.regexp.quoted.multi.python, support.other.match.any.regexp +) : meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, meta.named.regexp, punctuation.parenthesis.non-capturing.end.regexp, source.python, string.regexp.quoted.multi.python, support.other.parenthesis.regexp +* : keyword.operator.quantifier.regexp, meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, meta.named.regexp, source.python, string.regexp.quoted.multi.python +" : meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, meta.named.regexp, source.python, string.regexp.quoted.multi.python +# : comment.line.number-sign.python, meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, meta.named.regexp, punctuation.definition.comment.python, source.python, string.regexp.quoted.multi.python + Any doublequoted string : comment.line.number-sign.python, meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, meta.named.regexp, source.python, string.regexp.quoted.multi.python + : meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, meta.named.regexp, source.python, string.regexp.quoted.multi.python +| : keyword.operator.disjunction.regexp, meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, meta.named.regexp, source.python, string.regexp.quoted.multi.python + : meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, meta.named.regexp, source.python, string.regexp.quoted.multi.python +# : comment.line.number-sign.python, meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, meta.named.regexp, punctuation.definition.comment.python, source.python, string.regexp.quoted.multi.python + or : comment.line.number-sign.python, meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, meta.named.regexp, source.python, string.regexp.quoted.multi.python + : meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, meta.named.regexp, source.python, string.regexp.quoted.multi.python +\w : meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, meta.named.regexp, source.python, string.regexp.quoted.multi.python, support.other.escape.special.regexp +{3} : keyword.operator.quantifier.regexp, meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, meta.named.regexp, source.python, string.regexp.quoted.multi.python +, : meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, meta.named.regexp, source.python, string.regexp.quoted.multi.python +\s : meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, meta.named.regexp, source.python, string.regexp.quoted.multi.python, support.other.escape.special.regexp +[ : constant.other.set.regexp, meta.character.set.regexp, meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, meta.named.regexp, punctuation.character.set.begin.regexp, source.python, string.regexp.quoted.multi.python +\w : meta.character.set.regexp, meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, meta.named.regexp, source.python, string.regexp.quoted.multi.python, support.other.escape.special.regexp +\d : meta.character.set.regexp, meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, meta.named.regexp, source.python, string.regexp.quoted.multi.python, support.other.escape.special.regexp +\s : meta.character.set.regexp, meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, meta.named.regexp, source.python, string.regexp.quoted.multi.python, support.other.escape.special.regexp +- : constant.character.set.regexp, meta.character.set.regexp, meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, meta.named.regexp, source.python, string.regexp.quoted.multi.python +] : constant.other.set.regexp, meta.character.set.regexp, meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, meta.named.regexp, punctuation.character.set.end.regexp, source.python, string.regexp.quoted.multi.python +{9,11} : keyword.operator.quantifier.regexp, meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, meta.named.regexp, source.python, string.regexp.quoted.multi.python +\s : meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, meta.named.regexp, source.python, string.regexp.quoted.multi.python, support.other.escape.special.regexp +[ : constant.other.set.regexp, meta.character.set.regexp, meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, meta.named.regexp, punctuation.character.set.begin.regexp, source.python, string.regexp.quoted.multi.python +\d : meta.character.set.regexp, meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, meta.named.regexp, source.python, string.regexp.quoted.multi.python, support.other.escape.special.regexp +: : constant.character.set.regexp, meta.character.set.regexp, meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, meta.named.regexp, source.python, string.regexp.quoted.multi.python +] : constant.other.set.regexp, meta.character.set.regexp, meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, meta.named.regexp, punctuation.character.set.end.regexp, source.python, string.regexp.quoted.multi.python +{8} : keyword.operator.quantifier.regexp, meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, meta.named.regexp, source.python, string.regexp.quoted.multi.python +\s : meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, meta.named.regexp, source.python, string.regexp.quoted.multi.python, support.other.escape.special.regexp +GMT : meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, meta.named.regexp, source.python, string.regexp.quoted.multi.python +# : comment.line.number-sign.python, meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, meta.named.regexp, punctuation.definition.comment.python, source.python, string.regexp.quoted.multi.python + Special case for "expires" attr : comment.line.number-sign.python, meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, meta.named.regexp, source.python, string.regexp.quoted.multi.python + : meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, meta.named.regexp, source.python, string.regexp.quoted.multi.python +| : keyword.operator.disjunction.regexp, meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, meta.named.regexp, source.python, string.regexp.quoted.multi.python + : meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, meta.named.regexp, source.python, string.regexp.quoted.multi.python +# : comment.line.number-sign.python, meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, meta.named.regexp, punctuation.definition.comment.python, source.python, string.regexp.quoted.multi.python + or : comment.line.number-sign.python, meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, meta.named.regexp, source.python, string.regexp.quoted.multi.python + : meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, meta.named.regexp, source.python, string.regexp.quoted.multi.python +[ : constant.other.set.regexp, meta.character.set.regexp, meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, meta.named.regexp, punctuation.character.set.begin.regexp, source.python, string.regexp.quoted.multi.python +""" : meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, punctuation.definition.string.end.python, source.python, string.regexp.quoted.multi.python + : meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, source.python ++ : keyword.operator.arithmetic.python, meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, source.python + : meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, source.python +_LegalValueChars : meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, source.python + : meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, source.python ++ : keyword.operator.arithmetic.python, meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, source.python + : meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, source.python +r : meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, source.python, storage.type.string.python, string.regexp.quoted.multi.python +""" : meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, punctuation.definition.string.begin.python, source.python, string.regexp.quoted.multi.python +] : meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, source.python, string.regexp.quoted.multi.python +* : keyword.operator.quantifier.regexp, meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, source.python, string.regexp.quoted.multi.python + : meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, source.python, string.regexp.quoted.multi.python +# : comment.line.number-sign.python, meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, punctuation.definition.comment.python, source.python, string.regexp.quoted.multi.python + Any word or empty string : comment.line.number-sign.python, meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, source.python, string.regexp.quoted.multi.python + ) : meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, source.python, string.regexp.quoted.multi.python +# : comment.line.number-sign.python, meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, punctuation.definition.comment.python, source.python, string.regexp.quoted.multi.python + End of group 'val' : comment.line.number-sign.python, meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, source.python, string.regexp.quoted.multi.python + ) : meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, source.python, string.regexp.quoted.multi.python +? : keyword.operator.quantifier.regexp, meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, source.python, string.regexp.quoted.multi.python + : meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, source.python, string.regexp.quoted.multi.python +# : comment.line.number-sign.python, meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, punctuation.definition.comment.python, source.python, string.regexp.quoted.multi.python + End of optional value group : comment.line.number-sign.python, meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, source.python, string.regexp.quoted.multi.python + : meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, source.python, string.regexp.quoted.multi.python +\s : meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, source.python, string.regexp.quoted.multi.python, support.other.escape.special.regexp +* : keyword.operator.quantifier.regexp, meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, source.python, string.regexp.quoted.multi.python + : meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, source.python, string.regexp.quoted.multi.python +# : comment.line.number-sign.python, meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, punctuation.definition.comment.python, source.python, string.regexp.quoted.multi.python + Any number of spaces. : comment.line.number-sign.python, meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, source.python, string.regexp.quoted.multi.python + : meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, source.python, string.regexp.quoted.multi.python +( : meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, punctuation.parenthesis.begin.regexp, source.python, string.regexp.quoted.multi.python, support.other.parenthesis.regexp +\s : meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, source.python, string.regexp.quoted.multi.python, support.other.escape.special.regexp ++ : keyword.operator.quantifier.regexp, meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, source.python, string.regexp.quoted.multi.python +| : keyword.operator.disjunction.regexp, meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, source.python, string.regexp.quoted.multi.python +; : meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, source.python, string.regexp.quoted.multi.python +| : keyword.operator.disjunction.regexp, meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, source.python, string.regexp.quoted.multi.python +$ : meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, source.python, string.regexp.quoted.multi.python, support.other.match.end.regexp +) : meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, punctuation.parenthesis.end.regexp, source.python, string.regexp.quoted.multi.python, support.other.parenthesis.regexp + : meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, source.python, string.regexp.quoted.multi.python +# : comment.line.number-sign.python, meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, punctuation.definition.comment.python, source.python, string.regexp.quoted.multi.python + Ending either at space, semicolon, or EOS. : comment.line.number-sign.python, meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, source.python, string.regexp.quoted.multi.python + : meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, source.python, string.regexp.quoted.multi.python +""" : meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, punctuation.definition.string.end.python, source.python, string.regexp.quoted.multi.python +, : meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, punctuation.separator.arguments.python, source.python + : meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, source.python +re : meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, source.python +. : meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, punctuation.separator.period.python, source.python +ASCII : constant.other.caps.python, meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, source.python +) : meta.function-call.python, meta.member.access.python, punctuation.definition.arguments.end.python, source.python : source.python # : comment.line.number-sign.python, punctuation.definition.comment.python, source.python May be removed if safe. : comment.line.number-sign.python, source.python diff --git a/test/statements/annotation1.py b/test/statements/annotation1.py index a72bafc6..332cd26a 100644 --- a/test/statements/annotation1.py +++ b/test/statements/annotation1.py @@ -3,6 +3,7 @@ + some_number : source.python : : punctuation.separator.colon.python, source.python : source.python @@ -13,7 +14,7 @@ some_list : source.python : : punctuation.separator.colon.python, source.python : source.python -List : meta.item-access.python, source.python +List : meta.indexed-name.python, meta.item-access.python, source.python [ : meta.item-access.python, punctuation.definition.arguments.begin.python, source.python int : meta.item-access.arguments.python, meta.item-access.python, source.python, support.type.python ] : meta.item-access.python, punctuation.definition.arguments.end.python, source.python diff --git a/test/statements/for1.py b/test/statements/for1.py index 3300f8cb..b379ef19 100644 --- a/test/statements/for1.py +++ b/test/statements/for1.py @@ -15,7 +15,7 @@ : source.python c : source.python : source.python -in : keyword.operator.logical.python, source.python +in : keyword.control.flow.python, source.python : source.python b : source.python : : punctuation.separator.colon.python, source.python diff --git a/test/statements/for2.py b/test/statements/for2.py new file mode 100644 index 00000000..8468e08e --- /dev/null +++ b/test/statements/for2.py @@ -0,0 +1,44 @@ +forvariable = None +for a, b, c, invariable in [2 in q, 2 in w]: + pass + + + + +forvariable : source.python + : source.python += : keyword.operator.assignment.python, source.python + : source.python +None : constant.language.python, source.python +for : keyword.control.flow.python, source.python + : source.python +a : source.python +, : punctuation.separator.element.python, source.python + : source.python +b : source.python +, : punctuation.separator.element.python, source.python + : source.python +c : source.python +, : punctuation.separator.element.python, source.python + : source.python +invariable : source.python + : source.python +in : keyword.control.flow.python, source.python + : source.python +[ : punctuation.definition.list.begin.python, source.python +2 : constant.numeric.dec.python, source.python + : source.python +in : keyword.operator.logical.python, source.python + : source.python +q : source.python +, : punctuation.separator.element.python, source.python + : source.python +2 : constant.numeric.dec.python, source.python + : source.python +in : keyword.operator.logical.python, source.python + : source.python +w : source.python +] : punctuation.definition.list.end.python, source.python +: : punctuation.separator.colon.python, source.python + : source.python +pass : keyword.control.flow.python, source.python diff --git a/test/statements/for3.py b/test/statements/for3.py new file mode 100644 index 00000000..5ebfc592 --- /dev/null +++ b/test/statements/for3.py @@ -0,0 +1,38 @@ +for(a, b), c, invariable in[2 in q, 2 in w]: + pass + + + + +for : keyword.control.flow.python, source.python +( : punctuation.parenthesis.begin.python, source.python +a : source.python +, : punctuation.separator.element.python, source.python + : source.python +b : source.python +) : punctuation.parenthesis.end.python, source.python +, : punctuation.separator.element.python, source.python + : source.python +c : source.python +, : punctuation.separator.element.python, source.python + : source.python +invariable : source.python + : source.python +in : keyword.control.flow.python, source.python +[ : punctuation.definition.list.begin.python, source.python +2 : constant.numeric.dec.python, source.python + : source.python +in : keyword.operator.logical.python, source.python + : source.python +q : source.python +, : punctuation.separator.element.python, source.python + : source.python +2 : constant.numeric.dec.python, source.python + : source.python +in : keyword.operator.logical.python, source.python + : source.python +w : source.python +] : punctuation.definition.list.end.python, source.python +: : punctuation.separator.colon.python, source.python + : source.python +pass : keyword.control.flow.python, source.python diff --git a/test/statements/import5.py b/test/statements/import5.py index 01c57822..6050a777 100644 --- a/test/statements/import5.py +++ b/test/statements/import5.py @@ -10,6 +10,7 @@ def bar(): + from : keyword.control.import.python, source.python . : punctuation.separator.period.python, source.python foo : source.python @@ -24,8 +25,8 @@ def bar(): a : source.python : source.python foo : source.python -. : punctuation.separator.period.python, source.python -import : keyword.control.import.python, source.python +. : meta.member.access.python, punctuation.separator.period.python, source.python +import : keyword.control.import.python, meta.member.access.python, source.python : source.python raise : keyword.control.flow.python, source.python : source.python diff --git a/test/statements/match1.py b/test/statements/match1.py new file mode 100644 index 00000000..f393066a --- /dev/null +++ b/test/statements/match1.py @@ -0,0 +1,61 @@ +def foo(status): + match status: + case 404: + return "Not found" + case 401 | 403: + return "Not allowed" + case _: + return "Something's wrong with the internet" + + + + +def : meta.function.python, source.python, storage.type.function.python + : meta.function.python, source.python +foo : entity.name.function.python, meta.function.python, source.python +( : meta.function.parameters.python, meta.function.python, punctuation.definition.parameters.begin.python, source.python +status : meta.function.parameters.python, meta.function.python, source.python, variable.parameter.function.language.python +) : meta.function.parameters.python, meta.function.python, punctuation.definition.parameters.end.python, source.python +: : meta.function.python, punctuation.section.function.begin.python, source.python + : source.python +match : keyword.control.flow.python, source.python + : source.python +status : source.python +: : punctuation.separator.colon.python, source.python + : source.python +case : keyword.control.flow.python, source.python + : source.python +404 : constant.numeric.dec.python, source.python +: : punctuation.separator.colon.python, source.python + : source.python +return : keyword.control.flow.python, source.python + : source.python +" : punctuation.definition.string.begin.python, source.python, string.quoted.single.python +Not found : source.python, string.quoted.single.python +" : punctuation.definition.string.end.python, source.python, string.quoted.single.python + : source.python +case : keyword.control.flow.python, source.python + : source.python +401 : constant.numeric.dec.python, source.python + : source.python +| : keyword.operator.bitwise.python, source.python + : source.python +403 : constant.numeric.dec.python, source.python +: : punctuation.separator.colon.python, source.python + : source.python +return : keyword.control.flow.python, source.python + : source.python +" : punctuation.definition.string.begin.python, source.python, string.quoted.single.python +Not allowed : source.python, string.quoted.single.python +" : punctuation.definition.string.end.python, source.python, string.quoted.single.python + : source.python +case : keyword.control.flow.python, source.python + : source.python +_ : source.python +: : punctuation.separator.colon.python, source.python + : source.python +return : keyword.control.flow.python, source.python + : source.python +" : punctuation.definition.string.begin.python, source.python, string.quoted.single.python +Something's wrong with the internet : source.python, string.quoted.single.python +" : punctuation.definition.string.end.python, source.python, string.quoted.single.python diff --git a/test/statements/match2.py b/test/statements/match2.py new file mode 100644 index 00000000..a88ba055 --- /dev/null +++ b/test/statements/match2.py @@ -0,0 +1,112 @@ +match point: + case Point(x=0, y=0): + print("Origin is the point's location.") + case Point(x=0, y=y): + print(f"The point is on the y-axis.") + case Point(x=x, y=0): + print(f"The point is on the x-axis.") + case Point(): + print("The point is located somewhere else on the plane.") + case _: + print("Not a point") + + + +match : keyword.control.flow.python, source.python + : source.python +point : source.python +: : punctuation.separator.colon.python, source.python + : source.python +case : keyword.control.flow.python, source.python + : source.python +Point : meta.function-call.generic.python, meta.function-call.python, source.python +( : meta.function-call.python, punctuation.definition.arguments.begin.python, source.python +x : meta.function-call.arguments.python, meta.function-call.python, source.python, variable.parameter.function-call.python += : keyword.operator.assignment.python, meta.function-call.arguments.python, meta.function-call.python, source.python +0 : constant.numeric.dec.python, meta.function-call.arguments.python, meta.function-call.python, source.python +, : meta.function-call.arguments.python, meta.function-call.python, punctuation.separator.arguments.python, source.python + : meta.function-call.arguments.python, meta.function-call.python, source.python +y : meta.function-call.arguments.python, meta.function-call.python, source.python, variable.parameter.function-call.python += : keyword.operator.assignment.python, meta.function-call.arguments.python, meta.function-call.python, source.python +0 : constant.numeric.dec.python, meta.function-call.arguments.python, meta.function-call.python, source.python +) : meta.function-call.python, punctuation.definition.arguments.end.python, source.python +: : punctuation.separator.colon.python, source.python + : source.python +print : meta.function-call.python, source.python, support.function.builtin.python +( : meta.function-call.python, punctuation.definition.arguments.begin.python, source.python +" : meta.function-call.arguments.python, meta.function-call.python, punctuation.definition.string.begin.python, source.python, string.quoted.single.python +Origin is the point's location. : meta.function-call.arguments.python, meta.function-call.python, source.python, string.quoted.single.python +" : meta.function-call.arguments.python, meta.function-call.python, punctuation.definition.string.end.python, source.python, string.quoted.single.python +) : meta.function-call.python, punctuation.definition.arguments.end.python, source.python + : source.python +case : keyword.control.flow.python, source.python + : source.python +Point : meta.function-call.generic.python, meta.function-call.python, source.python +( : meta.function-call.python, punctuation.definition.arguments.begin.python, source.python +x : meta.function-call.arguments.python, meta.function-call.python, source.python, variable.parameter.function-call.python += : keyword.operator.assignment.python, meta.function-call.arguments.python, meta.function-call.python, source.python +0 : constant.numeric.dec.python, meta.function-call.arguments.python, meta.function-call.python, source.python +, : meta.function-call.arguments.python, meta.function-call.python, punctuation.separator.arguments.python, source.python + : meta.function-call.arguments.python, meta.function-call.python, source.python +y : meta.function-call.arguments.python, meta.function-call.python, source.python, variable.parameter.function-call.python += : keyword.operator.assignment.python, meta.function-call.arguments.python, meta.function-call.python, source.python +y : meta.function-call.arguments.python, meta.function-call.python, source.python +) : meta.function-call.python, punctuation.definition.arguments.end.python, source.python +: : punctuation.separator.colon.python, source.python + : source.python +print : meta.function-call.python, source.python, support.function.builtin.python +( : meta.function-call.python, punctuation.definition.arguments.begin.python, source.python +f : meta.fstring.python, meta.function-call.arguments.python, meta.function-call.python, source.python, storage.type.string.python, string.interpolated.python, string.quoted.single.python +" : meta.fstring.python, meta.function-call.arguments.python, meta.function-call.python, punctuation.definition.string.begin.python, source.python, string.interpolated.python, string.quoted.single.python +The point is on the y-axis. : meta.fstring.python, meta.function-call.arguments.python, meta.function-call.python, source.python, string.interpolated.python, string.quoted.single.python +" : meta.fstring.python, meta.function-call.arguments.python, meta.function-call.python, punctuation.definition.string.end.python, source.python, string.interpolated.python, string.quoted.single.python +) : meta.function-call.python, punctuation.definition.arguments.end.python, source.python + : source.python +case : keyword.control.flow.python, source.python + : source.python +Point : meta.function-call.generic.python, meta.function-call.python, source.python +( : meta.function-call.python, punctuation.definition.arguments.begin.python, source.python +x : meta.function-call.arguments.python, meta.function-call.python, source.python, variable.parameter.function-call.python += : keyword.operator.assignment.python, meta.function-call.arguments.python, meta.function-call.python, source.python +x : meta.function-call.arguments.python, meta.function-call.python, source.python +, : meta.function-call.arguments.python, meta.function-call.python, punctuation.separator.arguments.python, source.python + : meta.function-call.arguments.python, meta.function-call.python, source.python +y : meta.function-call.arguments.python, meta.function-call.python, source.python, variable.parameter.function-call.python += : keyword.operator.assignment.python, meta.function-call.arguments.python, meta.function-call.python, source.python +0 : constant.numeric.dec.python, meta.function-call.arguments.python, meta.function-call.python, source.python +) : meta.function-call.python, punctuation.definition.arguments.end.python, source.python +: : punctuation.separator.colon.python, source.python + : source.python +print : meta.function-call.python, source.python, support.function.builtin.python +( : meta.function-call.python, punctuation.definition.arguments.begin.python, source.python +f : meta.fstring.python, meta.function-call.arguments.python, meta.function-call.python, source.python, storage.type.string.python, string.interpolated.python, string.quoted.single.python +" : meta.fstring.python, meta.function-call.arguments.python, meta.function-call.python, punctuation.definition.string.begin.python, source.python, string.interpolated.python, string.quoted.single.python +The point is on the x-axis. : meta.fstring.python, meta.function-call.arguments.python, meta.function-call.python, source.python, string.interpolated.python, string.quoted.single.python +" : meta.fstring.python, meta.function-call.arguments.python, meta.function-call.python, punctuation.definition.string.end.python, source.python, string.interpolated.python, string.quoted.single.python +) : meta.function-call.python, punctuation.definition.arguments.end.python, source.python + : source.python +case : keyword.control.flow.python, source.python + : source.python +Point : meta.function-call.generic.python, meta.function-call.python, source.python +( : meta.function-call.python, punctuation.definition.arguments.begin.python, source.python +) : meta.function-call.python, punctuation.definition.arguments.end.python, source.python +: : punctuation.separator.colon.python, source.python + : source.python +print : meta.function-call.python, source.python, support.function.builtin.python +( : meta.function-call.python, punctuation.definition.arguments.begin.python, source.python +" : meta.function-call.arguments.python, meta.function-call.python, punctuation.definition.string.begin.python, source.python, string.quoted.single.python +The point is located somewhere else on the plane. : meta.function-call.arguments.python, meta.function-call.python, source.python, string.quoted.single.python +" : meta.function-call.arguments.python, meta.function-call.python, punctuation.definition.string.end.python, source.python, string.quoted.single.python +) : meta.function-call.python, punctuation.definition.arguments.end.python, source.python + : source.python +case : keyword.control.flow.python, source.python + : source.python +_ : source.python +: : punctuation.separator.colon.python, source.python + : source.python +print : meta.function-call.python, source.python, support.function.builtin.python +( : meta.function-call.python, punctuation.definition.arguments.begin.python, source.python +" : meta.function-call.arguments.python, meta.function-call.python, punctuation.definition.string.begin.python, source.python, string.quoted.single.python +Not a point : meta.function-call.arguments.python, meta.function-call.python, source.python, string.quoted.single.python +" : meta.function-call.arguments.python, meta.function-call.python, punctuation.definition.string.end.python, source.python, string.quoted.single.python +) : meta.function-call.python, punctuation.definition.arguments.end.python, source.python diff --git a/test/statements/match3.py b/test/statements/match3.py new file mode 100644 index 00000000..ac8e176c --- /dev/null +++ b/test/statements/match3.py @@ -0,0 +1,114 @@ +match points: + case []: + print("No points in the list.") + case [Point(0, 0)]: + print("The origin is the only point in the list.") + case [Point(x, y)]: + print(f"A single point is in the list.") + case [Point(0, y1), Point(0, y2)]: + print(f"Two points on the Y axis are in the list.") + case _: + print("Something else is found in the list.") + + + +match : keyword.control.flow.python, source.python + : source.python +points : source.python +: : punctuation.separator.colon.python, source.python + : source.python +case : keyword.control.flow.python, source.python + : source.python +[ : punctuation.definition.list.begin.python, source.python +] : punctuation.definition.list.end.python, source.python +: : punctuation.separator.colon.python, source.python + : source.python +print : meta.function-call.python, source.python, support.function.builtin.python +( : meta.function-call.python, punctuation.definition.arguments.begin.python, source.python +" : meta.function-call.arguments.python, meta.function-call.python, punctuation.definition.string.begin.python, source.python, string.quoted.single.python +No points in the list. : meta.function-call.arguments.python, meta.function-call.python, source.python, string.quoted.single.python +" : meta.function-call.arguments.python, meta.function-call.python, punctuation.definition.string.end.python, source.python, string.quoted.single.python +) : meta.function-call.python, punctuation.definition.arguments.end.python, source.python + : source.python +case : keyword.control.flow.python, source.python + : source.python +[ : punctuation.definition.list.begin.python, source.python +Point : meta.function-call.generic.python, meta.function-call.python, source.python +( : meta.function-call.python, punctuation.definition.arguments.begin.python, source.python +0 : constant.numeric.dec.python, meta.function-call.arguments.python, meta.function-call.python, source.python +, : meta.function-call.arguments.python, meta.function-call.python, punctuation.separator.arguments.python, source.python + : meta.function-call.arguments.python, meta.function-call.python, source.python +0 : constant.numeric.dec.python, meta.function-call.arguments.python, meta.function-call.python, source.python +) : meta.function-call.python, punctuation.definition.arguments.end.python, source.python +] : punctuation.definition.list.end.python, source.python +: : punctuation.separator.colon.python, source.python + : source.python +print : meta.function-call.python, source.python, support.function.builtin.python +( : meta.function-call.python, punctuation.definition.arguments.begin.python, source.python +" : meta.function-call.arguments.python, meta.function-call.python, punctuation.definition.string.begin.python, source.python, string.quoted.single.python +The origin is the only point in the list. : meta.function-call.arguments.python, meta.function-call.python, source.python, string.quoted.single.python +" : meta.function-call.arguments.python, meta.function-call.python, punctuation.definition.string.end.python, source.python, string.quoted.single.python +) : meta.function-call.python, punctuation.definition.arguments.end.python, source.python + : source.python +case : keyword.control.flow.python, source.python + : source.python +[ : punctuation.definition.list.begin.python, source.python +Point : meta.function-call.generic.python, meta.function-call.python, source.python +( : meta.function-call.python, punctuation.definition.arguments.begin.python, source.python +x : meta.function-call.arguments.python, meta.function-call.python, source.python +, : meta.function-call.arguments.python, meta.function-call.python, punctuation.separator.arguments.python, source.python + : meta.function-call.arguments.python, meta.function-call.python, source.python +y : meta.function-call.arguments.python, meta.function-call.python, source.python +) : meta.function-call.python, punctuation.definition.arguments.end.python, source.python +] : punctuation.definition.list.end.python, source.python +: : punctuation.separator.colon.python, source.python + : source.python +print : meta.function-call.python, source.python, support.function.builtin.python +( : meta.function-call.python, punctuation.definition.arguments.begin.python, source.python +f : meta.fstring.python, meta.function-call.arguments.python, meta.function-call.python, source.python, storage.type.string.python, string.interpolated.python, string.quoted.single.python +" : meta.fstring.python, meta.function-call.arguments.python, meta.function-call.python, punctuation.definition.string.begin.python, source.python, string.interpolated.python, string.quoted.single.python +A single point is in the list. : meta.fstring.python, meta.function-call.arguments.python, meta.function-call.python, source.python, string.interpolated.python, string.quoted.single.python +" : meta.fstring.python, meta.function-call.arguments.python, meta.function-call.python, punctuation.definition.string.end.python, source.python, string.interpolated.python, string.quoted.single.python +) : meta.function-call.python, punctuation.definition.arguments.end.python, source.python + : source.python +case : keyword.control.flow.python, source.python + : source.python +[ : punctuation.definition.list.begin.python, source.python +Point : meta.function-call.generic.python, meta.function-call.python, source.python +( : meta.function-call.python, punctuation.definition.arguments.begin.python, source.python +0 : constant.numeric.dec.python, meta.function-call.arguments.python, meta.function-call.python, source.python +, : meta.function-call.arguments.python, meta.function-call.python, punctuation.separator.arguments.python, source.python + : meta.function-call.arguments.python, meta.function-call.python, source.python +y1 : meta.function-call.arguments.python, meta.function-call.python, source.python +) : meta.function-call.python, punctuation.definition.arguments.end.python, source.python +, : punctuation.separator.element.python, source.python + : source.python +Point : meta.function-call.generic.python, meta.function-call.python, source.python +( : meta.function-call.python, punctuation.definition.arguments.begin.python, source.python +0 : constant.numeric.dec.python, meta.function-call.arguments.python, meta.function-call.python, source.python +, : meta.function-call.arguments.python, meta.function-call.python, punctuation.separator.arguments.python, source.python + : meta.function-call.arguments.python, meta.function-call.python, source.python +y2 : meta.function-call.arguments.python, meta.function-call.python, source.python +) : meta.function-call.python, punctuation.definition.arguments.end.python, source.python +] : punctuation.definition.list.end.python, source.python +: : punctuation.separator.colon.python, source.python + : source.python +print : meta.function-call.python, source.python, support.function.builtin.python +( : meta.function-call.python, punctuation.definition.arguments.begin.python, source.python +f : meta.fstring.python, meta.function-call.arguments.python, meta.function-call.python, source.python, storage.type.string.python, string.interpolated.python, string.quoted.single.python +" : meta.fstring.python, meta.function-call.arguments.python, meta.function-call.python, punctuation.definition.string.begin.python, source.python, string.interpolated.python, string.quoted.single.python +Two points on the Y axis are in the list. : meta.fstring.python, meta.function-call.arguments.python, meta.function-call.python, source.python, string.interpolated.python, string.quoted.single.python +" : meta.fstring.python, meta.function-call.arguments.python, meta.function-call.python, punctuation.definition.string.end.python, source.python, string.interpolated.python, string.quoted.single.python +) : meta.function-call.python, punctuation.definition.arguments.end.python, source.python + : source.python +case : keyword.control.flow.python, source.python + : source.python +_ : source.python +: : punctuation.separator.colon.python, source.python + : source.python +print : meta.function-call.python, source.python, support.function.builtin.python +( : meta.function-call.python, punctuation.definition.arguments.begin.python, source.python +" : meta.function-call.arguments.python, meta.function-call.python, punctuation.definition.string.begin.python, source.python, string.quoted.single.python +Something else is found in the list. : meta.function-call.arguments.python, meta.function-call.python, source.python, string.quoted.single.python +" : meta.function-call.arguments.python, meta.function-call.python, punctuation.definition.string.end.python, source.python, string.quoted.single.python +) : meta.function-call.python, punctuation.definition.arguments.end.python, source.python diff --git a/test/statements/match4.py b/test/statements/match4.py new file mode 100644 index 00000000..fc4857f5 --- /dev/null +++ b/test/statements/match4.py @@ -0,0 +1,59 @@ +match point: + case Point(x, y) if x == y: + print(f"The point is located on the diagonal Y=X.") + case Point(x, y): + print(f"Point is not on the diagonal.") + + + + +match : keyword.control.flow.python, source.python + : source.python +point : source.python +: : punctuation.separator.colon.python, source.python + : source.python +case : keyword.control.flow.python, source.python + : source.python +Point : meta.function-call.generic.python, meta.function-call.python, source.python +( : meta.function-call.python, punctuation.definition.arguments.begin.python, source.python +x : meta.function-call.arguments.python, meta.function-call.python, source.python +, : meta.function-call.arguments.python, meta.function-call.python, punctuation.separator.arguments.python, source.python + : meta.function-call.arguments.python, meta.function-call.python, source.python +y : meta.function-call.arguments.python, meta.function-call.python, source.python +) : meta.function-call.python, punctuation.definition.arguments.end.python, source.python + : source.python +if : keyword.control.flow.python, source.python + : source.python +x : source.python + : source.python +== : keyword.operator.comparison.python, source.python + : source.python +y : source.python +: : punctuation.separator.colon.python, source.python + : source.python +print : meta.function-call.python, source.python, support.function.builtin.python +( : meta.function-call.python, punctuation.definition.arguments.begin.python, source.python +f : meta.fstring.python, meta.function-call.arguments.python, meta.function-call.python, source.python, storage.type.string.python, string.interpolated.python, string.quoted.single.python +" : meta.fstring.python, meta.function-call.arguments.python, meta.function-call.python, punctuation.definition.string.begin.python, source.python, string.interpolated.python, string.quoted.single.python +The point is located on the diagonal Y=X. : meta.fstring.python, meta.function-call.arguments.python, meta.function-call.python, source.python, string.interpolated.python, string.quoted.single.python +" : meta.fstring.python, meta.function-call.arguments.python, meta.function-call.python, punctuation.definition.string.end.python, source.python, string.interpolated.python, string.quoted.single.python +) : meta.function-call.python, punctuation.definition.arguments.end.python, source.python + : source.python +case : keyword.control.flow.python, source.python + : source.python +Point : meta.function-call.generic.python, meta.function-call.python, source.python +( : meta.function-call.python, punctuation.definition.arguments.begin.python, source.python +x : meta.function-call.arguments.python, meta.function-call.python, source.python +, : meta.function-call.arguments.python, meta.function-call.python, punctuation.separator.arguments.python, source.python + : meta.function-call.arguments.python, meta.function-call.python, source.python +y : meta.function-call.arguments.python, meta.function-call.python, source.python +) : meta.function-call.python, punctuation.definition.arguments.end.python, source.python +: : punctuation.separator.colon.python, source.python + : source.python +print : meta.function-call.python, source.python, support.function.builtin.python +( : meta.function-call.python, punctuation.definition.arguments.begin.python, source.python +f : meta.fstring.python, meta.function-call.arguments.python, meta.function-call.python, source.python, storage.type.string.python, string.interpolated.python, string.quoted.single.python +" : meta.fstring.python, meta.function-call.arguments.python, meta.function-call.python, punctuation.definition.string.begin.python, source.python, string.interpolated.python, string.quoted.single.python +Point is not on the diagonal. : meta.fstring.python, meta.function-call.arguments.python, meta.function-call.python, source.python, string.interpolated.python, string.quoted.single.python +" : meta.fstring.python, meta.function-call.arguments.python, meta.function-call.python, punctuation.definition.string.end.python, source.python, string.interpolated.python, string.quoted.single.python +) : meta.function-call.python, punctuation.definition.arguments.end.python, source.python diff --git a/test/statements/match5.py b/test/statements/match5.py new file mode 100644 index 00000000..905ef8ba --- /dev/null +++ b/test/statements/match5.py @@ -0,0 +1,112 @@ +match command.split() if command else ['default']: + ... # Other cases + case ["north"] | ["go", "north"]: + ... # handle case + case ["get", obj] | ["pick", "up", *other] | ["pick", obj, "up"]: + ... # handle case + + + + +match : keyword.control.flow.python, source.python + : source.python +command : source.python +. : meta.member.access.python, punctuation.separator.period.python, source.python +split : meta.function-call.generic.python, meta.function-call.python, meta.member.access.python, source.python +( : meta.function-call.python, meta.member.access.python, punctuation.definition.arguments.begin.python, source.python +) : meta.function-call.python, meta.member.access.python, punctuation.definition.arguments.end.python, source.python + : source.python +if : keyword.control.flow.python, source.python + : source.python +command : source.python + : source.python +else : keyword.control.flow.python, source.python + : source.python +[ : punctuation.definition.list.begin.python, source.python +' : punctuation.definition.string.begin.python, source.python, string.quoted.single.python +default : source.python, string.quoted.single.python +' : punctuation.definition.string.end.python, source.python, string.quoted.single.python +] : punctuation.definition.list.end.python, source.python +: : punctuation.separator.colon.python, source.python + : source.python +... : constant.other.ellipsis.python, source.python + : source.python +# : comment.line.number-sign.python, punctuation.definition.comment.python, source.python + Other cases : comment.line.number-sign.python, source.python + : source.python +case : keyword.control.flow.python, source.python + : source.python +[ : punctuation.definition.list.begin.python, source.python +" : punctuation.definition.string.begin.python, source.python, string.quoted.single.python +north : source.python, string.quoted.single.python +" : punctuation.definition.string.end.python, source.python, string.quoted.single.python +] : punctuation.definition.list.end.python, source.python + : source.python +| : keyword.operator.bitwise.python, source.python + : source.python +[ : punctuation.definition.list.begin.python, source.python +" : punctuation.definition.string.begin.python, source.python, string.quoted.single.python +go : source.python, string.quoted.single.python +" : punctuation.definition.string.end.python, source.python, string.quoted.single.python +, : punctuation.separator.element.python, source.python + : source.python +" : punctuation.definition.string.begin.python, source.python, string.quoted.single.python +north : source.python, string.quoted.single.python +" : punctuation.definition.string.end.python, source.python, string.quoted.single.python +] : punctuation.definition.list.end.python, source.python +: : punctuation.separator.colon.python, source.python + : source.python +... : constant.other.ellipsis.python, source.python + : source.python +# : comment.line.number-sign.python, punctuation.definition.comment.python, source.python + handle case : comment.line.number-sign.python, source.python + : source.python +case : keyword.control.flow.python, source.python + : source.python +[ : punctuation.definition.list.begin.python, source.python +" : punctuation.definition.string.begin.python, source.python, string.quoted.single.python +get : source.python, string.quoted.single.python +" : punctuation.definition.string.end.python, source.python, string.quoted.single.python +, : punctuation.separator.element.python, source.python + : source.python +obj : source.python +] : punctuation.definition.list.end.python, source.python + : source.python +| : keyword.operator.bitwise.python, source.python + : source.python +[ : punctuation.definition.list.begin.python, source.python +" : punctuation.definition.string.begin.python, source.python, string.quoted.single.python +pick : source.python, string.quoted.single.python +" : punctuation.definition.string.end.python, source.python, string.quoted.single.python +, : punctuation.separator.element.python, source.python + : source.python +" : punctuation.definition.string.begin.python, source.python, string.quoted.single.python +up : source.python, string.quoted.single.python +" : punctuation.definition.string.end.python, source.python, string.quoted.single.python +, : punctuation.separator.element.python, source.python + : source.python +* : keyword.operator.arithmetic.python, source.python +other : source.python +] : punctuation.definition.list.end.python, source.python + : source.python +| : keyword.operator.bitwise.python, source.python + : source.python +[ : punctuation.definition.list.begin.python, source.python +" : punctuation.definition.string.begin.python, source.python, string.quoted.single.python +pick : source.python, string.quoted.single.python +" : punctuation.definition.string.end.python, source.python, string.quoted.single.python +, : punctuation.separator.element.python, source.python + : source.python +obj : source.python +, : punctuation.separator.element.python, source.python + : source.python +" : punctuation.definition.string.begin.python, source.python, string.quoted.single.python +up : source.python, string.quoted.single.python +" : punctuation.definition.string.end.python, source.python, string.quoted.single.python +] : punctuation.definition.list.end.python, source.python +: : punctuation.separator.colon.python, source.python + : source.python +... : constant.other.ellipsis.python, source.python + : source.python +# : comment.line.number-sign.python, punctuation.definition.comment.python, source.python + handle case : comment.line.number-sign.python, source.python diff --git a/test/statements/match6.py b/test/statements/match6.py new file mode 100644 index 00000000..b74491f7 --- /dev/null +++ b/test/statements/match6.py @@ -0,0 +1,53 @@ +match (foo + bar): + ... # cases +match [foo, bar]: + ... # cases +match {foo, bar}: + ... # cases + + + + +match : keyword.control.flow.python, source.python + : source.python +( : punctuation.parenthesis.begin.python, source.python +foo : source.python + : source.python ++ : keyword.operator.arithmetic.python, source.python + : source.python +bar : source.python +) : punctuation.parenthesis.end.python, source.python +: : punctuation.separator.colon.python, source.python + : source.python +... : constant.other.ellipsis.python, source.python + : source.python +# : comment.line.number-sign.python, punctuation.definition.comment.python, source.python + cases : comment.line.number-sign.python, source.python +match : keyword.control.flow.python, source.python + : source.python +[ : punctuation.definition.list.begin.python, source.python +foo : source.python +, : punctuation.separator.element.python, source.python + : source.python +bar : source.python +] : punctuation.definition.list.end.python, source.python +: : punctuation.separator.colon.python, source.python + : source.python +... : constant.other.ellipsis.python, source.python + : source.python +# : comment.line.number-sign.python, punctuation.definition.comment.python, source.python + cases : comment.line.number-sign.python, source.python +match : keyword.control.flow.python, source.python + : source.python +{ : punctuation.definition.dict.begin.python, source.python +foo : source.python +, : punctuation.separator.element.python, source.python + : source.python +bar : source.python +} : punctuation.definition.dict.end.python, source.python +: : punctuation.separator.colon.python, source.python + : source.python +... : constant.other.ellipsis.python, source.python + : source.python +# : comment.line.number-sign.python, punctuation.definition.comment.python, source.python + cases : comment.line.number-sign.python, source.python \ No newline at end of file diff --git a/test/statements/match7.py b/test/statements/match7.py new file mode 100644 index 00000000..878fa813 --- /dev/null +++ b/test/statements/match7.py @@ -0,0 +1,97 @@ +match 'prefix' + foo: + ... # cases +match "prefix" + foo: + ... # cases +match f'prefix{foo}': + ... # cases +match f"prefix{foo}": + ... # cases +match -foo: + ... # cases +match not foo: + ... # cases + + + + +match : keyword.control.flow.python, source.python + : source.python +' : punctuation.definition.string.begin.python, source.python, string.quoted.single.python +prefix : source.python, string.quoted.single.python +' : punctuation.definition.string.end.python, source.python, string.quoted.single.python + : source.python ++ : keyword.operator.arithmetic.python, source.python + : source.python +foo : source.python +: : punctuation.separator.colon.python, source.python + : source.python +... : constant.other.ellipsis.python, source.python + : source.python +# : comment.line.number-sign.python, punctuation.definition.comment.python, source.python + cases : comment.line.number-sign.python, source.python +match : keyword.control.flow.python, source.python + : source.python +" : punctuation.definition.string.begin.python, source.python, string.quoted.single.python +prefix : source.python, string.quoted.single.python +" : punctuation.definition.string.end.python, source.python, string.quoted.single.python + : source.python ++ : keyword.operator.arithmetic.python, source.python + : source.python +foo : source.python +: : punctuation.separator.colon.python, source.python + : source.python +... : constant.other.ellipsis.python, source.python + : source.python +# : comment.line.number-sign.python, punctuation.definition.comment.python, source.python + cases : comment.line.number-sign.python, source.python +match : keyword.control.flow.python, source.python + : source.python +f : meta.fstring.python, source.python, storage.type.string.python, string.interpolated.python, string.quoted.single.python +' : meta.fstring.python, punctuation.definition.string.begin.python, source.python, string.interpolated.python, string.quoted.single.python +prefix : meta.fstring.python, source.python, string.interpolated.python, string.quoted.single.python +{ : constant.character.format.placeholder.other.python, meta.fstring.python, source.python +foo : meta.fstring.python, source.python +} : constant.character.format.placeholder.other.python, meta.fstring.python, source.python +' : meta.fstring.python, punctuation.definition.string.end.python, source.python, string.interpolated.python, string.quoted.single.python +: : punctuation.separator.colon.python, source.python + : source.python +... : constant.other.ellipsis.python, source.python + : source.python +# : comment.line.number-sign.python, punctuation.definition.comment.python, source.python + cases : comment.line.number-sign.python, source.python +match : keyword.control.flow.python, source.python + : source.python +f : meta.fstring.python, source.python, storage.type.string.python, string.interpolated.python, string.quoted.single.python +" : meta.fstring.python, punctuation.definition.string.begin.python, source.python, string.interpolated.python, string.quoted.single.python +prefix : meta.fstring.python, source.python, string.interpolated.python, string.quoted.single.python +{ : constant.character.format.placeholder.other.python, meta.fstring.python, source.python +foo : meta.fstring.python, source.python +} : constant.character.format.placeholder.other.python, meta.fstring.python, source.python +" : meta.fstring.python, punctuation.definition.string.end.python, source.python, string.interpolated.python, string.quoted.single.python +: : punctuation.separator.colon.python, source.python + : source.python +... : constant.other.ellipsis.python, source.python + : source.python +# : comment.line.number-sign.python, punctuation.definition.comment.python, source.python + cases : comment.line.number-sign.python, source.python +match : keyword.control.flow.python, source.python + : source.python +- : keyword.operator.arithmetic.python, source.python +foo : source.python +: : punctuation.separator.colon.python, source.python + : source.python +... : constant.other.ellipsis.python, source.python + : source.python +# : comment.line.number-sign.python, punctuation.definition.comment.python, source.python + cases : comment.line.number-sign.python, source.python +match : keyword.control.flow.python, source.python + : source.python +not : keyword.operator.logical.python, source.python + : source.python +foo : source.python +: : punctuation.separator.colon.python, source.python + : source.python +... : constant.other.ellipsis.python, source.python + : source.python +# : comment.line.number-sign.python, punctuation.definition.comment.python, source.python + cases : comment.line.number-sign.python, source.python \ No newline at end of file diff --git a/test/strings/bug1.py b/test/strings/bug1.py index 9b43c6de..eeb0f950 100644 --- a/test/strings/bug1.py +++ b/test/strings/bug1.py @@ -35,7 +35,7 @@ : source.python v : source.python : source.python -in : keyword.operator.logical.python, source.python +in : keyword.control.flow.python, source.python : source.python foo : source.python : source.python diff --git a/test/strings/bug2.py b/test/strings/bug2.py index 0ba2bf8f..3f4622e8 100644 --- a/test/strings/bug2.py +++ b/test/strings/bug2.py @@ -30,6 +30,6 @@ -- ./**/*.proto > : source.python, string.quoted.single.python {OUTPUT} : constant.character.format.placeholder.other.python, meta.format.brace.python, source.python, string.quoted.single.python " : punctuation.definition.string.end.python, source.python, string.quoted.single.python -. : punctuation.separator.period.python, source.python -format : meta.function-call.generic.python, meta.function-call.python, source.python -( : meta.function-call.python, punctuation.definition.arguments.begin.python, source.python +. : meta.member.access.python, punctuation.separator.period.python, source.python +format : meta.function-call.generic.python, meta.function-call.python, meta.member.access.python, source.python +( : meta.function-call.python, meta.member.access.python, punctuation.definition.arguments.begin.python, source.python diff --git a/test/strings/bytes2.py b/test/strings/bytes2.py index 22df557e..7aefd973 100644 --- a/test/strings/bytes2.py +++ b/test/strings/bytes2.py @@ -8,7 +8,8 @@ -a : meta.item-access.python, source.python + +a : meta.indexed-name.python, meta.item-access.python, source.python [ : meta.item-access.python, punctuation.definition.arguments.begin.python, source.python 1 : constant.numeric.dec.python, meta.item-access.arguments.python, meta.item-access.python, source.python ] : meta.item-access.python, punctuation.definition.arguments.end.python, source.python diff --git a/test/strings/format2.py b/test/strings/format2.py index 86227776..d6079535 100644 --- a/test/strings/format2.py +++ b/test/strings/format2.py @@ -2,6 +2,7 @@ + a : source.python : source.python = : keyword.operator.assignment.python, source.python @@ -20,10 +21,10 @@ !s : constant.character.format.placeholder.other.python, meta.format.brace.python, source.python, storage.type.format.python, string.quoted.single.python } : constant.character.format.placeholder.other.python, meta.format.brace.python, source.python, string.quoted.single.python " : punctuation.definition.string.end.python, source.python, string.quoted.single.python -. : punctuation.separator.period.python, source.python -format : meta.function-call.generic.python, meta.function-call.python, source.python -( : meta.function-call.python, punctuation.definition.arguments.begin.python, source.python -fo : meta.function-call.arguments.python, meta.function-call.python, source.python, variable.parameter.function-call.python -= : keyword.operator.assignment.python, meta.function-call.arguments.python, meta.function-call.python, source.python -1 : constant.numeric.dec.python, meta.function-call.arguments.python, meta.function-call.python, source.python -) : meta.function-call.python, punctuation.definition.arguments.end.python, source.python +. : meta.member.access.python, punctuation.separator.period.python, source.python +format : meta.function-call.generic.python, meta.function-call.python, meta.member.access.python, source.python +( : meta.function-call.python, meta.member.access.python, punctuation.definition.arguments.begin.python, source.python +fo : meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, source.python, variable.parameter.function-call.python += : keyword.operator.assignment.python, meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, source.python +1 : constant.numeric.dec.python, meta.function-call.arguments.python, meta.function-call.python, meta.member.access.python, source.python +) : meta.function-call.python, meta.member.access.python, punctuation.definition.arguments.end.python, source.python