Show
Ignore:
Timestamp:
08/20/05 15:47:35 (3 years ago)
Author:
iblech
svk:copy_cache_prev:
8581
Message:

* Usual svn props.
* PIL2JS: &?CALLER_CONTINUATION.

  • t/unspecced/cont.t: Added some type annotations and a new test. PIL2JS passes 14/14 with 6 unexpected succeedings. :)
  • PIL, PIL2JS.js: PIL2JS.cps2normal now works correctly with functions which reach the end of the program (this can happen, for example, with continuations :)). Previously, the program flow was restarted after the call to PIL2JS.cps2normal, resulting in certain regions running twice.
  • PIL, PIL::PVar, PIL::Subs: sub foo { {return}() } didn't compile, because PIL2JS only kept track of the current subtype, not of all subs it's currently in. Fixed.

* PIL2JS: PIL, PIL2JS.js, README: Context objects are now unboxed -- boxing was

never needed. Should give a small speedup.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • perl5/PIL2JS/lib/PIL/PVar.pm

    r6276 r6376  
    77  die unless keys %{ $_[0] } == 1; 
    88  die if     ref(my $name = $_[0]->{pVarName}); 
     9  local $_; 
    910 
    1011  if($name eq "&return") { 
    1112    PIL::fail("Can't return outside a subroutine!") 
    12       unless $PIL::IN_SUBLIKE >= PIL::SUBROUTINE; 
     13      unless grep { $_ >= PIL::SUBROUTINE } @PIL::IN_SUBLIKES; 
     14    # XXX hack? 
     15    return bless { 
     16      pVarName => PIL::RawJS->new("PIL2JS.generic_return(subreturncc)") 
     17    } => "PIL::PVar"; 
     18  } elsif($name eq "&?CALLER_CONTINUATION") { 
     19    PIL::fail("There's no &?CALLER_CONTINUATION outside a subroutine!") 
     20      unless grep { $_ >= PIL::SUBROUTINE } @PIL::IN_SUBLIKES; 
    1321    # XXX hack? 
    1422    return bless {