Added libextutils-xspp-perl
[pkg-perl] / deb-src / libextutils-xspp-perl / libextutils-xspp-perl-0.07 / t / lib / XSP / Plugin.pm
1 package t::lib::XSP::Plugin;
2
3 use strict;
4 use warnings;
5
6 sub new { return bless {}, $_[0] }
7
8 sub register_plugin {
9     my( $class, $parser ) = @_;
10
11     $parser->add_post_process_plugin( $class->new );
12 }
13
14 # add _perl to all function/method names
15 sub post_process {
16     my( $self, $nodes ) = @_;
17
18     foreach my $node ( @$nodes ) {
19         next unless $node->isa( 'ExtUtils::XSpp::Node::Function' );
20         $node->set_perl_name( $node->cpp_name . '_perl' );
21     }
22 }
23
24 1;