rust/src/etc/indenter

17 lines
238 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: ~">>/) {
2012-04-05 22:59:07 -05:00
$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: ~"<</) {
2012-04-21 12:04:58 -05:00
$indent -= 1;
}
2012-04-05 22:59:07 -05:00
}