|
|
@ -1,3 +1,6 @@
|
|
|
|
|
|
|
|
(dotted_name
|
|
|
|
|
|
|
|
(identifier)* @namespace)
|
|
|
|
|
|
|
|
|
|
|
|
; Builtin functions
|
|
|
|
; Builtin functions
|
|
|
|
|
|
|
|
|
|
|
|
((call
|
|
|
|
((call
|
|
|
@ -8,6 +11,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
; Function calls
|
|
|
|
; Function calls
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[
|
|
|
|
|
|
|
|
"def"
|
|
|
|
|
|
|
|
"lambda"
|
|
|
|
|
|
|
|
] @keyword.function
|
|
|
|
|
|
|
|
|
|
|
|
(call
|
|
|
|
(call
|
|
|
|
function: (attribute attribute: (identifier) @constructor)
|
|
|
|
function: (attribute attribute: (identifier) @constructor)
|
|
|
|
(#match? @constructor "^[A-Z]"))
|
|
|
|
(#match? @constructor "^[A-Z]"))
|
|
|
@ -49,6 +57,13 @@
|
|
|
|
(parameters (typed_default_parameter name: (identifier) @variable.parameter))
|
|
|
|
(parameters (typed_default_parameter name: (identifier) @variable.parameter))
|
|
|
|
(keyword_argument name: (identifier) @variable.parameter)
|
|
|
|
(keyword_argument name: (identifier) @variable.parameter)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(parameters
|
|
|
|
|
|
|
|
(list_splat_pattern ; *args
|
|
|
|
|
|
|
|
(identifier) @variable.parameter))
|
|
|
|
|
|
|
|
(parameters
|
|
|
|
|
|
|
|
(dictionary_splat_pattern ; **kwargs
|
|
|
|
|
|
|
|
(identifier) @variable.parameter))
|
|
|
|
|
|
|
|
|
|
|
|
; Types
|
|
|
|
; Types
|
|
|
|
|
|
|
|
|
|
|
|
((identifier) @type.builtin
|
|
|
|
((identifier) @type.builtin
|
|
|
@ -81,12 +96,11 @@
|
|
|
|
(identifier) @variable
|
|
|
|
(identifier) @variable
|
|
|
|
|
|
|
|
|
|
|
|
; Literals
|
|
|
|
; Literals
|
|
|
|
|
|
|
|
(none) @constant.builtin
|
|
|
|
[
|
|
|
|
[
|
|
|
|
(none)
|
|
|
|
|
|
|
|
(true)
|
|
|
|
(true)
|
|
|
|
(false)
|
|
|
|
(false)
|
|
|
|
] @constant.builtin
|
|
|
|
] @constant.builtin.boolean
|
|
|
|
|
|
|
|
|
|
|
|
(integer) @constant.numeric.integer
|
|
|
|
(integer) @constant.numeric.integer
|
|
|
|
(float) @constant.numeric.float
|
|
|
|
(float) @constant.numeric.float
|
|
|
@ -94,9 +108,11 @@
|
|
|
|
(string) @string
|
|
|
|
(string) @string
|
|
|
|
(escape_sequence) @constant.character.escape
|
|
|
|
(escape_sequence) @constant.character.escape
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
["," "." ":" ";" (ellipsis)] @punctuation.delimiter
|
|
|
|
(interpolation
|
|
|
|
(interpolation
|
|
|
|
"{" @punctuation.special
|
|
|
|
"{" @punctuation.special
|
|
|
|
"}" @punctuation.special) @embedded
|
|
|
|
"}" @punctuation.special) @embedded
|
|
|
|
|
|
|
|
"(" ")" "[" "]" "{" "}"] @punctuation.bracket
|
|
|
|
|
|
|
|
|
|
|
|
[
|
|
|
|
[
|
|
|
|
"-"
|
|
|
|
"-"
|
|
|
@ -135,24 +151,39 @@
|
|
|
|
"as"
|
|
|
|
"as"
|
|
|
|
"assert"
|
|
|
|
"assert"
|
|
|
|
"await"
|
|
|
|
"await"
|
|
|
|
"break"
|
|
|
|
"from"
|
|
|
|
"continue"
|
|
|
|
"pass"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"with"
|
|
|
|
|
|
|
|
] @keyword.control
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[
|
|
|
|
|
|
|
|
"if"
|
|
|
|
"elif"
|
|
|
|
"elif"
|
|
|
|
"else"
|
|
|
|
"else"
|
|
|
|
"except"
|
|
|
|
] @keyword.control.conditional
|
|
|
|
"finally"
|
|
|
|
|
|
|
|
|
|
|
|
[
|
|
|
|
|
|
|
|
"while"
|
|
|
|
"for"
|
|
|
|
"for"
|
|
|
|
"from"
|
|
|
|
"break"
|
|
|
|
"if"
|
|
|
|
"continue"
|
|
|
|
"import"
|
|
|
|
] @keyword.control.repeat
|
|
|
|
"pass"
|
|
|
|
|
|
|
|
"raise"
|
|
|
|
[
|
|
|
|
"return"
|
|
|
|
"return"
|
|
|
|
"try"
|
|
|
|
|
|
|
|
"while"
|
|
|
|
|
|
|
|
"with"
|
|
|
|
|
|
|
|
"yield"
|
|
|
|
"yield"
|
|
|
|
] @keyword.control
|
|
|
|
] @keyword.control.return
|
|
|
|
|
|
|
|
(yield "from" @keyword.control.return)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[
|
|
|
|
|
|
|
|
"raise"
|
|
|
|
|
|
|
|
"try"
|
|
|
|
|
|
|
|
"except"
|
|
|
|
|
|
|
|
"finally"
|
|
|
|
|
|
|
|
] @keyword.control.except
|
|
|
|
|
|
|
|
(raise_statement "from" @keyword.control.except)
|
|
|
|
|
|
|
|
"import" @keyword.control.import
|
|
|
|
|
|
|
|
|
|
|
|
(for_statement "in" @keyword.control)
|
|
|
|
(for_statement "in" @keyword.control)
|
|
|
|
(for_in_clause "in" @keyword.control)
|
|
|
|
(for_in_clause "in" @keyword.control)
|
|
|
@ -161,16 +192,22 @@
|
|
|
|
"and"
|
|
|
|
"and"
|
|
|
|
"async"
|
|
|
|
"async"
|
|
|
|
"class"
|
|
|
|
"class"
|
|
|
|
"def"
|
|
|
|
|
|
|
|
"del"
|
|
|
|
|
|
|
|
"exec"
|
|
|
|
"exec"
|
|
|
|
"global"
|
|
|
|
"global"
|
|
|
|
"in"
|
|
|
|
|
|
|
|
"is"
|
|
|
|
|
|
|
|
"lambda"
|
|
|
|
|
|
|
|
"nonlocal"
|
|
|
|
"nonlocal"
|
|
|
|
"not"
|
|
|
|
|
|
|
|
"or"
|
|
|
|
|
|
|
|
"print"
|
|
|
|
"print"
|
|
|
|
] @keyword
|
|
|
|
] @keyword
|
|
|
|
|
|
|
|
[
|
|
|
|
|
|
|
|
"and"
|
|
|
|
|
|
|
|
"or"
|
|
|
|
|
|
|
|
"in"
|
|
|
|
|
|
|
|
"not"
|
|
|
|
|
|
|
|
"del"
|
|
|
|
|
|
|
|
"is"
|
|
|
|
|
|
|
|
] @keyword.operator
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
((identifier) @type.builtin
|
|
|
|
|
|
|
|
(#match? @type.builtin
|
|
|
|
|
|
|
|
"^(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)$"))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(ERROR) @error
|
|
|
|