diff options
author | Christian Clason <c.clason@uni-graz.at> | 2024-03-17 13:16:28 +0100 |
---|---|---|
committer | Christian Clason <c.clason@uni-graz.at> | 2024-03-19 09:41:16 +0100 |
commit | 8a3385dde75fad4270a43ea6e2ad058197cebcc8 (patch) | |
tree | cfbe6aade758cb7adc06cbd866204b2cba055140 /runtime/queries/python | |
parent | 1384bebd5aa3f6d2b2494892b96e830890bc9132 (diff) | |
download | rneovim-8a3385dde75fad4270a43ea6e2ad058197cebcc8.tar.gz rneovim-8a3385dde75fad4270a43ea6e2ad058197cebcc8.tar.bz2 rneovim-8a3385dde75fad4270a43ea6e2ad058197cebcc8.zip |
feat(treesitter): update Python parser and queries to v0.21.0
Diffstat (limited to 'runtime/queries/python')
-rw-r--r-- | runtime/queries/python/highlights.scm | 46 |
1 files changed, 27 insertions, 19 deletions
diff --git a/runtime/queries/python/highlights.scm b/runtime/queries/python/highlights.scm index 764521c7be..fea97bed32 100644 --- a/runtime/queries/python/highlights.scm +++ b/runtime/queries/python/highlights.scm @@ -17,11 +17,9 @@ (#lua-match? @constant.builtin "^__[a-zA-Z0-9_]*__$")) ((identifier) @constant.builtin - ; format-ignore - (#any-of? @constant.builtin + (#any-of? @constant.builtin ; https://docs.python.org/3/library/constants.html - "NotImplemented" "Ellipsis" - "quit" "exit" "copyright" "credits" "license")) + "NotImplemented" "Ellipsis" "quit" "exit" "copyright" "credits" "license")) "_" @constant.builtin ; match wildcard @@ -89,7 +87,14 @@ ; Builtin functions ((call function: (identifier) @function.builtin) - (#any-of? @function.builtin "abs" "all" "any" "ascii" "bin" "bool" "breakpoint" "bytearray" "bytes" "callable" "chr" "classmethod" "compile" "complex" "delattr" "dict" "dir" "divmod" "enumerate" "eval" "exec" "filter" "float" "format" "frozenset" "getattr" "globals" "hasattr" "hash" "help" "hex" "id" "input" "int" "isinstance" "issubclass" "iter" "len" "list" "locals" "map" "max" "memoryview" "min" "next" "object" "oct" "open" "ord" "pow" "print" "property" "range" "repr" "reversed" "round" "set" "setattr" "slice" "sorted" "staticmethod" "str" "sum" "super" "tuple" "type" "vars" "zip" "__import__")) + (#any-of? @function.builtin + "abs" "all" "any" "ascii" "bin" "bool" "breakpoint" "bytearray" "bytes" "callable" "chr" + "classmethod" "compile" "complex" "delattr" "dict" "dir" "divmod" "enumerate" "eval" "exec" + "filter" "float" "format" "frozenset" "getattr" "globals" "hasattr" "hash" "help" "hex" "id" + "input" "int" "isinstance" "issubclass" "iter" "len" "list" "locals" "map" "max" "memoryview" + "min" "next" "object" "oct" "open" "ord" "pow" "print" "property" "range" "repr" "reversed" + "round" "set" "setattr" "slice" "sorted" "staticmethod" "str" "sum" "super" "tuple" "type" + "vars" "zip" "__import__")) ; Function definitions (function_definition @@ -200,6 +205,8 @@ ; doc-strings (module . + (comment)* + . (expression_statement (string) @string.documentation @spell)) @@ -387,7 +394,7 @@ (expression_statement (assignment left: (identifier) @variable.member)))) - (#lua-match? @variable.member "^%l.*$")) + (#lua-match? @variable.member "^[%l_].*$")) ((class_definition body: @@ -397,7 +404,7 @@ left: (_ (identifier) @variable.member))))) - (#lua-match? @variable.member "^%l.*$")) + (#lua-match? @variable.member "^[%l_].*$")) ((class_definition (block @@ -406,23 +413,24 @@ (#any-of? @constructor "__new__" "__init__")) ((identifier) @type.builtin - ; format-ignore (#any-of? @type.builtin ; https://docs.python.org/3/library/exceptions.html - "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" + "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" ; https://docs.python.org/3/library/stdtypes.html - "bool" "int" "float" "complex" "list" "tuple" "range" "str" - "bytes" "bytearray" "memoryview" "set" "frozenset" "dict" "type" "object")) + "bool" "int" "float" "complex" "list" "tuple" "range" "str" "bytes" "bytearray" "memoryview" + "set" "frozenset" "dict" "type" "object")) ; Regex from the `re` module (call |