File Coverage

blib/lib/Regexp/SAR.pm
Criterion Covered Total %
statement 6 33 18.1
branch 0 6 0.0
condition n/a
subroutine 2 11 18.1
pod 7 8 87.5
total 15 58 25.8


line stmt bran cond sub pod time code
1             package Regexp::SAR;
2              
3              
4              
5              
6              
7 2     2   33267 use strict;
  2         5  
  2         72  
8 2     2   6 use warnings;
  2         2  
  2         726  
9              
10              
11             require XSLoader;
12             XSLoader::load( 'Regexp::SAR' );
13              
14              
15             sub new {
16 0     0 1   my $class = shift;
17              
18 0           my $obj = [];
19 0           my $rootNode = Regexp::SAR::buildRootNode();
20 0           return bless \$rootNode, $class;
21             }
22              
23             sub addRegexp {
24 0     0 1   my ( $rootRef, $regexpStr, $handler ) = @_;
25 0           my $reLength = length $regexpStr;
26 0 0         unless ($reLength) {
27 0           return;
28             }
29 0           Regexp::SAR::buildPath( $$rootRef, $regexpStr, $reLength, $handler );
30             }
31              
32             sub match {
33 0     0 1   my ( $rootRef, $matchStr ) = @_;
34 0 0         if (ref $matchStr) {
35 0           Regexp::SAR::lookPathRef( $$rootRef, $matchStr, 0 );
36             }
37             else {
38 0           Regexp::SAR::lookPath( $$rootRef, $matchStr, 0 );
39             }
40             }
41              
42             sub matchRef {
43 0     0 0   my ( $rootRef, $matchStr ) = @_;
44 0           Regexp::SAR::lookPathRef( $$rootRef, $matchStr, 0 );
45             }
46              
47             sub matchFrom {
48 0     0 1   my ( $rootRef, $matchStr, $pos ) = @_;
49 0 0         if (ref $matchStr) {
50 0           Regexp::SAR::lookPathRef( $$rootRef, $matchStr, $pos );
51             }
52             else {
53 0           Regexp::SAR::lookPath( $$rootRef, $matchStr, $pos );
54             }
55             }
56              
57             sub matchAt {
58 0     0 1   my ( $rootRef, $matchStr, $pos ) = @_;
59 0           Regexp::SAR::lookPathAtPos( $$rootRef, $matchStr, $pos );
60             }
61              
62             sub stopMatch {
63 0     0 1   my ( $rootRef ) = @_;
64 0           Regexp::SAR::stop($$rootRef);
65             }
66              
67             sub continueFrom {
68 0     0 1   my ( $rootRef, $from ) = @_;
69 0           Regexp::SAR::continue($$rootRef, $from);
70             }
71              
72             sub DESTROY {
73 0     0     my ( $rootRef ) = @_;
74 0           Regexp::SAR::cleanAll($$rootRef);
75             }
76              
77             1;
78              
79             __END__