2
0
mirror of https://github.com/xcat2/xNBA.git synced 2024-11-26 11:19:17 +00:00

Special handling for symbols of the form "xxx_end", to make table end

markers appear before the symbols that immediately follow the table.
This commit is contained in:
Michael Brown 2005-04-27 12:08:13 +00:00
parent 1ddcdb0524
commit c8fc121890

View File

@ -17,14 +17,18 @@ while ( <> ) {
print;
( my $index, my $section ) = ( $1, $2 );
$section_idx{$section} = sprintf ( "%02d", $index );
} elsif ( /^([0-9a-fA-F]+)\s.*?\s([\.\*]\S+)\s+([0-9a-fA-F]+)\s/ ) {
} elsif ( /^([0-9a-fA-F]+)\s.*?\s([\.\*]\S+)\s+([0-9a-fA-F]+)\s+(\S+)/ ) {
# It's a symbol line - store it in the hash, indexed by
# "<section index>:<value>:<size>"
( my $value, my $section, my $size ) = ( $1, $2, $3 );
# "<section_index>:<value>:<size>:<end_tag>". <end_tag> is "0" if
# the symbol name is of the form xxx_end, "1" otherwise; this is
# done so that table end markers show up before any other symbols
# with the same value.
( my $value, my $section, my $size, my $name ) = ( $1, $2, $3, $4 );
die "Unrecognised section \"$section\"\n"
unless exists $section_idx{$section};
my $section_idx = $section_idx{$section};
my $key = $section_idx.":".$value.":".$size;
my $end = ( $name =~ /_end$/ ) ? "0" : "1";
my $key = $section_idx.":".$value.":".$size.":".$end;
$lines{$key} ||= '';
$lines{$key} .= $_;
} else {