Changeset 21629 for misc

Show
Ignore:
Timestamp:
07/30/08 08:34:48 (5 months ago)
Author:
pmurias
Message:

[elfX] sub {...}, lack of support from smop yet

Location:
misc/elfish/elfX
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • misc/elfish/elfX/EmitSM0P.pm

    r21570 r21629  
    3434  } 
    3535  method cb__CompUnit ($n) { 
    36       "# this is autogenerated sm0p code\n" ~ ";\n" ~ $.e($n.statements).join(';'); 
     36      "# this is autogenerated sm0p code\n" ~ ";\n" ~ $.e($n.statements).join(''); 
    3737  } 
    3838  method capturize($arguments,$id) { 
     
    7272          '$SMOP__SLIME__CurrentFrame.move_capturize('~self.capturize($arguments,$id)~");\n" ~ 
    7373          $ret ~ ': $continuation.$SMOP__ID__setr();' ~ "\n" 
     74      } elsif ($n.function eq 'circumfix:( )') { 
     75          $n.capture.arguments[0].callback(self,$ret); 
     76      } else { 
     77          die "unsupported form of Apply\n"; 
    7478      } 
    7579  } 
     
    8185      $label ~ ": " ~ $n.text ~ ";\n"; 
    8286  } 
     87  method cb__Block ($n,$label) { 
     88      $label ~ ": " ~ "{\n"~ $.e($n.statements).join('') ~ "};\n" 
     89  } 
    8390  method cb__SubDecl ($n,$label) { 
    84       $label ~ ": " ~ "q:sm0p {\n"~ $.e($n.block.statements).join(';') ~ "};\n" 
     91      IRx1::Call.new('invocant',IRx1::Var.new('sigil','::','name','Code'),'method','new','capture',IRx1::Capture.new('arguments',[$n.block])).callback(self,$label); 
    8592  } 
     93 
    8694  method cb__Var ($n,$label) { 
    8795      if $n.sigil eq '$' and $n.twigil ne '*' { 
  • misc/elfish/elfX/elfX

    r21570 r21629  
    35403540(do{(("\#\ this\ is\ autogenerated\ sm0p\ code\ 
    35413541" . "\;\ 
    3542 ") . $self->e($n->statements())->join("\;"))})}; 
     3542") . $self->e($n->statements())->join(""))})}; 
    35433543sub capturize{my $self=CORE::shift;my($arguments,$id)=@_; 
    35443544(do{my $positionals = $arguments->keys()->map(sub {my($k)=@_; 
     
    35763576") . $ret) . "\:\ \$continuation\.\$SMOP__ID__setr\(\)\;") . "\ 
    35773577")}) 
     3578}elsif((($n->function() eq "circumfix\:\(\ \)"))) { 
     3579(do{$n->capture()->arguments()->[0]->callback($self, $ret)}) 
     3580}else { 
     3581(do{GLOBAL::die("unsupported\ form\ of\ Apply\ 
     3582")}) 
    35783583}})}; 
    35793584sub cb__Buf{my $self=CORE::shift;my($n,$label)=@_; 
     
    35833588(do{((($label . "\:\ ") . $n->text()) . "\;\ 
    35843589")})}; 
     3590sub cb__Block{my $self=CORE::shift;my($n,$label)=@_; 
     3591(do{(((($label . "\:\ ") . "\{\ 
     3592") . $self->e($n->statements())->join("")) . "\}\;\ 
     3593")})}; 
    35853594sub cb__SubDecl{my $self=CORE::shift;my($n,$label)=@_; 
    3586 (do{(((($label . "\:\ ") . "q\:sm0p\ \{\ 
    3587 ") . $self->e($n->block()->statements())->join("\;")) . "\}\;\ 
    3588 ")})}; 
     3595(do{IRx1::Call->new("invocant", IRx1::Var->new("sigil", "\:\:", "name", "Code"), "method", "new", "capture", IRx1::Capture->new("arguments", [$n->block()]))->callback($self, $label)})}; 
    35893596sub cb__Var{my $self=CORE::shift;my($n,$label)=@_; 
    35903597(do{if((($n->sigil() eq "\$") and ($n->twigil() ne "\*"))) {