Skip to content

Commit

Permalink
Fix order in substitution commands.
Browse files Browse the repository at this point in the history
When parsing, the pattern is expected first, followed by the replacement,
but when the 'raw' string is reconstructed, the order is the other way
around due to the argument order when passing the data from change() via
translate() to to_change().

Re-order the arguments so that the reconstructed 'raw' string will contain
the arguments in the order in which they were actually present in the source
file.
  • Loading branch information
pne committed Jun 20, 2009
1 parent 0a1f9f7 commit 6a30b42
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/Lingua/tlhInganHol/yIghun.pm
Expand Up @@ -240,7 +240,7 @@ my %v_change = qw(
);
my $v_change = enqr keys %v_change;
sub to_change {
my ($expr, $becomes, $pattern, $op) = @_;
my ($expr, $pattern, $becomes, $op) = @_;
$pattern->{trans} =~ s/^qq?<|>$//g;
$becomes->{trans} =~ s/^qq?<|>$//g;
return "$expr->{trans} =~ $op->{trans}<$pattern->{trans}><$becomes->{trans}>";
Expand Down Expand Up @@ -754,7 +754,7 @@ sub change {
my $expr = top('dat')
or die "$op: DoS Sambe'!\n" ; # missing data
$op = tok('verb',$op,$v_change{$op});
pushtok('acc', translate($expr,$becomes,$pattern,$op));
pushtok('acc', translate($expr,$pattern,$becomes,$op));
}

sub arg1 {
Expand Down

0 comments on commit 6a30b42

Please sign in to comment.