| Next | Making Programs Faster | 69 |
Old code:
elsif ( /^([A-Z])(<(?:<+\s)?)$/ ) {
## Push a new sequence onto the stack of those "in-progress"
($cmd, $ldelim) = ($1, $2);
$seq = Pod::InteriorSequence->new(
-name => $cmd,
-ldelim => $ldelim, -rdelim => '',
-file => $file, -line => $line
);
$ldelim =~ s/\s+$//, ($rdelim = $ldelim) =~ tr/</>/;
(@seq_stack > 1) and $seq->nested($seq_stack[-1]);
push @seq_stack, $seq;
}
This handles the X< part of a sequence
It builds a new Pod::InteriorSequence and puts it on the stack
Later code takes the remainder, complete sequence> blah blah
Expands complete sequence if necessary
Appends it to the Pod::InteriorSequence object
Puts blah blah back into the input stream
There's a lot of state variable management and stack jiggery-pokery
| Next | ![]() |
Copyright © 2003 M. J. Dominus |