rust/src/etc/indenter

18 lines
237 B
Plaintext
Raw Normal View History

2012-04-17 10:01:17 -05:00
#!/usr/bin/perl
use strict;
use warnings;
2012-04-05 22:59:07 -05:00
2012-04-17 10:01:17 -05:00
my $indent = 0;
2012-04-05 22:59:07 -05:00
while (<>) {
if (/^rust: ">>/) {
$indent += 1;
}
2012-04-17 10:01:17 -05:00
printf "%03d %s%s", $indent, (" " x $indent), $_;
2012-04-21 12:04:58 -05:00
if (/^rust: "<</) {
$indent -= 1;
}
2012-04-05 22:59:07 -05:00
}