Subject: | Acme::MetaSyntactic::RefactorCode is broken with AMS::alphabet |
I'm using AMSRC 0.02, and AMS 0.71 with Perl 5.8.8.
script.pl is a basic Perl example.
$ perl -MAcme::MetaSyntactic::RefactorCode script.pl -t alphabet
The symbol dictionary is empty! at
/opt/perl/5.8.8/lib/site_perl/5.8.8/B/Deobfuscate.pm line 56
B::Deobfuscate::load_unknown_dict('B::Deobfuscate=HASH(0x8454ff0)')
called at /opt/perl/5.8.8/lib/site_perl/5.8.8/B/Deobfuscate.pm line 261
B::Deobfuscate::new('B::Deobfuscate',
'Acme::MetaSyntactic::RefactorCode') called at
/opt/perl/5.8.8/lib/site_perl/5.8.8/B/Deobfuscate.pm line 279
B::Deobfuscate::__ANON__() called at (eval 18) line 31
O::CHECK() called at script.pl line 0
eval {...} called at script.pl line 0
CHECK failed--call queue aborted, <DATA> line 1.
This does not seem to be related to the fact that AMS::alphabet is an
AMS::Locale theme, because other multilingual themes work perfectly.
$ perl -MAcme::MetaSyntactic::RefactorCode script.pl -t haddock
Loup_garou_a_la_graisse_de_renoncule_de_mille_tonnerres_de_Brest();
sub Loup_garou_a_la_graisse_de_renoncule_de_mille_tonnerres_de_Brest {
my($Brute, $Demon, $Judas, $Lache, @Mufle) = @_;
foreach my $Papou (@Mufle) {
();
}
}
Worse than that, other alphabet subthemes work correctly:
$ LANG=he perl -MAcme::MetaSyntactic::RefactorCode script.pl -t alphabet
tsadie();
sub tsadie {
my($chet, $resh, $shin, $aleph, @dalet) = @_;
foreach my $lamed (@dalet) {
();
}
}
script.pl syntax OK
I think it may be possible that it only breaks with replacement variable
names that are only 1 character long.
I think I have found the culprit: B::Deobfuscate remove all items
shorter than 3 characters!
In load_unknown_dict():
$p->{'unknown_dict_data'} =
[ sort { length $a <=> length $b or $a cmp $b }
grep { length > 3 and ! /\W/ and ! exists $k->{$_} }
split /\n/, $dict_data ];
If I replace the 3 by 0, this works perfectly.
I'll file a bug report to B::Deobfuscate.