| 1 | package Text::Snippet::TabStop::WithDefault; | ||||||||||||
| 2 | 11 | ▶ | BEGIN { | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 3 | 11 | $Text::Snippet::TabStop::WithDefault::VERSION = '0.04'; | |||||||||||
| 4 | } | ||||||||||||
| 5 | |||||||||||||
| 6 | # ABSTRACT: Tab stop that specifies a default value for the user | ||||||||||||
| 7 | |||||||||||||
| 8 | 11 | ▶ | use strict; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 9 | 11 | ▶ | use warnings; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 10 | 11 | ▶ | use base qw(Text::Snippet::TabStop); | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 11 | 11 | ▶ | use Carp qw(croak); | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 12 | 11 | ▶ | use Class::XSAccessor getters => { default => 'default' }; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 13 | |||||||||||||
| 14 | |||||||||||||
| 15 | 11 | ▶ | sub replacement { | ||||||||||
|
Subroutine
replacement: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||||
| 16 | 11 | my $self = shift; | |||||||||||
| 17 | 11 | ▶ | return $self->has_replacement ? $self->SUPER::replacement : $self->default; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 18 | } | ||||||||||||
| 19 | |||||||||||||
| 20 | 16 | ▶ | sub parse { | ||||||||||
|
Subroutine
parse: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||||
| 21 | 16 | my $class = shift; | |||||||||||
| 22 | 16 | my $src = shift; | |||||||||||
| 23 | 16 | ▶ | if($src =~ m/\$\{(\d+):(.*)\}/){ | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 24 | 10 | ▶ | return $class->_new( index => $1, src => $src, default => $2 || '' ); | ||||||||||
|
Condition100%2/2
$2 || ''
MC/DC100%1/1
$2 || ''
$2
Truth table100%2/2
A
A= $2
| |||||||||||||
| 25 | } | ||||||||||||
| 26 | 6 | return; | |||||||||||
| 27 | } | ||||||||||||
| 28 | |||||||||||||
| 29 | 11 | 1; | |||||||||||
| 30 | |||||||||||||
| 31 | __END__ | ||||||||||||