Changeset 25 for trunk/orca/ovalue.c
- Timestamp:
- 02/06/06 23:30:15 (3 years ago)
- Files:
-
- 1 modified
-
trunk/orca/ovalue.c (modified) (44 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/orca/ovalue.c
r3 r25 617 617 OContext ctx; 618 618 OString* str = orSTRING( from ); 619 int start = from->series.i ndex;619 int start = from->series.it; 620 620 621 621 orGlobalCtx( ctx ); … … 658 658 { 659 659 OString* str = orSTRING(from); 660 char* it = str->charArray + from->series.i ndex;660 char* it = str->charArray + from->series.it; 661 661 char* end = str->charArray + str->used; 662 662 const char* fin; … … 677 677 { 678 678 OString* str = orSTRING(from); 679 char* it = str->charArray + from->series.i ndex;679 char* it = str->charArray + from->series.it; 680 680 char* end = str->charArray + str->used; 681 681 const char* fin; … … 690 690 { 691 691 OBlock* blk = orBLOCK( from ); 692 OValue* it = blk->values + from->series.i ndex;692 OValue* it = blk->values + from->series.it; 693 693 OValue* end = blk->values + blk->used; 694 694 if( (end - it) == 2 && … … 709 709 { 710 710 OBlock* blk = orBLOCK( from ); 711 OValue* it = blk->values + from->series.i ndex;711 OValue* it = blk->values + from->series.it; 712 712 OValue* end = blk->values + blk->used; 713 713 uint8_t* tuple = res->tuple; … … 771 771 { 772 772 OContext ctx; 773 if( orMakeObject( orBLOCK(a2), a2->series.i ndex, &ctx ) )773 if( orMakeObject( orBLOCK(a2), a2->series.it, &ctx ) ) 774 774 { 775 775 orSetTF( a1, OT_OBJECT ); … … 787 787 { 788 788 case OT_STRING: 789 bin = orMakeCharset( orSTRING(a2), a2->series.i ndex);789 bin = orMakeCharset( orSTRING(a2), a2->series.it ); 790 790 break; 791 791 792 792 case OT_BINARY: 793 bin = orCopyString( a2->index, a2->series.i ndex);793 bin = orCopyString( a2->index, a2->series.it ); 794 794 break; 795 795 796 796 case OT_BLOCK: 797 bin = _makeBitset( orBLOCK(a2), a2->series.i ndex);797 bin = _makeBitset( orBLOCK(a2), a2->series.it ); 798 798 break; 799 799 } … … 811 811 { 812 812 OBlock* blk = orBLOCK( a2 ); 813 OValue* it = blk->values + a2->series.i ndex;813 OValue* it = blk->values + a2->series.it; 814 814 OValue* end = blk->values + blk->used; 815 815 int len = end - it; … … 884 884 { 885 885 OContext ctx; 886 if( orMakeClone( &a1->ctx, &ctx, a2->index, a2->series.i ndex) )886 if( orMakeClone( &a1->ctx, &ctx, a2->index, a2->series.it ) ) 887 887 { 888 888 orSetTF( a1, OT_OBJECT ); … … 955 955 orSetSeries( res, orBlockN(blk), 0 ); 956 956 957 if( bin->used > a2->series.i ndex)957 if( bin->used > a2->series.it ) 958 958 { 959 959 OIndex len; 960 960 const uint8_t* code; 961 code = bin->byteArray + a2->series.i ndex;961 code = bin->byteArray + a2->series.it; 962 962 if( orByteCodeBlock( &code, &len ) ) 963 963 orRevaluateByteCodes( code, len, blk ); … … 987 987 OString* str; 988 988 OBlock* blk = orBLOCK(a2); 989 OValue* it = blk->values + a2->series.i ndex;989 OValue* it = blk->values + a2->series.it; 990 990 OValue* end = blk->values + blk->used; 991 991 … … 1182 1182 { 1183 1183 OString* str = orSTRING( a1 ); 1184 blk = orTokenize( str->charArray + a1->series.i ndex,1184 blk = orTokenize( str->charArray + a1->series.it, 1185 1185 str->charArray + str->used ); 1186 1186 if( blk ) … … 1316 1316 if( orIs(a1, OT_BLOCK) || orIs(a1, OT_PAREN) ) 1317 1317 { 1318 orEvalBlock( orBLOCK( a1 ), a1->series.i ndex);1318 orEvalBlock( orBLOCK( a1 ), a1->series.it ); 1319 1319 } 1320 1320 else if( orIs(a1, OT_FILE) ) … … 1407 1407 { 1408 1408 OBlock* blk = orBLOCK(a1); 1409 OValue* it = blk->values + a1->series.i ndex;1409 OValue* it = blk->values + a1->series.it; 1410 1410 OValue* end = blk->values + blk->used; 1411 1411 while( it != end ) … … 1477 1477 { 1478 1478 OValue* a2 = a1 + 1; 1479 orEvalBlock( orBLOCK( a2 ), a2->series.i ndex);1479 orEvalBlock( orBLOCK( a2 ), a2->series.it ); 1480 1480 return; 1481 1481 } … … 1491 1491 { 1492 1492 OValue* a2 = a1 + 1; 1493 orEvalBlock( orBLOCK( a2 ), a2->series.i ndex);1493 orEvalBlock( orBLOCK( a2 ), a2->series.it ); 1494 1494 return; 1495 1495 } … … 1506 1506 --blkArg; 1507 1507 } 1508 orEvalBlock( orBLOCK( blkArg ), blkArg->series.i ndex);1508 orEvalBlock( orBLOCK( blkArg ), blkArg->series.it ); 1509 1509 } 1510 1510 … … 1518 1518 ++a1; 1519 1519 body = a1->index; 1520 bi = a1->series.i ndex;1520 bi = a1->series.it; 1521 1521 1522 1522 while( n > 0 ) … … 1537 1537 OValue* a3 = a1 + 2; 1538 1538 OIndex body = a3->index; 1539 OIndex bi = a3->series.i ndex;1539 OIndex bi = a3->series.it; 1540 1540 1541 1541 orWordVal( a1, vblk, wval ); … … 1556 1556 else 1557 1557 { 1558 int si = a2->series.i ndex;1558 int si = a2->series.it; 1559 1559 OIndex serN = a2->index; 1560 1560 … … 1602 1602 OValue* res; 1603 1603 OIndex cond = a1->index; 1604 OIndex ci = a1->series.i ndex;1604 OIndex ci = a1->series.it; 1605 1605 1606 1606 while( 1 ) … … 1628 1628 int onstack = 0; 1629 1629 OIndex cond = a1->index; 1630 OIndex ci = a1->series.i ndex;1630 OIndex ci = a1->series.it; 1631 1631 OIndex body = (a1 + 1)->index; 1632 OIndex bi = (a1 + 1)->series.i ndex;1632 OIndex bi = (a1 + 1)->series.it; 1633 1633 1634 1634 orRefPush( OT_BLOCK, cond ); … … 1786 1786 void orTryNative( OValue* a1 ) 1787 1787 { 1788 orEvalBlock( orBLOCK( a1 ), a1->series.i ndex);1788 orEvalBlock( orBLOCK( a1 ), a1->series.it ); 1789 1789 if( orErrorThrown ) 1790 1790 { … … 1812 1812 { 1813 1813 OBlock* blk = orBLOCK(nameV); 1814 OValue* it = blk->values + nameV->series.i ndex;1814 OValue* it = blk->values + nameV->series.it; 1815 1815 if( blk->used && (it->type == OT_WORD) ) 1816 1816 { … … 1841 1841 { 1842 1842 OBlock* blk = orBLOCKS + nameBlk; 1843 OValue* it = blk->values; /* TODO: series.i ndex*/1843 OValue* it = blk->values; /* TODO: series.it */ 1844 1844 OValue* end = blk->values + blk->used; 1845 1845 while( it != end ) … … 2027 2027 if( end->type == OT_INTEGER ) 2028 2028 { 2029 result->series.i ndex= end->integer - 1;2029 result->series.it = end->integer - 1; 2030 2030 } 2031 2031 else if( end->type == OT_GETWORD ) … … 2036 2036 if( val->type != OT_INTEGER ) 2037 2037 goto invalid; 2038 result->series.i ndex= val->integer - 1;2038 result->series.it = val->integer - 1; 2039 2039 } 2040 2040 else if( end->type == OT_WORD ) 2041 2041 { 2042 2042 //TODO 2043 //result->series.i ndex= select(result, word)->index;2043 //result->series.it = select(result, word)->index; 2044 2044 goto invalid; 2045 2045 } … … 2091 2091 if( val->type == OT_CHAR ) 2092 2092 { 2093 OString* str = orSTRINGS + ser->series. which;2094 int index = ser->series.i ndex;2093 OString* str = orSTRINGS + ser->series.n; 2094 int index = ser->series.it; 2095 2095 if( index < str->used ) 2096 2096 str->charArray[ index ] = val->integer; … … 2102 2102 case OT_PATH: 2103 2103 { 2104 OBlock* blk = orBLOCKS + ser->series. which;2105 int index = ser->series.i ndex;2104 OBlock* blk = orBLOCKS + ser->series.n; 2105 int index = ser->series.it; 2106 2106 if( index < blk->used ) 2107 2107 { … … 2163 2163 /** 2164 2164 Evaluate one value. 2165 Returns position of next value. 2165 2166 \param blkN Block index. 2167 \param vi Value index to evaluate. 2168 2169 \returns Index of the next value or -1 if there is an error. 2166 2170 */ 2167 2171 int orEval( OIndex blkN, int vi ) … … 2264 2268 2265 2269 wval = orRESULT; 2266 ppos = orEvalPath( orBLOCK(pc), pc->series.i ndex, 0, wval );2270 ppos = orEvalPath( orBLOCK(pc), pc->series.it, 0, wval ); 2267 2271 if( orErrorThrown ) 2268 2272 return -1; … … 2881 2885 blk = orBLOCK( a1 ); 2882 2886 used = blk->used; 2883 vi = a1->series.i ndex;2887 vi = a1->series.it; 2884 2888 2885 2889 orRefPush( OT_BLOCK, blkN ); … … 2919 2923 if( it->type == OT_PAREN ) 2920 2924 { 2921 orEvalBlock( orBLOCK(it), it->series.i ndex);2925 orEvalBlock( orBLOCK(it), it->series.it ); 2922 2926 if( orErrorThrown ) 2923 2927 break; … … 2926 2930 else if( (it->type == OT_BLOCK) && deep ) 2927 2931 { 2928 composeBlock( orBLOCK(it), it->series.i ndex, 1 );2932 composeBlock( orBLOCK(it), it->series.it, 1 ); 2929 2933 } 2930 2934 ++it; … … 2945 2949 deep = orRefineSet(REF_COMP_DEEP) ? 1 : 0; 2946 2950 2947 blk = orCopyBlock( a1->index, a1->series.i ndex, deep );2951 blk = orCopyBlock( a1->index, a1->series.it, deep ); 2948 2952 blkN = orBlockN(blk); 2949 2953 … … 3077 3081 if( (it->type == OT_BLOCK) || (it->type == OT_PATH) ) 3078 3082 { 3079 dprint( " %d %d\n", it->series.i ndex, it->index );3083 dprint( " %d %d\n", it->series.it, it->index ); 3080 3084 if( it->index < orEnv->blocks.used ) 3081 3085 orDumpBlock( orBLOCK( it ), depth + 1 ); … … 3117 3121 strNCpy( buf, str->charArray, 31 ); 3118 3122 buf[32] = '\0'; 3119 dprint( " %d {%s...}\n", it->series.i ndex, buf );3123 dprint( " %d {%s...}\n", it->series.it, buf ); 3120 3124 } 3121 3125 else 3122 3126 { 3123 dprint( " %d {%s}\n", it->series.i ndex, str->charArray );3127 dprint( " %d {%s}\n", it->series.it, str->charArray ); 3124 3128 } 3125 3129 } … … 3164 3168 3165 3169 dprint( "block %d\n", a1->index ); 3166 dprint( "series %d\n", a1->series.i ndex);3170 dprint( "series %d\n", a1->series.it ); 3167 3171 dprint( "used %d\n", blk->used ); 3168 3172 dprint( "avail %d\n", blk->avail ); 3169 3173 3170 orDumpBlock( blk, a1->series.i ndex);3174 orDumpBlock( blk, a1->series.it ); 3171 3175 } 3172 3176 } … … 3712 3716 if( (it->type == OT_BLOCK) || (it->type == OT_PAREN) ) 3713 3717 { 3714 blk = orCopyBlock( it->index, it->series.i ndex, 1 );3718 blk = orCopyBlock( it->index, it->series.it, 1 ); 3715 3719 it->index = orBlockN( blk ); 3716 it->series.i ndex= 0;3720 it->series.it = 0; 3717 3721 } 3718 3722 ++it; … … 3791 3795 OString* str = orSTRING( it ); 3792 3796 _setStringBits( bin->byteArray, 3793 str->byteArray + it->series.i ndex,3797 str->byteArray + it->series.it, 3794 3798 str->byteArray + str->used ); 3795 3799 } … … 3896 3900 orSetTF( val, type ); 3897 3901 val->index = ind; 3898 val->series.i ndex= 0;3902 val->series.it = 0; 3899 3903 return val; 3900 3904 } … … 3952 3956 orSetTF( val, type ); 3953 3957 val->index = blkN; 3954 val->series.i ndex= 0;3958 val->series.it = 0; 3955 3959 return val; 3956 3960 } … … 4232 4236 // Count arguments. 4233 4237 blk = orBLOCK( a1 ); 4234 it = blk->values + a1->series.i ndex;4238 it = blk->values + a1->series.it; 4235 4239 end = blk->values + blk->used; 4236 4240 countArguments( it, end, &argc, &refc ); … … 4258 4262 lastArg = 0; 4259 4263 prevWord = 0; 4260 it = blk->values + a1->series.i ndex;4264 it = blk->values + a1->series.it; 4261 4265 while( it != end ) 4262 4266 {
