summaryrefslogtreecommitdiffstats
path: root/queries/python
diff options
context:
space:
mode:
authorAmaan Qureshi <amaanq12@gmail.com>2023-04-24 00:38:31 -0400
committerAmaan Qureshi <amaanq12@gmail.com>2023-04-25 03:04:05 -0400
commit87faf372eb517077cc600c4e653e4fb3252d02ac (patch)
tree7753d3ac7bc5e731d077bf9a1c4ae079f386a994 /queries/python
parentfeat(python,starlark): highlight type conversions as `@function.macro` (diff)
downloadnvim-treesitter-87faf372eb517077cc600c4e653e4fb3252d02ac.tar
nvim-treesitter-87faf372eb517077cc600c4e653e4fb3252d02ac.tar.gz
nvim-treesitter-87faf372eb517077cc600c4e653e4fb3252d02ac.tar.bz2
nvim-treesitter-87faf372eb517077cc600c4e653e4fb3252d02ac.tar.lz
nvim-treesitter-87faf372eb517077cc600c4e653e4fb3252d02ac.tar.xz
nvim-treesitter-87faf372eb517077cc600c4e653e4fb3252d02ac.tar.zst
nvim-treesitter-87faf372eb517077cc600c4e653e4fb3252d02ac.zip
fix(python,starlark): builtin types should come after types
Diffstat (limited to 'queries/python')
-rw-r--r--queries/python/highlights.scm36
1 files changed, 18 insertions, 18 deletions
diff --git a/queries/python/highlights.scm b/queries/python/highlights.scm
index 6e9436ff1..956b1d19c 100644
--- a/queries/python/highlights.scm
+++ b/queries/python/highlights.scm
@@ -31,24 +31,6 @@
attribute: (identifier) @field)
(#lua-match? @field "^.*%l.*$"))
-((identifier) @type.builtin
- (#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"
- "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"))
-
((assignment
left: (identifier) @type.definition
(type (identifier) @_annotation))
@@ -341,5 +323,23 @@
name: (identifier) @constructor)))
(#any-of? @constructor "__new__" "__init__"))
+((identifier) @type.builtin
+ (#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"
+ "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"))
+
;; Error
(ERROR) @error