package xm::cblocks;
use xm::o;
use strict;
"
look into the actual C-text and mark pairs of { and }. These are
then called <CBLK>
rem: the blocks have depthnumbers.
"}
my $in = shift;
$in =~ s{\{} {\&\$in =~ s{\}} {\&\return $in;
}
my $in = shift;
$in =~ s{\&\#7B\;} {\{}sg;
$in =~ s{\&\return $in
}
my $in = shift;
my $d;
for $d (qw{ CPRE CSTR CCHR CDOC })
{
$in =~ s{<($d[A-Z]*)(\s[^<>]*)?>(?!<\1[\s>])
((?:.(?!</?\1[\s>]))*.) (</\1(?:\s[^<>]*)?>) }
{ "<$1$2>".x_off($3).$4 }gsex;
}
my $i = 10;
while (
$in =~ s{ ( \{ [^\{\}]* \} ) }
{ ++$i; "<CBLK $i>".x_off($1)."</CBLK $i>" }gsex
) { };
while (
$in =~ s{ (<CBLK\s*\d+>) ((?:.(?!</?CBLK\s*\d*>))*.?)
<(CBLK\s*\d+)> ((?:.(?!</?CBLK\s*\d*>))*.?) </\3> }
{ $1.$2."<CBLKS>".$4."</CBLKS>" }gsex
) { };
$in =~ s{(</?)CBLK\s*\d+>} {$1."CBLK>"}gsex; return x_on($in);
}
return xm::o::args_stdin(@_,DESC); }
return DO(xm::o::args_stdin(@_,DESC)); }
1;