Skip to content

Commit 5c26a6e

Browse files
committed
test: update tests
1 parent e172df5 commit 5c26a6e

File tree

6 files changed

+830
-3
lines changed

6 files changed

+830
-3
lines changed

queries/highlights.scm

Lines changed: 54 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,21 +25,54 @@
2525
@function.builtin
2626
"^(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__)$"))
2727

28+
; Types
29+
30+
(maybe_typed_name
31+
type: ((_) @type))
32+
33+
(type
34+
(identifier) @type)
35+
36+
(c_type
37+
type: ((_) @type))
38+
(c_type
39+
((identifier) @type))
40+
(c_type
41+
((int_type) @type))
42+
43+
(maybe_typed_name
44+
name: ((identifier) @variable))
45+
2846
; Function definitions
2947

3048
(function_definition
3149
name: (identifier) @function)
3250

51+
(cdef_statement
52+
(cvar_def
53+
(maybe_typed_name
54+
name: ((identifier) @function))
55+
(c_function_definition)))
56+
57+
(cvar_decl
58+
(c_type
59+
([(identifier) (int_type)]))
60+
(c_name
61+
((identifier) @function))
62+
(c_function_definition))
63+
3364
(attribute attribute: (identifier) @property)
34-
(type (identifier) @type)
3565

3666
; Literals
3767

3868
[
3969
(none)
70+
] @constant.builtin
71+
72+
[
4073
(true)
4174
(false)
42-
] @constant.builtin
75+
] @boolean
4376

4477
[
4578
(integer)
@@ -96,6 +129,7 @@
96129
"is"
97130
"not"
98131
"or"
132+
"@"
99133
] @operator
100134

101135
[
@@ -130,4 +164,22 @@
130164
"yield"
131165
"match"
132166
"case"
167+
168+
; cython-specific
169+
"cdef"
170+
"cpdef"
171+
"ctypedef"
172+
"cimport"
173+
"nogil"
174+
"gil"
175+
"extern"
176+
"inline"
177+
"public"
178+
"readonly"
179+
"struct"
180+
"union"
181+
"enum"
182+
"fused"
183+
"property"
184+
"namespace"
133185
] @keyword

0 commit comments

Comments
 (0)