Changeset 22508

Show
Ignore:
Timestamp:
10/05/08 05:33:15 (7 weeks ago)
Author:
lwall
Message:

[STD] clean up nibbler output
[viv] now successfully produces transforms STD.pm to ast(ish)

Location:
src/perl6
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • src/perl6/STD.pm

    r22506 r22508  
    19011901    :my $buf = self.orig; 
    19021902    :my $multiline = 0; 
     1903    :my $nibble; 
    19031904    { $<firstpos> = self.pos; } 
    19041905    [ <!before <stopper> > 
     
    19131914                        } 
    19141915        || <escape>   { 
    1915                             push @nibbles, $text, $<escape>; 
     1916                            push @nibbles, $text, $<escape>[*-1]; 
    19161917                            $text = ''; 
    19171918                        } 
     
    19301931        push @nibbles, $text; $<nibbles> = [@nibbles]; 
    19311932        $<lastpos> = $¢.pos; 
     1933        $/.:delete<nibbler>; 
     1934        $/.:delete<escape>; 
    19321935        $COMPILING::LAST_NIBBLE = $¢; 
    19331936        $COMPILING::LAST_NIBBLE_MULTILINE = $¢ if $multiline; 
     
    23592362 
    23602363        # in single quotes, keep backslash on random character by default 
    2361         token backslash:misc { {} (.) { $<text> = "\\" ~ $0; } } 
     2364        token backslash:misc { {} (.) { $<text> = "\\" ~ $0.text; } } 
    23622365 
    23632366        # begin tweaks (DO NOT ERASE) 
  • src/perl6/viv

    r22498 r22508  
    4646                my $zyg = []; 
    4747                for my $z (@$v) { 
    48                     if (ref $z eq 'HASH' and exists $z->{''}) { 
    49                         push @$zyg, $z->{''}; 
     48                    if (ref $z) { 
     49                        if (ref $z eq 'ARRAY') { 
     50                            warn "ARRAY"; 
     51                            push @$zyg, $z; 
     52                        } 
     53                        elsif (exists $z->{''}) { 
     54                            push @$zyg, $z->{''}; 
     55                        } 
    5056                    } 
    5157                    else { 
    5258                        push @$zyg, $z; 
    5359                    } 
    54                     push @$zyg, $z; 
    5560                } 
    5661                $r{$k} = $zyg;