Changeset 21564
- Timestamp:
- 07/27/08 10:41:54 (6 months ago)
- Location:
- perl5/Pugs-Compiler-Perl6
- Files:
-
- 5 modified
-
ChangeLog (modified) (1 diff)
-
Makefile.PL (modified) (1 diff)
-
lib/Pugs/Emitter/Perl6/Perl5.pm (modified) (5 diffs)
-
lib/Pugs/Grammar/Prefix.pm (modified) (2 diffs)
-
lib/v6.pm (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
perl5/Pugs-Compiler-Perl6/ChangeLog
r21537 r21564 1 - all(), any(), true(), not() 2 1 3 0.027 2008-07-25 2 4 - more unicode tests are skipped -
perl5/Pugs-Compiler-Perl6/Makefile.PL
r21536 r21564 23 23 requires('Module::Compile' => '0.20'); 24 24 requires('Scalar::Util' => '0'); 25 requires('Quantum::Superpositions' => '0'); 25 26 requires('Devel::Caller' => '0.10'); 26 27 requires('Data::Bind' => '0.28'); -
perl5/Pugs-Compiler-Perl6/lib/Pugs/Emitter/Perl6/Perl5.pm
r21550 r21564 787 787 } 788 788 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 { 790 797 return $subname . emit_parenthesis( $n->{param} ); 791 798 } … … 1220 1227 our \@EXPORT; 1221 1228 bool->import(); # True, False 1229 use Quantum::Superpositions; 1222 1230 $attributes "; 1223 1231 … … 1583 1591 } 1584 1592 1593 if ( $n->{op1} eq '|' ) { 1594 return 'any(' . _emit( $n->{exp1} ) . ', ' . _emit( $n->{exp2} ) . ')'; 1595 } 1596 1585 1597 return '(' . _emit( $n->{exp1} ) . ' ' . 1586 1598 $n->{op1} . ' ' . _emit( $n->{exp2} ) . ')'; … … 1798 1810 return ' "" . ' . _emit( $n->{exp1} ); 1799 1811 } 1800 if ( $n->{op1} eq '!' ) {1812 if ( $n->{op1} eq '!' || $n->{op1} eq 'not' ) { 1801 1813 return _emit( $n->{exp1} ) . ' ? 0 : 1 '; 1802 1814 } … … 1817 1829 } 1818 1830 1819 if ($n->{op1} eq '?' ) { # bool1820 return '(' ._emit($n->{exp1}).' ? 1 : 0 )';1831 if ($n->{op1} eq '?' || $n->{op1} eq 'true') { # bool 1832 return '(' . _emit($n->{exp1}) . ' ? 1 : 0 )'; 1821 1833 } 1822 1834 -
perl5/Pugs-Compiler-Perl6/lib/Pugs/Grammar/Prefix.pm
r16160 r21564 47 47 ); 48 48 __PACKAGE__->add_same_precedence_ops( { assoc => 'left'}, 'prefix:<+>', qw( 49 - ? ~ | @ % $ & ! * : = \\ 49 - ? ~ | @ % $ & ! * : = \\ 50 50 ) ); 51 51 __PACKAGE__->add_rule( … … 68 68 other => 'infix:<+>', 69 69 ); 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 ); 70 82 71 83 __PACKAGE__->recompile; -
perl5/Pugs-Compiler-Perl6/lib/v6.pm
r21537 r21564 93 93 ) : ''). 94 94 "use Scalar::Util; 95 use Quantum::Superpositions; 95 96 use Pugs::Runtime::Perl6; 96 97 use Pugs::Runtime::Perl6Prelude; … … 106 107 my \%_V6_PAD; 107 108 our \%_V6_STATE; 109 bool->import(); # True, False 108 110 " . 109 111 # "Pugs::Runtime::Perl6Prelude->import();\n" . # XXX - is import() needed?
