Skip to content

Commit

Permalink
etc: Modernize the indenter
Browse files Browse the repository at this point in the history
  • Loading branch information
pcwalton committed Apr 17, 2012
1 parent 35a93e6 commit f9eca21
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/etc/indenter
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
#!/usr/bin/perl -w
#!/usr/bin/perl
use strict;
use warnings;

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

printf "%03d ", $indent;
for ($i = 0; $i < $indent; $i++) {
printf(" ");
}
print;
printf "%03d %s%s", $indent, (" " x $indent), $_;
}

0 comments on commit f9eca21

Please sign in to comment.