Jarkko Hietaniemi wrote:
...
 
> This sounds like having also 'basic block' entry/exit opcodes.  Hmmm.
> 
> BLB = block begin
> BBB = basic block begin
> SE  = statement end
> BBE = basic block end
> BLE = block end
> 
> sub foo {
>         BLB
>         BBB
>         my ($a, $b) = @_;
>         SE
>         my $c = bar($a + $b);
>         SE
>         my $d = bar($a - $b);
>         SE
>         BBE
>         BLB
>         if (BBB $c < $d BBE) {
>                 BLB
>                 my $e = $c * $d;
>                 SE
>                 return ($e + 1)/($e - 1);
>                 SE
>                 BLE
>         } else {
>                 BLB
>                 ($c, $d) = ($d, $c);
>                 SE
>                 BLE
>         }
>         BBB
>         return ($c + $d)/($c - $d);
>         SE
>         BBE
>         BLE
> }


do

        s%([A-Z]+)([BE])%<${\(($2 eq 'E')?'/':'')}$1>%g

on that and you've almost got XML!



-- 
                                           David Nicol 816.235.1187
                   "Perl was born in downtown Hell!" -- Matt Youell

Reply via email to