Subject: Re: bug#42168: 26.1; cperl-mode: Bad interpretation of $a++ / $b

From: Stefan Kangas <[email-masked]>
Date: Wed, 12 Aug 2020 17:40:19 -0700

Eli Zaretskii <[email-masked]> writes:

>> From: Harald Jörg <[email-masked]>
>> 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.

Harald, would you be willing to sign the copyright papers?  Please find
out more about the reason for this here:

    https://www.gnu.org/licenses/why-assign.html

Best regards,
Stefan Kangas