summary refs log tree commit diff
path: root/src/etc/indenter
blob: 017cb926981fb324ec506aa36d5af5ba11b29830 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/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;
    }
}