# each_line_handler()s. So, if the format of the line is not in the desired
# format for the main handler, these are used to do that adjusting. They can
# be stacked (by enclosing them in an [ anonymous array ] in the constructor,
-# so the $_ output of one is used as the input to the next. None of the other
-# handlers are stackable, but could easily be changed to be so.
+# so the $_ output of one is used as the input to the next. The eof handler
+# is also stackable, but none of the others are, but could easily be changed
+# to be so.
#
# Most of the handlers can call insert_lines() or insert_adjusted_lines()
# which insert the parameters as lines to be processed before the next input
-# file line is read. This allows the EOF handler to flush buffers, for
+# file line is read. This allows the EOF handler(s) to flush buffers, for
# example. The difference between the two routines is that the lines inserted
# by insert_lines() are subjected to the each_line_handler()s. (So if you
# called it from such a handler, you would get infinite recursion without some
main::set_access('pre_handler', \%pre_handler, qw{ c });
my %eof_handler;
- # Subroutine to call upon getting an EOF on the input file, but before
+ # Subroutines to call upon getting an EOF on the input file, but before
# that is returned to the main handler. This is to allow buffers to be
# flushed. The handler is expected to call insert_lines() or
# insert_adjusted() with the buffered material
- main::set_access('eof_handler', \%eof_handler, qw{ c r });
+ main::set_access('eof_handler', \%eof_handler, qw{ c });
my %post_handler;
# Subroutine to call after all the lines of the file are read in and
$added_lines{$addr} = [ ];
$remapped_lines{$addr} = [ ];
$each_line_handler{$addr} = [ ];
+ $eof_handler{$addr} = [ ];
$errors{$addr} = { };
$missings{$addr} = [ ];
sub run {
# Process the input object $self. This opens and closes the file and
# calls all the handlers for it. Currently, this can only be called
- # once per file, as it destroy's the EOF handler
+ # once per file, as it destroy's the EOF handlers
my $self = shift;
Carp::carp_extra_args(\@_) if main::DEBUG && @_;
return 1;
} # End of looping through lines.
- # If there is an EOF handler, call it (only once) and if it generates
+ # If there are EOF handlers, call each (only once) and if it generates
# more lines to process go back in the loop to handle them.
- if ($eof_handler{$addr}) {
- &{$eof_handler{$addr}}($self);
- $eof_handler{$addr} = ""; # Currently only get one shot at it.
+ while ($eof_handler{$addr}->@*) {
+ &{$eof_handler{$addr}[0]}($self);
+ shift $eof_handler{$addr}->@*; # Currently only get one shot at it.
goto LINE if $added_lines{$addr};
}
* 1a0687fb9c6c4567e853913549df0944fe40821279a3e9cdaa6ab8679bc286fd lib/unicore/extracted/DLineBreak.txt
* 40bcfed3ca727c19e1331f6c33806231d5f7eeeabd2e6a9e06a3740c85d0c250 lib/unicore/extracted/DNumType.txt
* a18d502bad39d527ac5586d7bc93e29f565859e3bcc24ada627eff606d6f5fed lib/unicore/extracted/DNumValues.txt
- * 3354de92c9bccd2eb1912c54d3accf2855da6b77ebd52891a797299e0cd1e360 lib/unicore/mktables
+ * 18fbf94ad448e47cb72e463de0eb4f03c471a88a0c9afde1ed0709cc775a8604 lib/unicore/mktables
* 462c9aaa608fb2014cd9649af1c5c009485c60b9c8b15b89401fdc10cf6161c6 lib/unicore/version
* c6884f4d629f04d1316f3476cb1050b6a1b98ca30c903262955d4eae337c6b1e regen/charset_translations.pl
* d9c04ac46bdd81bb3e26519f2b8eb6242cb12337205add3f7cf092b0c58dccc4 regen/regcharclass.pl