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