on master help sign in
Add syntax highlighting for Python pattern matching

Add syntax highlighting for `match` and `case` keywords in Python (https://peps.python.org/pep-0636/).

commite0b034dcd1a99683efa429e55657dd68ebd9a301 authorYuriy <yugabuev@gmail.com> dateTue 1 Nov 2022, 18:01 (4 years ago) parentdb3383c
1 file changed+5−3
runtime/queries/python/highlights.scm+5−3
runtime/queries/python/highlights.scm+5−3
@@ -2,7 +2,7 @@
22
33(dotted_name
44 (identifier)* @namespace)
5−
5+
66(aliased_import
77 alias: (identifier) @namespace)
88
@@ -67,7 +67,7 @@
6767(parameters
6868 (dictionary_splat_pattern ; **kwargs
6969 (identifier) @variable.parameter))
70−
70+
7171(lambda_parameters
7272 (identifier) @variable.parameter)
7373
@@ -97,7 +97,7 @@
9797 (#match? @constant "^[A-Z_]{2,}$"))
9898
9999((identifier) @type
100− (#match? @type "^[A-Z]"))
100+ (#match? @type "^[A-Z]"))
101101
102102(attribute attribute: (identifier) @variable.other.member)
103103(identifier) @variable
@@ -168,6 +168,8 @@
168168 "if"
169169 "elif"
170170 "else"
171+ "match"
172+ "case"
171173] @keyword.control.conditional
172174
173175[