Changeset 21951 for src/perl6

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

[gimme5] treat whitespace before optional | as insignificant
[STD] allow anonymous sigil on simple var declarations
[STD] allow post constraints on simple var declarations
[teststd] don't report on failures if no failures

Location:
src/perl6
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • src/perl6/STD.pm

    r21922 r21951  
    1111# random rule for debugging, please ignore 
    1212token foo { 
    13    'foo' 'bar' 'baz' 
     13   'foo' <.ws> 'bar' <.ws> 'baz' 
    1414} 
    1515 
     
    436436token unv { 
    437437   | \h+                 {*}                                    #= hwhite 
    438    | <?before '='> ^^ :: <.pod_comment>  {*}                    #= pod 
    439    | \h* '#' :: [ 
    440          |  <?opener> :: 
     438   | <?before '='> ^^ <.pod_comment>  {*}                    #= pod 
     439   | \h* '#' [ 
     440         |  <?opener> 
    441441            [ <!after ^^ . > || <.panic: "Can't use embedded comments in column 1"> ] 
    442442            <.quibble($¢.cursor_fresh( ::STD::Q ))>   {*}                               #= embedded 
     
    10941094        ]* 
    10951095    ]? 
     1096    <.ws> 
    10961097 
    10971098    <trait>* 
    1098     <.ws> 
     1099 
     1100    <post_constraint>* 
     1101 
    10991102    [ 
    11001103    | '=' <.ws> <EXPR( ($<sigil> // '') eq '$' ?? item %item_assignment !! item %list_prefix )> 
     
    11101113    | <fulltypename>+ <multi_declarator> 
    11111114    | <multi_declarator> 
    1112     | <?before <[A..Z]> > <name> <.panic("Apparent type name " ~ $<name>.text ~ " is not declared yet")> 
     1115#    | <?before <[A..Z]> > <name> <.panic("Apparent type name " ~ $<name>.text ~ " is not declared yet")> 
    11131116    ] 
    11141117} 
     
    15121515        # Note: $() can also parse as contextualizer in an expression; should have same effect 
    15131516        | <sigil> <?before '<' | '('> <postcircumfix> {*}           #= $() 
     1517        | <sigil> <?{ $+IN_DECL }> {*}                              #= anondecl 
    15141518        ] 
    15151519    ] 
     
    18091813    [ <!before <stopper> > 
    18101814        [ 
    1811         || <starter> :: <nibbler> <stopper> 
     1815        || <starter> <nibbler> <stopper> 
    18121816                        { 
    18131817                            my $n = $<nibbler>[*-1]<nibbles>; 
     
    18171821                            push @nibbles, @n; 
    18181822                        } 
    1819         || <escape>   :: { 
     1823        || <escape>   { 
    18201824                            push @nibbles, $text, $<escape>; 
    18211825                            $text = ''; 
    18221826                        } 
    1823         ||            :: . 
     1827        || . 
    18241828                        {{ 
    18251829                            my $ch = substr($$buf, $¢.pos-1, 1); 
     
    34753479        :my $ignorecase is context<rw> = $+ignorecase // 0; 
    34763480        :my $ignoreaccent    is context<rw> = $+ignoreaccent    // 0; 
    3477         < || | && & >? 
     3481        [ \s* < || | && & > ]? 
    34783482        <EXPR> 
    34793483    } 
  • src/perl6/gimme5

    r21926 r21951  
    961961    my $min = 1_000_000_000; 
    962962 
    963     s/^\|\|//; 
     963    s/^\s*\|\|//; 
    964964 
    965965    do { 
     
    10151015    my $name = $ALTNAME; 
    10161016 
    1017     s/^ \| (?!\|) //x; 
     1017    s/^ \s*\| (?!\|) //x; 
    10181018 
    10191019    do { 
     
    22272227                substr(<<"END",0,-1); 
    22282228do { 
    2229     if (my (\$C) = ($outer)[0]) { 
     2229    if (my (\$C) = ($outer)) { 
    22302230$in; 
    22312231    } 
  • src/perl6/teststd

    r21799 r21951  
    2525 
    2626printf "Passed $success/$total, %6.2f%%\n", $success/$total * 100; 
    27 print "Failed tests:\n"; 
    28 for my $file (@failed) { 
    29     print "$file\n"; 
     27if (@failed) { 
     28    print "Failed tests:\n"; 
     29    for my $file (@failed) { 
     30        print "$file\n"; 
     31    } 
    3032}