all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Dario Gjorgjevski <dario.gjorgjevski@gmail.com>
To: 44572@debbugs.gnu.org
Subject: bug#44572: [PATCH] Fix regression from 296e4dd
Date: Wed, 11 Nov 2020 12:11:26 +0100	[thread overview]
Message-ID: <fv2zojmtzob129.fsf@gmail.com> (raw)

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

‘symbol-name’ should not be quantified by a ‘+’ as it is redundant and
performs very badly.

Sorry for the mishap!


[-- Attachment #2: Fix regression from 296e4dd --]
[-- Type: text/x-diff, Size: 2461 bytes --]

From e8b6bdff94a4c997eabc332b39a9d009762ae247 Mon Sep 17 00:00:00 2001
From: Dario Gjorgjevski <dario.gjorgjevski@gmail.com>
Date: Wed, 11 Nov 2020 12:07:04 +0100
Subject: [PATCH] Fix regression from 296e4dd
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

‘symbol-name’ should not be quantified by a ‘+’ as it is redundant and
performs very badly.
---
 lisp/progmodes/python.el | 19 ++++++++-----------
 1 file changed, 8 insertions(+), 11 deletions(-)

diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index eb84b494e3..a179318589 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -662,14 +662,11 @@ python-font-lock-keywords-maximum-decoration
     ;; assignments
     ;; support for a = b = c = 5
     (,(lambda (limit)
-        (let ((re (python-rx (group (+ symbol-name))
-                             (? ?\[ (+ (not ?\])) ?\])
-                             (* space)
-                             ;; A type, like " : int ".
-                             (? ?:
-                                (* space)
-                                (+ not-simple-operator)
-                                (* space))
+        (let ((re (python-rx (group symbol-name)
+                             ;; subscript, like "[5]"
+                             (? ?\[ (+ (not ?\])) ?\]) (* space)
+                             ;; type hint, like ": int" or ": Mapping[int, str]"
+                             (? ?: (* space) (+ not-simple-operator) (* space))
                              assignment-operator))
               (res nil))
           (while (and (setq res (re-search-forward re limit t))
@@ -679,9 +676,9 @@ python-font-lock-keywords-maximum-decoration
      (1 font-lock-variable-name-face nil nil))
     ;; support for a, b, c = (1, 2, 3)
     (,(lambda (limit)
-        (let ((re (python-rx (group (+ symbol-name)) (* space)
-                             (* ?, (* space) (+ symbol-name) (* space))
-                             ?, (* space) (+ symbol-name) (* space)
+        (let ((re (python-rx (group symbol-name) (* space)
+                             (* ?, (* space) symbol-name (* space))
+                             ?, (* space) symbol-name (* space)
                              assignment-operator))
               (res nil))
           (while (and (setq res (re-search-forward re limit t))
-- 
2.28.0


[-- Attachment #3: Type: text/plain, Size: 149 bytes --]


Best regards,
Dario

-- 
$ keyserver=hkps://hkps.pool.sks-keyservers.net
$ keyid=744A4F0B4F1C9371
$ gpg --keyserver $keyserver --search-keys $keyid

             reply	other threads:[~2020-11-11 11:11 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-11 11:11 Dario Gjorgjevski [this message]
2020-11-11 11:28 ` bug#44572: [PATCH] Fix regression from 296e4dd Lars Ingebrigtsen

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=fv2zojmtzob129.fsf@gmail.com \
    --to=dario.gjorgjevski@gmail.com \
    --cc=44572@debbugs.gnu.org \
    /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.