Changeset 22005 for src/perl6

Show
Ignore:
Timestamp:
08/22/08 11:08:07 (3 months ago)
Author:
lwall
Message:

[STD] remove p5ish usages of exists/delete
[gimme5] translate .:exists and .:delete forms to p5
[S29] remove "is export" from exists/delete methods

Location:
src/perl6
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • src/perl6/STD.pm

    r22002 r22005  
    154154    say print open close printf sprintf slurp unlink link symlink 
    155155    elems grep map first reduce sort push reverse take splice 
    156     exists delete 
    157156 
    158157    zip each roundrobin caller 
     
    180179push @routinenames, "HOW", "fail", "temp", "let"; 
    181180 
    182 # if True ref False unless length bless delete exists 
     181# please don't add: ref length bless delete exists 
    183182 
    184183my %routinenames; 
     
    458457 
    459458token ws { 
    460     # XXX exists is a p5ism 
    461     :my @stub = return self if exists self.<_>[self.pos]<ws>; 
     459    :my @stub = return self if self.<_>[self.pos].:exists<ws>; 
    462460    :my $startpos = self.pos; 
    463461 
     
    33133311# hopefully we can include these tokens in any outer LTM matcher 
    33143312regex stdstopper { 
    3315     :my @stub = return self if exists self.<_>[self.pos]<endstmt>; 
     3313    :my @stub = return self if self.<_>[self.pos].:exists<endstmt>; 
    33163314    [ 
    33173315    | <?terminator> 
     
    39753973token in (Str $stop, Str $insides, Str $name = $insides) { 
    39763974    :my $GOAL is context = $stop; 
    3977     <x=$insides> $stop {{ $/.{$insides} = $<x>; delete $<x> }} || <.panic: "Unable to parse $name; couldn't find final '$stop'"> 
     3975    <x=$insides> $stop {{ $/.{$insides} = $<x>; $/.:delete<x> }} || <.panic: "Unable to parse $name; couldn't find final '$stop'"> 
    39783976} 
    39793977 
  • src/perl6/gimme5

    r21975 r22005  
    8080    $f =~ s/\\x([0-9a-fA-F]{3,4})/\\x{$1}/g; 
    8181    $f =~ s!\$([0-9]+)!\$\$C{$1}!g; 
     82    $f =~ s/(\S+\.):(exists|delete)/$2 $1/g if $f =~ /\.:(exists|delete)/; 
    8283    while ($f ne "") { 
    8384        #print "$f\n" if $trace;