File Coverage

blib/lib/Data/Sah/Compiler/TH.pm
Criterion Covered Total %
statement 31 35 88.5
branch n/a
condition n/a
subroutine 9 11 81.8
pod 0 7 0.0
total 40 53 75.4


line stmt bran cond sub pod time code
1              
2             use 5.010;
3 24     24   10330 use strict;
  24         76  
4 24     24   114 use warnings;
  24         37  
  24         583  
5 24     24   110 use Mo qw(build default);
  24         40  
  24         711  
6 24     24   149  
  24         74  
  24         119  
7             # reference to compiler object
8             has compiler => (is => 'rw');
9              
10             our $AUTHORITY = 'cpan:PERLANCAR'; # AUTHORITY
11             our $DATE = '2022-09-30'; # DATE
12             our $DIST = 'Data-Sah'; # DIST
13             our $VERSION = '0.913'; # VERSION
14              
15             my ($self, $cd) = @_;
16             $self->compiler->_ignore_clause($cd);
17 27     27 0 64 }
18 27         94  
19             my ($self, $cd) = @_;
20             $self->compiler->_ignore_clause($cd);
21             }
22 27     27 0 53  
23 27         99 my ($self, $cd) = @_;
24             $self->compiler->_ignore_clause($cd);
25             }
26              
27 0     0 0 0 my ($self, $cd) = @_;
28 0         0 $self->compiler->_ignore_clause($cd);
29             }
30              
31             my ($self, $cd) = @_;
32 0     0 0 0 $self->compiler->_ignore_clause($cd);
33 0         0 }
34              
35             my ($self, $cd) = @_;
36             my $c = $self->compiler;
37 54     54 0 107 my $cv = $cd->{cl_value};
38 54         151  
39             my ($clause, $clv) = @$cv;
40             my $meth = "clause_$clause";
41             my $mmeth = "clausemeta_$clause";
42 162     162 0 289  
43 162         465 # provide an illusion of a clsets
44 162         703 my $clsets = [{$clause => $clv}];
45             local $cd->{clsets} = $clsets;
46 162         326  
47 162         294 $c->_process_clause($cd, 0, $clause);
48 162         251 }
49              
50             # clause_clset, like clause_clause, also works by doing what compile() does.
51 162         431  
52 162         338 my ($self, $cd) = @_;
53             my $c = $self->compiler;
54 162         461 my $cv = $cd->{cl_value};
55              
56             # provide an illusion of a clsets
57             local $cd->{clsets} = [$cv];
58             $c->_process_clsets($cd, 'from clause_clset');
59             }
60 384     384 0 806  
61 384         1082 1;
62 384         1645 # ABSTRACT: Base class for type handlers
63              
64              
65 384         890 =pod
66 384         1052  
67             =encoding UTF-8
68              
69             =head1 NAME
70              
71             Data::Sah::Compiler::TH - Base class for type handlers
72              
73             =head1 VERSION
74              
75             This document describes version 0.913 of Data::Sah::Compiler::TH (from Perl distribution Data-Sah), released on 2022-09-30.
76              
77             =for Pod::Coverage ^(compiler|clause_.+)$
78              
79             =head1 HOMEPAGE
80              
81             Please visit the project's homepage at L<https://metacpan.org/release/Data-Sah>.
82              
83             =head1 SOURCE
84              
85             Source repository is at L<https://github.com/perlancar/perl-Data-Sah>.
86              
87             =head1 AUTHOR
88              
89             perlancar <perlancar@cpan.org>
90              
91             =head1 CONTRIBUTING
92              
93              
94             To contribute, you can send patches by email/via RT, or send pull requests on
95             GitHub.
96              
97             Most of the time, you don't need to build the distribution yourself. You can
98             simply modify the code, then test via:
99              
100             % prove -l
101              
102             If you want to build the distribution (e.g. to try to install it locally on your
103             system), you can install L<Dist::Zilla>,
104             L<Dist::Zilla::PluginBundle::Author::PERLANCAR>,
105             L<Pod::Weaver::PluginBundle::Author::PERLANCAR>, and sometimes one or two other
106             Dist::Zilla- and/or Pod::Weaver plugins. Any additional steps required beyond
107             that are considered a bug and can be reported to me.
108              
109             =head1 COPYRIGHT AND LICENSE
110              
111             This software is copyright (c) 2022, 2021, 2020, 2019, 2018, 2017, 2016, 2015, 2014, 2013, 2012 by perlancar <perlancar@cpan.org>.
112              
113             This is free software; you can redistribute it and/or modify it under
114             the same terms as the Perl 5 programming language system itself.
115              
116             =head1 BUGS
117              
118             Please report any bugs or feature requests on the bugtracker website L<https://rt.cpan.org/Public/Dist/Display.html?Name=Data-Sah>
119              
120             When submitting a bug or request, please include a test-file or a
121             patch to an existing test-file that illustrates the bug or desired
122             feature.
123              
124             =cut