Improve Python syntax highlighting (#25331)

chbk and Marshall Bowers created

Release Notes:

  - Improved Python syntax highlighting.

| Zed 0.174.6 | With this PR |
| --- | --- |
|
![Image](https://github.com/user-attachments/assets/3d8830c9-23cd-437d-88a6-258bcfba5f50)
|
![Image](https://github.com/user-attachments/assets/fd34ca38-c105-4f27-9979-98ab8d616c51)
|

- `identifier`: `variable`
- `.`, `,`, `:`: `punctuation.delimiter`
- `@`: `operator`, for matrix multiplication

```python
class Mat(list):
  def __matmul__(self, b):
    ...
a, b = Mat(), Mat()
identifier = a @ b
IDENTIFIER = True
```

---------

Co-authored-by: Marshall Bowers <git@maxdeviant.com>

Change summary

crates/languages/src/python/highlights.scm | 8 ++++++++
1 file changed, 8 insertions(+)

Detailed changes

crates/languages/src/python/highlights.scm 🔗

@@ -8,6 +8,7 @@
 ((identifier) @constant
   (#match? @constant "^_*[A-Z][A-Z0-9_]*$"))
 
+(identifier) @variable
 (attribute attribute: (identifier) @property)
 (type (identifier) @type)
 (generic_type (identifier) @type)
@@ -117,6 +118,12 @@
   (#match? @variable.special "^self|cls$")
 ]
 
+[
+  "."
+  ","
+  ":"
+] @punctuation.delimiter
+
 [
   "("
   ")"
@@ -190,6 +197,7 @@
   "&"
   "%"
   "%="
+  "@"
   "^"
   "+"
   "->"