| 1 | package Org::Element::Text; | ||||||||||||||||||||||
| 2 | |||||||||||||||||||||||
| 3 | 25 | ▶ | use 5.010; | ||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||
| 4 | 25 | ▶ | use locale; | ||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||
| 5 | 25 | ▶ | use Moo; | ||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||
| 6 | 25 | extends 'Org::Element'; | |||||||||||||||||||||
| 7 | 25 | with 'Org::ElementRole'; | |||||||||||||||||||||
| 8 | 25 | with 'Org::ElementRole::Inline'; | |||||||||||||||||||||
| 9 | |||||||||||||||||||||||
| 10 | 25 | our $AUTHORITY = 'cpan:PERLANCAR'; # AUTHORITY | |||||||||||||||||||||
| 11 | 25 | our $DATE = '2026-07-21'; # DATE | |||||||||||||||||||||
| 12 | 25 | our $DIST = 'Org-Parser'; # DIST | |||||||||||||||||||||
| 13 | 25 | our $VERSION = '0.563'; # VERSION | |||||||||||||||||||||
| 14 | |||||||||||||||||||||||
| 15 | 25 | has text => (is => 'rw'); | |||||||||||||||||||||
| 16 | 25 | has style => (is => 'rw'); | |||||||||||||||||||||
| 17 | |||||||||||||||||||||||
| 18 | 25 | our %mu2style = (''=>'', '*'=>'B', '_'=>'U', '/'=>'I', | |||||||||||||||||||||
| 19 | '+'=>'S', '='=>'C', '~'=>'V'); | ||||||||||||||||||||||
| 20 | 25 | our %style2mu = reverse(%mu2style); | |||||||||||||||||||||
| 21 | |||||||||||||||||||||||
| 22 | 194 | ▶ | sub as_string { | ||||||||||||||||||||
|
Subroutine
as_string: called CC=4 SCAR=15.2
Pod
documented
| |||||||||||||||||||||||
| 23 | 194 | my ($self) = @_; | |||||||||||||||||||||
| 24 | 194 | ▶ | my $muchar = $style2mu{$self->style // ''} // ''; | ||||||||||||||||||||
|
Condition50%2/4
$Org::Element::Text::style2mu{$self->style // ""} // ""
$self->style // ""
MC/DC0%0/1
$Org::Element::Text::style2mu{$self->style // ""} // ""
$Org::Element::Text::style2mu{$self->style // ""}
MC/DC0%0/1
$self->style // ""
$self->style
Truth table50%1/2
A
A= $Org::Element::Text::style2mu{$self->style // ""}
Truth table50%1/2
A
A= $self->style
| |||||||||||||||||||||||
| 25 | |||||||||||||||||||||||
| 26 | 194 | ▶ | join("", | ||||||||||||||||||||
|
Condition50%1/2
$self->text // ""
MC/DC0%0/1
$self->text // ""
$self->text
Truth table50%1/2
A
A= $self->text
| |||||||||||||||||||||||
| 27 | $muchar, | ||||||||||||||||||||||
| 28 | $self->text // '', $self->children_as_string, | ||||||||||||||||||||||
| 29 | $muchar); | ||||||||||||||||||||||
| 30 | } | ||||||||||||||||||||||
| 31 | |||||||||||||||||||||||
| 32 | 1 | ▶ | sub as_text { | ||||||||||||||||||||
|
Subroutine
as_text: called CC=4 SCAR=15.2
Pod
documented
| |||||||||||||||||||||||
| 33 | 1 | my $self = shift; | |||||||||||||||||||||
| 34 | 1 | ▶ | my $muchar = $style2mu{$self->style // ''} // ''; | ||||||||||||||||||||
|
Condition50%2/4
$Org::Element::Text::style2mu{$self->style // ""} // ""
$self->style // ""
MC/DC0%0/1
$Org::Element::Text::style2mu{$self->style // ""} // ""
$Org::Element::Text::style2mu{$self->style // ""}
MC/DC0%0/1
$self->style // ""
$self->style
Truth table50%1/2
A
A= $Org::Element::Text::style2mu{$self->style // ""}
Truth table50%1/2
A
A= $self->style
| |||||||||||||||||||||||
| 35 | |||||||||||||||||||||||
| 36 | 1 | ▶ | join("", | ||||||||||||||||||||
|
Condition50%1/2
$self->text // ""
MC/DC0%0/1
$self->text // ""
$self->text
Truth table50%1/2
A
A= $self->text
| |||||||||||||||||||||||
| 37 | $muchar, | ||||||||||||||||||||||
| 38 | $self->text // '', $self->children_as_text, | ||||||||||||||||||||||
| 39 | $muchar); | ||||||||||||||||||||||
| 40 | } | ||||||||||||||||||||||
| 41 | |||||||||||||||||||||||
| 42 | 25 | 1; | |||||||||||||||||||||
| 43 | # ABSTRACT: Represent text | ||||||||||||||||||||||
| 44 | |||||||||||||||||||||||
| 45 | __END__ | ||||||||||||||||||||||