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


View this message in rfc822 format

From: Harald Jörg <haj <at> posteo.de>
To: 42168 <at> debbugs.gnu.org
Subject: bug#42168: 26.1; cperl-mode: Bad interpretation of $a++ / $b
Date: Thu, 2 Jul 2020 20:19:21 +0200
[Message part 1 (text/plain, inline)]
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.

Disclaimer: I'm rather new to elisp and even newer to ERT.

Cheers,
haj

[postincrement.diff (text/x-patch, attachment)]

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.