Changeset 22174 for src/perl6

Show
Ignore:
Timestamp:
09/06/08 21:10:58 (3 months ago)
Author:
lwall
Message:

[STD] allow 'where' clauses on bare type names (mostly for matching)

Location:
src/perl6
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • src/perl6/Cursor.pmc

    r22080 r22174  
    24222422        my $base = $ALT // ''; 
    24232423        $base .= ' ' if $base; 
     2424        my %autolexbase = %AUTOLEXED; 
    24242425        for my $alt (@$alts) { 
     2426            local %AUTOLEXED = %autolexbase;    # alts are independent 
    24252427            $fakepos = $oldfakepos; 
    24262428            local $ALT = $base . $alt->{alt}; 
  • src/perl6/STD.pm

    r22162 r22174  
    25372537    [ 
    25382538    | '(' <capture>? ')' 
    2539     | <termish> 
     2539    | <?before \S> <termish> 
    25402540    ] 
    25412541} 
     
    25692569    <longname> { $¢.add_type($<longname>); } 
    25702570    [ of <fulltypename> ]? 
    2571     where <EXPR> 
     2571    where <termish> 
    25722572} 
    25732573 
     
    31983198 
    31993199token args ($istype = 0) { 
    3200     :my $listopy = 0; 
     3200    :my $listopish = 0; 
    32013201    [ 
    32023202    | '.(' <in: ')', 'semilist', 'argument list'> {*}             #= func args 
    32033203    | '(' <in: ')', 'semilist', 'argument list'> {*}              #= func args 
    32043204    | <.unsp> '.'? '(' <in: ')', 'semilist', 'argument list'> {*} #= func args 
    3205     | {} [<?before \s> <!{ $istype }> <.ws> <!infixstopper> <arglist>]? { $listopy = 1 } 
    3206     ] 
    3207  
    3208     [ 
    3209     || <?{ $listopy }> 
     3205    | {} <?before \s> <.ws> 
     3206        [ 
     3207        || <!{ $istype }> <!infixstopper> <arglist> { $listopish = 1 } 
     3208        || <?{ $istype }> ['where' <.ws> <constraints=termish> <.ws>]* 
     3209        ] 
     3210         
     3211    ] 
     3212 
     3213    [ 
     3214    || <?{ $listopish }> 
    32103215    || ':' <?before \s> <arglist>    # either switch to listopiness 
    32113216    || {{ $+prevop = $<O> = {}; }}   # or allow adverbs (XXX needs hoisting?) 
     
    32293234            {*}                                                 #= packagevar  
    32303235        ]? 
     3236        # subset type? 
     3237        <.ws> 
     3238        [ 'where' <.ws> <constraints=termish> <.ws> ]* 
    32313239        {*}                                                     #= typename 
    32323240