[system] / trunk / pg / lib / Parser.pm Repository:
ViewVC logotype

Diff of /trunk/pg/lib/Parser.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 2797 Revision 2798
552 $self->setValues(@_); 552 $self->setValues(@_);
553 foreach my $x (keys %{$self->{values}}) { 553 foreach my $x (keys %{$self->{values}}) {
554 $self->Error("The value of '$x' can't be a formula") 554 $self->Error("The value of '$x' can't be a formula")
555 if Value::isFormula($self->{values}{$x}); 555 if Value::isFormula($self->{values}{$x});
556 } 556 }
557 $self->{tree}->eval; 557 Value::makeValue($self->{tree}->eval);
558} 558}
559 559
560################################################## 560##################################################
561# 561#
562# Removes redundent items (like x+-y, 0+x and 1*x, etc) 562# Removes redundent items (like x+-y, 0+x and 1*x, etc)
611# Produces a perl eval string (substituting the given values). 611# Produces a perl eval string (substituting the given values).
612# 612#
613sub perl { 613sub perl {
614 my $self = shift; 614 my $self = shift;
615 $self->setValues(@_); 615 $self->setValues(@_);
616 $self->{tree}->perl; 616 my $perl = $self->{tree}->perl;
617 $perl = 'Real('.$perl.')' if $self->isRealNumber;
618 return $perl;
617} 619}
618 620
619################################################## 621##################################################
620# 622#
621# Produce a perl function 623# Produce a perl function

Legend:
Removed from v.2797  
changed lines
  Added in v.2798

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9