File Coverage

blib/lib/SpeL/Object/Binop.pm
Criterion Covered Total %
statement 24 25 96.0
branch 18 22 81.8
condition n/a
subroutine 4 4 100.0
pod 1 1 100.0
total 47 52 90.3


line stmt bran cond sub pod time code
1             # -*- cperl -*-
2             # ABSTRACT: LaTeX operator object
3              
4              
5             package SpeL::Object::Binop;
6              
7              
8 41     41   1905 use parent 'Exporter';
  41         87  
  41         849  
9 41     41   3426 use Carp;
  41         87  
  41         2830  
10              
11 41     41   264 use Data::Dumper;
  41         84  
  41         20791  
12              
13              
14              
15             sub read {
16 131     131 1 300 my $self = shift;
17 131         261 my ( $level ) = @_;
18              
19             # say STDERR Data::Dumper->Dump( [ $self ], [ 'self' ] );
20 131 100       402 if ( exists $self->{Op} ) {
21             $self->{Op} =~ /^[+-]$/ and
22 128 100       622 return ' ' . $SpeL::I18n::lh->maketext( $self->{Op} ) . ' ';
23 82 100       260 $self->{Op} =~ /^\\pm$/ and
24             return ' ' . $SpeL::I18n::lh->maketext( 'plusminus' ) . ' ';
25 80 100       307 $self->{Op} =~ /^,|;$/ and
26             return ', ';
27 77 50       235 $self->{Op} =~ /^\\in$/ and
28             return ' ' . $SpeL::I18n::lh->maketext( 'In' ) . ' ';
29 77 100       215 $self->{Op} =~ /^\\mid$/ and
30             return ' ' . $SpeL::I18n::lh->maketext( 'Mid' ) . ' ';
31 76 100       264 $self->{Op} =~ /^\\cdots$/ and
32             return ' ' . $SpeL::I18n::lh->maketext( 'dotdotdot' ) . ' ';
33 74 100       301 $self->{Op} =~ /^\\times|\\cdot$/ and
34             return ' ' . $SpeL::I18n::lh->maketext( '*' ) . ' ';
35 64 50       178 $self->{Op} =~ /^\\sim$/ and
36             return ' ' . $SpeL::I18n::lh->maketext( 'Sim' ) . ' ';
37 64         306 return ' ' . $SpeL::I18n::lh->maketext( '*' ) . ' ';
38             }
39 3 50       14 if ( exists $self->{Pause} ) {
40 0         0 return ', ';
41             }
42 3 50       14 if ( exists $self->{Com} ) {
43 3         52 return $self->{Com}->read( $level + 1 );
44             }
45             }
46              
47             1;
48              
49             __END__