Ticket #2936: Entity.pm-relative-templates.patch

File Entity.pm-relative-templates.patch, 755 bytes (added by historic_bruno, 9 years ago)
  • tools/entity/Entity.pm

     
    8383            }
    8484        }
    8585        $base->{' content'} = join ' ', @t;
     86    } elsif ($new->{'@op'}) {
     87        my $op = $new->{'@op'}{' content'};
     88        my $op1 = $base->{' content'};
     89        my $op2 = $new->{' content'};
     90        if ($op eq 'add') {
     91            $base->{' content'} = $op1 + $op2;
     92        }
     93        elsif ($op eq 'mul') {
     94            $base->{' content'} = $op1 * $op2;
     95        }
     96        else {
     97            die "Invalid operator '$op'";
     98        }
    8699    } else {
    87100        $base->{' content'} = $new->{' content'};
    88101    }