GNU bug report logs - #47598
cperl-mode: Highlighting confused with ternary and -x

Previous Next

Package: emacs;

Reported by: "E. Choroba" <choroba <at> matfyz.cz>

Date: Mon, 5 Apr 2021 00:06:01 UTC

Severity: normal

Tags: fixed, patch

Fixed in version 28.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


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

From: "E. Choroba" <choroba <at> matfyz.cz>
To: bug-gnu-emacs <at> gnu.org
Subject: cperl-mode: Highlighting confused with ternary and -x
Date: Mon, 5 Apr 2021 02:04:56 +0200 (CEST)
When combining the ternary operator with file tests using the default 
argument, cperl-mode gets confused.

For example:

my $f = -f ? 'file'
      : -l ? [readlink]
      : -d ? 'dir'
           : 'unknown';

It seems to think the ?'s are not part of a ternary operator, but rather a 
match-once operator. Note that m?? without m results in a syntax error since 
Perl 5.22.

Ch.




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

Previous Next


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