From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Harald =?UTF-8?Q?J=C3=B6rg?= Newsgroups: gmane.emacs.bugs Subject: bug#66178: 30.0.50; cperl-mode inconsistent hash key fontification Date: Sun, 24 Sep 2023 13:44:02 +0000 Message-ID: <8734z3y9cp.fsf@oook.m.uunet.de> References: <1817567d-4fce-cd09-a34f-89e30186c0b3@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="891"; mail-complaints-to="usenet@ciao.gmane.io" To: 66178@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Sep 24 15:45:13 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1qkPQ6-000AUu-PA for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 24 Sep 2023 15:45:10 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qkPPo-0000n0-Pm; Sun, 24 Sep 2023 09:44:52 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qkPPn-0000mE-33 for bug-gnu-emacs@gnu.org; Sun, 24 Sep 2023 09:44:51 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qkPPm-0007dH-R3 for bug-gnu-emacs@gnu.org; Sun, 24 Sep 2023 09:44:50 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qkPPy-00078N-61 for bug-gnu-emacs@gnu.org; Sun, 24 Sep 2023 09:45:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Harald =?UTF-8?Q?J=C3=B6rg?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 24 Sep 2023 13:45:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 66178 X-GNU-PR-Package: emacs Original-Received: via spool by 66178-submit@debbugs.gnu.org id=B66178.169556307127363 (code B ref 66178); Sun, 24 Sep 2023 13:45:02 +0000 Original-Received: (at 66178) by debbugs.gnu.org; 24 Sep 2023 13:44:31 +0000 Original-Received: from localhost ([127.0.0.1]:41350 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qkPPT-00077H-5p for submit@debbugs.gnu.org; Sun, 24 Sep 2023 09:44:31 -0400 Original-Received: from mout02.posteo.de ([185.67.36.66]:48257) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qkPPP-00076u-0b for 66178@debbugs.gnu.org; Sun, 24 Sep 2023 09:44:29 -0400 Original-Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id E974F240101 for <66178@debbugs.gnu.org>; Sun, 24 Sep 2023 15:44:08 +0200 (CEST) Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4RtnKg1rW2z9ryh; Sun, 24 Sep 2023 15:44:07 +0200 (CEST) In-Reply-To: <1817567d-4fce-cd09-a34f-89e30186c0b3@gmail.com> (Mauro Aranda's message of "Sun, 24 Sep 2023 08:02:04 -0300") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:271245 Archived-At: tags 66178 + wontfix thanks Mauro Aranda writes: > emacs -Q > C-x C-f bug.pl > M-x cperl-mode > my %factorial = ( > 0 => 1, > zero => 1 > ); > > zero is recognized as a string, 0 is not. This might look surprising, but it is intentional. zero is a bareword which undergoes hash-key stringification. The digit 0, on the other hand, is converted to a string according to Perl's type conversion rules. That is a different thing: Perl's type conversion converts all of 0, 000, 0.0, 0E0 to the hash key "0". Let me expand your example to demonstrate some more cases where the hash key is (correctly) not fontified as a string: my %hash = ( "0" => 'The string "0"', "00" => 'The string "00"', 0 => 'A number which is converted to the string "0"', 00 => 'A number which is converted to the string "0"', 0.0 => 'A number which is converted to the string "0"', 0E0 => 'A number which is converted to the string "0"', zero => "A bareword which is stringified", zero() => "The function's return value is the key", +zero => "The function's return value is the key", ); -- Cheers, haj