Changeset 21272 for src

Show
Ignore:
Timestamp:
07/08/08 18:19:45 (5 months ago)
Author:
lwall
Message:

[STD] start transition to .pmc forms so names are conserved under Perl 5
[STD] also allow for Cat|Dog type constraints

Location:
src/perl6
Files:
7 modified

Legend:

Unmodified
Added
Removed
  • src/perl6/Cursor5.pm

    r21128 r21272  
    1919        trace_call=> 128, 
    2020        cursors => 256, 
    21         try_processing_in_STD5_dot_pm => 1024, 
     21        try_processing => 1024, 
    2222        mixins => 2048, 
    2323        callm_show_subnames => 16384, 
     
    3232} 
    3333 
    34 package Cursor5; 
     34package Cursor; 
    3535 
    3636use LazyMap qw(lazymap eager); 
     
    740740                next; 
    741741            } 
    742             elsif ($s =~ /^Cursor5::/) { 
     742            elsif ($s =~ /^Cursor::/) { 
    743743                next; 
    744744            } 
  • src/perl6/Makefile

    r21090 r21272  
    1 STD5.pm: STD.pm gimme5 STD5_run Cursor5.pm LazyMap.pm mangle.pl 
    2         ./gimme5 STD.pm >STD5.pm 
    3         perl -c STD5.pm 
     1STD.pmc: STD.pm gimme5 try5 Cursor.pmc LazyMap.pm mangle.pl 
     2        ./gimme5 STD.pm >STD.pmc 
     3        perl -c STD.pmc 
    44        rm -rf lex 
    55        # pre-generate common sublexers 
    6         ./STD5_run comp_unit -e 'say "howdy" ~ "";' 
     6        ./try5 comp_unit -e 'say "howdy" ~ "";' 
  • src/perl6/STD.pm

    r21223 r21272  
    15581558} 
    15591559 
    1560 rule fulltypename {<typename> 
     1560rule fulltypename {<typename>['|'<typename>]* 
    15611561    [ of <fulltypename> ]? 
    15621562    {*} 
  • src/perl6/STD5_run

    r21041 r21272  
    11#!/usr/local/bin/perl 
    2 # A script to make running STD5.pm easier, 
     2# A script to make running STD.pmc easier, 
    33# by providing it input, and isolating it's Match yaml output. 
    44use strict; 
     
    3535    if(-e 'STD.pm' and -e 'gimme5') { # We're in the right place. 
    3636        # pretend we're 'make' 
    37         if(!-e 'STD5.pm' or 
    38                 -M 'STD5.pm' > -M 'STD.pm' or 
    39                 -M 'STD5.pm' > -M 'gimme5') { 
    40             system("$^X gimme5 $fo STD.pm >STD5.pm"); 
     37        if(!-e 'STD.pmc' or 
     38                -M 'STD.pmc' > -M 'STD.pm' or 
     39                -M 'STD.pmc' > -M 'gimme5') { 
     40            system("$^X gimme5 $fo STD.pm >STD.pmc"); 
    4141            system("rm -rf lex"); 
    4242        } 
     
    4646    #system "$cmd 2>std5.err"; 
    4747    unshift(@INC,'.'); 
    48     require "STD5.pm"; 
     48    require "STD.pmc"; 
    4949    my $err = "std5.err"; 
    5050    my $perl = Perl->new($input); 
  • src/perl6/gimme5

    r21203 r21272  
    11#!/usr/local/bin/perl 
    2  
    3 # This is a version of "metholate" that spits out Perl 5 instead of Perl 6. 
    4 # If metholate is hacky, I hate to think what this is... 
    5  
    6 # Note: expects you to pipe STD through cheat first 
    72 
    83use 5.010; 
     
    239234    if (s/^\s*grammar (\w+)(?::\w+<.*?>)*(?:\s*is\s+(\w+))?;\n//) { 
    240235        $TOP = $PKG = $1; 
    241         my $extends = $2 // 'Cursor5'; 
     236        my $extends = $2 // 'Cursor'; 
    242237        $out .= "package $PKG;\n"; 
    243238        $out .= <<"END"; 
     
    372367                if (ref \$try eq 'ARRAY') { 
    373368                    (\$tag, \$try, \$C->{_fate}) = \@\$try;     # next candidate fate 
    374                     \$C->deb("Retrying with \$tag \$try") if \$::DEBUG & DEBUG::try_processing_in_STD5_dot_pm; 
     369                    \$C->deb("Retrying with \$tag \$try") if \$::DEBUG & DEBUG::try_processing; 
    375370                } 
    376371                elsif (ref \$try eq 'CODE') { 
     
    383378            } 
    384379     
    385             \$C->deb("$name trying \$tag \$try") if \$::DEBUG & DEBUG::try_processing_in_STD5_dot_pm; 
     380            \$C->deb("$name trying \$tag \$try") if \$::DEBUG & DEBUG::try_processing; 
    386381            push \@gather, \$C->\$try(\@_); 
    387382        } 
     
    500495            if ($args =~ s/ *--> *(\w*) *$//) { 
    501496                my $pkg = $pkg_really{$1} || "${PKG}::$1"; 
    502                 $coercion = " Cursor5::lazymap sub { $pkg->coerce(\$_[0]) }, "; 
     497                $coercion = " Cursor::lazymap sub { $pkg->coerce(\$_[0]) }, "; 
    503498            } 
    504499            $args .= ', '; 
     
    21262121        my ($outer, $inner) = @_; 
    21272122        if ($MAYBACKTRACK) { 
    2128             "Cursor5::lazymap(sub { my \$C=\$_[0];\n" . 
     2123            "Cursor::lazymap(sub { my \$C=\$_[0];\n" . 
    21292124                ::indent($inner) . 
    21302125            "\n}, $outer)"; 
     
    23162311            if (ref $try eq 'ARRAY') { 
    23172312                ($tag, $try, $C->{_fate}) = @$try;      # next candidate fate 
    2318                 $C->deb("Retrying with $tag $try") if $::DEBUG & DEBUG::try_processing_in_STD5_dot_pm; 
     2313                $C->deb("Retrying with $tag $try") if $::DEBUG & DEBUG::try_processing; 
    23192314            } 
    23202315            elsif (ref $try eq 'CODE') { 
     
    23302325 
    23312326            $result .= <<"END"; 
    2332         \$C->deb("$altname trying \$tag \$try") if \$::DEBUG & DEBUG::try_processing_in_STD5_dot_pm; 
     2327        \$C->deb("$altname trying \$tag \$try") if \$::DEBUG & DEBUG::try_processing; 
    23332328        push \@gather, (( 
    23342329@{[ ::indent(join("\n", @result),3) ]} 
  • src/perl6/tryfile

    r21127 r21272  
    44my $file = shift; 
    55 
    6 use STD5; 
     6use STD; 
    77use utf8; 
    88use YAML::XS; 
  • src/perl6/tryfoo

    r20854 r21272  
    22 
    33BEGIN { $ENV{STD5DEBUG} = 16383; } 
    4 use STD5; 
     4use STD; 
    55use utf8; 
    66use YAML::XS;