Changeset 22251 for v6

Show
Ignore:
Timestamp:
09/15/08 10:58:57 (2 months ago)
Author:
pmurias
Message:

[smop/pugs]
switched to method postcircumfix:<( )> (|$capture) {...}
interpreter dies on an unknown method
pugs emits correct m0ld for $*OUT.print("1..1\nok 1\n")

Location:
v6/smop
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • v6/smop/src/smop_interpreter.c

    r22017 r22251  
    33#include <stdlib.h> 
    44#include <smop.h> 
     5#include <smop_s1p.h> 
    56#include <smop_lowlevel.h> 
    67 
     
    275276    smop_lowlevel_unlock(capture); 
    276277    if (cont) SMOP_RELEASE(interpreter,cont); 
     278  } else { 
     279    ___UNKNOWN_METHOD___ 
    277280  } 
    278281  SMOP_RELEASE(interpreter, invocant); 
  • v6/smop/src/smop_s1p_code.sm0p

    r22192 r22251  
    135135    $void = $lexical_outer_container."STORE"($outer); 
    136136 
    137     my $actualcapture = $capture."positional"(0); 
     137    # for method postcircumfix:<( )> ($capture) {...} instead of the specced method postcircumfix:<( )> (|$capture) {...} 
     138    #my $actualcapture = $capture."positional"(0); 
     139    #$void = $signature."BIND"($actualcapture,$lexical); 
    138140 
    139     $void = $signature."BIND"($actualcapture,$lexical); 
     141    $void = $signature."BIND"($capture,$lexical); 
     142 
    140143    my $frame_proto = ¢SMOP__Mold__Frame; 
    141144    my $frame = $frame_proto."new"($mold); 
  • v6/smop/test/21_code.m0ld

    r22206 r22251  
    3333})); 
    3434 
    35 my $capture = ¢SMOP__S1P__Capturize."capturize"("ok 1\n"); 
    36 $void = $code1."postcircumfix:( )"($capture); 
    37 $capture = ¢SMOP__S1P__Capturize."capturize"("ok 2\n"); 
    38 $void = $code1."postcircumfix:( )"($capture); 
    39 $capture = ¢SMOP__S1P__Capturize."capturize"(); 
    40 $void = $code1."postcircumfix:( )"($capture); 
     35$void = $code1."postcircumfix:( )"("ok 1\n"); 
     36$void = $code1."postcircumfix:( )"("ok 2\n"); 
     37$void = $code1."postcircumfix:( )"(); 
  • v6/smop/test/modified_pugs_output.m0ld

    r22249 r22251  
    11my $void; 
     2my $scope = ¢SMOP__S1P__LexicalScope."new"(); 
     3 
    24my $OUT_root_scalar = ¢SMOP__S1P__RootNamespace."postcircumfix:{ }"("$*OUT"); 
    35my $OUT_root = $OUT_root_scalar."FETCH"(); 
     6my $OUT_scalar = $scope."postcircumfix:{ }"("$*OUT"); 
     7$void = $OUT_scalar."STORE"($OUT_root); 
    48 
    5 my $void = $OUT_root."print"("creating scope...\n"); 
    6 my $scope = ¢SMOP__S1P__LexicalScope."new"(); 
    79 
    8 my $void = $OUT_root."print"("1\n"); 
    910my $Code_scalar = $scope."postcircumfix:{ }"("Code"); 
    10 my $void = $OUT_root."print"("2\n"); 
    1111my $Code_root_scalar = ¢SMOP__S1P__RootNamespace."postcircumfix:{ }"("::Code"); 
    12 my $void = $OUT_root."print"("3\n"); 
    1312my $Code_root = $Code_root_scalar."FETCH"(); 
    14 my $void = $OUT_root."print"("4\n"); 
    1513$void = $Code_scalar."STORE"($Code_root); 
    1614 
    17 my $void = $OUT_root."print"("5\n"); 
    18 my $OUT_scalar = $scope."postcircumfix:{ }"("$*OUT"); 
    19 my $void = $OUT_root."print"("6\n"); 
    20 $void = $OUT_scalar."STORE"($OUT_root); 
    2115 
    22 my $void = $OUT_root."print"("7\n"); 
    23 ###  
     16############################################################## 
    2417 
    2518my $interpreter; 
    2619my $scope; 
    27 #my $void; 
    28 my $Code_scalar = $scope."postcircumfix:{ }"("Code"); 
     20my $void; 
     21my $Code_scalar = $scope."lookup"("Code"); 
    2922my $Code = $Code_scalar."FETCH"(); 
    3023my $id2 = $Code."new"(:"outer"($scope),:"mold"(mold { 
     
    3225my $scope; 
    3326my $void; 
    34 my $Code_scalar = $scope."postcircumfix:{ }"("Code"); 
     27my $Code_scalar = $scope."lookup"("Code"); 
    3528my $Code = $Code_scalar."FETCH"(); 
    3629my $id3 = $Code."new"(:"outer"($scope),:"mold"(mold { 
     
    3831my $scope; 
    3932my $void; 
    40 my $Code_scalar = $scope."postcircumfix:{ }"("Code"); 
     33my $Code_scalar = $scope."lookup"("Code"); 
    4134my $Code = $Code_scalar."FETCH"(); 
    42 #noop 
    43 my $id5 = $scope."postcircumfix:{ }"("$*OUT"); 
    44 my $id6 = "Hello World"; 
    45 my $id4 = $id5."say"($id6); 
    46 $void = $interpreter."return"($id4); 
     35my $id6 = $scope."lookup"("$*OUT"); 
     36my $id5 = $id6."FETCH"(); 
     37my $id7 = "1..1\nok 1\n"; 
     38my $id4 = $id5."print"($id7); 
     39my $continuation = $interpreter."continuation"(); 
     40my $back = $continuation."back"(); 
     41my $void = $back."setr"($id4); 
     42$void = $interpreter."goto"($back); 
    4743})); 
    48 $void = $interpreter."return"($id3); 
     44my $continuation = $interpreter."continuation"(); 
     45my $back = $continuation."back"(); 
     46my $void = $back."setr"($id3); 
     47$void = $interpreter."goto"($back); 
    4948})); 
    5049my $id1 = $id2."postcircumfix:( )"(); 
    51 my $id7 = $scope."postcircumfix:{ }"("$_"); 
    52 my $void = $id1."postcircumfix:( )"($id7); 
     50my $id9 = $scope."lookup"("$_"); 
     51my $id8 = $id9."FETCH"(); 
     52my $void = $id1."postcircumfix:( )"($id8);