Changeset 498
- Timestamp:
- 11/14/07 17:18:50 (11 months ago)
- Location:
- trunk/thune
- Files:
-
- 4 modified
-
doc/UserManual (modified) (2 diffs)
-
tests/working/iter.good (modified) (2 diffs)
-
tests/working/iter.t (modified) (2 diffs)
-
thune.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/thune/doc/UserManual
r497 r498 82 82 block! [] [a b c] 83 83 paren! () (a b c) 84 macro! <size 2 mul>84 macro! ^(size 2 mul) 85 85 vector! #[1 2 3] #[-85.33 2 44.8] 86 86 function! [2 add] proc :inc2 … … 114 114 Example:: 115 115 116 <34 2 mul :border>117 118 box-width <border>add116 ^(34 2 mul :border) 117 118 box-width ^(border) add 119 119 120 120 Conditional Example:: 121 121 122 <script-env/os [122 ^(script-env/os [ 123 123 linux ["Linux"] 124 124 solaris ["Solaris"] 125 125 ["Unsupported OS" error] 126 ] case >126 ] case) 127 127 print 128 128 -
trunk/thune/tests/working/iter.good
r497 r498 6 6 [1 2 3] 7 7 [3] 8 --- Forward one --- 9 [a] 8 10 --- Forward empty --- 9 11 --- Reverse --- … … 14 16 [3] 15 17 [1 2 3] 18 --- Reverse one --- 19 [x] 16 20 --- Reverse empty --- -
trunk/thune/tests/working/iter.t
r497 r498 6 6 "--- Forward skip ---" print 7 7 data [.] iter/2 8 9 "--- Forward one ---" print 10 [a] [.] iter 8 11 9 12 "--- Forward empty ---" print … … 16 19 data tail prev [.] iter/-2 17 20 21 "--- Reverse one ---" print 22 [x] tail prev [.] iter/-1 23 18 24 "--- Reverse empty ---" print 19 25 [] [.] iter/-1 -
trunk/thune/thune.c
r497 r498 609 609 610 610 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) ) 612 613 { 613 614 int skip = ur_sel(val); 614 615 if( skip == 0 ) 615 616 skip = 1; 616 if( skip > 0 )617 {618 if( ur_itLen( ut, ur_s_prev(UR_TOS) ) < 1 )619 goto no_iter;620 }621 else622 {623 if( ur_s_prev(UR_TOS)->series.it < 1 )624 goto no_iter;625 }626 617 PUSHC_EVAL( blkN, start, pc ); 627 618 SET_BLK_PC( UR_TOS->series.n, … … 634 625 else 635 626 { 636 no_iter:637 627 UR_S_DROPN(2); 638 628 }
