This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package JS::Perl::Tidy; | |
use Perl::Tidy qw(); | |
use strict; | |
use warnings; | |
sub perltidy { | |
return Perl::Tidy::perltidy( prefilter => \&prefilter, postfilter => \&postfilter, @_ ); | |
} | |
sub prefilter { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Separate out compiler and request parameters | |
# | |
$self->{compiler_params} = {}; | |
my %is_compiler_attribute = | |
map { ( $_, 1 ) } $self->compiler_class->meta->get_attribute_list(); | |
foreach my $key ( keys(%$params) ) { | |
if ( $is_compiler_attribute{$key} ) { | |
$self->{compiler_params}->{$key} = delete( $params->{$key} ); | |
} | |
} |