line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Moonshine::Parser; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
13086
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
24
|
|
4
|
1
|
|
|
1
|
|
3
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
26
|
|
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
3
|
use base qw/HTML::Parser/; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
494
|
|
7
|
|
|
|
|
|
|
|
8
|
1
|
|
|
1
|
|
4475
|
use Moonshine::Element; |
|
1
|
|
|
|
|
21259
|
|
|
1
|
|
|
|
|
55
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
=head1 NAME |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
Moonshine::Parser - Parsed |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
=head1 VERSION |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
Version 0.03 |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
=cut |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
our $VERSION = '0.03'; |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
=head1 SYNOPSIS |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
use Moonshine::Parser; |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
my $parser = Moonshine::Parser->new(); |
27
|
|
|
|
|
|
|
my $moonshine_element = $parser->parse('html', $html); |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
=head1 SUBROUTINES/METHODS |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
=head2 parse |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
$self->parse($type, $string); |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
Parse html into a Moonshine::Element. |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
=head2 parse_file |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
$self->parse_file($type, $file); |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
=cut |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=head2 parse_html |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
$self->parse_html($string); |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
Parse html into a Moonshine::Element. |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
=cut |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
=head2 parse_html_file |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
$self->parse_html_file($file); |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
Parse a file that contains html into a Moonshine::Element. |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
=cut |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
=head2 parse_pod |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
$self->parse_pod($string); |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
Parse pod into a Moonshine::Element. |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
=cut |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
=head2 parse_pod_file |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
Parse a file that contains pod into a Moonshine::Element. |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
=cut |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
=head1 AUTHOR |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
Robert Acock, C<< >> |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
=head1 BUGS |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
Please report any bugs or feature requests to C, or through |
80
|
|
|
|
|
|
|
the web interface at L. I will be notified, and then you'll |
81
|
|
|
|
|
|
|
automatically be notified of progress on your bug as I make changes. |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
=head1 SUPPORT |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
You can find documentation for this module with the perldoc command. |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
perldoc Moonshine::Parser |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
You can also look for information at: |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
=over 4 |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
=item * RT: CPAN's request tracker (report bugs here) |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
L |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
=item * AnnoCPAN: Annotated CPAN documentation |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
L |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
=item * CPAN Ratings |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
L |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
=item * Search CPAN |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
L |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
=back |
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
=head1 ACKNOWLEDGEMENTS |
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
=head1 LICENSE AND COPYRIGHT |
114
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
Copyright 2017 Robert Acock. |
116
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify it |
118
|
|
|
|
|
|
|
under the terms of the the Artistic License (2.0). You may obtain a |
119
|
|
|
|
|
|
|
copy of the full license at: |
120
|
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
L |
122
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
Any use, modification, and distribution of the Standard or Modified |
124
|
|
|
|
|
|
|
Versions is governed by this Artistic License. By using, modifying or |
125
|
|
|
|
|
|
|
distributing the Package, you accept this license. Do not use, modify, |
126
|
|
|
|
|
|
|
or distribute the Package, if you do not accept this license. |
127
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
If your Modified Version has been derived from a Modified Version made |
129
|
|
|
|
|
|
|
by someone other than you, you are nevertheless required to ensure that |
130
|
|
|
|
|
|
|
your Modified Version complies with the requirements of this license. |
131
|
|
|
|
|
|
|
|
132
|
|
|
|
|
|
|
This license does not grant you the right to use any trademark, service |
133
|
|
|
|
|
|
|
mark, tradename, or logo of the Copyright Holder. |
134
|
|
|
|
|
|
|
|
135
|
|
|
|
|
|
|
This license includes the non-exclusive, worldwide, free-of-charge |
136
|
|
|
|
|
|
|
patent license to make, have made, use, offer to sell, sell, import and |
137
|
|
|
|
|
|
|
otherwise transfer the Package with respect to any patent claims |
138
|
|
|
|
|
|
|
licensable by the Copyright Holder that are necessarily infringed by the |
139
|
|
|
|
|
|
|
Package. If you institute patent litigation (including a cross-claim or |
140
|
|
|
|
|
|
|
counterclaim) against any party alleging that the Package constitutes |
141
|
|
|
|
|
|
|
direct or contributory patent infringement, then this Artistic License |
142
|
|
|
|
|
|
|
to you shall terminate on the date that such litigation is filed. |
143
|
|
|
|
|
|
|
|
144
|
|
|
|
|
|
|
Disclaimer of Warranty: THE PACKAGE IS PROVIDED BY THE COPYRIGHT HOLDER |
145
|
|
|
|
|
|
|
AND CONTRIBUTORS "AS IS' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES. |
146
|
|
|
|
|
|
|
THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR |
147
|
|
|
|
|
|
|
PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED TO THE EXTENT PERMITTED BY |
148
|
|
|
|
|
|
|
YOUR LOCAL LAW. UNLESS REQUIRED BY LAW, NO COPYRIGHT HOLDER OR |
149
|
|
|
|
|
|
|
CONTRIBUTOR WILL BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, OR |
150
|
|
|
|
|
|
|
CONSEQUENTIAL DAMAGES ARISING IN ANY WAY OUT OF THE USE OF THE PACKAGE, |
151
|
|
|
|
|
|
|
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
152
|
|
|
|
|
|
|
|
153
|
|
|
|
|
|
|
=cut |
154
|
|
|
|
|
|
|
|
155
|
|
|
|
|
|
|
1; # End of Moonshine::Parser |