File Coverage

blib/lib/RDF/Notation3/ReaderString.pm
Criterion Covered Total %
statement 9 26 34.6
branch 0 4 0.0
condition 0 3 0.0
subroutine 3 5 60.0
pod 0 1 0.0
total 12 39 30.7


line stmt bran cond sub pod time code
1 2     2   10 use strict;
  2         3  
  2         68  
2 2     2   8 use warnings;
  2         3  
  2         79  
3              
4             package RDF::Notation3::ReaderString;
5              
6             require 5.005_62;
7 2     2   9 use RDF::Notation3::Template::TReader;
  2         4  
  2         555  
8              
9             ############################################################
10              
11             @RDF::Notation3::ReaderString::ISA = qw(RDF::Notation3::Template::TReader);
12              
13             sub new {
14 0     0 0   my ($class, $str) = @_;
15 0           my @lines = split /\n|\r|\n\r/, $str;
16              
17 0           my $self = {
18             lines => \@lines,
19             tokens => [],
20             ln => 0,
21             };
22              
23 0           bless $self, $class;
24 0           return $self;
25             }
26              
27             sub _new_line {
28 0     0     my ($self, $dont_modify) = @_;
29              
30 0           my $line = '';
31              
32 0           until ($line) {
33 0           $line = shift @{$self->{lines}};
  0            
34 0           $self->{ln}++;
35              
36 0 0 0       unless ($dont_modify or !$line) {
37 0           $line =~ s/^\s*(.*)$/$1/;
38 0           $line =~ s/^(\#.*)$//;
39             }
40 0 0         last unless (scalar @{$self->{lines}});
  0            
41             }
42 0           return $line;
43             }
44              
45              
46             1;
47              
48             __END__