Commit | Line | Data |
3fea05b9 |
1 | package PPI::Token::_QuoteEngine::Simple; |
2 | |
3 | # Simple quote engine |
4 | |
5 | use strict; |
6 | use PPI::Token::_QuoteEngine (); |
7 | |
8 | use vars qw{$VERSION @ISA}; |
9 | BEGIN { |
10 | $VERSION = '1.206'; |
11 | @ISA = 'PPI::Token::_QuoteEngine'; |
12 | } |
13 | |
14 | sub new { |
15 | my $class = shift; |
16 | my $separator = shift or return undef; |
17 | |
18 | # Create a new token containing the separator |
19 | ### This manual SUPER'ing ONLY works because none of |
20 | ### Token::Quote, Token::QuoteLike and Token::Regexp |
21 | ### implement a new function of their own. |
22 | my $self = PPI::Token::new( $class, $separator ) or return undef; |
23 | $self->{separator} = $separator; |
24 | |
25 | $self; |
26 | } |
27 | |
28 | sub _fill { |
29 | my $class = shift; |
30 | my $t = shift; |
31 | my $self = $t->{token} or return undef; |
32 | |
33 | # Scan for the end separator |
34 | my $string = $self->_scan_for_unescaped_character( $t, $self->{separator} ); |
35 | return undef unless defined $string; |
36 | if ( ref $string ) { |
37 | # End of file |
38 | $self->{content} .= $$string; |
39 | return 0; |
40 | } else { |
41 | # End of string |
42 | $self->{content} .= $string; |
43 | return $self; |
44 | } |
45 | } |
46 | |
47 | 1; |
48 | |
49 | =pod |
50 | |
51 | =head1 SUPPORT |
52 | |
53 | See the L<support section|PPI/SUPPORT> in the main module. |
54 | |
55 | =head1 AUTHOR |
56 | |
57 | Adam Kennedy E<lt>adamk@cpan.orgE<gt> |
58 | |
59 | =head1 COPYRIGHT |
60 | |
61 | Copyright 2001 - 2009 Adam Kennedy. |
62 | |
63 | This program is free software; you can redistribute |
64 | it and/or modify it under the same terms as Perl itself. |
65 | |
66 | The full text of the license can be found in the |
67 | LICENSE file included with this module. |
68 | |
69 | =cut |