| 1 | package PICA::Writer::Plain; | ||||||||||||||||||||||||||||
| 2 | 8 | ▶ | use v5.14.1; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 3 | |||||||||||||||||||||||||||||
| 4 | 8 | our $VERSION = '1.18'; | |||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||
| 6 | 8 | ▶ | use charnames qw(:full); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 7 | 8 | ▶ | use Term::ANSIColor; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||
| 9 | 8 | ▶ | use parent 'PICA::Writer::Base'; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||
| 11 | 7 | ▶ | sub SUBFIELD_INDICATOR {'$'} | ||||||||||||||||||||||||||
|
Subroutine
SUBFIELD_INDICATOR: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 12 | 7 | ▶ | sub END_OF_FIELD {"\n"} | ||||||||||||||||||||||||||
|
Subroutine
END_OF_FIELD: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 13 | 7 | ▶ | sub END_OF_RECORD {"\n"} | ||||||||||||||||||||||||||
|
Subroutine
END_OF_RECORD: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 14 | |||||||||||||||||||||||||||||
| 15 | sub write_subfield { | ||||||||||||||||||||||||||||
| 16 | 7 | ▶ | my ($self, $code, $value) = @_; | ||||||||||||||||||||||||||
|
Subroutine
write_subfield: called CC=5 SCAR=22.7
Pod
undocumented
| |||||||||||||||||||||||||||||
| 17 | 7 | $value =~ s/\$/\$\$/g; | |||||||||||||||||||||||||||
| 18 | |||||||||||||||||||||||||||||
| 19 | 7 | ▶ | if (my $col = $self->{color}) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 20 | $value | ||||||||||||||||||||||||||||
| 21 | = ($col->{syntax} ? colored('$', $col->{syntax}) : '$') | ||||||||||||||||||||||||||||
| 22 | . ($col->{code} ? colored($code, $col->{code}) : $code) | ||||||||||||||||||||||||||||
| 23 | 0 | ▶ | . ($col->{value} ? colored($value, $col->{value}) : $value); | ||||||||||||||||||||||||||
|
Branch: 3 branches
| |||||||||||||||||||||||||||||
| 24 | } | ||||||||||||||||||||||||||||
| 25 | else { | ||||||||||||||||||||||||||||
| 26 | 7 | $value = $self->SUBFIELD_INDICATOR . $code . $value; | |||||||||||||||||||||||||||
| 27 | } | ||||||||||||||||||||||||||||
| 28 | |||||||||||||||||||||||||||||
| 29 | 7 | $self->{fh}->print($value); | |||||||||||||||||||||||||||
| 30 | } | ||||||||||||||||||||||||||||
| 31 | |||||||||||||||||||||||||||||
| 32 | sub write_annotation { | ||||||||||||||||||||||||||||
| 33 | 7 | ▶ | my ($self, $field) = @_; | ||||||||||||||||||||||||||
|
Subroutine
write_annotation: called CC=5 SCAR=18.6
Pod
undocumented
| |||||||||||||||||||||||||||||
| 34 | |||||||||||||||||||||||||||||
| 35 | 7 | ▶ | if (@$field % 2) { | ||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||
| 36 | $self->{fh}->print($field->[$#$field] . " ") | ||||||||||||||||||||||||||||
| 37 | 4 | ▶ | unless defined $self->{annotated} && !$self->{annotated}; | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
defined $self->{"annotated"} and not $self->{"annotated"}
MC/DC0%0/2
defined $self->{"annotated"} and not $self->{"annotated"}
defined $self->{"annotated"}
not $self->{"annotated"}
Truth table33%1/3
A and not(B)
A= defined $self->{"annotated"}B= not $self->{"annotated"}
| |||||||||||||||||||||||||||||
| 38 | } | ||||||||||||||||||||||||||||
| 39 | elsif ($self->{annotated}) { | ||||||||||||||||||||||||||||
| 40 | 0 | $self->{fh}->print(" "); | |||||||||||||||||||||||||||
| 41 | } | ||||||||||||||||||||||||||||
| 42 | } | ||||||||||||||||||||||||||||
| 43 | |||||||||||||||||||||||||||||
| 44 | 8 | 1; | |||||||||||||||||||||||||||
| 45 | __END__ | ||||||||||||||||||||||||||||