Changeset 22807 for v6

Show
Ignore:
Timestamp:
10/28/08 20:14:51 (2 months ago)
Author:
ruoso
Message:

[mildew] dotty->postop->postcircumfix implemented

Location:
v6/mildew
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • v6/mildew/P6Meta.pm

    r22709 r22807  
    44    $OUT.print("add_method not implemented yet\n"); 
    55}; 
    6 $p6meta.add_method($p6meta,'HOW',sub { 
     6$p6meta.^!how.add_method($p6meta,'HOW',sub { 
    77}); 
  • v6/mildew/mildew

    r22708 r22807  
    2020 
    2121sub XXX { 
    22     confess 'unimplemented' 
     22    confess join ' ', 'unimplemented: ', @_; 
    2323} 
    2424sub FETCH { 
     
    246246            ); 
    247247        } else { 
    248             XXX 
    249         } 
    250     } else { 
    251         XXX; 
     248            XXX('unknown methodop'); 
     249        } 
     250    } elsif (my $postop = $m->{dottyop}{postop}) { 
     251        if (my $postcircumfix = $postop->{postcircumfix}) { 
     252            my $positional = $methodop->{semilist}[0]{statement}[0]; 
     253            my @positional = $positional ? $positional->emit_m0ld : (); 
     254            AST::Call->new( 
     255                identifier => string 'postcircumfix:'.$postcircumfix->{FIRST}.' '.$postcircumfix->{LAST}, 
     256                capture => AST::Capture->new(invocant=>FETCH($noun),positional=>[@positional]), 
     257            ); 
     258        } else { 
     259            XXX('unknown postop'); 
     260        } 
     261    } else { 
     262        XXX('unknown dotty'); 
    252263    } 
    253264} 
  • v6/mildew/t/pure_prototype_how.t

    r22649 r22807  
    44$object = ::p6opaque.^!CREATE; 
    55$object.^!how() = ::PurePrototypeHow; 
    6 $object.^!methods.postcircumfix:<{ }>("foo") = sub { 
     6$object.^!methods.{"foo"} = sub { 
    77    #say "ok 1 #method call"; 
    88    $OUT.print("ok 1 #method call\n");