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

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

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

Revision 2686 Revision 2687
14# 14#
15sub new { 15sub new {
16 my $self = shift; my $class = ref($self) || $self; 16 my $self = shift; my $class = ref($self) || $self;
17 my $equation = shift; 17 my $equation = shift;
18 my ($name,$ref) = @_; 18 my ($name,$ref) = @_;
19 unless (defined($equation->{context}{variables}{$name})) { 19 unless ($equation->{context}{variables}{$name}) {
20 my $string = substr($equation->{string},$ref->[2]); 20 my $string = substr($equation->{string},$ref->[2]);
21 if ($string =~ m/^([a-z][a-z]+)/i) { 21 if ($string =~ m/^([a-z][a-z]+)/i) {
22 $ref->[3] = $ref->[2]+length($1); 22 $ref->[3] = $ref->[2]+length($1);
23 $equation->Error("'$1' is not defined in this context",$ref); 23 $equation->Error("'$1' is not defined in this context",$ref);
24 } 24 }
25 $equation->Error("Variable '$name' is not defined in this context",$ref); 25 $equation->Error("Variable '$name' is not defined in this context",$ref);
26 } 26 }
27 $equation->Error("Variable '$name' is not defined in this context",$ref)
28 if $equation->{context}{variables}{$name}{parameter} &&
29 $equation->{context}{flags}{no_parameters};
27 $equation->{variables}{$name} = 1; 30 $equation->{variables}{$name} = 1;
28 my $def = $equation->{context}{variables}{$name}; 31 my $def = $equation->{context}{variables}{$name};
29 bless { 32 bless {
30 name => $name, def => $def, type => $def->{type}, 33 name => $name, def => $def, type => $def->{type},
31 ref => $ref, equation => $equation 34 ref => $ref, equation => $equation

Legend:
Removed from v.2686  
changed lines
  Added in v.2687

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9