Also, fix detection of erroneous input lines.
$st_delete_disc_range->execute($id, $min_ndisc, $old_ndisc);
}
$st_delete_disc_range->execute($id, $min_ndisc, $old_ndisc);
}
- for (my $i = $min_ndisc; $i < $ndisc; $i++)
- { $st_add_disc->execute($id, $i, $path[$i]); }
+ for (my $i = $min_ndisc; $i < $ndisc; $i++) {
+ my $box = $box{$path[$i]};
+ $st_add_disc->execute($id, $i, $path[$i],
+ $box eq "#nil" ? undef : $box);
+ }
- $id = undef; @path = ();
+ $id = undef; @path = (); %box = ();
}
LINE: while (<>) {
chomp;
}
LINE: while (<>) {
chomp;
- if (/^ \[ \# (\d+ | NEW | UNK) \s* : \s* (\d+ | \* | DEL) ]
- \s* (\S .*)? $/x) {
+ if (/^ \s* (\; .*)? $/x) {
+ next LINE;
+ } elsif (/^ \[ \# (\d+ | NEW | UNK) \s* : \s* (\d+ | \* | DEL) ]
+ \s* (\S .*)? $/x) {
flush_set;
($id, $ndisc, $name) = ($1, $2, $3);
flush_set;
($id, $ndisc, $name) = ($1, $2, $3);
} elsif (/^ \s+ (?: !! \s*)? (\S .*) $/x) {
my $path = $1;
defined $id or die "no active set";
} elsif (/^ \s+ (?: !! \s*)? (\S .*) $/x) {
my $path = $1;
defined $id or die "no active set";
- push @path, $path;
- } elsif (/^ .* \S .* $/) {
+ push @path, $path; $box{$path} = $curbox;
+ } else {
die "unrecognized line `$_'";
}
}
die "unrecognized line `$_'";
}
}