Changeset 21564 for perl5

Show
Ignore:
Timestamp:
07/27/08 10:41:54 (4 months ago)
Author:
fglock
Message:

[v6.pm] added all(), any(), true(), not()

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

Legend:

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

    r21537 r21564  
     1- all(), any(), true(), not() 
     2 
    130.027  2008-07-25 
    24- more unicode tests are skipped 
  • perl5/Pugs-Compiler-Perl6/Makefile.PL

    r21536 r21564  
    2323requires('Module::Compile'      => '0.20'); 
    2424requires('Scalar::Util'         => '0'); 
     25requires('Quantum::Superpositions' => '0'); 
    2526requires('Devel::Caller'        => '0.10'); 
    2627requires('Data::Bind'           => '0.28'); 
  • perl5/Pugs-Compiler-Perl6/lib/Pugs/Emitter/Perl6/Perl5.pm

    r21550 r21564  
    787787            } 
    788788 
    789             if ($subname eq 'substr' || $subname eq 'split' || $subname eq 'die' || $subname eq 'return' || $subname eq 'push' || $subname eq 'pop' || $subname eq 'shift' || $subname eq 'join' || $subname eq 'index' || $subname eq 'undef' || $subname eq 'rand' || $subname eq 'int' || $subname eq 'splice' || $subname eq 'keys' || $subname eq 'values' || $subname eq 'sort' || $subname eq 'chomp' || $subname eq 'lc' || $subname eq 'abs' ) { 
     789            if (   $subname eq 'any' || $subname eq 'all'   
     790                || $subname eq 'substr' || $subname eq 'split' || $subname eq 'die' || $subname eq 'return'  
     791                || $subname eq 'push' || $subname eq 'pop' || $subname eq 'shift' || $subname eq 'join'  
     792                || $subname eq 'index' || $subname eq 'undef' || $subname eq 'rand' || $subname eq 'int'  
     793                || $subname eq 'splice' || $subname eq 'keys' || $subname eq 'values' || $subname eq 'sort'  
     794                || $subname eq 'chomp' || $subname eq 'lc' || $subname eq 'abs'  
     795                )  
     796            { 
    790797                return $subname . emit_parenthesis( $n->{param} ); 
    791798            } 
     
    12201227                our \@EXPORT; 
    12211228                bool->import();  # True, False 
     1229                use Quantum::Superpositions; 
    12221230                $attributes "; 
    12231231 
     
    15831591    } 
    15841592     
     1593    if ( $n->{op1} eq '|' ) { 
     1594        return 'any(' . _emit( $n->{exp1} ) . ', ' . _emit( $n->{exp2} ) . ')'; 
     1595    } 
     1596 
    15851597    return '(' . _emit( $n->{exp1} ) . ' ' . 
    15861598        $n->{op1} . ' ' . _emit( $n->{exp2} ) . ')'; 
     
    17981810        return ' "" . ' . _emit( $n->{exp1} ); 
    17991811    } 
    1800     if ( $n->{op1} eq '!' ) { 
     1812    if ( $n->{op1} eq '!' || $n->{op1} eq 'not' ) { 
    18011813        return _emit( $n->{exp1} ) . ' ? 0 : 1 '; 
    18021814    } 
     
    18171829    } 
    18181830 
    1819     if ($n->{op1} eq '?') { # bool 
    1820         return '('._emit($n->{exp1}).' ? 1 : 0 )'; 
     1831    if ($n->{op1} eq '?' || $n->{op1} eq 'true') { # bool 
     1832        return '(' . _emit($n->{exp1}) . ' ? 1 : 0 )'; 
    18211833    } 
    18221834 
  • perl5/Pugs-Compiler-Perl6/lib/Pugs/Grammar/Prefix.pm

    r16160 r21564  
    4747    ); 
    4848    __PACKAGE__->add_same_precedence_ops( { assoc => 'left'}, 'prefix:<+>', qw( 
    49         - ? ~ | @ % $ & ! * : = \\ 
     49        - ? ~ | @ % $ & ! * : = \\  
    5050    ) ); 
    5151    __PACKAGE__->add_rule(  
     
    6868        other => 'infix:<+>', 
    6969    ); 
     70    __PACKAGE__->add_rule(  
     71        name => 'true', 
     72        assoc => 'left', 
     73        precedence => 'looser', 
     74        other => 'infix:<eq>', 
     75    ); 
     76    __PACKAGE__->add_rule(  
     77        name => 'not', 
     78        assoc => 'left', 
     79        precedence => 'equal', 
     80        other => 'prefix:<true>', 
     81    ); 
    7082 
    7183    __PACKAGE__->recompile; 
  • perl5/Pugs-Compiler-Perl6/lib/v6.pm

    r21537 r21564  
    9393        ) : ''). 
    9494        "use Scalar::Util; 
     95         use Quantum::Superpositions; 
    9596         use Pugs::Runtime::Perl6; 
    9697         use Pugs::Runtime::Perl6Prelude; 
     
    106107         my \%_V6_PAD; 
    107108         our \%_V6_STATE; 
     109         bool->import();  # True, False 
    108110        " .   
    109111        # "Pugs::Runtime::Perl6Prelude->import();\n" .   # XXX - is import() needed?