Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #21242 - richo:no-perl, r=brson
There's only one build-critical path in which perl is used, and it was to do a text replacement trivially achievable with sed(1). I ported the indenter script because it [appears to be used][indenter], but removed check links because it appears to be entirely out of date. [indenter]: https://github.com/rust-lang/rust/blob/master/src/librustc/util/common.rs#L60-70
- Loading branch information
Showing
4 changed files
with
17 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,19 @@ | ||
#!/usr/bin/perl | ||
use strict; | ||
use warnings; | ||
#!/usr/bin/env python | ||
import re | ||
import sys | ||
|
||
my $indent = 0; | ||
while (<>) { | ||
if (/^rust: ~">>/) { | ||
$indent += 1; | ||
} | ||
indent = 0 | ||
more_re = re.compile(r"^rust: ~\">>") | ||
less_re = re.compile(r"^rust: ~\"<<") | ||
while True: | ||
line = sys.stdin.readline() | ||
if not line: | ||
break | ||
|
||
printf "%03d %s%s", $indent, (" " x $indent), $_; | ||
if more_re.match(line): | ||
indent += 1 | ||
|
||
if (/^rust: ~"<</) { | ||
$indent -= 1; | ||
} | ||
} | ||
print "%03d %s%s" % (indent, " " * indent, line.strip()) | ||
|
||
if less_re.match(line): | ||
indent -= 1 |