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

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

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

Revision 2624 Revision 2625
14sub _check { 14sub _check {
15 my $self = shift; 15 my $self = shift;
16 return if ($self->checkStrings()); 16 return if ($self->checkStrings());
17 if ($self->{lop}->{canBeInterval} && $self->{rop}->{canBeInterval}) { 17 if ($self->{lop}->{canBeInterval} && $self->{rop}->{canBeInterval}) {
18 $self->{type} = Value::Type('Union',2,$Value::Type{number}); 18 $self->{type} = Value::Type('Union',2,$Value::Type{number});
19 $self->{canBeInterval} = 1;
20 foreach my $op ('lop','rop') {
21 if ($self->{$op}->type !~ m/^(Interval|Union)$/) {
22 $self->{$op} = bless $self->{$op}, 'Parser::List::Interval';
23 $self->{$op}->typeRef->{name} = $self->{equation}{context}{parens}{interval}{type};
24 }
25 }
19 } else {$self->Error("Operands of '$self->{bop}' must be intervals")} 26 } else {$self->Error("Operands of '$self->{bop}' must be intervals")}
20} 27}
21 28
22 29
23# 30#
39# 46#
40# Turn a union into a list of the intervals in the union. 47# Turn a union into a list of the intervals in the union.
41# 48#
42sub makeUnion { 49sub makeUnion {
43 my $self = shift; 50 my $self = shift;
44 return $self unless ($self->{def}{isUnion}); 51 return (
45 return ($self->{lop}->makeUnion,$self->{rop}->makeUnion); 52 $self->{lop}{def}{isUnion}? $self->{lop}->makeUnion : $self->{lop},
53 $self->{rop}{def}{isUnion}? $self->{rop}->makeUnion : $self->{rop},
54 );
46} 55}
47 56
48######################################################################### 57#########################################################################
49 58
501; 591;

Legend:
Removed from v.2624  
changed lines
  Added in v.2625

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9