[system] / trunk / pg / macros / contextLimitedVector.pl Repository:
ViewVC logotype

Diff of /trunk/pg/macros/contextLimitedVector.pl

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

Revision 2726 Revision 3371
45 $self->checkConstants($self->{lop}); 45 $self->checkConstants($self->{lop});
46 $self->checkConstants($self->{rop}); 46 $self->checkConstants($self->{rop});
47 return if $self->checkVectors; 47 return if $self->checkVectors;
48 } 48 }
49 my $bop = $self->{def}{string} || $self->{bop}; 49 my $bop = $self->{def}{string} || $self->{bop};
50 $self->Error("In this context, '$bop' can only be used with Numbers") 50 $self->Error("In this context, '%s' can only be used with Numbers",$bop)
51 if $self->{equation}{context}{flags}{vector_format} eq 'coordinate'; 51 if $self->{equation}{context}{flags}{vector_format} eq 'coordinate';
52 $self->Error("In this context, '$bop' can only be used with Numbers or i,j and k"); 52 $self->Error("In this context, '%s' can only be used with Numbers or i,j and k",$bop);
53} 53}
54 54
55# 55#
56# filled in by subclasses 56# filled in by subclasses
57# 57#
72 foreach my $x ('i','j','k') { 72 foreach my $x ('i','j','k') {
73 $duplicate = $x if $self->{ijk}{$x} && $op->{ijk}{$x}; 73 $duplicate = $x if $self->{ijk}{$x} && $op->{ijk}{$x};
74 $self->{ijk}{$x} = $self->{ijk}{$x} || $op->{ijk}{$x}; 74 $self->{ijk}{$x} = $self->{ijk}{$x} || $op->{ijk}{$x};
75 } 75 }
76 } 76 }
77 Value::Error("The constant '$duplicate' may appear only once in your formula") 77 Value::Error("The constant '%s' may appear only once in your formula",$duplicate)
78 if $duplicate; 78 if $duplicate;
79} 79}
80 80
81############################################## 81##############################################
82# 82#
123our @ISA = qw(LimitedVector::BOP Parser::BOP::divide); 123our @ISA = qw(LimitedVector::BOP Parser::BOP::divide);
124 124
125sub checkVectors { 125sub checkVectors {
126 my $self = shift; 126 my $self = shift;
127 my $bop = $self->{def}{string} || $self->{bop}; 127 my $bop = $self->{def}{string} || $self->{bop};
128 $self->Error("In this context, '$bop' can only be used with Numbers"); 128 $self->Error("In this context, '%s' can only be used with Numbers",$bop);
129} 129}
130 130
131############################################## 131##############################################
132############################################## 132##############################################
133# 133#
144 if ($self->{equation}{context}{flags}{vector_format} ne 'coordinate') { 144 if ($self->{equation}{context}{flags}{vector_format} ne 'coordinate') {
145 LimitedVector::BOP::checkConstants($self,$self->{op}); 145 LimitedVector::BOP::checkConstants($self,$self->{op});
146 return if $self->checkVector; 146 return if $self->checkVector;
147 } 147 }
148 my $uop = $self->{def}{string} || $self->{uop}; 148 my $uop = $self->{def}{string} || $self->{uop};
149 $self->Error("In this context, '$uop' can only be used with Numbers") 149 $self->Error("In this context, '%s' can only be used with Numbers",$uop)
150 if $self->{equation}{context}{flags}{vector_format} eq 'coordinate'; 150 if $self->{equation}{context}{flags}{vector_format} eq 'coordinate';
151 $self->Error("In this context, '$uop' can only be used with Numbers or i,j and k"); 151 $self->Error("In this context, '%s' can only be used with Numbers or i,j and k",$uop);
152} 152}
153 153
154sub checkVector {return 0} 154sub checkVector {return 0}
155 155
156############################################## 156##############################################

Legend:
Removed from v.2726  
changed lines
  Added in v.3371

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9