File Coverage

blib/lib/B/Hooks/Parser.pm
Criterion Covered Total %
statement 20 20 100.0
branch n/a
condition n/a
subroutine 6 6 100.0
pod 2 2 100.0
total 28 28 100.0


line stmt bran cond sub pod time code
1 3     3   223813 use strict;
  3         25  
  3         89  
2 3     3   15 use warnings;
  3         5  
  3         141  
3             package B::Hooks::Parser; # git description: v0.20-4-g44a7b86
4             # ABSTRACT: Interface to perl's parser variables
5             # KEYWORDS: perl internals API parser hooks modify
6              
7 3     3   1359 use B::Hooks::OP::Check;
  3         3937  
  3         97  
8 3     3   20 use parent qw/DynaLoader/;
  3         5  
  3         12  
9              
10             our $VERSION = '0.21';
11              
12 3     3 1 653 sub dl_load_flags { 0x01 }
13              
14             __PACKAGE__->bootstrap($VERSION);
15              
16             sub inject {
17 2     2 1 454 my ($code) = @_;
18              
19 2         13 setup();
20              
21 2         7 my $line = get_linestr();
22 2         5 my $offset = get_linestr_offset();
23              
24 2         7 substr($line, $offset, 0) = $code;
25              
26 2         5 set_linestr($line);
27              
28 2         1290 return;
29             }
30              
31             1;
32              
33             __END__