Subject: [PATCH] Add "->" to python--treesit-operators
From: Daniel Martín <[email-masked]>
To: [email-masked]
Date: Sun, 11 Dec 2022 17:37:20 +0100
List-Id: <debbugs-submit.debbugs.gnu.org>

Tags: patch

Python has a "->" operator to specify the return type of functions.
For example:

def add(a: int, b: int) -> int:
    return a + b

The following patch adds support for it in python-ts-mode.

From 18b8e2e2719726f8f7c06f8374b39b51e15c42b2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Daniel=20Mart=C3=ADn?= <[email-masked]>
Date: Sun, 11 Dec 2022 17:33:13 +0100
Subject: [PATCH] Add "->" to python--treesit-operators

* lisp/progmodes/python.el (python--treesit-operators): Add "->", used
to specify the return types of functions in Python.
---
 lisp/progmodes/python.el | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index ebee703499..0e0898ffe2 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -993,7 +993,8 @@ python--treesit-constants
 
 (defvar python--treesit-operators
   '("-" "-=" "!=" "*" "**" "**=" "*=" "/" "//" "//=" "/=" "&" "%" "%="
-    "^" "+" "+=" "<" "<<" "<=" "<>" "=" "==" ">" ">=" ">>" "|" "~" "@" "@="))
+    "^" "+" "->" "+=" "<" "<<" "<=" "<>" "=" ":=" "==" ">" ">=" ">>" "|"
+    "~" "@" "@="))
 
 (defvar python--treesit-special-attributes
   '("__annotations__" "__closure__" "__code__"
-- 
2.34.1