Closed moregan closed 7 years ago
PPI::Token::Symbol->canonical and ->symbol' normalize the perl4 package separator'to::``:
PPI::Token::Symbol->canonical
->symbol' normalize the perl4 package separator
to
$ perl -MPPI -WE 'my $d = PPI::Document->new( \"\$'x\''y" ); my ($s) = @{ $d->find("PPI::Token::Symbol") }; say join "\n", $s->content, $s->canonical, $s->symbol;' $x'y $x::y $x::y
and normalize leading :: to `main:::
::
`main::
$ perl -MPPI -WE 'my $d = PPI::Document->new( \"\$::x" ); my ($s) = @{ $d->find("PPI::Token::Symbol") }; say join "\n", $s->content, $s->canonical, $s->symbol;' $::x $main::x $main::x
but not in combination. I'd expect canonical on $'x to be $main::x:
$'x
$main::x
$ perl -MPPI -WE 'my $d = PPI::Document->new( \"\$'\''x" ); my ($s) = @{ $d->find("PPI::Token::Symbol") }; say join "\n", $s->content, $s->canonical, $s->symbol;' $'x $::x $::x
This is fixed and released.
PPI::Token::Symbol->canonical
and->symbol' normalize the perl4 package separator
'to
::``:and normalize leading
::
to`main::
:but not in combination. I'd expect canonical on
$'x
to be$main::x
: