Perl-Critic/PPI

dies with unicode bare key name

plicease opened this issue · 3 comments

First reported with to Perl::Critic, since I wasn't sure if the problem was there or here. However, it seems to be reproducible with ppidump (see Perl-Critic/Perl-Critic#948 (comment) ), so I believe this is indeed a PPI issue.

code:

use utf8;
my %x = (Привет => 1);

my($key) = keys %x;
die unless $key eq 'Привет';

perlcritic:

% perlcritic .
Problem while critiquing "foo.pl": Can't parse code: Encountered unexpected character '208'

It does work when I change it to 'Привет' => 1)

I admit to not being 100% certain that you can use a bare unicode key name like this, but the code does seem to work as intended. If so a more useful diagnostic would indicate where the character is located, if that is possible.