GNU bug report logs - #42168
26.1; cperl-mode: Bad interpretation of $a++ / $b

Previous Next

Package: emacs;

Reported by: Harald Jörg <haj <at> posteo.de>

Date: Thu, 2 Jul 2020 19:37:02 UTC

Severity: minor

Tags: confirmed, patch

Merged with 36946

Found in versions 26.1, 26.2, 28.0.50

Fixed in version 28.1

Done: Stefan Kangas <stefankangas <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #8 received at 42168 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Harald Jörg <haj <at> posteo.de>
Cc: 42168 <at> debbugs.gnu.org
Subject: Re: bug#42168: 26.1; cperl-mode: Bad interpretation of $a++ / $b
Date: Sat, 11 Jul 2020 12:53:49 +0300
> From: Harald Jörg <haj <at> posteo.de>
> Date: Thu, 2 Jul 2020 20:19:21 +0200
> 
> How to reproduce:
> In a buffer, activate cperl-mode (M-x cperl-mode), then enter:
> 
> $a++ / $b;
> 
> This is supposed to be a division.  However, cperl-mode interprets the
> slash as the start of a regular expression.  Accordingly, the following
> text is displayed with the wrong face, and also cperl-mode might
> complain that it can't find the end of the regular expression.
> 
> Emacs does not crash.
> 
> Attached: A patch which fixes the issue for $a++ and $a--, and also
> includes a test to verify that the very similar text "$a+ / $b" is still
> correctly interpreted as a regular expression.

Thanks.

To accept a substantial contribution such as this one, we will need
you to assign the copyright of your code to the FSF.  If you are okay
with starting your legal paperwork, I will send you the form to sign
and email.

Thank you for your interest in Emacs.




This bug report was last modified 4 years and 268 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.