| 1 | package Lingua::StarDict::Writer::Entry::Part; | ||||||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||||||
| 3 | 2 | ▶ | use 5.006; | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 4 | 2 | ▶ | use strict; | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 5 | 2 | ▶ | use warnings; | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 6 | 2 | ▶ | use Moo; | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||||||
| 9 | =encoding utf8 | ||||||||||||||||||||||||||||||||
| 10 | =cut | ||||||||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||||||
| 12 | =head1 NAME | ||||||||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||||||
| 14 | Lingua::StarDict::Writer::Entry::Part - an internal module for Lingua::StarDict::Writer. Please read L<Lingua::StarDict::Writer> manual. | ||||||||||||||||||||||||||||||||
| 15 | |||||||||||||||||||||||||||||||||
| 16 | =cut | ||||||||||||||||||||||||||||||||
| 17 | |||||||||||||||||||||||||||||||||
| 18 | has 'type' => ( | ||||||||||||||||||||||||||||||||
| 19 | is => 'rw', | ||||||||||||||||||||||||||||||||
| 20 | default => "m", | ||||||||||||||||||||||||||||||||
| 21 | isa => sub { | ||||||||||||||||||||||||||||||||
| 22 | 21 | ▶ | my $type = shift; | ||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=5 SCAR=16.3
| |||||||||||||||||||||||||||||||||
| 23 | 21 | ▶ | die "Error setting part type ". (defined $type ? "'type'": "undef") .": Part type should be one latin letter" unless defined $type && $type =~ /^[a-zA-Z]$/; | ||||||||||||||||||||||||||||||
|
Branch: 2 branches
Condition66%2/3
defined $type and $type =~ /^[a-zA-Z]$/
MC/DC50%1/2
defined $type and $type =~ /^[a-zA-Z]$/
defined $type
$type =~ /^[a-zA-Z]$/
Truth table66%2/3
A and B
A= defined $typeB= $type =~ /^[a-zA-Z]$/
| |||||||||||||||||||||||||||||||||
| 24 | 20 | ▶ | die "Error setting part type '$type': Binary (upper case) part types are not supported" unless $type =~ /^[a-z]$/; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 25 | } | ||||||||||||||||||||||||||||||||
| 26 | 2 | ); | |||||||||||||||||||||||||||||||
| 27 | |||||||||||||||||||||||||||||||||
| 28 | 2 | has 'data' => ( | |||||||||||||||||||||||||||||||
| 29 | is => 'rw', | ||||||||||||||||||||||||||||||||
| 30 | required => 1, | ||||||||||||||||||||||||||||||||
| 31 | ); | ||||||||||||||||||||||||||||||||
| 32 | |||||||||||||||||||||||||||||||||
| 33 | |||||||||||||||||||||||||||||||||
| 34 | =head1 LICENSE AND COPYRIGHT | ||||||||||||||||||||||||||||||||
| 35 | |||||||||||||||||||||||||||||||||
| 36 | Copyright 2021 Nikolay Shaplov. | ||||||||||||||||||||||||||||||||
| 37 | |||||||||||||||||||||||||||||||||
| 38 | This program is free software; you can redistribute it and/or modify it | ||||||||||||||||||||||||||||||||
| 39 | under the terms of the the Artistic License (2.0). You may obtain a | ||||||||||||||||||||||||||||||||
| 40 | copy of the full license at: | ||||||||||||||||||||||||||||||||
| 41 | |||||||||||||||||||||||||||||||||
| 42 | L<http://www.perlfoundation.org/artistic_license_2_0> | ||||||||||||||||||||||||||||||||
| 43 | |||||||||||||||||||||||||||||||||
| 44 | Any use, modification, and distribution of the Standard or Modified | ||||||||||||||||||||||||||||||||
| 45 | Versions is governed by this Artistic License. By using, modifying or | ||||||||||||||||||||||||||||||||
| 46 | distributing the Package, you accept this license. Do not use, modify, | ||||||||||||||||||||||||||||||||
| 47 | or distribute the Package, if you do not accept this license. | ||||||||||||||||||||||||||||||||
| 48 | |||||||||||||||||||||||||||||||||
| 49 | If your Modified Version has been derived from a Modified Version made | ||||||||||||||||||||||||||||||||
| 50 | by someone other than you, you are nevertheless required to ensure that | ||||||||||||||||||||||||||||||||
| 51 | your Modified Version complies with the requirements of this license. | ||||||||||||||||||||||||||||||||
| 52 | |||||||||||||||||||||||||||||||||
| 53 | This license does not grant you the right to use any trademark, service | ||||||||||||||||||||||||||||||||
| 54 | mark, tradename, or logo of the Copyright Holder. | ||||||||||||||||||||||||||||||||
| 55 | |||||||||||||||||||||||||||||||||
| 56 | This license includes the non-exclusive, worldwide, free-of-charge | ||||||||||||||||||||||||||||||||
| 57 | patent license to make, have made, use, offer to sell, sell, import and | ||||||||||||||||||||||||||||||||
| 58 | otherwise transfer the Package with respect to any patent claims | ||||||||||||||||||||||||||||||||
| 59 | licensable by the Copyright Holder that are necessarily infringed by the | ||||||||||||||||||||||||||||||||
| 60 | Package. If you institute patent litigation (including a cross-claim or | ||||||||||||||||||||||||||||||||
| 61 | counterclaim) against any party alleging that the Package constitutes | ||||||||||||||||||||||||||||||||
| 62 | direct or contributory patent infringement, then this Artistic License | ||||||||||||||||||||||||||||||||
| 63 | to you shall terminate on the date that such litigation is filed. | ||||||||||||||||||||||||||||||||
| 64 | |||||||||||||||||||||||||||||||||
| 65 | Disclaimer of Warranty: THE PACKAGE IS PROVIDED BY THE COPYRIGHT HOLDER | ||||||||||||||||||||||||||||||||
| 66 | AND CONTRIBUTORS "AS IS' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES. | ||||||||||||||||||||||||||||||||
| 67 | THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR | ||||||||||||||||||||||||||||||||
| 68 | PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED TO THE EXTENT PERMITTED BY | ||||||||||||||||||||||||||||||||
| 69 | YOUR LOCAL LAW. UNLESS REQUIRED BY LAW, NO COPYRIGHT HOLDER OR | ||||||||||||||||||||||||||||||||
| 70 | CONTRIBUTOR WILL BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, OR | ||||||||||||||||||||||||||||||||
| 71 | CONSEQUENTIAL DAMAGES ARISING IN ANY WAY OUT OF THE USE OF THE PACKAGE, | ||||||||||||||||||||||||||||||||
| 72 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||||||||||||||||||||||||||||||||
| 73 | |||||||||||||||||||||||||||||||||
| 74 | |||||||||||||||||||||||||||||||||
| 75 | =cut | ||||||||||||||||||||||||||||||||
| 76 | |||||||||||||||||||||||||||||||||
| 77 | 2 | 1; | |||||||||||||||||||||||||||||||