chiark / gitweb /
auditor wip
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 30 Sep 2018 11:27:12 +0000 (12:27 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 30 Sep 2018 11:27:12 +0000 (12:27 +0100)
i18n-diff-auditor [new file with mode: 0755]

diff --git a/i18n-diff-auditor b/i18n-diff-auditor
new file mode 100755 (executable)
index 0000000..777bf47
--- /dev/null
@@ -0,0 +1,38 @@
+#!/usr/bin/perl -w
+use strict;
+use Carp;
+
+my @d = <>;
+
+sub l_ok ($) {
+    my ($i) = @_;
+    return unless $i < @d;
+    $_ = $d[$i];
+    1;
+}
+
+sub l ($) { confess unless l_ok $_[0]; };
+
+our ($ifilehead, $ihunkhead, $ichunk);
+our ($before, $after);
+
+for ($ifilehead = 0; l_ok $ifilehead; $ifilehead++) {
+    m{^diff} or next;
+    while (l_ok $ifilehead and m{^index|^---|^\Q+++\E}) { }
+    $ihunkhead = $ifilehead;
+    while (l_ok $ihunkhead) {
+       m{^\@\@} or confess;
+       $ichunk = $ihunkhead + 1;
+       for (;;) {
+           l_ok $ichunk or last;
+           
+       while (l_ok $ichunk and 
+    }
+       
+    confess unless m{^\@\@};
+          
+
+while (<>){
+    if (m/^diff.*/) {
+       my $headline = 
+}