Changeset 6569

Show
Ignore:
Timestamp:
08/29/05 22:59:00 (3 years ago)
Author:
iblech
Message:

* pugs::hack: Minor cosmetic fixes.
* t/var/refs_point_to_containers.t: Fixed a test (but it could be said that the

test was correct, I don't think that has been specced yet).

* t/rules/*: Fixed the skip_rest_unless_p5style_regexes_are_available_guards.
* PIL2JS: $/[0] etc. works!

  • PIL: (Hack) Subs named /&PIL2JS::Internals::Hacks::init_foobar/ are run at INIT time.
  • Prelude::JS::Rules: $/ := $match, .[] for Match objects

* PIL2JS: PIL2JS.js: (HacK) All things which .isa(Num) are .isa(Int) .isa(Rat)

now, too.

Files:
15 modified

Legend:

Unmodified
Added
Removed
  • lib/pugs/hack.pod

    r6531 r6569  
    260260=back 
    261261 
    262  
    263262=head2 Editing 
    264263 
    265264There is a F<util/perl6.vim> Vim syntax file.  There is no emacs mode yet, 
    266265but perl-mode works better than cperl-mode. 
    267  
    268266 
    269267=head2 Testing 
     
    294292=over 
    295293 
    296 =item * 
    297  
    298 L<http://www-users.cs.york.ac.uk/~ndm/hoogle/> A cross index of 
    299 standard Haskell libraries. It is searchable by type signature, name, 
    300 etc. 
    301  
    302 =item * 
    303  
    304 L<http://rt.openfoundry.org/Foundry/Project/Source/index.html/pugs/browse/> 
    305 Browsable Pugs vcs.  You sometimes get a blank page the first time you 
    306 access a URL (a timeout) - just click again. 
    307  
    308 =item * 
    309  
    310 L<http://svn.perl.org/perl6/pugs/trunk/> Mirror of Pugs vcs head. 
    311 Usually faster and more reliable than the openfoundry browser. 
     294=item L<http://www-users.cs.york.ac.uk/~ndm/hoogle/> 
     295 
     296A cross index of standard Haskell libraries.  It is searchable by type 
     297signature, name, etc. 
     298 
     299=item L<http://rt.openfoundry.org/Foundry/Project/Source/index.html/pugs/browse/> 
     300 
     301Browsable Pugs VCS.  You sometimes get a blank page the first time you access a 
     302URL (a timeout) - just click again. 
     303 
     304=item L<http://svn.perl.org/perl6/pugs/trunk/> 
     305 
     306Mirror of Pugs VCS head.  Usually faster and more reliable than the OpenFoundry 
     307browser, but doesn't show diffs between revisions. 
     308 
     309=item L<http://m19s28.vlinux.de/cgi-bin/pugs-smokeserv.pl> 
     310 
     311Pugs Smoke Reports Server.  List of recently uploaded smoke reports sorted by 
     312the runcore used (normal Haskell backend, PIL2JS, PIL-Run, PIR, etc.), see 
     313F<util/smokeserv/README> for more information. 
    312314 
    313315=back 
  • perl5/PIL2JS/lib/PIL.pm

    r6527 r6569  
    223223    join("\n", map { 
    224224      my $name = $_->{pSubName}; 
    225       $name =~ /^(?:__init_|__export_)/ && $name !~ /import$/ 
    226         ? sprintf("PIL2JS.cps2normal(%s.FETCH(), [PIL2JS.Context.Void]);", PIL::name_mangle $name) 
     225      $name =~ /^(?:__init_|__export_|&PIL2JS::Internals::Hacks::init)/ && $name !~ /import$/ 
     226        ? sprintf("PIL2JS.cps2normal(%s.FETCH(), [PIL2JS.Context.Void]);", PIL::name_mangle($name)) 
    227227        : (); 
    228228    } @{ $fixed_tree->{"pilGlob" } })  . 
  • perl5/PIL2JS/lib6/Prelude/JS/Operators.pm

    r6526 r6569  
    5151  \}"; 
    5252 
    53   # XXX! HACK! See the end of Prelude::JS for explanation. 
     53  # XXX! minor hack. See the end of Prelude::JS for explanation. 
    5454  my $args  = $arity == 1  ?? '?$__a = $CALLER::_' :: '$__a, $__b'; 
    5555  my $c     = $type eq "S" ?? "~"                  :: "+"; 
  • perl5/PIL2JS/lib6/Prelude/JS/Rules.pm

    r6563 r6569  
    4343    if !@ret { 
    4444        my $m  = $new_match(?0); 
    45         #my $m = Match.new(0,"",[],undef,undef); 
    46         # $/ = $m; 
     45        $/    := $m; 
    4746    } elsif $global { 
    4847        # XXX - unfinished 
     
    5251        my @m_as_array = @ret; 
    5352        my $to = $from + $m_as_str.chars; 
    54         my $m  = $new_match(?1, $from, $to, $m_as_str, @m_as_array, []); # $/ = $m; 
     53        my $m  = $new_match(?1, $from, $to, $m_as_str, @m_as_array, []); 
     54        $/    := $m; 
    5555    } 
    5656  }; 
     
    7272} 
    7373 
     74# Needs PIL2 and MMD to be done without hacks 
     75sub PIL2JS::Internals::Hacks::postcircumfix_for_match_objects ( 
     76  Match $match, Int *@idxs 
     77) is primitive { 
     78  $match.subpos[*@idxs]; 
     79} 
     80 
     81sub PIL2JS::Internals::Hacks::init_match_postcircumfix_method () is primitive { 
     82  JS::inline('(function () { 
     83    PIL2JS.addmethod( 
     84      _3amain_3a_3aMatch, 
     85      "postcircumfix:[]", 
     86      _26PIL2JS_3a_3aInternals_3a_3aHacks_3a_3apostcircumfix_for_match_objects 
     87    ); 
     88  })')(); 
     89} 
     90 
    7491# $0 etc. are aliases for $/[0] etc. 
  • perl5/PIL2JS/libjs/PIL2JS.js

    r6563 r6569  
    672672var _24main_3a_3a_3fPUGS_BACKEND = new PIL2JS.Box.Constant("BACKEND_JAVASCRIPT"); 
    673673var _24main_3a_3a_           = new PIL2JS.Box(undefined); 
     674// $/ -- XXX WRONG needs to be lexical 
     675var _24main_3a_3a_2f         = new PIL2JS.Box(undefined); 
    674676// Stub for $?CALLER::CALLER::POSITION, so Test.pm doesn't die on a failed 
    675677// test. 
     
    960962      type == cmptype                      || 
    961963      type == "Array" && cmptype == "List" || 
     964      // Hacks: 
     965      type == "Num"   && cmptype == "Int"  || 
     966      type == "Num"   && cmptype == "Rat"  || 
    962967      type == "Any" 
    963968    )); 
  • perl5/PIL2JS/pil2js.pl

    r6518 r6569  
    1212    require BSD::Resource; 
    1313    import BSD::Resource; 
    14     setrlimit(RLIMIT_CPU(), 35, 45) or die "Couldn't setrlimit: $!\n"; 
     14    setrlimit(RLIMIT_CPU(), 43, 45) or die "Couldn't setrlimit: $!\n"; 
    1515    warn "*** Limited CPU resources.\n"; 
    1616  } 
  • perl5/PIL2JS/runjs.pl

    r6547 r6569  
    1515    require BSD::Resource; 
    1616    import BSD::Resource; 
    17     setrlimit(RLIMIT_CPU(), 35, 45) or die "Couldn't setrlimit: $!\n"; 
     17    setrlimit(RLIMIT_CPU(), 43, 45) or die "Couldn't setrlimit: $!\n"; 
    1818    warn "*** Limited CPU resources.\n"; 
    1919  } 
  • t/rules/perl5.t

    r6119 r6569  
    66plan 882; 
    77 
    8 if(!eval('("a" ~~ rx:P5/a/)')) { 
     8unless "a" ~~ rx:P5/a/ { 
    99  skip_rest "skipped tests - P5 regex support appears to be missing"; 
    1010  exit; 
  • t/rules/rules_refs.t

    r6534 r6569  
    1212=cut 
    1313 
    14 if(!eval('("a" ~~ rx:P5/a/)')) { 
     14unless "a" ~~ rx:P5/a/ { 
    1515  skip_rest "skipped tests - P5 regex support appears to be missing"; 
    1616  exit; 
  • t/rules/rx_perl5_escape.t

    r6534 r6569  
    66plan 1; 
    77 
    8 if(!eval('("a" ~~ rx:P5/a/)')) { 
     8unless "a" ~~ rx:P5/a/ { 
    99  skip_rest "skipped tests - P5 regex support appears to be missing"; 
    1010  exit; 
  • t/rules/rx_perl5_g.t

    r6534 r6569  
    66plan 4; 
    77 
    8 if(!eval('("a" ~~ rx:P5/a/)')) { 
     8unless "a" ~~ rx:P5/a/ { 
    99  skip_rest "skipped tests - P5 regex support appears to be missing"; 
    1010  exit; 
  • t/rules/rx_perl5_match.t

    r6534 r6569  
    2121=cut 
    2222 
    23 if(!eval('("a" ~~ rx:P5/a/)')) { 
     23unless "a" ~~ rx:P5/a/ { 
    2424  skip_rest "skipped tests - P5 regex support appears to be missing"; 
    2525  exit; 
  • t/rules/s_perl5.t

    r6534 r6569  
    1414=cut 
    1515 
    16 if(!eval('("a" ~~ rx:P5/a/)')) { 
     16unless "a" ~~ rx:P5/a/ { 
    1717  skip_rest "skipped tests - P5 regex support appears to be missing"; 
    1818  exit; 
     
    2222$foo ~~ s:perl5{f}{b};  
    2323is($foo, "boo", 'substitute regexp works'); 
     24unless $foo eq "boo" { 
     25  skip_rest "Skipping test which depend on a previous failed test"; 
     26} 
    2427 
    2528my $bar = "barrrr";  
  • t/rules/variable_interpolation.t

    r6534 r6569  
    66plan 5; 
    77 
    8 if(!eval('("a" ~~ rx:P5/a/)')) { 
     8unless "a" ~~ rx:P5/a/ { 
    99  skip_rest "skipped tests - P5 regex support appears to be missing"; 
    1010  exit; 
  • t/var/refs_point_to_containers.t

    r6397 r6569  
    5151{ 
    5252  my $arrayref = [1,2,3]; 
    53   my $test  = sub (@array) { 
     53  my $test  = sub (@array is rw) { 
    5454    is @array[1], 2, "automatically dereffed arrays"; 
    5555