| … | |
… | |
| 22 | # |
22 | # |
| 23 | sub _eval { |
23 | sub _eval { |
| 24 | my $self = shift; my ($a,$b) = @_; |
24 | my $self = shift; my ($a,$b) = @_; |
| 25 | $a = Value::makeValue($a) unless ref($a); |
25 | $a = Value::makeValue($a) unless ref($a); |
| 26 | $b = Value::makeValue($b) unless ref($b); |
26 | $b = Value::makeValue($b) unless ref($b); |
| 27 | $a == $b; |
27 | return ($a == $b)? 1 : 0; |
| 28 | } |
28 | } |
| 29 | |
29 | |
| 30 | # |
30 | # |
| 31 | # Add/Remove the equality operator to/from a context |
31 | # Add/Remove the equality operator to/from a context |
| 32 | # |
32 | # |
| … | |
… | |
| 40 | '=' => { |
40 | '=' => { |
| 41 | class => 'Parser::BOP::equality', |
41 | class => 'Parser::BOP::equality', |
| 42 | precedence => $prec+.25, # just above comma |
42 | precedence => $prec+.25, # just above comma |
| 43 | associativity => 'left', # computed left to right |
43 | associativity => 'left', # computed left to right |
| 44 | type => 'bin', # binary operator |
44 | type => 'bin', # binary operator |
| 45 | string => '=', # output string for it |
45 | string => ' = ', # output string for it |
| 46 | perl => '==', # perl string |
46 | perl => '==', # perl string |
| 47 | } |
47 | } |
| 48 | ); |
48 | ); |
| 49 | } else {$context->operators->remove('=')} |
49 | } else {$context->operators->remove('=')} |
| 50 | return; |
50 | return; |