- Timestamp:
- 07/25/08 21:28:49 (4 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
perl5/Pugs-Compiler-Perl6/lib/Pugs/Emitter/Perl6/Perl5.pm
r21535 r21543 581 581 } 582 582 583 sub _is_empty_braces { 584 return 1 if 585 ref($_[0]) eq 'HASH' 586 && exists $_[0]{fixity} 587 && !exists $_[0]{exp1} 588 && $_[0]{fixity} eq 'circumfix' 589 && $_[0]{op1} eq '[' 590 && $_[0]{op2} eq ']' 591 } 592 593 sub _is_empty_exp { 594 return 1 if 595 ref($_[0]) eq 'HASH' 596 && !exists $_[0]{exp1} 597 } 598 599 sub _is_exp_containing { 600 return 1 if 601 ref($_[0]) eq 'HASH' 602 && exists $_[0]{exp1} 603 && $_[1]->( $_[0]{exp1}, @_[2..$#_] ) 604 } 605 606 sub _is_paren_containing { 607 return 1 if 608 ref($_[0]) eq 'HASH' 609 && exists $_[0]{fixity} 610 && $_[0]{fixity} eq 'circumfix' 611 && $_[0]{op1} eq '(' 612 && $_[0]{op2} eq ')' 613 && $_[1]->($_[0], @_[2..$#_] ) 614 } 615 583 616 sub _emit_closure { 584 617 my ($signature, $block) = @_; … … 620 653 ) 621 654 { 655 if ( $n->{sub}{bareword} eq 'push' 656 && $n->{op1} eq 'call' 657 && ( _is_paren_containing($n->{param}, \&_is_empty_exp) 658 || _is_paren_containing($n->{param}, \&_is_exp_containing, \&_is_empty_braces ) 659 ) 660 ) 661 { 662 return _not_implemented( "push without parameters", "call" ); 663 } 664 622 665 if ( $n->{sub}{bareword} eq 'call' ) { 623 666 # call; … … 786 829 no warnings 'uninitialized'; 787 830 #warn "method_call: ", Dumper( $n ); 831 if ( $n->{method}{dot_bareword} eq 'nextwith' ) { 832 if ( exists $n->{self}{code} ) { 833 my ($sub_name) = $n->{self}{code} =~ /^&(.*)$/; 834 return 'return ' . _emit( { 835 op1 => 'call', 836 param => $n->{param}, 837 sub => { bareword => $sub_name }, 838 } ); 839 } 840 } 788 841 if ( $n->{method}{dot_bareword} eq 'print' || 789 842 $n->{method}{dot_bareword} eq 'warn' ) {
