Changeset 498

Show
Ignore:
Timestamp:
11/14/07 17:18:50 (11 months ago)
Author:
krobillard
Message:

Fixed bug in reverse 'iter when series had one element.

Location:
trunk/thune
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • trunk/thune/doc/UserManual

    r497 r498  
    8282block!       []  [a b c] 
    8383paren!       ()  (a b c) 
    84 macro!       <size 2 mul> 
     84macro!       ^(size 2 mul) 
    8585vector!      #[1 2 3]  #[-85.33 2 44.8] 
    8686function!    [2 add] proc :inc2 
     
    114114Example:: 
    115115 
    116     <34 2 mul :border> 
    117  
    118     box-width <border> add 
     116    ^(34 2 mul :border) 
     117 
     118    box-width ^(border) add 
    119119 
    120120Conditional Example:: 
    121121 
    122     <script-env/os [ 
     122    ^(script-env/os [ 
    123123        linux   ["Linux"] 
    124124        solaris ["Solaris"] 
    125125        ["Unsupported OS" error] 
    126      ] case> 
     126     ] case) 
    127127    print 
    128128 
  • trunk/thune/tests/working/iter.good

    r497 r498  
    66[1 2 3] 
    77[3] 
     8--- Forward one --- 
     9[a] 
    810--- Forward empty --- 
    911--- Reverse --- 
     
    1416[3] 
    1517[1 2 3] 
     18--- Reverse one --- 
     19[x] 
    1620--- Reverse empty --- 
  • trunk/thune/tests/working/iter.t

    r497 r498  
    66"--- Forward skip ---" print 
    77data [.] iter/2 
     8 
     9"--- Forward one ---" print 
     10[a] [.] iter 
    811 
    912"--- Forward empty ---" print 
     
    1619data tail prev [.] iter/-2 
    1720 
     21"--- Reverse one ---" print 
     22[x] tail prev [.] iter/-1 
     23 
    1824"--- Reverse empty ---" print 
    1925[] [.] iter/-1 
  • trunk/thune/thune.c

    r497 r498  
    609609 
    610610                case OP_ITER:           // (series blk -- ) 
    611                     if( ur_is(UR_TOS, UT_BLOCK) ) 
     611                    if( ur_is(UR_TOS, UT_BLOCK) && 
     612                        (ur_itLen( ut, ur_s_prev(UR_TOS) ) > 0) ) 
    612613                    { 
    613614                        int skip = ur_sel(val); 
    614615                        if( skip == 0 ) 
    615616                            skip = 1; 
    616                         if( skip > 0 ) 
    617                         { 
    618                             if( ur_itLen( ut, ur_s_prev(UR_TOS) ) < 1 ) 
    619                                 goto no_iter; 
    620                         } 
    621                         else 
    622                         { 
    623                             if( ur_s_prev(UR_TOS)->series.it < 1 ) 
    624                                 goto no_iter; 
    625                         } 
    626617                        PUSHC_EVAL( blkN, start, pc ); 
    627618                        SET_BLK_PC( UR_TOS->series.n, 
     
    634625                    else 
    635626                    { 
    636 no_iter: 
    637627                        UR_S_DROPN(2); 
    638628                    }