Changeset 44
- Timestamp:
- 02/12/06 15:46:49 (3 years ago)
- Location:
- trunk/orca
- Files:
-
- 3 modified
Legend:
- Unmodified
- Added
- Removed
-
trunk/orca/ovalue.c
r42 r44 1488 1488 void orIfNative( OValue* a1 ) 1489 1489 { 1490 if( a1->type != OT_NONE ) 1491 { 1492 if( (a1->type != OT_LOGIC) || (a1->integer != 0) ) 1493 { 1494 OValue* a2 = a1 + 1; 1495 orEvalBlock( orBLOCK( a2 ), a2->series.it ); 1496 return; 1497 } 1490 if( orIfTrue(a1) ) 1491 { 1492 OValue* a2 = a1 + 1; 1493 orEvalBlock( orBLOCK( a2 ), a2->series.it ); 1494 return; 1498 1495 } 1499 1496 orResultNONE; … … 1503 1500 void orUnlessNative( OValue* a1 ) 1504 1501 { 1505 if( (a1->type == OT_NONE) || 1506 ((a1->type == OT_LOGIC) && (a1->integer == 0)) ) 1502 if( orIfFalse(a1) ) 1507 1503 { 1508 1504 OValue* a2 = a1 + 1; -
trunk/orca/ovalue.h
r42 r44 486 486 #define orType(val) (val)->type 487 487 #define orInteger(val) (val)->integer 488 #define orLogic(val) (val)->integer 488 489 #define orDecimal(val) (val)->num.decimal 489 490 #define orTupleLen(val) (val)->argc … … 494 495 #define orIsBlock(t) ((t >= OT_BLOCK) && (t < OT_SETPATH)) 495 496 #define orIsNumber(t) ((t == OT_INTEGER) || (t == OT_DECIMAL)) 497 498 #define orIfTrue(val) \ 499 ((orType(val) != OT_NONE) && \ 500 ((orType(val) != OT_LOGIC) || (orLogic(val) != 0))) 501 502 #define orIfFalse(val) \ 503 (orIs(val, OT_NONE) || (orIs(val, OT_LOGIC) && (orLogic(val) == 0))) 496 504 497 505 #define orRefAvail(n) \ -
trunk/orca/tests/run_test
r11 r44 2 2 3 3 INTERPRETER=../orca 4 #INTERPRETER=../rsharp 4 REBOL=rebol 5 #REBOL=./rebol 5 6 6 7 #DIFF='diff -w --ignore-blank-lines' … … 13 14 ROUT=${FILE%.*}.outr 14 15 OUT=${FILE%.*}.out 15 rebol-qs $FILE >$ROUT16 $REBOL -qs $FILE >$ROUT 16 17 $INTERPRETER $FILE >$OUT 17 18 ${DIFF} $OUT $ROUT
