| 1 | package TOON::Error; | ||||||||||||||||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||||||||||||||||
| 3 | 5 | ▶ | use v5.40; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 4 | 5 | ▶ | use feature 'signatures'; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 5 | 5 | ▶ | use overload '""' => 'as_string', fallback => 1; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||||||||||||||||
| 7 | 5 | our $VERSION = '0.0.1'; | |||||||||||||||||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||||||||||||||||
| 9 | ▶ | sub new ($class, %args) { | |||||||||||||||||||||||||||||||||||||||||
|
Subroutine
new: called CC=5 SCAR=19.7
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 10 | return bless { | ||||||||||||||||||||||||||||||||||||||||||
| 11 | message => $args{message} // 'Unknown TOON error', | ||||||||||||||||||||||||||||||||||||||||||
| 12 | line => $args{line} // 1, | ||||||||||||||||||||||||||||||||||||||||||
| 13 | column => $args{column} // 1, | ||||||||||||||||||||||||||||||||||||||||||
| 14 | 1 | ▶ | offset => $args{offset} // 0, | ||||||||||||||||||||||||||||||||||||||||
|
Condition50%4/8
$args{"message"} // "Unknown TOON error"
$args{"line"} // 1
$args{"column"} // 1
$args{"offset"} // 0
MC/DC0%0/1
$args{"message"} // "Unknown TOON error"
$args{"message"}
MC/DC0%0/1
$args{"line"} // 1
$args{"line"}
MC/DC0%0/1
$args{"column"} // 1
$args{"column"}
MC/DC0%0/1
$args{"offset"} // 0
$args{"offset"}
Truth table50%1/2
A
A= $args{"message"}
Truth table50%1/2
A
A= $args{"line"}
Truth table50%1/2
A
A= $args{"column"}
Truth table50%1/2
A
A= $args{"offset"}
| |||||||||||||||||||||||||||||||||||||||||||
| 15 | }, $class; | ||||||||||||||||||||||||||||||||||||||||||
| 16 | } | ||||||||||||||||||||||||||||||||||||||||||
| 17 | |||||||||||||||||||||||||||||||||||||||||||
| 18 | 0 | ▶ | sub message ($self) { return $self->{message} } | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
message: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 19 | 0 | ▶ | sub line ($self) { return $self->{line} } | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
line: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 20 | 0 | ▶ | sub column ($self) { return $self->{column} } | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
column: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 21 | 0 | ▶ | sub offset ($self) { return $self->{offset} } | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
offset: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 22 | |||||||||||||||||||||||||||||||||||||||||||
| 23 | ▶ | sub as_string ($self, @) { | |||||||||||||||||||||||||||||||||||||||||
|
Subroutine
as_string: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 24 | return sprintf '%s at line %d, column %d', | ||||||||||||||||||||||||||||||||||||||||||
| 25 | 1 | $self->{message}, $self->{line}, $self->{column}; | |||||||||||||||||||||||||||||||||||||||||
| 26 | } | ||||||||||||||||||||||||||||||||||||||||||
| 27 | |||||||||||||||||||||||||||||||||||||||||||
| 28 | 5 | 1; | |||||||||||||||||||||||||||||||||||||||||
| 29 | |||||||||||||||||||||||||||||||||||||||||||
| 30 | __END__ | ||||||||||||||||||||||||||||||||||||||||||