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
This commit is contained in:
bors 2015-01-21 11:07:31 +00:00
commit 6869645e86
4 changed files with 17 additions and 50 deletions

View file

@ -1,34 +0,0 @@
#!/usr/bin/perl -w
# Copyright 2014 The Rust Project Developers. See the COPYRIGHT
# file at the top-level directory of this distribution and at
# http://rust-lang.org/COPYRIGHT.
#
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
# <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
# option. This file may not be copied, modified, or distributed
# except according to those terms.
my $file = $ARGV[0];
my @lines = <>;
my $anchors = {};
my $i = 0;
for $line (@lines) {
$i++;
if ($line =~ m/id="([^"]+)"/) {
$anchors->{$1} = $i;
}
}
$i = 0;
for $line (@lines) {
$i++;
while ($line =~ m/href="#([^"]+)"/g) {
if (! exists($anchors->{$1})) {
print "$file:$i: $1 referenced\n";
}
}
}

View file

@ -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