File Coverage

blib/lib/Dotiac/DTL/Tag/comment.pm
Criterion Covered Total %
statement 63 69 91.3
branch n/a
condition n/a
subroutine 12 14 85.7
pod 11 11 100.0
total 86 94 91.4


line stmt bran cond sub pod time code
1             #comment.pm
2             #Last Change: 2009-01-19
3             #Copyright (c) 2009 Marc-Seabstian "Maluku" Lucksch
4             #Version 0.8
5             ####################
6             #This file is part of the Dotiac::DTL project.
7             #http://search.cpan.org/perldoc?Dotiac::DTL
8             #
9             #comment.pm is published under the terms of the MIT license, which basically
10             #means "Do with it whatever you want". For more information, see the
11             #license.txt file that should be enclosed with libsofu distributions. A copy of
12             #the license is (at the time of writing) also available at
13             #http://www.opensource.org/licenses/mit-license.php .
14             ###############################################################################
15            
16             package Dotiac::DTL::Tag::comment;
17 11     11   236 use base qw/Dotiac::DTL::Tag/;
  11         24  
  11         974  
18 11     11   59 use strict;
  11         25  
  11         344  
19 11     11   54 use warnings;
  11         27  
  11         9458  
20            
21             our $VERSION = 0.8;
22            
23             sub new {
24 1     1 1 3 my $class=shift;
25 1         4 my $self={p=>shift()};
26 1         3 my $name=shift;
27 1         3 my $obj=shift;
28 1         2 my $data=shift;
29 1         3 my $pos=shift;
30 1         2 my $found="";
31 1         8 $self->{content}=$obj->parse($data,$pos,\$found,"endcomment");
32 1         3 bless $self,$class;
33 1         5 return $self;
34             }
35             sub print {
36 1     1 1 2 my $self=shift;
37 1         18 print $self->{p};
38 1         6 $self->{n}->print(@_);
39             }
40             sub string {
41 1     1 1 4 my $self=shift;
42 1         7 return $self->{p}.$self->{n}->string(@_);
43            
44             }
45             sub perlcount {
46 0     0 1 0 my $self=shift;
47 0         0 my $id=shift;
48 0         0 $id=$self->{content}->perlcount($id+1,@_);
49 0         0 return $self->{n}->perlcount($id+1);
50             }
51             sub perl {
52 1     1 1 3 my $self=shift;
53 1         2 my $fh=shift;
54 1         4 my $id=shift;
55 1         12 $self->SUPER::perl($fh,$id,@_);
56 1         10 $id = $self->{content}->perl($fh,$id+1,@_);
57 1         6 return $self->{n}->perl($fh,$id+1,@_)
58             }
59             sub perlinit {
60 1     1 1 3 my $self=shift;
61 1         2 my $fh=shift;
62 1         3 my $id=shift;
63             #$self->SUPER::perl($fh,$id,@_);
64 1         7 $id = $self->{content}->perlinit($fh,$id+1,@_);
65 1         6 return $self->{n}->perlinit($fh,$id+1,@_)
66             }
67             sub perlprint {
68 1     1 1 3 my $self=shift;
69 1         2 my $fh=shift;
70 1         2 my $id=shift;
71 1         3 my $level=shift;
72 1         31 $self->SUPER::perlprint($fh,$id,$level,@_);
73 1         5 print $fh "\t" x $level,"if (0) {\n";
74 1         7 $id = $self->{content}->perlprint($fh,$id+1,$level+1,@_);
75 1         4 print $fh "\t" x $level,"}\n";
76 1         6 return $self->{n}->perlprint($fh,$id+1,$level,@_);
77             }
78             sub perlstring {
79 1     1 1 3 my $self=shift;
80 1         2 my $fh=shift;
81 1         2 my $id=shift;
82 1         2 my $level=shift;
83 1         10 $self->SUPER::perlstring($fh,$id,$level,@_);
84 1         3 print $fh "\t" x $level,"if (0) {\n";
85 1         9 $id = $self->{content}->perlstring($fh,$id+1,$level+1,@_);
86 1         4 print $fh "\t" x $level,"}\n";
87 1         5 return $self->{n}->perlstring($fh,$id+1,$level,@_);
88             }
89             sub perleval {
90 1     1 1 2 my $self=shift;
91 1         2 my $fh=shift;
92 1         2 my $id=shift;
93 1         2 my $level=shift;
94 1         3 print $fh "\t" x $level,"if (0) {\n";
95 1         7 $id=$self->{content}->perleval($fh,$id+1,$level+1,@_);
96 1         4 print $fh "\t" x $level,"}\n";
97 1         6 return $self->{n}->perleval($fh,$id+1,$level,@_);
98             }
99             sub next {
100 1     1 1 3 my $self=shift;
101 1         15 $self->{n}=shift;
102             }
103             sub eval {
104 0     0 1   my $self=shift;
105 0           $self->{n}->eval(@_);
106             }
107             1;
108            
109             __END__