[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#42168: 26.1; cperl-mode: Bad interpretation of $a++ / $b
From: |
Harald Jörg |
Subject: |
bug#42168: 26.1; cperl-mode: Bad interpretation of $a++ / $b |
Date: |
Thu, 2 Jul 2020 20:19:21 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0 |
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
Description: Text Data
- bug#42168: 26.1; cperl-mode: Bad interpretation of $a++ / $b,
Harald Jörg <=