| 1 | # You may distribute under the terms of the GNU General Public License | ||||||||||||||||||||||||||||
| 2 | # | ||||||||||||||||||||||||||||
| 3 | # (C) Paul Evans, 2008-2010 -- leonerd@leonerd.org.uk | ||||||||||||||||||||||||||||
| 4 | |||||||||||||||||||||||||||||
| 5 | package Circle::TaggedString; | ||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||
| 7 | 4 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 8 | 4 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 9 | 4 | ▶ | use base qw( String::Tagged ); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 10 | 4 | String::Tagged->VERSION( '0.11' ); | |||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||
| 12 | 4 | our $VERSION = '0.173320'; | |||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||
| 14 | sub new_from_formatting | ||||||||||||||||||||||||||||
| 15 | 0 | ▶ | { | ||||||||||||||||||||||||||
|
Subroutine
new_from_formatting: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 16 | 0 | my $class = shift; | |||||||||||||||||||||||||||
| 17 | 0 | my ( $orig ) = @_; | |||||||||||||||||||||||||||
| 18 | |||||||||||||||||||||||||||||
| 19 | 0 | return $class->clone( $orig, | |||||||||||||||||||||||||||
| 20 | only_tags => [qw( bold under italic reverse monospace blockquote )], | ||||||||||||||||||||||||||||
| 21 | convert_tags => { | ||||||||||||||||||||||||||||
| 22 | bold => "b", | ||||||||||||||||||||||||||||
| 23 | under => "u", | ||||||||||||||||||||||||||||
| 24 | italic => "i", | ||||||||||||||||||||||||||||
| 25 | reverse => "rv", | ||||||||||||||||||||||||||||
| 26 | monospace => "m", | ||||||||||||||||||||||||||||
| 27 | blockquote => "bq", | ||||||||||||||||||||||||||||
| 28 | # TODO: fg/bg | ||||||||||||||||||||||||||||
| 29 | }, | ||||||||||||||||||||||||||||
| 30 | ); | ||||||||||||||||||||||||||||
| 31 | } | ||||||||||||||||||||||||||||
| 32 | |||||||||||||||||||||||||||||
| 33 | sub squash | ||||||||||||||||||||||||||||
| 34 | 3 | ▶ | { | ||||||||||||||||||||||||||
|
Subroutine
squash: called CC=3 SCAR=12.3
Pod
undocumented
| |||||||||||||||||||||||||||||
| 35 | 3 | my $self = shift; | |||||||||||||||||||||||||||
| 36 | |||||||||||||||||||||||||||||
| 37 | 3 | my @output; | |||||||||||||||||||||||||||
| 38 | 3 | ▶ | $self->iter_substr_nooverlap( sub { | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=2 SCAR=7.2
| |||||||||||||||||||||||||||||
| 39 | 3 | my ( $str, %format ) = @_; | |||||||||||||||||||||||||||
| 40 | 3 | ▶ | push @output, %format ? [ $str, %format ] : $str; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 41 | 3 | } ); | |||||||||||||||||||||||||||
| 42 | |||||||||||||||||||||||||||||
| 43 | 3 | ▶ | return $output[0] if @output == 1 and !ref $output[0]; | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
@output == 1 and not ref $output[0]
MC/DC0%0/2
@output == 1 and not ref $output[0]
@output == 1
not ref $output[0]
Truth table33%1/3
A and not(B)
A= @output == 1B= not ref $output[0]
| |||||||||||||||||||||||||||||
| 44 | 0 | return \@output; | |||||||||||||||||||||||||||
| 45 | } | ||||||||||||||||||||||||||||
| 46 | |||||||||||||||||||||||||||||
| 47 | 4 | 0x55AA; | |||||||||||||||||||||||||||