← Index
NYTProf Performance Profile   « line view »
For /Users/timbo/perl5/perlbrew/perls/perl-5.18.2/bin/perlcritic
  Run on Sat Mar 19 22:12:22 2016
Reported on Sat Mar 19 22:14:10 2016

Filename/Users/timbo/perl5/perlbrew/perls/perl-5.18.2/lib/site_perl/5.18.2/PPI/Token/_QuoteEngine/Full.pm
StatementsExecuted 41704 statements in 73.4ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
10611135.2ms119msPPI::Token::_QuoteEngine::Full::::_fillPPI::Token::_QuoteEngine::Full::_fill
10611120.6ms24.2msPPI::Token::_QuoteEngine::Full::::newPPI::Token::_QuoteEngine::Full::new
9561110.7ms70.3msPPI::Token::_QuoteEngine::Full::::_fill_bracedPPI::Token::_QuoteEngine::Full::_fill_braced
105111.52ms5.88msPPI::Token::_QuoteEngine::Full::::_fill_normalPPI::Token::_QuoteEngine::Full::_fill_normal
1933411.50ms1.50msPPI::Token::_QuoteEngine::Full::::CORE:matchPPI::Token::_QuoteEngine::Full::CORE:match (opcode)
11126┬Ás26┬ÁsPPI::Token::_QuoteEngine::Full::::BEGIN@11PPI::Token::_QuoteEngine::Full::BEGIN@11
11111┬Ás22┬ÁsPPI::Token::_QuoteEngine::Full::::BEGIN@5PPI::Token::_QuoteEngine::Full::BEGIN@5
1116┬Ás58┬ÁsPPI::Token::_QuoteEngine::Full::::BEGIN@10PPI::Token::_QuoteEngine::Full::BEGIN@10
1113┬Ás3┬ÁsPPI::Token::_QuoteEngine::Full::::_sectionsPPI::Token::_QuoteEngine::Full::_sections
1113┬Ás3┬ÁsPPI::Token::_QuoteEngine::Full::::BEGIN@6PPI::Token::_QuoteEngine::Full::BEGIN@6
1113┬Ás3┬ÁsPPI::Token::_QuoteEngine::Full::::BEGIN@7PPI::Token::_QuoteEngine::Full::BEGIN@7
1112┬Ás2┬ÁsPPI::Token::_QuoteEngine::Full::::BEGIN@8PPI::Token::_QuoteEngine::Full::BEGIN@8
0000s0sPPI::Token::_QuoteEngine::Full::::_delimitersPPI::Token::_QuoteEngine::Full::_delimiters
0000s0sPPI::Token::_QuoteEngine::Full::::_modifiersPPI::Token::_QuoteEngine::Full::_modifiers
0000s0sPPI::Token::_QuoteEngine::Full::::_section_contentPPI::Token::_QuoteEngine::Full::_section_content
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1package PPI::Token::_QuoteEngine::Full;
2
3# Full quote engine
4
5218┬Ás233┬Ás
# spent 22┬Ás (11+11) within PPI::Token::_QuoteEngine::Full::BEGIN@5 which was called: # once (11┬Ás+11┬Ás) by PPI::Token::Quote::Literal::BEGIN@33 at line 5
use strict;
# spent 22┬Ás making 1 call to PPI::Token::_QuoteEngine::Full::BEGIN@5 # spent 11┬Ás making 1 call to strict::import
6215┬Ás13┬Ás
# spent 3┬Ás within PPI::Token::_QuoteEngine::Full::BEGIN@6 which was called: # once (3┬Ás+0s) by PPI::Token::Quote::Literal::BEGIN@33 at line 6
use Clone ();
# spent 3┬Ás making 1 call to PPI::Token::_QuoteEngine::Full::BEGIN@6
7215┬Ás13┬Ás
# spent 3┬Ás within PPI::Token::_QuoteEngine::Full::BEGIN@7 which was called: # once (3┬Ás+0s) by PPI::Token::Quote::Literal::BEGIN@33 at line 7
use Carp ();
# spent 3┬Ás making 1 call to PPI::Token::_QuoteEngine::Full::BEGIN@7
8222┬Ás12┬Ás
# spent 2┬Ás within PPI::Token::_QuoteEngine::Full::BEGIN@8 which was called: # once (2┬Ás+0s) by PPI::Token::Quote::Literal::BEGIN@33 at line 8
use PPI::Token::_QuoteEngine ();
# spent 2┬Ás making 1 call to PPI::Token::_QuoteEngine::Full::BEGIN@8
9
102131┬Ás2109┬Ás
# spent 58┬Ás (6+51) within PPI::Token::_QuoteEngine::Full::BEGIN@10 which was called: # once (6┬Ás+51┬Ás) by PPI::Token::Quote::Literal::BEGIN@33 at line 10
use vars qw{$VERSION @ISA %quotes %sections};
# spent 58┬Ás making 1 call to PPI::Token::_QuoteEngine::Full::BEGIN@10 # spent 51┬Ás making 1 call to vars::import
11
# spent 26┬Ás within PPI::Token::_QuoteEngine::Full::BEGIN@11 which was called: # once (26┬Ás+0s) by PPI::Token::Quote::Literal::BEGIN@33 at line 48
BEGIN {
121400ns $VERSION = '1.215';
1317┬Ás @ISA = 'PPI::Token::_QuoteEngine';
14
15 # Prototypes for the different braced sections
1614┬Ás %sections = (
17 '(' => { type => '()', _close => ')' },
18 '<' => { type => '<>', _close => '>' },
19 '[' => { type => '[]', _close => ']' },
20 '{' => { type => '{}', _close => '}' },
21 );
22
23 # For each quote type, the extra fields that should be set.
24 # This should give us faster initialization.
25115┬Ás %quotes = (
26 'q' => { operator => 'q', braced => undef, separator => undef, _sections => 1 },
27 'qq' => { operator => 'qq', braced => undef, separator => undef, _sections => 1 },
28 'qx' => { operator => 'qx', braced => undef, separator => undef, _sections => 1 },
29 'qw' => { operator => 'qw', braced => undef, separator => undef, _sections => 1 },
30 'qr' => { operator => 'qr', braced => undef, separator => undef, _sections => 1, modifiers => 1 },
31 'm' => { operator => 'm', braced => undef, separator => undef, _sections => 1, modifiers => 1 },
32 's' => { operator => 's', braced => undef, separator => undef, _sections => 2, modifiers => 1 },
33 'tr' => { operator => 'tr', braced => undef, separator => undef, _sections => 2, modifiers => 1 },
34
35 # Y is the little used varient of tr
36 'y' => { operator => 'y', braced => undef, separator => undef, _sections => 2, modifiers => 1 },
37
38 '/' => { operator => undef, braced => 0, separator => '/', _sections => 1, modifiers => 1 },
39
40 # Angle brackets quotes mean "readline(*FILEHANDLE)"
41 '<' => { operator => undef, braced => 1, separator => undef, _sections => 1, },
42
43 # The final ( and kind of depreciated ) "first match only" one is not
44 # used yet, since I'm not sure on the context differences between
45 # this and the trinary operator, but its here for completeness.
46 '?' => { operator => undef, braced => 0, separator => '?', _sections => 1, modifiers => 1 },
47 );
481961┬Ás126┬Ás}
# spent 26┬Ás making 1 call to PPI::Token::_QuoteEngine::Full::BEGIN@11
49
50=pod
51
52=begin testing new 90
53
54# Verify that Token::Quote, Token::QuoteLike and Token::Regexp
55# do not have ->new functions
56my $RE_SYMBOL = qr/\A(?!\d)\w+\z/;
57foreach my $name ( qw{Token::Quote Token::QuoteLike Token::Regexp} ) {
58 no strict 'refs';
59 my @functions = sort
60 grep { defined &{"${name}::$_"} }
61 grep { /$RE_SYMBOL/o }
62 keys %{"PPI::${name}::"};
63 is( scalar(grep { $_ eq 'new' } @functions), 0,
64 "$name does not have a new function" );
65}
66
67# This primarily to ensure that qw() with non-balanced types
68# are treated the same as those with balanced types.
69SCOPE: {
70 my @seps = ( undef, undef, '/', '#', ',' );
71 my @types = ( '()', '<>', '//', '##', ',,' );
72 my @braced = ( qw{ 1 1 0 0 0 } );
73 my $i = 0;
74 for my $q ('qw()', 'qw<>', 'qw//', 'qw##', 'qw,,') {
75 my $d = PPI::Document->new(\$q);
76 my $o = $d->{children}->[0]->{children}->[0];
77 my $s = $o->{sections}->[0];
78 is( $o->{operator}, 'qw', "$q correct operator" );
79 is( $o->{_sections}, 1, "$q correct _sections" );
80 is( $o->{braced}, $braced[$i], "$q correct braced" );
81 is( $o->{separator}, $seps[$i], "$q correct seperator" );
82 is( $o->{content}, $q, "$q correct content" );
83 is( $s->{position}, 3, "$q correct position" );
84 is( $s->{type}, $types[$i], "$q correct type" );
85 is( $s->{size}, 0, "$q correct size" );
86 $i++;
87 }
88}
89
90SCOPE: {
91 my @stuff = ( qw-( ) < > / / -, '#', '#', ',',',' );
92 my @seps = ( undef, undef, '/', '#', ',' );
93 my @types = ( '()', '<>', '//', '##', ',,' );
94 my @braced = ( qw{ 1 1 0 0 0 } );
95 my @secs = ( qw{ 1 1 0 0 0 } );
96 my $i = 0;
97 while ( @stuff ) {
98 my $opener = shift @stuff;
99 my $closer = shift @stuff;
100 my $d = PPI::Document->new(\"qw$opener");
101 my $o = $d->{children}->[0]->{children}->[0];
102 my $s = $o->{sections}->[0];
103 is( $o->{operator}, 'qw', "qw$opener correct operator" );
104 is( $o->{_sections}, $secs[$i], "qw$opener correct _sections" );
105 is( $o->{braced}, $braced[$i], "qw$opener correct braced" );
106 is( $o->{separator}, $seps[$i], "qw$opener correct seperator" );
107 is( $o->{content}, "qw$opener", "qw$opener correct content" );
108 if ( $secs[$i] ) {
109 is( $s->{type}, "$opener$closer", "qw$opener correct type" );
110 }
111 $i++;
112 }
113}
114
115SCOPE: {
116 foreach (
117 [ '/foo/i', 'foo', undef, { i => 1 }, [ '//' ] ],
118 [ 'm<foo>x', 'foo', undef, { x => 1 }, [ '<>' ] ],
119 [ 's{foo}[bar]g', 'foo', 'bar', { g => 1 }, [ '{}', '[]' ] ],
120 [ 'tr/fo/ba/', 'fo', 'ba', {}, [ '//', '//' ] ],
121 [ 'qr{foo}smx', 'foo', undef, { s => 1, m => 1, x => 1 },
122 [ '{}' ] ],
123 ) {
124 my ( $code, $match, $subst, $mods, $delims ) = @{ $_ };
125 my $doc = PPI::Document->new( \$code );
126 $doc or warn "'$code' did not create a document";
127 my $obj = $doc->child( 0 )->child( 0 );
128 is( $obj->_section_content( 0 ), $match, "$code correct match" );
129 is( $obj->_section_content( 1 ), $subst, "$code correct subst" );
130 is_deeply( { $obj->_modifiers() }, $mods, "$code correct modifiers" );
131 is_deeply( [ $obj->_delimiters() ], $delims, "$code correct delimiters" );
132 }
133}
134
135=end testing
136
137=cut
138
139
# spent 24.2ms (20.6+3.63) within PPI::Token::_QuoteEngine::Full::new which was called 1061 times, avg 23┬Ás/call: # 1061 times (20.6ms+3.63ms) by PPI::Tokenizer::_new_token at line 623 of PPI/Tokenizer.pm, avg 23┬Ás/call
sub new {
1401061398┬Ás my $class = shift;
1411061483┬Ás my $init = defined $_[0]
142 ? shift
143 : Carp::croak("::Full->new called without init string");
144
145 # Create the token
146 ### This manual SUPER'ing ONLY works because none of
147 ### Token::Quote, Token::QuoteLike and Token::Regexp
148 ### implement a new function of their own.
14910615.43ms21223.61ms my $self = PPI::Token::new( $class, $init ) or return undef;
# spent 2.87ms making 1061 calls to PPI::Token::new, avg 3┬Ás/call # spent 738┬Ás making 1061 calls to PPI::Util::TRUE, avg 696ns/call
150
151 # Do we have a prototype for the intializer? If so, add the extra fields
1521061673┬Ás my $options = $quotes{$init} or return $self->_error(
153 "Unknown quote type '$init'"
154 );
15510612.42ms foreach ( keys %$options ) {
15644563.23ms $self->{$_} = $options->{$_};
157 }
158
159 # Set up the modifiers hash if needed
1601061449┬Ás $self->{modifiers} = {} if $self->{modifiers};
161
162 # Handle the special < base
1631061308┬Ás522┬Ás if ( $init eq '<' ) {
# spent 22┬Ás making 5 calls to Clone::clone, avg 4┬Ás/call
164 $self->{sections}->[0] = Clone::clone( $sections{'<'} );
165 }
166
16710612.70ms $self;
168}
169
170
# spent 119ms (35.2+83.8) within PPI::Token::_QuoteEngine::Full::_fill which was called 1061 times, avg 112┬Ás/call: # 1061 times (35.2ms+83.8ms) by PPI::Token::_QuoteEngine::__TOKENIZER__on_char at line 51 of PPI/Token/_QuoteEngine.pm, avg 112┬Ás/call
sub _fill {
1711061229┬Ás my $class = shift;
1721061141┬Ás my $t = shift;
17310613.01ms1061564┬Ás my $self = $t->{token}
# spent 564┬Ás making 1061 calls to PPI::Util::TRUE, avg 532ns/call
174 or Carp::croak("::Full->_fill called without current token");
175
176 # Load in the operator stuff if needed
1771061743┬Ás if ( $self->{operator} ) {
178 # In an operator based quote-like, handle the gap between the
179 # operator and the opening separator.
18010557.15ms1055753┬Ás if ( substr( $t->{line}, $t->{line_cursor}, 1 ) =~ /\s/ ) {
# spent 753┬Ás making 1055 calls to PPI::Token::_QuoteEngine::Full::CORE:match, avg 714ns/call
181 # Go past the gap
182 my $gap = $self->_scan_quote_like_operator_gap( $t );
183 return undef unless defined $gap;
184 if ( ref $gap ) {
185 # End of file
186 $self->{content} .= $$gap;
187 return 0;
188 }
189 $self->{content} .= $gap;
190 }
191
192 # The character we are now on is the separator. Capture,
193 # and advance into the first section.
1941055953┬Ás my $sep = substr( $t->{line}, $t->{line_cursor}++, 1 );
1951055464┬Ás $self->{content} .= $sep;
196
197 # Determine if these are normal or braced type sections
1981055999┬Ás if ( my $section = $sections{$sep} ) {
199951362┬Ás $self->{braced} = 1;
2009518.83ms9515.57ms $self->{sections}->[0] = Clone::clone($section);
# spent 5.57ms making 951 calls to Clone::clone, avg 6┬Ás/call
201 } else {
20210444┬Ás $self->{braced} = 0;
20310470┬Ás $self->{separator} = $sep;
204 }
205 }
206
207 # Parse different based on whether we are normal or braced
20810612.43ms106176.2ms my $rv = $self->{braced}
# spent 70.3ms making 956 calls to PPI::Token::_QuoteEngine::Full::_fill_braced, avg 74┬Ás/call # spent 5.88ms making 105 calls to PPI::Token::_QuoteEngine::Full::_fill_normal, avg 56┬Ás/call
209 ? $self->_fill_braced($t)
210 : $self->_fill_normal($t);
2111061159┬Ás return $rv if !$rv;
212
213 # Return now unless it has modifiers ( i.e. s/foo//eieio )
21410616.34ms return 1 unless $self->{modifiers};
215
216 # Check for modifiers
21721225┬Ás my $char;
21821238┬Ás my $len = 0;
2192121.41ms212252┬Ás while ( ($char = substr( $t->{line}, $t->{line_cursor} + 1, 1 )) =~ /[^\W\d_]/ ) {
# spent 252┬Ás making 212 calls to PPI::Token::_QuoteEngine::Full::CORE:match, avg 1┬Ás/call
22064659┬Ás $len++;
221646239┬Ás $self->{content} .= $char;
222646573┬Ás $self->{modifiers}->{lc $char} = 1;
2236462.08ms646479┬Ás $t->{line_cursor}++;
# spent 479┬Ás making 646 calls to PPI::Token::_QuoteEngine::Full::CORE:match, avg 741ns/call
224 }
225}
226
227# Handle the content parsing path for normally seperated
228
# spent 5.88ms (1.52+4.36) within PPI::Token::_QuoteEngine::Full::_fill_normal which was called 105 times, avg 56┬Ás/call: # 105 times (1.52ms+4.36ms) by PPI::Token::_QuoteEngine::Full::_fill at line 208, avg 56┬Ás/call
sub _fill_normal {
22910540┬Ás my $self = shift;
23010518┬Ás my $t = shift;
231
232 # Get the content up to the next separator
233105259┬Ás1054.11ms my $string = $self->_scan_for_unescaped_character( $t, $self->{separator} );
# spent 4.11ms making 105 calls to PPI::Token::_QuoteEngine::_scan_for_unescaped_character, avg 39┬Ás/call
23410528┬Ás return undef unless defined $string;
23510529┬Ás if ( ref $string ) {
236 # End of file
237 $self->{content} .= $$string;
238 if ( length($$string) > 1 ) {
239 # Complete the properties for the first section
240 my $str = $$string;
241 chop $str;
242 $self->{sections}->[0] = {
243 position => length($self->{content}),
244 size => length($string),
245 type => "$self->{separator}$self->{separator}",
246 };
247 } else {
248 # No sections at all
249 $self->{_sections} = 0;
250 }
251 return 0;
252 }
253
254 # Complete the properties of the first section
255105485┬Ás $self->{sections}->[0] = {
256 position => length $self->{content},
257 size => length($string) - 1,
258 type => "$self->{separator}$self->{separator}",
259 };
26010573┬Ás $self->{content} .= $string;
261
262 # We are done if there is only one section
263105306┬Ás return 1 if $self->{_sections} == 1;
264
265 # There are two sections.
266
267 # Advance into the next section
268134┬Ás $t->{line_cursor}++;
269
270 # Get the content up to the end separator
2711326┬Ás13249┬Ás $string = $self->_scan_for_unescaped_character( $t, $self->{separator} );
# spent 249┬Ás making 13 calls to PPI::Token::_QuoteEngine::_scan_for_unescaped_character, avg 19┬Ás/call
272133┬Ás return undef unless defined $string;
273132┬Ás if ( ref $string ) {
274 # End of file
275 $self->{content} .= $$string;
276 return 0;
277 }
278
279 # Complete the properties of the second section
2801334┬Ás $self->{sections}->[1] = {
281 position => length($self->{content}),
282 size => length($string) - 1
283 };
2841310┬Ás $self->{content} .= $string;
285
286134.44ms 1;
287}
288
289# Handle content parsing for matching crace seperated
290
# spent 70.3ms (10.7+59.6) within PPI::Token::_QuoteEngine::Full::_fill_braced which was called 956 times, avg 74┬Ás/call: # 956 times (10.7ms+59.6ms) by PPI::Token::_QuoteEngine::Full::_fill at line 208, avg 74┬Ás/call
sub _fill_braced {
291956286┬Ás my $self = shift;
292956186┬Ás my $t = shift;
293
294 # Get the content up to the close character
295956493┬Ás my $section = $self->{sections}->[0];
2969562.13ms95659.1ms my $brace_str = $self->_scan_for_brace_character( $t, $section->{_close} );
# spent 59.1ms making 956 calls to PPI::Token::_QuoteEngine::_scan_for_brace_character, avg 62┬Ás/call
297956189┬Ás return undef unless defined $brace_str;
298956202┬Ás if ( ref $brace_str ) {
299 # End of file
300 $self->{content} .= $$brace_str;
301 return 0;
302 }
303
304 # Complete the properties of the first section
305956943┬Ás $section->{position} = length $self->{content};
306956543┬Ás $section->{size} = length($brace_str) - 1;
307956648┬Ás $self->{content} .= $brace_str;
308956872┬Ás delete $section->{_close};
309
310 # We are done if there is only one section
3119567.21ms return 1 if $self->{_sections} == 1;
312
313 # There are two sections.
314
315 # Is there a gap between the sections.
3162018┬Ás my $char = substr( $t->{line}, ++$t->{line_cursor}, 1 );
3172064┬Ás2012┬Ás if ( $char =~ /\s/ ) {
# spent 12┬Ás making 20 calls to PPI::Token::_QuoteEngine::Full::CORE:match, avg 625ns/call
318 # Go past the gap
319 my $gap_str = $self->_scan_quote_like_operator_gap( $t );
320 return undef unless defined $gap_str;
321 if ( ref $gap_str ) {
322 # End of file
323 $self->{content} .= $$gap_str;
324 return 0;
325 }
326 $self->{content} .= $gap_str;
327 $char = substr( $t->{line}, $t->{line_cursor}, 1 );
328 }
329
3302010┬Ás $section = $sections{$char};
331
332208┬Ás if ( $section ) {
333 # It's a brace
334
335 # Initialize the second section
336209┬Ás $self->{content} .= $char;
3372055┬Ás $section = $self->{sections}->[1] = { %$section };
338
339 # Advance into the second region
340205┬Ás $t->{line_cursor}++;
3412013┬Ás $section->{position} = length($self->{content});
342208┬Ás $section->{size} = 0;
343
344 # Get the content up to the close character
3452039┬Ás20541┬Ás $brace_str = $self->_scan_for_brace_character( $t, $section->{_close} );
# spent 541┬Ás making 20 calls to PPI::Token::_QuoteEngine::_scan_for_brace_character, avg 27┬Ás/call
346204┬Ás return undef unless defined $brace_str;
347209┬Ás if ( ref $brace_str ) {
348 # End of file
349 $self->{content} .= $$brace_str;
350 $section->{size} = length($$brace_str);
351 delete $section->{_close};
352 return 0;
353 } else {
354 # Complete the properties for the second section
3552012┬Ás $self->{content} .= $brace_str;
3562010┬Ás $section->{size} = length($brace_str) - 1;
3572017┬Ás delete $section->{_close};
358 }
359 } elsif ( $char =~ m/ \A [^\w\s] \z /smx ) {
360 # It is some other delimiter (weird, but possible)
361
362 # Add the delimiter to the content.
363 $self->{content} .= $char;
364
365 # Advance into the next section
366 $t->{line_cursor}++;
367
368 # Get the content up to the end separator
369 my $string = $self->_scan_for_unescaped_character( $t, $char );
370 return undef unless defined $string;
371 if ( ref $string ) {
372 # End of file
373 $self->{content} .= $$string;
374 return 0;
375 }
376
377 # Complete the properties of the second section
378 $self->{sections}->[1] = {
379 position => length($self->{content}),
380 size => length($string) - 1,
381 type => "$char$char",
382 };
383 $self->{content} .= $string;
384
385 } else {
386
387 # Error, it has to be a delimiter of some sort.
388 # Although this will result in a REALLY illegal regexp,
389 # we allow it anyway.
390
391 # Create a null second section
392 $self->{sections}->[1] = {
393 position => length($self->{content}),
394 size => 0,
395 type => '',
396 };
397
398 # Attach an error to the token and move on
399 $self->{_error} = "No second section of regexp, or does not start with a balanced character";
400
401 # Roll back the cursor one char and return signalling end of regexp
402 $t->{line_cursor}--;
403 return 0;
404 }
405
4062050┬Ás 1;
407}
408
- -
413#####################################################################
414# Additional methods to find out about the quote
415
416# In a scalar context, get the number of sections
417# In an array context, get the section information
41817┬Ás
# spent 3┬Ás within PPI::Token::_QuoteEngine::Full::_sections which was called: # once (3┬Ás+0s) by PPI::Token::Quote::Literal::string at line 72 of PPI/Token/Quote/Literal.pm
sub _sections { wantarray ? @{$_[0]->{sections}} : scalar @{$_[0]->{sections}} }
419
420# Get a section's content
421sub _section_content {
422 my ( $self, $inx ) = @_;
423 $self->{sections} or return;
424 my $sect = $self->{sections}[$inx] or return;
425 return substr $self->content(), $sect->{position}, $sect->{size};
426}
427
428# Get the modifiers if any.
429# In list context, return the modifier hash.
430# In scalar context, clone the hash and return a reference to it.
431# If there are no modifiers, simply return.
432sub _modifiers {
433 my ( $self ) = @_;
434 $self->{modifiers} or return;
435 wantarray and return %{ $self->{modifiers} };
436 return +{ %{ $self->{modifiers} } };
437}
438
439# Get the delimiters, or at least give it a good try to get them.
440sub _delimiters {
441 my ( $self ) = @_;
442 $self->{sections} or return;
443 my @delims;
444 foreach my $sect ( @{ $self->{sections} } ) {
445 if ( exists $sect->{type} ) {
446 push @delims, $sect->{type};
447 } else {
448 my $content = $self->content();
449 push @delims,
450 substr( $content, $sect->{position} - 1, 1 ) .
451 substr( $content, $sect->{position} + $sect->{size}, 1 );
452 }
453 }
454 return @delims;
455}
456
45712┬Ás1;
458
459=pod
460
461=head1 SUPPORT
462
463See the L<support section|PPI/SUPPORT> in the main module.
464
465=head1 AUTHOR
466
467Adam Kennedy E<lt>adamk@cpan.orgE<gt>
468
469=head1 COPYRIGHT
470
471Copyright 2001 - 2011 Adam Kennedy.
472
473This program is free software; you can redistribute
474it and/or modify it under the same terms as Perl itself.
475
476The full text of the license can be found in the
477LICENSE file included with this module.
478
479=cut
 
# spent 1.50ms within PPI::Token::_QuoteEngine::Full::CORE:match which was called 1933 times, avg 774ns/call: # 1055 times (753┬Ás+0s) by PPI::Token::_QuoteEngine::Full::_fill at line 180, avg 714ns/call # 646 times (479┬Ás+0s) by PPI::Token::_QuoteEngine::Full::_fill at line 223, avg 741ns/call # 212 times (252┬Ás+0s) by PPI::Token::_QuoteEngine::Full::_fill at line 219, avg 1┬Ás/call # 20 times (12┬Ás+0s) by PPI::Token::_QuoteEngine::Full::_fill_braced at line 317, avg 625ns/call
sub PPI::Token::_QuoteEngine::Full::CORE:match; # opcode