Changeset 21836 for src/perl6

Show
Ignore:
Timestamp:
08/07/08 22:23:40 (4 months ago)
Author:
lwall
Message:

[STD] distinguish &infix:<x> inside declaration from outside

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • src/perl6/STD.pm

    r21834 r21836  
    77my $GOAL is context = "(eof)"; 
    88my $PARSER is context<rw>; 
     9my $IN_DECL is context<rw>; 
    910 
    1011# random rule for debugging, please ignore 
     
    10621063 
    10631064token variable_declarator { 
     1065    :my $IN_DECL is context<rw> = 1; 
    10641066    <variable> { $<sigil> = $<variable><sigil> } 
     1067    { $IN_DECL = 0; } 
    10651068    [   # Is it a shaped array or hash declaration? 
    10661069      #  <?{ $<sigil> eq '@' | '%' }> 
     
    15161519    <name> 
    15171520    # XXX too soon 
    1518     [ <colonpair>+ { $¢.add_macro($<name>); } ]? 
     1521    [ <colonpair>+ { $¢.add_macro($<name>) if $+IN_DECL; } ]? 
    15191522} 
    15201523 
     
    15431546    [ 
    15441547    | <category> 
    1545         [ <colonpair>+ { $¢.add_macro($<category>); } ]? 
     1548        [ <colonpair>+ { $¢.add_macro($<category>) if $+IN_DECL; } ]? 
    15461549    | <desigilname> 
    15471550    ] 
     
    23472350 
    23482351rule routine_def { 
     2352    :my $IN_DECL is context<rw> = 1; 
    23492353    [ '&'<deflongname>? | <deflongname> ]? [ <multisig> | <trait> ]* 
    23502354    <!!{ bless $¢, ref $PARSER; }> 
     2355    { $IN_DECL = 0; } 
    23512356    <block> 
    23522357} 
     
    24212426 
    24222427token signature { 
     2428    # XXX incorrectly scopes &infix:<x> parameters to outside following block 
     2429    :my $IN_DECL is context<rw> = 1; 
    24232430    :my $zone is context<rw> = 'posreq'; 
    24242431    <.ws> 
     
    24292436    <.ws> 
    24302437    [ '-->' <.ws> <fulltypename> ]? 
     2438    { $IN_DECL = 0; } 
    24312439} 
    24322440