Changeset 21572 for perl5

Show
Ignore:
Timestamp:
07/27/08 16:58:33 (4 months ago)
Author:
fglock
Message:

[v6.pm] improved smartmatching

Location:
perl5/Pugs-Compiler-Perl6
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • perl5/Pugs-Compiler-Perl6/ChangeLog

    r21564 r21572  
    11- all(), any(), true(), not() 
     2- improved smartmatching, given/when 
    23 
    340.027  2008-07-25 
  • perl5/Pugs-Compiler-Perl6/lib/Pugs/Emitter/Perl6/Perl5.pm

    r21569 r21572  
    14771477            } 
    14781478        } 
     1479        if (   exists $n->{exp2}{int} && defined $n->{exp2}{int}  
     1480            || exists $n->{exp2}{num} && defined $n->{exp2}{num}  
     1481            )  
     1482        { 
     1483            return _emit( { 
     1484                      'assoc' => 'chain', 
     1485                      'chain' => [ $n->{exp1}, '==', $n->{exp2} ] 
     1486                } ); 
     1487        } 
     1488        if (   exists $n->{exp2}{single_quoted} && defined $n->{exp2}{single_quoted}  
     1489            || exists $n->{exp2}{double_quoted} && defined $n->{exp2}{double_quoted}  
     1490            )  
     1491        { 
     1492            return _emit( { 
     1493                      'assoc' => 'chain', 
     1494                      'chain' => [ $n->{exp1}, 'eq', $n->{exp2} ] 
     1495                } ); 
     1496        } 
    14791497        return _emit( $n->{exp1} ) . ' =~ (ref' . emit_parenthesis( $n->{exp2} ).' eq "Regexp" '. 
    14801498            ' ? '._emit($n->{exp2}).