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