Changeset 509
- Timestamp:
- 02/09/08 02:35:22 (7 months ago)
- Location:
- trunk/thune
- Files:
-
- 15 modified
-
doc/UserManual (modified) (1 diff)
-
doc/thune.vim (modified) (1 diff)
-
eval.c (modified) (1 diff)
-
gc.c (modified) (5 diffs)
-
gl/rfont.c (modified) (2 diffs)
-
scripts/replace.t (modified) (1 diff)
-
series.c (modified) (2 diffs)
-
tests/working/parse.t (modified) (3 diffs)
-
tests/working/parse2.good (modified) (1 diff)
-
tests/working/parse2.t (modified) (1 diff)
-
thread.c (modified) (1 diff)
-
tokenize.c (modified) (3 diffs)
-
unix/os.c (modified) (2 diffs)
-
urlan.h (modified) (2 diffs)
-
win32/os.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/thune/doc/UserManual
r506 r509 423 423 copy (a -- r) Copy value. 424 424 copy.part (ser limit -- r) Copy part of a series. 425 mark. eol (block -- block) Set EOLflag for current cell.425 mark.sol (val -- block) Set Start Of Line flag for current cell. 426 426 parse (data rules -- pos) Parse string or block. 427 427 ========== ======================== ================= -
trunk/thune/doc/thune.vim
r468 r509 125 125 " Control statements 126 126 syn keyword thuneStatement try throw halt quit return recurse break 127 syn keyword thuneConditional ift iff either select case127 syn keyword thuneConditional ift iff if-some or-else either select case 128 128 syn keyword thuneRepeat iter forever each each.set 129 129 "for forall foreach forskip loop repeat while until do -
trunk/thune/eval.c
r499 r509 1749 1749 { uc_recycle, "recycle" }, 1750 1750 { uc_to_hex, "to-hex" }, 1751 { uc_mark_sol, "mark. eol" },1751 { uc_mark_sol, "mark.sol" }, 1752 1752 { uc_hash, "hash" }, 1753 1753 { uc_encode, "encode" }, -
trunk/thune/gc.c
r508 r509 231 231 232 232 233 static void _checkCells( UThread* ut, UCollector* gc, UCell* it, UCell* end ); 234 233 235 static void _checkBlock( UThread* ut, UCollector* gc, UBlock* blk ) 234 236 { 235 int idx;236 237 UCell* it = blk->ptr.cells; 237 UCell* end = it + blk->used;238 238 239 239 #ifdef GC_VERBOSE … … 241 241 #endif 242 242 243 if( ! it ) 244 return; 245 243 if( it ) 244 _checkCells( ut, gc, it, it + blk->used ); 245 } 246 247 248 static void _checkCells( UThread* ut, UCollector* gc, UCell* it, UCell* end ) 249 { 250 int idx; 246 251 while( it != end ) 247 252 { … … 396 401 case CC_ITER: 397 402 case CC_EACH: 403 { 404 UCell* cell = ((UCell*) it) - 1; 398 405 SET_BIT_BLOCK_L( it->cp.n ) 406 _checkCells( ut, gc, cell, cell + 1 ); 399 407 it -= CC_LEN_ITER; 408 } 400 409 break; 401 410 … … 422 431 static void _checkControlStack( UThread* ut, UCollector* gc ) 423 432 { 424 UBlock blk; 425 426 blk.ptr.cells = UR_BOC; 427 blk.used = UR_TOC - UR_BOC; 428 429 assert( blk.used > -1 ); 430 431 _checkBlock( ut, gc, &blk ); 433 assert( UR_TOC >= UR_BOC ); 434 435 _checkCells( ut, gc, UR_BOC, UR_TOC ); 432 436 } 433 437 #endif … … 436 440 static void _checkDataStack( UThread* ut, UCollector* gc ) 437 441 { 438 UBlock blk;439 440 blk.ptr.cells = UR_BOS + 1;441 blk.used = UR_TOS - UR_BOS;442 443 442 #ifndef LANG_RUNE 444 443 assert( ur_is(UR_BOS, UT_UNSET) ); 445 444 #endif 446 assert( blk.used > -1);447 448 _check Block( ut, gc, &blk);445 assert( UR_TOS >= UR_BOS ); 446 447 _checkCells( ut, gc, UR_BOS + 1, UR_TOS + 1 ); 449 448 } 450 449 -
trunk/thune/gl/rfont.c
r458 r509 112 112 if( bin->ptr.b ) 113 113 { 114 hold = ur_hold ( ut, UT_BINARY,rastN );114 hold = ur_holdBin( rastN ); 115 115 116 116 fbm.width = cfg->texW; … … 195 195 196 196 txf_free( &tf ); 197 ur_release( ut,hold );197 ur_release( hold ); 198 198 return ok; 199 199 } -
trunk/thune/scripts/replace.t
r232 r509 35 35 [[b a] [a b]] rev pick 36 36 [ 37 rules [a (b prin) |] copy 'a infuse append.cat tail prev mark. eol drop37 rules [a (b prin) |] copy 'a infuse append.cat tail prev mark.sol drop 38 38 ] 39 39 each.set -
trunk/thune/series.c
r508 r509 2380 2380 if( it != end ) 2381 2381 { 2382 hold = (deep == 1) ? ur_hold( ut, UT_BLOCK, blkN ) : 2383 UR_INVALID_HOLD; 2382 hold = (deep == 1) ? ur_holdBlock(blkN) : UR_INVALID_HOLD; 2384 2383 do 2385 2384 { … … 2390 2389 2391 2390 if( hold != UR_INVALID_HOLD ) 2392 ur_release( ut,hold );2391 ur_release( hold ); 2393 2392 } 2394 2393 } -
trunk/thune/tests/working/parse.t
r212 r509 10 10 11 11 [ 12 linefeed ift (tail prev mark. eol none :linefeed)12 linefeed ift (tail prev mark.sol none :linefeed) 13 13 drop 14 ] proc :blk- eol14 ] proc :blk-sol 15 15 16 16 [ 17 17 make 18 18 blk swap append 19 blk- eol19 blk-sol 20 20 ] proc :app 21 21 … … 23 23 0 make 24 24 blk over append 25 blk- eol25 blk-sol 26 26 blk-stack blk append drop 27 27 :blk … … 31 31 drop ; TODO: verify type 32 32 blk-stack dup last :blk tail prev remove drop 33 linefeed ift (/*blk tail prev 2 mark. eol drop*/ none :linefeed)33 linefeed ift (/*blk tail prev 2 mark.sol drop*/ none :linefeed) 34 34 ] proc :pop-block 35 35 -
trunk/thune/tests/working/parse2.good
r503 r509 23 23 [[b a] [a b]] rev pick 24 24 [ 25 rules [a (b prin) |] copy 'a infuse append.cat tail prev mark. eol drop25 rules [a (b prin) |] copy 'a infuse append.cat tail prev mark.sol drop 26 26 ] 27 27 each.set -
trunk/thune/tests/working/parse2.t
r503 r509 23 23 [[b a] [a b]] rev pick 24 24 [ 25 rules [a (b prin) |] copy 'a infuse append.cat tail prev mark. eol drop25 rules [a (b prin) |] copy 'a infuse append.cat tail prev mark.sol drop 26 26 ] 27 27 each.set -
trunk/thune/thread.c
r508 r509 303 303 304 304 305 void ur_release ( UThread* ut, UIndex which )305 void ur_releaseT( UThread* ut, UIndex which ) 306 306 { 307 307 UBlock* blk = ur_blockPtr( BLK_THREAD_HOLD ); -
trunk/thune/tokenize.c
r508 r509 323 323 stack.used++; 324 324 325 hold = ur_hold ( ut, UT_BLOCK,STACK[0] );325 hold = ur_holdBlock( STACK[0] ); 326 326 327 327 start: … … 1079 1079 } 1080 1080 1081 ur_release( ut,hold );1081 ur_release( hold ); 1082 1082 hold = STACK[0]; 1083 1083 ur_arrayFree( &stack ); … … 1089 1089 error: 1090 1090 1091 ur_release( ut,hold );1091 ur_release( hold ); 1092 1092 ur_arrayFree( &stack ); 1093 1093 return 0; -
trunk/thune/unix/os.c
r458 r509 247 247 UCell* cell; 248 248 UIndex blkN; 249 U Block* blk;249 UIndex hold; 250 250 251 251 blkN = ur_makeBlock( 0 ); 252 blk = ur_blockPtr( blkN );252 hold = ur_holdBlock( blkN ); 253 253 254 254 while( (entry = readdir( dir )) ) … … 259 259 260 260 // Mark cell as unset in case GC is called by ur_makeString. 261 cell = ur_appendCell( blk, UT_UNSET );261 cell = ur_appendCell( ur_blockPtr( blkN ), UT_UNSET ); 262 262 ur_makeString( cell, cp, -1 ); 263 263 } 264 264 265 265 closedir( dir ); 266 267 ur_release( hold ); 266 268 267 269 ur_initType(res, UT_BLOCK); -
trunk/thune/urlan.h
r508 r509 598 598 599 599 UIndex ur_hold( UThread*, int type, UIndex which ); 600 void ur_release ( UThread*, UIndex );600 void ur_releaseT( UThread*, UIndex ); 601 601 602 602 UBlock* ur_blockPtrT( UThread*, UIndex ); … … 648 648 #define ur_block(c) ur_blockPtr( (c)->series.n ) 649 649 #define ur_bin(c) ur_binPtr( (c)->series.n ) 650 651 #define ur_holdBlock(n) ur_hold( ut, UT_BLOCK, n ) 652 #define ur_holdBin(n) ur_hold( ut, UT_BINARY, n ) 653 #define ur_release(n) ur_releaseT( ut, n ) 650 654 651 655 #define ur_type(c) (c)->id.type -
trunk/thune/win32/os.c
r477 r509 314 314 UCell* cell; 315 315 UIndex blkN; 316 U Block* blk;316 UIndex hold; 317 317 318 318 blkN = ur_makeBlock( 0 ); 319 blk = ur_blockPtr( blkN );319 hold = ur_holdBlock( blkN ); 320 320 321 321 do … … 326 326 327 327 // Mark cell as unset in case GC is called by ur_makeString. 328 cell = ur_appendCell( blk, UT_UNSET );328 cell = ur_appendCell( ur_blockPtr( blkN ), UT_UNSET ); 329 329 ur_makeString( cell, fileinfo.name, -1 ); 330 330 } … … 332 332 333 333 _findclose( handle ); 334 335 ur_release( hold ); 334 336 335 337 ur_initType(res, UT_BLOCK);
