X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=dgit-junk.git;a=blobdiff_plain;f=i18n-diff-auditor;fp=i18n-diff-auditor;h=53819ca94f445c859f14a5dea54a2847694db5ed;hp=8c40f4a848822f6d7c7aa23a443ea99dac51b417;hb=25665dabae423ecc15a0c8cf46861e2bf7b3b0b2;hpb=b3924012db06a3b2d378c19d9a59a2af632b42a7 diff --git a/i18n-diff-auditor b/i18n-diff-auditor index 8c40f4a..53819ca 100755 --- a/i18n-diff-auditor +++ b/i18n-diff-auditor @@ -159,17 +159,17 @@ sub analyse_chunk_core () { $$var = shift @$ary; }; my ($x,$y); - my $next_before = sub { $next_something->(\@xs, \$x, 'before'); }; - my $next_after = sub { $next_something->(\@ys , \$y, 'after' ); }; + my $next_x = sub { $next_something->(\@xs, \$x, 'before'); }; + my $next_y = sub { $next_something->(\@ys, \$y, 'after' ); }; my $is_string = sub { $_[0]{T} =~ m/heredoc|string/; }; for (;;) { last unless @xs or @ys; - $next_before->(); - $next_after->(); + $next_x->(); + $next_y->(); next if $x->{E} eq $y->{E}; my $string_changed; if ($y->{E} eq '__' or $y->{E} eq '_f') { - $next_after->(); + $next_y->(); die "__ on non-string $y->{P}\n" unless Sis_string->($y); die "__ on was non-string $y->{P}\n" unless $is_string->($x); if ($y->{Q} ne "'") { @@ -210,10 +210,10 @@ sub analyse_chunk_core () { $fmt = $'; if ($& eq '%%') { $exactly->('%'); next; } elsif ($& ne '%s') { die "unhandled %-subst $&\n"; } - $next_after->(); + $next_y->(); die "expected comma, got $y->{P}\n" unless $y->{E} eq ','; if ($xs =~ m{^\@}) { - $next_after->(); + $next_y->(); die "\@... => not string" unless $is_string->($y); die "\@... => $y->{P}" if $y->{Q} ne '"'; $exactly->($y->{V}); @@ -224,7 +224,7 @@ sub analyse_chunk_core () { if (!$bras and !@ys) { last; } - $next_after->(); + $next_y->(); if (!$bras and (grep { $y->{E} eq $_ } qw( or xor and not ; : ) or $y->{T} eq 'ket'