@@ -1,3 +1,6 @@
1+(dotted_name
2+ (identifier)* @namespace)
3+
14; Builtin functions
25
36((call
@@ -8,6 +11,11 @@
811
912; Function calls
1013
14+[
15+ "def"
16+ "lambda"
17+] @keyword.function
18+
1119(call
1220 function: (attribute attribute: (identifier) @constructor)
1321 (#match? @constructor "^[A-Z]"))
@@ -49,6 +57,13 @@
4957(parameters (typed_default_parameter name: (identifier) @variable.parameter))
5058(keyword_argument name: (identifier) @variable.parameter)
5159
60+(parameters
61+ (list_splat_pattern ; *args
62+ (identifier) @variable.parameter))
63+(parameters
64+ (dictionary_splat_pattern ; **kwargs
65+ (identifier) @variable.parameter))
66+
5267; Types
5368
5469((identifier) @type.builtin
@@ -81,12 +96,11 @@
8196(identifier) @variable
8297
8398; Literals
84−
99+(none) @constant.builtin
85100[
86− (none)
87101 (true)
88102 (false)
89−] @constant.builtin
103+] @constant.builtin.boolean
90104
91105(integer) @constant.numeric.integer
92106(float) @constant.numeric.float
@@ -94,9 +108,11 @@
94108(string) @string
95109(escape_sequence) @constant.character.escape
96110
111+["," "." ":" ";" (ellipsis)] @punctuation.delimiter
97112(interpolation
98113 "{" @punctuation.special
99114 "}" @punctuation.special) @embedded
115+"(" ")" "[" "]" "{" "}"] @punctuation.bracket
100116
101117[
102118 "-"
@@ -135,24 +151,39 @@
135151 "as"
136152 "assert"
137153 "await"
138− "break"
139− "continue"
154+ "from"
155+ "pass"
156+
157+ "with"
158+] @keyword.control
159+
160+[
161+ "if"
140162 "elif"
141163 "else"
142− "except"
143− "finally"
164+] @keyword.control.conditional
165+
166+[
167+ "while"
144168 "for"
145− "from"
146− "if"
147− "import"
148− "pass"
149− "raise"
169+ "break"
170+ "continue"
171+] @keyword.control.repeat
172+
173+[
150174 "return"
151− "try"
152− "while"
153− "with"
154175 "yield"
155−] @keyword.control
176+] @keyword.control.return
177+(yield "from" @keyword.control.return)
178+
179+[
180+ "raise"
181+ "try"
182+ "except"
183+ "finally"
184+] @keyword.control.except
185+(raise_statement "from" @keyword.control.except)
186+"import" @keyword.control.import
156187
157188(for_statement "in" @keyword.control)
158189(for_in_clause "in" @keyword.control)
@@ -161,16 +192,22 @@
161192 "and"
162193 "async"
163194 "class"
164− "def"
165− "del"
166195 "exec"
167196 "global"
168− "in"
169− "is"
170− "lambda"
171197 "nonlocal"
172− "not"
173− "or"
174198 "print"
175199] @keyword
200+[
201+ "and"
202+ "or"
203+ "in"
204+ "not"
205+ "del"
206+ "is"
207+] @keyword.operator
208+
209+((identifier) @type.builtin
210+ (#match? @type.builtin
211+ "^(BaseException|Exception|ArithmeticError|BufferError|LookupError|AssertionError|AttributeError|EOFError|FloatingPointError|GeneratorExit|ImportError|ModuleNotFoundError|IndexError|KeyError|KeyboardInterrupt|MemoryError|NameError|NotImplementedError|OSError|OverflowError|RecursionError|ReferenceError|RuntimeError|StopIteration|StopAsyncIteration|SyntaxError|IndentationError|TabError|SystemError|SystemExit|TypeError|UnboundLocalError|UnicodeError|UnicodeEncodeError|UnicodeDecodeError|UnicodeTranslateError|ValueError|ZeroDivisionError|EnvironmentError|IOError|WindowsError|BlockingIOError|ChildProcessError|ConnectionError|BrokenPipeError|ConnectionAbortedError|ConnectionRefusedError|ConnectionResetError|FileExistsError|FileNotFoundError|InterruptedError|IsADirectoryError|NotADirectoryError|PermissionError|ProcessLookupError|TimeoutError|Warning|UserWarning|DeprecationWarning|PendingDeprecationWarning|SyntaxWarning|RuntimeWarning|FutureWarning|ImportWarning|UnicodeWarning|BytesWarning|ResourceWarning)$"))
176212
213+(ERROR) @error