From unknown Mon Aug 18 08:27:40 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#45255 <45255@debbugs.gnu.org> To: bug#45255 <45255@debbugs.gnu.org> Subject: Status: cperl-mode doesn't recognise the double diamond operator Reply-To: bug#45255 <45255@debbugs.gnu.org> Date: Mon, 18 Aug 2025 15:27:40 +0000 retitle 45255 cperl-mode doesn't recognise the double diamond operator reassign 45255 emacs submitter 45255 "E. Choroba" severity 45255 normal tag 45255 fixed thanks From debbugs-submit-bounces@debbugs.gnu.org Tue Dec 15 09:20:22 2020 Received: (at submit) by debbugs.gnu.org; 15 Dec 2020 14:20:22 +0000 Received: from localhost ([127.0.0.1]:55979 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kpBBe-000837-9V for submit@debbugs.gnu.org; Tue, 15 Dec 2020 09:20:22 -0500 Received: from lists.gnu.org ([209.51.188.17]:57050) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kpBBc-00082z-HH for submit@debbugs.gnu.org; Tue, 15 Dec 2020 09:20:20 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:35588) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kpBBc-0002IR-9g for bug-gnu-emacs@gnu.org; Tue, 15 Dec 2020 09:20:20 -0500 Received: from ufal-mail.mff.cuni.cz ([195.113.20.158]:54200) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kpBBa-00017m-2F for bug-gnu-emacs@gnu.org; Tue, 15 Dec 2020 09:20:19 -0500 Received: from localhost (localhost.localdomain [127.0.0.1]) by ufal-mail.mff.cuni.cz (Postfix) with ESMTP id 20D6E6FC934 for ; Tue, 15 Dec 2020 15:20:14 +0100 (CET) Received: from ufal-mail.mff.cuni.cz ([127.0.0.1]) by localhost (ufal-mail.mff.cuni.cz [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id 1ZNq6HUitLoM for ; Tue, 15 Dec 2020 15:20:14 +0100 (CET) Received: from localhost (localhost.localdomain [127.0.0.1]) by ufal-mail.mff.cuni.cz (Postfix) with ESMTP id 1A2D36FBE65 for ; Tue, 15 Dec 2020 15:20:14 +0100 (CET) X-Virus-Scanned: amavisd-new at ufal.mff.cuni.cz Received: from ufal-mail.mff.cuni.cz ([127.0.0.1]) by localhost (ufal-mail.mff.cuni.cz [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id a4K3TKj2sz7K for ; Tue, 15 Dec 2020 15:20:14 +0100 (CET) Received: from [192.168.0.111] (83-101-243-80.cust.centrio.cz [80.243.101.83]) by ufal-mail.mff.cuni.cz (Postfix) with ESMTPSA id 00A636FBED1 for ; Tue, 15 Dec 2020 15:20:13 +0100 (CET) Date: Tue, 15 Dec 2020 15:20:13 +0100 (CET) From: "E. Choroba" X-X-Sender: jan.stepanek@triangle To: bug-gnu-emacs@gnu.org Subject: cperl-mode doesn't recognise the double diamond operator Message-ID: User-Agent: Alpine 2.21 (LSU 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset=US-ASCII Received-SPF: none client-ip=195.113.20.158; envelope-from=choroba@matfyz.cz; helo=ufal-mail.mff.cuni.cz X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Perl 5.22 added the new form of the diamond operator <<>> (which uses the three argument version of open under the hood). Unfortunately, cperl-mode doesn't recognise it and treats it as a HERE-doc start: while (<<>>) { This is displayed in the font-lock-string-face. The here document ends with an empty line. Pressing Tab doesn't indent the code. Ch. From debbugs-submit-bounces@debbugs.gnu.org Tue Dec 15 12:55:16 2020 Received: (at 45255) by debbugs.gnu.org; 15 Dec 2020 17:55:16 +0000 Received: from localhost ([127.0.0.1]:59041 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kpEXc-00083e-DS for submit@debbugs.gnu.org; Tue, 15 Dec 2020 12:55:16 -0500 Received: from mout02.posteo.de ([185.67.36.66]:43307) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kpEXa-00083R-Lu for 45255@debbugs.gnu.org; Tue, 15 Dec 2020 12:55:15 -0500 Received: from submission (posteo.de [89.146.220.130]) by mout02.posteo.de (Postfix) with ESMTPS id 29FD82400FB for <45255@debbugs.gnu.org>; Tue, 15 Dec 2020 18:55:08 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.de; s=2017; t=1608054908; bh=kdU/xcl9DXqFjwRG+xQblFYGpeeh/cltDI9HMwUo/ok=; h=From:To:Subject:Date:From; b=OjgEA+krNewRNRh/7Dx0UUipd11Vmg2crhGJzKuHMVSxVge8Vj4M7inVDrmS3kujN Juzw+crhq34vl7Y0FOyS4wNs9Ymi0MH3ThGHzOSZUgH6ghnvMKwgHb1x6DTNKYmjAY tcd97B4nchgoGXO+EAmBhuMeK2pGgdOu4+Dw2uAiN+zhEUl1aQureOQ8RvFW3E0Saf tepWwrQ/J4EQ2dy6EAu5Qiq6a4Gn1K/+n/MZynAM/QPbdwcIbHmCDM0Scpij0xupCw w/5sdInRITb5R9haF0E0KmrWDYnDYqJ5Y+PRlwSvVKZu5+rgm1EIyaNf6J/TDyki51 6ZUPGr8hHUlog== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4CwQrq4Zqdz9rxb for <45255@debbugs.gnu.org>; Tue, 15 Dec 2020 18:55:07 +0100 (CET) From: haj@posteo.de (Harald =?utf-8?Q?J=C3=B6rg?=) To: 45255@debbugs.gnu.org Subject: [PATCH] cperl-mode: Don't mistreat <<>> as starting a here-doc User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) Date: Tue, 15 Dec 2020 18:55:07 +0100 Message-ID: <87wnxjar9g.fsf@hajtower> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 45255 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) --=-=-= Content-Type: text/plain The patch includes "<<>>" in the list of checks for stuff which does not start a here-doc after "<<", and adds a test. -- Cheers, haj --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-CPerl-mode-don-t-treat-as-starting-a-here-doc.patch Content-Description: Don't treat <<>> as here-doc >From 80c7ba0cb9ffc71b5d3ebd389f668d1c8fd86462 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Harald=20J=C3=B6rg?= Date: Tue, 15 Dec 2020 18:53:03 +0100 Subject: [PATCH] ; CPerl-mode: don't treat <<>> as starting a here-doc * lisp/progmodes/cperl-mode.el (cperl-find-pods-heres): Detect the "<<>>" operator (Bug#42455). * test/lisp/progmodes/cperl-mode-tests.el (cperl-test-bug-45255): Verify that <<>> does not start a HERE-doc. --- lisp/progmodes/cperl-mode.el | 3 ++- test/lisp/progmodes/cperl-mode-tests.el | 8 ++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el index ae839a6622..a9edb42b15 100644 --- a/lisp/progmodes/cperl-mode.el +++ b/lisp/progmodes/cperl-mode.el @@ -3694,13 +3694,14 @@ cperl-find-pods-heres ;; ;; "\\([^= \t0-9$@%&]\\|[ \t]+[^ \t\n0-9$@%&]\\)" ; 6 + 1 ;; "\\(\\)" ; To preserve count of pars :-( 6 + 1 ;; "\\)" - ((match-beginning 3) ; 2 + 1 + ((match-beginning 3) ; 2 + 1: found "<<", detect its type (setq b (point) tb (match-beginning 0) c (and ; not HERE-DOC (match-beginning 6) (save-match-data (or (looking-at "[ \t]*(") ; << function_call() + (looking-at ">>") ; <<>> operator (save-excursion ; 1 << func_name, or $foo << 10 (condition-case nil (progn diff --git a/test/lisp/progmodes/cperl-mode-tests.el b/test/lisp/progmodes/cperl-mode-tests.el index 896160bb88..cb2d067a61 100644 --- a/test/lisp/progmodes/cperl-mode-tests.el +++ b/test/lisp/progmodes/cperl-mode-tests.el @@ -312,4 +312,12 @@ cperl-test-bug-42168 (let ((code "{ $a- / $b } # /")) (should (equal (nth 8 (cperl-test-ppss code "/")) 7)))) +(ert-deftest cperl-test-bug-45255 () + "Verify that \"<<>>\" is recognized as not starting a HERE-doc." + (let ((code (concat "while (<<>>) {\n" + " ...;\n" + "}\n"))) + ;; The yadda-yadda operator should not be in a string. + (should (equal (nth 8 (cperl-test-ppss code "\\.")) nil)))) + ;;; cperl-mode-tests.el ends here -- 2.20.1 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Wed Dec 16 10:40:16 2020 Received: (at 45255) by debbugs.gnu.org; 16 Dec 2020 15:40:16 +0000 Received: from localhost ([127.0.0.1]:33523 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kpYuW-0002BM-GW for submit@debbugs.gnu.org; Wed, 16 Dec 2020 10:40:16 -0500 Received: from mail-pl1-f177.google.com ([209.85.214.177]:44545) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kpYuR-0002Am-0f for 45255@debbugs.gnu.org; Wed, 16 Dec 2020 10:40:13 -0500 Received: by mail-pl1-f177.google.com with SMTP id r4so13137923pls.11 for <45255@debbugs.gnu.org>; Wed, 16 Dec 2020 07:40:10 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=ve1L3F5ckYle85QAXFwQTZEX4ce0nghmNyEagoIdClA=; b=lDNogMQ9mKZ8zzRERMihvIgmrFhT8hd5rp8ADYN1uxk6Du0XBHv9yqYZdbv3HnS1K5 pcpckt7cRCVNbJoqKuJG5YWSlp7iQQJtsyNmMUDI24E4XLYv2141WpHBKupXAoui3HsC k/7UraSrXC3mCU6mI39i2H9PcgZ5NRru/AfiphMk3RgTU0zTpL/GBZBp2GqEZmzXopYB /zJ/J8oBCsXR764sY8b/BDqeTComT+coqk9n5GKWFTDUoWoWKsx5Ax2Y/6vS2Diz9ycv Q7Yw0UGXDi6LVLO9oHCRzSyQjQ0ObzGUF0GeiS5ZWGb1mX0U203vFEGemZwT89MYq/vy NAuA== X-Gm-Message-State: AOAM5304EfU3XK4GJOun65AnC4y3Ut1RgFJzBxY1WvgsxIKXz8tXrgNd odE9tpD9ihFtwA1c8v3CGyaKTEPzhjVUEZkK7i0= X-Google-Smtp-Source: ABdhPJy0r3hg3v8VT+FAiAP5PCfw6zoXT76kD8zOPw18muyag6KnFUg+PSs7QLQGuwryyagjPbDGT5ei3D0hspQNw0A= X-Received: by 2002:a17:902:9309:b029:db:c725:d19c with SMTP id bc9-20020a1709029309b02900dbc725d19cmr5291015plb.39.1608133205212; Wed, 16 Dec 2020 07:40:05 -0800 (PST) MIME-Version: 1.0 References: <87wnxjar9g.fsf@hajtower> In-Reply-To: <87wnxjar9g.fsf@hajtower> From: Stefan Kangas Date: Wed, 16 Dec 2020 16:39:53 +0100 Message-ID: Subject: Re: bug#45255: [PATCH] cperl-mode: Don't mistreat <<>> as starting a here-doc To: =?UTF-8?B?SGFyYWxkIErDtnJn?= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.5 (/) X-Debbugs-Envelope-To: 45255 Cc: 45255@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.5 (/) tags 45255 fixed close 45255 28.1 thanks Harald J=C3=B6rg writes: > The patch includes "<<>>" in the list of checks for stuff which does not > start a here-doc after "<<", and adds a test. LGTM, so I pushed it to master as commit 32d85e3079. Thanks! From unknown Mon Aug 18 08:27:40 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Thu, 14 Jan 2021 12:24:05 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator