[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#26850: perl-mode and cperl-mode: Recognize regex after "return"

From: Harald Jörg
Subject: bug#26850: perl-mode and cperl-mode: Recognize regex after "return"
Date: Mon, 16 Nov 2020 23:13:16 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux)

merge 26850 26745

I don't know whether I have the authority to merge bugs, but they
clearly are the same issue, so I'll just give it a try.

The apostrophe, as mentioned in the subject of Bug#26850, is irrelevant:
The actual problem in both reports is the failure to recognize a regular
expression after the keyword "return".  The apostrophe just changes the
interpretation of the text which follows.

There are several workarounds: You could, for example, explicitly write
the regexes as $_ =~ /.../; ... but of course, why would you do that,
since $_ is superfluous.  Alternatively, you could just omit the
"return", which is also superfluous in the examples provided.

Nevertheless, the patch fixes the issue, which happens in both perl-mode
and cperl-mode.  I guess that in neither mode the list of keywords which
precede a regex is actually complete, but "return" is a use case
relevant enough to be fixed.

Attachment: 0001-cperl-mode-perl-mode-Recognize-a-regular-expression-.patch
Description: Recognize regex after "return"

reply via email to

[Prev in Thread] Current Thread [Next in Thread]