all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Daniel Martín via Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: 59968@debbugs.gnu.org
Subject: bug#59968: [PATCH] Add "->" to python--treesit-operators
Date: Sun, 11 Dec 2022 17:37:20 +0100	[thread overview]
Message-ID: <m1bko9nbgf.fsf@yahoo.es> (raw)
In-Reply-To: m1bko9nbgf.fsf.ref@yahoo.es

[-- Attachment #1: Type: text/plain, Size: 206 bytes --]

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.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Add-to-python-treesit-operators.patch --]
[-- Type: text/patch, Size: 1032 bytes --]

From 18b8e2e2719726f8f7c06f8374b39b51e15c42b2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Daniel=20Mart=C3=ADn?= <mardani29@yahoo.es>
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


       reply	other threads:[~2022-12-11 16:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <m1bko9nbgf.fsf.ref@yahoo.es>
2022-12-11 16:37 ` Daniel Martín via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2022-12-14  1:53   ` bug#59968: [PATCH] Add "->" to python--treesit-operators Yuan Fu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m1bko9nbgf.fsf@yahoo.es \
    --to=bug-gnu-emacs@gnu.org \
    --cc=59968@debbugs.gnu.org \
    --cc=mardani29@yahoo.es \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.