line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
use 5.010; |
3
|
2
|
|
|
2
|
|
33
|
use strict; |
|
2
|
|
|
|
|
7
|
|
4
|
2
|
|
|
2
|
|
10
|
use warnings; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
49
|
|
5
|
2
|
|
|
2
|
|
10
|
#use Log::Any '$log'; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
75
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
use Mo qw(build default); |
8
|
2
|
|
|
2
|
|
11
|
use Role::Tiny::With; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
18
|
|
9
|
2
|
|
|
2
|
|
553
|
|
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
892
|
|
10
|
|
|
|
|
|
|
extends 'Data::Sah::Compiler::human::TH'; |
11
|
|
|
|
|
|
|
with 'Data::Sah::Type::all'; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:PERLANCAR'; # AUTHORITY |
14
|
|
|
|
|
|
|
our $DATE = '2022-10-19'; # DATE |
15
|
|
|
|
|
|
|
our $DIST = 'Data-Sah'; # DIST |
16
|
|
|
|
|
|
|
our $VERSION = '0.914'; # VERSION |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
13
|
0
|
|
|
20
|
|
|
|
|
|
|
my ($self, $cd) = @_; |
21
|
|
|
|
|
|
|
my $c = $self->compiler; |
22
|
|
|
|
|
|
|
my $cv = $cd->{cl_value}; |
23
|
13
|
|
|
13
|
0
|
36
|
|
24
|
13
|
|
|
|
|
43
|
my @result; |
25
|
13
|
|
|
|
|
62
|
my $i = 0; |
26
|
|
|
|
|
|
|
for my $cv2 (@$cv) { |
27
|
13
|
|
|
|
|
17
|
local $cd->{spath} = [@{$cd->{spath}}, $i]; |
28
|
13
|
|
|
|
|
66
|
my %iargs = %{$cd->{args}}; |
29
|
13
|
|
|
|
|
68
|
$iargs{outer_cd} = $cd; |
30
|
26
|
|
|
|
|
35
|
$iargs{schema} = $cv2; |
|
26
|
|
|
|
|
138
|
|
31
|
26
|
|
|
|
|
44
|
$iargs{cache} = $cd->{args}{cache}; |
|
26
|
|
|
|
|
328
|
|
32
|
26
|
|
|
|
|
86
|
$iargs{schema_is_normalized} = 0; |
33
|
26
|
|
|
|
|
101
|
my $icd = $c->compile(%iargs); |
34
|
26
|
|
|
|
|
47
|
push @result, $icd->{ccls}; |
35
|
26
|
|
|
|
|
36
|
$c->_add_msg_catalog($cd, $icd->{ccls}); |
36
|
26
|
|
|
|
|
133
|
$i++; |
37
|
26
|
|
|
|
|
69
|
} |
38
|
26
|
|
|
|
|
70
|
|
39
|
26
|
|
|
|
|
276
|
# can we say 'NOUN1 as well as NOUN2 as well as NOUN3 ...'? |
40
|
|
|
|
|
|
|
my $can = 1; |
41
|
|
|
|
|
|
|
for my $r (@result) { |
42
|
|
|
|
|
|
|
unless (@$r == 1 && $r->[0]{type} eq 'noun') { |
43
|
13
|
|
|
|
|
25
|
$can = 0; |
44
|
13
|
|
|
|
|
25
|
last; |
45
|
13
|
50
|
33
|
|
|
120
|
} |
46
|
13
|
|
|
|
|
19
|
} |
47
|
13
|
|
|
|
|
18
|
|
48
|
|
|
|
|
|
|
my $vals; |
49
|
|
|
|
|
|
|
if ($can) { |
50
|
|
|
|
|
|
|
my $c0 = $c->_xlt($cd, '%(modal_verb)s be %s'); |
51
|
13
|
|
|
|
|
18
|
my $awa = $c->_xlt($cd, 'as well as %s'); |
52
|
13
|
50
|
|
|
|
28
|
my $wb = $c->_xlt($cd, ' '); |
53
|
0
|
|
|
|
|
0
|
my $fmt; |
54
|
0
|
|
|
|
|
0
|
my $i = 0; |
55
|
0
|
|
|
|
|
0
|
for my $r (@result) { |
56
|
0
|
|
|
|
|
0
|
$fmt .= $i ? $wb . $awa : $c0; |
57
|
0
|
|
|
|
|
0
|
push @$vals, ref($r->[0]{text}) eq 'ARRAY' ? |
58
|
0
|
|
|
|
|
0
|
$r->[0]{text}[0] : $r->[0]{text}; |
59
|
0
|
0
|
|
|
|
0
|
$i++; |
60
|
|
|
|
|
|
|
} |
61
|
0
|
0
|
|
|
|
0
|
$c->add_ccl($cd, { |
62
|
0
|
|
|
|
|
0
|
fmt => $fmt, |
63
|
|
|
|
|
|
|
vals => $vals, |
64
|
0
|
|
|
|
|
0
|
xlt => 0, |
65
|
|
|
|
|
|
|
type => 'noun', |
66
|
|
|
|
|
|
|
}); |
67
|
|
|
|
|
|
|
} else { |
68
|
|
|
|
|
|
|
$c->add_ccl($cd, { |
69
|
|
|
|
|
|
|
type => 'list', |
70
|
|
|
|
|
|
|
fmt => '%(modal_verb)s be all of the following', |
71
|
13
|
|
|
|
|
73
|
items => [ |
72
|
|
|
|
|
|
|
@result, |
73
|
|
|
|
|
|
|
], |
74
|
|
|
|
|
|
|
vals => [], |
75
|
|
|
|
|
|
|
}); |
76
|
|
|
|
|
|
|
} |
77
|
|
|
|
|
|
|
} |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
1; |
80
|
|
|
|
|
|
|
# ABSTRACT: perl's type handler for type "all" |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
=pod |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
=encoding UTF-8 |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
=head1 NAME |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
Data::Sah::Compiler::human::TH::all - perl's type handler for type "all" |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
=head1 VERSION |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
This document describes version 0.914 of Data::Sah::Compiler::human::TH::all (from Perl distribution Data-Sah), released on 2022-10-19. |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
=for Pod::Coverage ^(clause_.+|superclause_.+)$ |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
=head1 HOMEPAGE |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
Please visit the project's homepage at L<https://metacpan.org/release/Data-Sah>. |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
=head1 SOURCE |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
Source repository is at L<https://github.com/perlancar/perl-Data-Sah>. |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
=head1 AUTHOR |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
perlancar <perlancar@cpan.org> |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
=head1 CONTRIBUTING |
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
To contribute, you can send patches by email/via RT, or send pull requests on |
113
|
|
|
|
|
|
|
GitHub. |
114
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
Most of the time, you don't need to build the distribution yourself. You can |
116
|
|
|
|
|
|
|
simply modify the code, then test via: |
117
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
% prove -l |
119
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
If you want to build the distribution (e.g. to try to install it locally on your |
121
|
|
|
|
|
|
|
system), you can install L<Dist::Zilla>, |
122
|
|
|
|
|
|
|
L<Dist::Zilla::PluginBundle::Author::PERLANCAR>, |
123
|
|
|
|
|
|
|
L<Pod::Weaver::PluginBundle::Author::PERLANCAR>, and sometimes one or two other |
124
|
|
|
|
|
|
|
Dist::Zilla- and/or Pod::Weaver plugins. Any additional steps required beyond |
125
|
|
|
|
|
|
|
that are considered a bug and can be reported to me. |
126
|
|
|
|
|
|
|
|
127
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
128
|
|
|
|
|
|
|
|
129
|
|
|
|
|
|
|
This software is copyright (c) 2022, 2021, 2020, 2019, 2018, 2017, 2016, 2015, 2014, 2013, 2012 by perlancar <perlancar@cpan.org>. |
130
|
|
|
|
|
|
|
|
131
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
132
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
133
|
|
|
|
|
|
|
|
134
|
|
|
|
|
|
|
=head1 BUGS |
135
|
|
|
|
|
|
|
|
136
|
|
|
|
|
|
|
Please report any bugs or feature requests on the bugtracker website L<https://rt.cpan.org/Public/Dist/Display.html?Name=Data-Sah> |
137
|
|
|
|
|
|
|
|
138
|
|
|
|
|
|
|
When submitting a bug or request, please include a test-file or a |
139
|
|
|
|
|
|
|
patch to an existing test-file that illustrates the bug or desired |
140
|
|
|
|
|
|
|
feature. |
141
|
|
|
|
|
|
|
|
142
|
|
|
|
|
|
|
=cut |