File Coverage

blib/lib/Parse/Path/PerlClassUTF8.pm
Criterion Covered Total %
statement 19 19 100.0
branch n/a
condition n/a
subroutine 7 7 100.0
pod n/a
total 26 26 100.0


line stmt bran cond sub pod time code
1             package Parse::Path::PerlClassUTF8;
2              
3             our $VERSION = '0.92'; # VERSION
4             # ABSTRACT: Perl::Class::path::support'with'ŮΤᖴ8
5              
6             #############################################################################
7             # Modules
8              
9 1     1   937 use v5.14;
  1         5  
  1         68  
10              
11 1     1   892 use Moo;
  1         11862  
  1         7  
12 1     1   2175 use sanity;
  1         4  
  1         9  
13              
14 1     1   392989 use namespace::clean;
  1         2  
  1         11  
15 1     1   258 no warnings 'uninitialized';
  1         2  
  1         148  
16              
17             #############################################################################
18             # Required Methods
19              
20             with 'Parse::Path::Role::Path';
21              
22             sub _build_blueprint { {
23 14     14   2695 hash_step_regexp => qr{
24             # See http://www.learning-perl.com/2011/07/matching-perl-identifiers-is-a-lot-harder-now/
25             (?<key>\p{XID_Start}\p{XID_Continue}*)
26 1     1   6 }x,
  1         3  
  1         15  
27              
28             array_step_regexp => qr/\Z.\A/, # no-op; arrays not supported
29             delimiter_regexp => qr{(?:\:\:|')(?=\p{XID_Start})}, # no dangling delimiters
30              
31             # no support for escapes
32             unescape_translation => [],
33              
34             pos_translation => [
35             [qr/.?/, 'X+1'],
36             ],
37              
38             delimiter_placement => {
39             HH => '::',
40             },
41              
42             array_key_sprintf => '',
43             hash_key_stringification => [
44             [qr/.?/, '%s'],
45             ],
46             } }
47              
48             42;
49              
50             __END__
51              
52             =pod
53              
54             =encoding utf-8
55              
56             =head1 NAME
57              
58             Parse::Path::PerlClassUTF8 - Perl::Class::path::support'with'ŮΤᖴ8
59              
60             =head1 SYNOPSIS
61              
62             use v5.14;
63             use utf8;
64             use Parse::Path;
65            
66             my $path = Parse::Path->new(
67             path => 'Parse::Path',
68             style => 'PerlClassUTF8',
69             );
70            
71             say $path->as_string;
72             $path->push($path, qw[ Ê»NIGHTMäREʼ::ʺ'チツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワン ]);
73             say $path->as_string;
74              
75             =head1 DESCRIPTION
76              
77             This is a path style for Perl classes with full UTF8 support. Perl 5.14 is required to use this style, as this uses
78             L<special UTF8 character classes|http://www.learning-perl.com/2011/07/matching-perl-identifiers-is-a-lot-harder-now/>. Some examples:
79              
80             Perl::Class
81             overload::pragma
82             K2P'Foo'Bar'Baz
83             K2P'Class::Fun
84              
85             =head1 AVAILABILITY
86              
87             The project homepage is L<https://github.com/SineSwiper/Parse-Path/wiki>.
88              
89             The latest version of this module is available from the Comprehensive Perl
90             Archive Network (CPAN). Visit L<http://www.perl.com/CPAN/> to find a CPAN
91             site near you, or see L<https://metacpan.org/module/Parse::Path/>.
92              
93             =head1 AUTHOR
94              
95             Brendan Byrd <bbyrd@cpan.org>
96              
97             =head1 COPYRIGHT AND LICENSE
98              
99             This software is Copyright (c) 2013 by Brendan Byrd.
100              
101             This is free software, licensed under:
102              
103             The Artistic License 2.0 (GPL Compatible)
104              
105             =cut