line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package MARC::Moose::Parser::Yaml; |
2
|
|
|
|
|
|
|
# ABSTRACT: Parser for YAML records |
3
|
|
|
|
|
|
|
$MARC::Moose::Parser::Yaml::VERSION = '1.0.46'; |
4
|
4
|
|
|
4
|
|
32
|
use Moose; |
|
4
|
|
|
|
|
10
|
|
|
4
|
|
|
|
|
28
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
extends 'MARC::Moose::Parser'; |
7
|
|
|
|
|
|
|
|
8
|
4
|
|
|
4
|
|
25990
|
use YAML::Syck; |
|
4
|
|
|
|
|
14
|
|
|
4
|
|
|
|
|
729
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
$YAML::Syck::ImplicitUnicode = 1; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
# FIXME Experimental. Not used yet. |
13
|
|
|
|
|
|
|
#has converter => ( |
14
|
|
|
|
|
|
|
# is => 'rw', |
15
|
|
|
|
|
|
|
# isa => 'Text::IconvPtr', |
16
|
|
|
|
|
|
|
# default => sub { Text::Iconv->new( "cp857", "utf8" ) } |
17
|
|
|
|
|
|
|
#); |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
override 'parse' => sub { |
22
|
|
|
|
|
|
|
my ($self, $raw) = @_; |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
#print "\nRAW: $raw\n"; |
25
|
|
|
|
|
|
|
return unless $raw; |
26
|
|
|
|
|
|
|
my $record = Load( $raw ); |
27
|
|
|
|
|
|
|
$record->lint($self->lint) if $self->lint; |
28
|
|
|
|
|
|
|
return $record; |
29
|
|
|
|
|
|
|
}; |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
1; |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
__END__ |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
=pod |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
=encoding UTF-8 |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
=head1 NAME |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
MARC::Moose::Parser::Yaml - Parser for YAML records |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
=head1 VERSION |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
version 1.0.46 |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
=head1 SEE ALSO |
50
|
|
|
|
|
|
|
=for :list |
51
|
|
|
|
|
|
|
* L<MARC::Moose> |
52
|
|
|
|
|
|
|
* L<MARC::Moose::Parser> |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
=head1 AUTHOR |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
Frédéric Demians <f.demians@tamil.fr> |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
This software is copyright (c) 2022 by Frédéric Demians. |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
63
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
=cut |