bug-gnu-emacs
[Top][All Lists]
Advanced

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

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


From: E. Choroba
Subject: bug#47598: cperl-mode: Highlighting confused with ternary and -x
Date: Mon, 5 Apr 2021 02:04:56 +0200 (CEST)
User-agent: Alpine 2.21 (LSU 202 2017-01-01)

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.





reply via email to

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