From 78ab0ab57128eec1ef2447cdd3e6008230ee5c04 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sun, 30 Sep 2018 12:27:12 +0100 Subject: [PATCH] auditor wip --- i18n-diff-auditor | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100755 i18n-diff-auditor diff --git a/i18n-diff-auditor b/i18n-diff-auditor new file mode 100755 index 0000000..777bf47 --- /dev/null +++ b/i18n-diff-auditor @@ -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 = +} -- 2.30.2