Skip to content

Commit

Permalink
If a flush is encountered, prevent outputting ¶ cohorts until non-tag…
Browse files Browse the repository at this point in the history
… input is seen
  • Loading branch information
TinoDidriksen committed Oct 16, 2023
1 parent a28341b commit 71c2c86
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tools/shellscripts/kal-tokenise.in
Original file line number Diff line number Diff line change
Expand Up @@ -595,16 +595,30 @@ sub propagate_tags {
}

my $out = "\"<¶>\"\n\t\"\" CLB\n";
my $flushing = 0;
my $wf = '';
while (<STDIN>) {
s/\x{feff}//g; # Unicode BOM

if (/^<STREAMCMD:FLUSH>/) {
# If a flush is encountered, prevent outputting ¶ cohorts until non-tag input is seen
$flushing = 1;
print;
next;
}

if (scalar(keys(%cache)) > 10000) {
%cache = ();
}

$out = "\"<¶>\"\n\t\"\" CLB\n";
if ($flushing) {
$out = $_;
}
if (!/^\s*$/) {
if (!/^</) {
$flushing = 0;
}
$out = analyze($_);
}

Expand Down

0 comments on commit 71c2c86

Please sign in to comment.