@willbooster/tree-sitter-python 2.0.1 → 2.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/queries/highlights.scm +30 -1
- package/tree-sitter-python.wasm +0 -0
- package/tree-sitter.json +1 -1
package/package.json
CHANGED
package/queries/highlights.scm
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
(#match? @constructor "^[A-Z]"))
|
|
7
7
|
|
|
8
8
|
((identifier) @constant
|
|
9
|
-
(#match? @constant "^[A-Z][A-
|
|
9
|
+
(#match? @constant "^[0-9_]*[A-Z][A-Z_0-9]*$"))
|
|
10
10
|
|
|
11
11
|
; Function calls
|
|
12
12
|
|
|
@@ -32,6 +32,35 @@
|
|
|
32
32
|
(function_definition
|
|
33
33
|
name: (identifier) @function)
|
|
34
34
|
|
|
35
|
+
; Later patterns override naming heuristics in syntactically known class positions.
|
|
36
|
+
|
|
37
|
+
((class_definition
|
|
38
|
+
name: (identifier) @constructor)
|
|
39
|
+
(#match? @constructor "^[0-9_]*[A-Z][A-Z_0-9]*$"))
|
|
40
|
+
|
|
41
|
+
((class_definition
|
|
42
|
+
superclasses: (argument_list (identifier) @constructor))
|
|
43
|
+
(#match? @constructor "^[0-9_]*[A-Z][A-Z_0-9]*$"))
|
|
44
|
+
|
|
45
|
+
((class_definition
|
|
46
|
+
superclasses: (argument_list (subscript value: (identifier) @constructor)))
|
|
47
|
+
(#match? @constructor "^[0-9_]*[A-Z][A-Z_0-9]*$"))
|
|
48
|
+
|
|
49
|
+
((except_clause value: [
|
|
50
|
+
(identifier) @constructor
|
|
51
|
+
(tuple (identifier) @constructor)
|
|
52
|
+
(parenthesized_expression (identifier) @constructor)
|
|
53
|
+
(as_pattern [
|
|
54
|
+
(identifier) @constructor
|
|
55
|
+
(tuple (identifier) @constructor)
|
|
56
|
+
(parenthesized_expression (identifier) @constructor)
|
|
57
|
+
])
|
|
58
|
+
])
|
|
59
|
+
(#match? @constructor "^[0-9_]*[A-Z][A-Z_0-9]*$"))
|
|
60
|
+
|
|
61
|
+
((class_pattern (dotted_name (identifier) @constructor .))
|
|
62
|
+
(#match? @constructor "^[0-9_]*[A-Z][A-Z_0-9]*$"))
|
|
63
|
+
|
|
35
64
|
(attribute attribute: (identifier) @property)
|
|
36
65
|
(type (identifier) @type)
|
|
37
66
|
|
package/tree-sitter-python.wasm
CHANGED
|
Binary file
|