File Coverage

blib/lib/SpeL/Object/Variable.pm
Criterion Covered Total %
statement 28 28 100.0
branch 4 4 100.0
condition n/a
subroutine 7 7 100.0
pod 1 1 100.0
total 40 40 100.0


line stmt bran cond sub pod time code
1             # -*- cperl -*-
2             # ABSTRACT: LaTeX variable (math) object
3              
4              
5 41     41   312 use strict;
  41         80  
  41         1667  
6 41     41   213 use warnings;
  41         73  
  41         2606  
7             package SpeL::Object::Variable;
8              
9 41     41   244 use parent 'Exporter';
  41         98  
  41         220  
10 41     41   2390 use Carp;
  41         75  
  41         3280  
11              
12 41     41   240 use SpeL::I18n;
  41         88  
  41         1027  
13              
14 41     41   197 use Data::Dumper;
  41         71  
  41         11882  
15              
16              
17              
18             sub read {
19 191     191 1 412 my $self = shift;
20 191         365 my ( $level ) = @_;
21              
22 191         303 my $line;
23 191 100       545 if( exists $self->{Greek} ) {
24 25         183 $self->{Greek} =~ s/\\(?:mit|mup)?(?:var)?//;
25 25         188 $line = $SpeL::I18n::lh->maketext( lc( $self->{Greek} ) );
26             }
27             else {
28 166         364 $line = '"' . $self->{Alphabet} . '"';
29             }
30 191 100       1880 if ( exists $self->{Subscript} ) {
31 51         195 $line .= $self->{Subscript}->read( $level + 1 );
32             }
33 191         1125 return $line;
34             }
35              
36             1;
37              
38             __END__