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

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

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

Revision 3465 Revision 3466
35 35
36 my $c = bless { 36 my $c = bless {
37 value => $value, type => $type, isConstant => 1, 37 value => $value, type => $type, isConstant => 1,
38 ref => $ref, equation => $equation, 38 ref => $ref, equation => $equation,
39 }, $class; 39 }, $class;
40 $c->{canBeInterval} = 1 if ($value->class eq 'Point' && $type->{length} == 2); 40 $c->{canBeInterval} = 1
41 if $value->{canBeInterval} ||
42 ($value->class =~ m/Point|List/ &&
43 $type->{length} == 2 && $type->{entryType}{name} eq 'Number');
41 44
42 $c->{isZero} = $value->isZero; 45 $c->{isZero} = $value->isZero;
43 $c->{isOne} = $value->isOne; 46 $c->{isOne} = $value->isOne;
44 return $c; 47 return $c;
45} 48}
76 return $TeX; 79 return $TeX;
77} 80}
78sub perl { 81sub perl {
79 my $self = shift; my $parens = shift; my $matrix = shift; 82 my $self = shift; my $parens = shift; my $matrix = shift;
80 my $perl = $self->{value}->perl(0,$matrix); 83 my $perl = $self->{value}->perl(0,$matrix);
81 $perl = 'Closed('.$perl.')' 84 $perl = "(($perl)->with(open=>'$self->{open}',close=>'$self->{close}'))"
82 if $self->{canBeInterval} && $self->{open}.$self->{close} eq '[]'; 85 if $self->{canBeInterval} && $self->{open}.$self->{close} eq '[]';
83 $perl = '('.$perl.')' if $parens; 86 $perl = '('.$perl.')' if $parens;
84 return $perl; 87 return $perl;
85} 88}
86 89
97} 100}
98 101
99# 102#
100# Get a Union object's data 103# Get a Union object's data
101# 104#
102sub makeUnion {@{shift->{value}->{data}}} 105sub makeUnion {@{shift->{value}{data}}}
103 106
104######################################################################### 107#########################################################################
105 108
1061; 1091;
107 110

Legend:
Removed from v.3465  
changed lines
  Added in v.3466

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9