| 1 | package PPI::Token::_QuoteEngine::Simple; | ||||||||||
| 2 | |||||||||||
| 3 | # Simple quote engine | ||||||||||
| 4 | |||||||||||
| 5 | 62 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | 62 | ▶ | use PPI::Token::_QuoteEngine (); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | |||||||||||
| 8 | 62 | ▶ | use vars qw{$VERSION @ISA}; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | BEGIN { | ||||||||||
| 10 | 62 | ▶ | $VERSION = '1.236'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 11 | 62 | @ISA = 'PPI::Token::_QuoteEngine'; | |||||||||
| 12 | } | ||||||||||
| 13 | |||||||||||
| 14 | sub new { | ||||||||||
| 15 | 10427 | ▶ | my $class = shift; | ||||||||
|
Subroutine
new: called CC=3 SCAR=11.3
Pod
undocumented
| |||||||||||
| 16 | 10427 | ▶ | my $separator = shift or return undef; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 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 | 10427 | ▶ | my $self = PPI::Token::new( $class, $separator ) or return undef; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 23 | 10427 | $self->{separator} = $separator; | |||||||||
| 24 | |||||||||||
| 25 | 10427 | $self; | |||||||||
| 26 | } | ||||||||||
| 27 | |||||||||||
| 28 | sub _fill { | ||||||||||
| 29 | 10427 | ▶ | my $class = shift; | ||||||||
|
Subroutine
_fill: called CC=4 SCAR=13.9
| |||||||||||
| 30 | 10427 | my $t = shift; | |||||||||
| 31 | 10427 | ▶ | my $self = $t->{token} or return undef; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 32 | |||||||||||
| 33 | # Scan for the end separator | ||||||||||
| 34 | 10427 | my $string = $self->_scan_for_unescaped_character( $t, $self->{separator} ); | |||||||||
| 35 | 10427 | ▶ | return undef unless defined $string; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 36 | 10427 | ▶ | if ( ref $string ) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 37 | # End of file | ||||||||||
| 38 | 727 | $self->{content} .= $$string; | |||||||||
| 39 | 727 | return 0; | |||||||||
| 40 | } else { | ||||||||||
| 41 | # End of string | ||||||||||
| 42 | 9700 | $self->{content} .= $string; | |||||||||
| 43 | 9700 | return $self; | |||||||||
| 44 | } | ||||||||||
| 45 | } | ||||||||||
| 46 | |||||||||||
| 47 | 62 | 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 - 2011 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 | ||||||||||