#!/usr/bin/perl
use strict;
use warnings;

my $indent = 0;
while (<>) {
    if (/^rust: ~">>/) {
        $indent += 1;
    }

    printf "%03d  %s%s", $indent, ("  " x $indent), $_;

    if (/^rust: ~"<</) {
        $indent -= 1;
    }
}

