From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Konstantin Kharlamov Newsgroups: gmane.emacs.devel Subject: [PATCH] Highlight typed variables in python Date: Mon, 1 Jun 2020 23:58:33 +0300 Message-ID: <20200601205833.35606-1-Hi-Angel@yandex.ru> Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="109648"; mail-complaints-to="usenet@ciao.gmane.io" To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Jun 01 22:59:28 2020 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jfrWq-000SRd-80 for ged-emacs-devel@m.gmane-mx.org; Mon, 01 Jun 2020 22:59:28 +0200 Original-Received: from localhost ([::1]:58300 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jfrWp-000635-Ak for ged-emacs-devel@m.gmane-mx.org; Mon, 01 Jun 2020 16:59:27 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58432) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jfrWE-0005X1-IX for emacs-devel@gnu.org; Mon, 01 Jun 2020 16:58:50 -0400 Original-Received: from forward102o.mail.yandex.net ([2a02:6b8:0:1a2d::602]:48530) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jfrWC-0003Sh-Q8 for emacs-devel@gnu.org; Mon, 01 Jun 2020 16:58:49 -0400 Original-Received: from mxback9g.mail.yandex.net (mxback9g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:170]) by forward102o.mail.yandex.net (Yandex) with ESMTP id 6CEF4668034F for ; Mon, 1 Jun 2020 23:58:41 +0300 (MSK) Original-Received: from iva4-bca95d3b11b1.qloud-c.yandex.net (iva4-bca95d3b11b1.qloud-c.yandex.net [2a02:6b8:c0c:4e8e:0:640:bca9:5d3b]) by mxback9g.mail.yandex.net (mxback/Yandex) with ESMTP id gDEtXVcZU8-wfVGgEQi; Mon, 01 Jun 2020 23:58:41 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1591045121; bh=UX3JEA92rSROlxJ3EaQYE1XJK3iU700FX8aG+xGMo34=; h=Subject:To:From:Date:Message-Id; b=tdzelJJOcw0b5gXOVopXWGckkyEg+QFwvhHe16V5vw2llEDjp7KNtsVNhEQkJmmbA xSaDqIKD8m9l8pVeYIszw3ybkGCiipjEHMlet8LfBh3S4qgKHnBvZFFUupvgn/Kfem 2JCAANiVxnNedbPtOSIN75/kYS8og+95leoKjTXw= Authentication-Results: mxback9g.mail.yandex.net; dkim=pass header.i=@yandex.ru Original-Received: by iva4-bca95d3b11b1.qloud-c.yandex.net (smtp/Yandex) with ESMTPSA id i6e9W4Pu11-weXGRW2b; Mon, 01 Jun 2020 23:58:40 +0300 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client certificate not present) X-Mailer: git-send-email 2.26.2 Received-SPF: pass client-ip=2a02:6b8:0:1a2d::602; envelope-from=Hi-Angel@yandex.ru; helo=forward102o.mail.yandex.net X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:251740 Archived-At: * progmodes/python.el (python-font-lock-keywords-maximum-decoration): recognize typed variables like "foo: int = 1" as well. --- lisp/progmodes/python.el | 1 + 1 file changed, 1 insertion(+) diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index ae5aff351c0..0263f4cc291 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -634,6 +634,7 @@ python-font-lock-keywords-maximum-decoration (,(lambda (limit) (let ((re (python-rx (group (+ (any word ?. ?_))) (? ?\[ (+ (not (any ?\]))) ?\]) (* space) + (? ?: (* space) (+ (any word ?. ?_)) (* space)) ;; a type, like " : int " assignment-operator)) (res nil)) (while (and (setq res (re-search-forward re limit t)) -- 2.26.2