Changeset 25 for trunk/orca/ovalue.c

Show
Ignore:
Timestamp:
02/06/06 23:30:15 (3 years ago)
Author:
krobillard
Message:

series which/index renamed to n/it.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/orca/ovalue.c

    r3 r25  
    617617                OContext ctx; 
    618618                OString* str = orSTRING( from ); 
    619                 int start = from->series.index; 
     619                int start = from->series.it; 
    620620 
    621621                orGlobalCtx( ctx ); 
     
    658658            { 
    659659                OString* str = orSTRING(from); 
    660                 char* it  = str->charArray + from->series.index; 
     660                char* it  = str->charArray + from->series.it; 
    661661                char* end = str->charArray + str->used; 
    662662                const char* fin; 
     
    677677            { 
    678678                OString* str = orSTRING(from); 
    679                 char* it  = str->charArray + from->series.index; 
     679                char* it  = str->charArray + from->series.it; 
    680680                char* end = str->charArray + str->used; 
    681681                const char* fin; 
     
    690690            { 
    691691                OBlock* blk = orBLOCK( from ); 
    692                 OValue* it  = blk->values + from->series.index; 
     692                OValue* it  = blk->values + from->series.it; 
    693693                OValue* end = blk->values + blk->used; 
    694694                if( (end - it) == 2 && 
     
    709709            { 
    710710                OBlock* blk = orBLOCK( from ); 
    711                 OValue* it  = blk->values + from->series.index; 
     711                OValue* it  = blk->values + from->series.it; 
    712712                OValue* end = blk->values + blk->used; 
    713713                uint8_t* tuple = res->tuple; 
     
    771771                { 
    772772                    OContext ctx; 
    773                     if( orMakeObject( orBLOCK(a2), a2->series.index, &ctx ) ) 
     773                    if( orMakeObject( orBLOCK(a2), a2->series.it, &ctx ) ) 
    774774                    { 
    775775                        orSetTF( a1, OT_OBJECT ); 
     
    787787                { 
    788788                case OT_STRING: 
    789                     bin = orMakeCharset( orSTRING(a2), a2->series.index ); 
     789                    bin = orMakeCharset( orSTRING(a2), a2->series.it ); 
    790790                    break; 
    791791 
    792792                case OT_BINARY: 
    793                     bin = orCopyString( a2->index, a2->series.index ); 
     793                    bin = orCopyString( a2->index, a2->series.it ); 
    794794                    break; 
    795795 
    796796                case OT_BLOCK: 
    797                     bin = _makeBitset( orBLOCK(a2), a2->series.index ); 
     797                    bin = _makeBitset( orBLOCK(a2), a2->series.it ); 
    798798                    break; 
    799799                } 
     
    811811                { 
    812812                    OBlock* blk = orBLOCK( a2 ); 
    813                     OValue* it  = blk->values + a2->series.index; 
     813                    OValue* it  = blk->values + a2->series.it; 
    814814                    OValue* end = blk->values + blk->used; 
    815815                    int len = end - it; 
     
    884884        { 
    885885            OContext ctx; 
    886             if( orMakeClone( &a1->ctx, &ctx, a2->index, a2->series.index ) ) 
     886            if( orMakeClone( &a1->ctx, &ctx, a2->index, a2->series.it ) ) 
    887887            { 
    888888                orSetTF( a1, OT_OBJECT ); 
     
    955955            orSetSeries( res, orBlockN(blk), 0 ); 
    956956 
    957             if( bin->used > a2->series.index ) 
     957            if( bin->used > a2->series.it ) 
    958958            { 
    959959                OIndex len; 
    960960                const uint8_t* code; 
    961                 code = bin->byteArray + a2->series.index; 
     961                code = bin->byteArray + a2->series.it; 
    962962                if( orByteCodeBlock( &code, &len ) ) 
    963963                    orRevaluateByteCodes( code, len, blk ); 
     
    987987            OString* str; 
    988988            OBlock* blk = orBLOCK(a2); 
    989             OValue* it  = blk->values + a2->series.index; 
     989            OValue* it  = blk->values + a2->series.it; 
    990990            OValue* end = blk->values + blk->used; 
    991991 
     
    11821182    { 
    11831183        OString* str = orSTRING( a1 ); 
    1184         blk = orTokenize( str->charArray + a1->series.index, 
     1184        blk = orTokenize( str->charArray + a1->series.it, 
    11851185                          str->charArray + str->used ); 
    11861186        if( blk ) 
     
    13161316    if( orIs(a1, OT_BLOCK) || orIs(a1, OT_PAREN) ) 
    13171317    { 
    1318         orEvalBlock( orBLOCK( a1 ), a1->series.index ); 
     1318        orEvalBlock( orBLOCK( a1 ), a1->series.it ); 
    13191319    } 
    13201320    else if( orIs(a1, OT_FILE) ) 
     
    14071407    { 
    14081408        OBlock* blk = orBLOCK(a1); 
    1409         OValue* it  = blk->values + a1->series.index; 
     1409        OValue* it  = blk->values + a1->series.it; 
    14101410        OValue* end = blk->values + blk->used; 
    14111411        while( it != end ) 
     
    14771477        { 
    14781478            OValue* a2 = a1 + 1; 
    1479             orEvalBlock( orBLOCK( a2 ), a2->series.index ); 
     1479            orEvalBlock( orBLOCK( a2 ), a2->series.it ); 
    14801480            return; 
    14811481        } 
     
    14911491    { 
    14921492        OValue* a2 = a1 + 1; 
    1493         orEvalBlock( orBLOCK( a2 ), a2->series.index ); 
     1493        orEvalBlock( orBLOCK( a2 ), a2->series.it ); 
    14941494        return; 
    14951495    } 
     
    15061506            --blkArg; 
    15071507    } 
    1508     orEvalBlock( orBLOCK( blkArg ), blkArg->series.index ); 
     1508    orEvalBlock( orBLOCK( blkArg ), blkArg->series.it ); 
    15091509} 
    15101510 
     
    15181518    ++a1; 
    15191519    body = a1->index; 
    1520     bi   = a1->series.index; 
     1520    bi   = a1->series.it; 
    15211521 
    15221522    while( n > 0 ) 
     
    15371537    OValue* a3 = a1 + 2; 
    15381538    OIndex body = a3->index; 
    1539     OIndex bi   = a3->series.index; 
     1539    OIndex bi   = a3->series.it; 
    15401540 
    15411541    orWordVal( a1, vblk, wval ); 
     
    15561556    else 
    15571557    { 
    1558         int si = a2->series.index; 
     1558        int si = a2->series.it; 
    15591559        OIndex serN = a2->index; 
    15601560 
     
    16021602    OValue* res; 
    16031603    OIndex cond = a1->index; 
    1604     OIndex ci   = a1->series.index; 
     1604    OIndex ci   = a1->series.it; 
    16051605 
    16061606    while( 1 ) 
     
    16281628    int onstack = 0; 
    16291629    OIndex cond = a1->index; 
    1630     OIndex ci   = a1->series.index; 
     1630    OIndex ci   = a1->series.it; 
    16311631    OIndex body = (a1 + 1)->index; 
    1632     OIndex bi   = (a1 + 1)->series.index; 
     1632    OIndex bi   = (a1 + 1)->series.it; 
    16331633 
    16341634    orRefPush( OT_BLOCK, cond ); 
     
    17861786void orTryNative( OValue* a1 ) 
    17871787{ 
    1788    orEvalBlock( orBLOCK( a1 ), a1->series.index ); 
     1788   orEvalBlock( orBLOCK( a1 ), a1->series.it ); 
    17891789   if( orErrorThrown ) 
    17901790   { 
     
    18121812        { 
    18131813            OBlock* blk  = orBLOCK(nameV); 
    1814             OValue* it = blk->values + nameV->series.index; 
     1814            OValue* it = blk->values + nameV->series.it; 
    18151815            if( blk->used && (it->type == OT_WORD) ) 
    18161816            { 
     
    18411841        { 
    18421842            OBlock* blk  = orBLOCKS + nameBlk; 
    1843             OValue* it  = blk->values;  /* TODO: series.index */ 
     1843            OValue* it  = blk->values;  /* TODO: series.it */ 
    18441844            OValue* end = blk->values + blk->used; 
    18451845            while( it != end ) 
     
    20272027            if( end->type == OT_INTEGER ) 
    20282028            { 
    2029                 result->series.index = end->integer - 1; 
     2029                result->series.it = end->integer - 1; 
    20302030            } 
    20312031            else if( end->type == OT_GETWORD ) 
     
    20362036                if( val->type != OT_INTEGER ) 
    20372037                    goto invalid; 
    2038                 result->series.index = val->integer - 1; 
     2038                result->series.it = val->integer - 1; 
    20392039            } 
    20402040            else if( end->type == OT_WORD ) 
    20412041            { 
    20422042                //TODO 
    2043                 //result->series.index = select(result, word)->index; 
     2043                //result->series.it = select(result, word)->index; 
    20442044                goto invalid; 
    20452045            } 
     
    20912091            if( val->type == OT_CHAR ) 
    20922092            { 
    2093                 OString* str = orSTRINGS + ser->series.which; 
    2094                 int index = ser->series.index; 
     2093                OString* str = orSTRINGS + ser->series.n; 
     2094                int index = ser->series.it; 
    20952095                if( index < str->used ) 
    20962096                    str->charArray[ index ] = val->integer; 
     
    21022102        case OT_PATH: 
    21032103            { 
    2104             OBlock* blk = orBLOCKS + ser->series.which; 
    2105             int index = ser->series.index; 
     2104            OBlock* blk = orBLOCKS + ser->series.n; 
     2105            int index = ser->series.it; 
    21062106            if( index < blk->used ) 
    21072107            { 
     
    21632163/** 
    21642164  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. 
    21662170*/ 
    21672171int orEval( OIndex blkN, int vi ) 
     
    22642268 
    22652269            wval = orRESULT; 
    2266             ppos = orEvalPath( orBLOCK(pc), pc->series.index, 0, wval ); 
     2270            ppos = orEvalPath( orBLOCK(pc), pc->series.it, 0, wval ); 
    22672271            if( orErrorThrown ) 
    22682272                return -1; 
     
    28812885        blk = orBLOCK( a1 ); 
    28822886        used = blk->used; 
    2883         vi = a1->series.index; 
     2887        vi = a1->series.it; 
    28842888 
    28852889        orRefPush( OT_BLOCK, blkN ); 
     
    29192923        if( it->type == OT_PAREN ) 
    29202924        { 
    2921             orEvalBlock( orBLOCK(it), it->series.index ); 
     2925            orEvalBlock( orBLOCK(it), it->series.it ); 
    29222926            if( orErrorThrown ) 
    29232927                break; 
     
    29262930        else if( (it->type == OT_BLOCK) && deep ) 
    29272931        { 
    2928             composeBlock( orBLOCK(it), it->series.index, 1 ); 
     2932            composeBlock( orBLOCK(it), it->series.it, 1 ); 
    29292933        } 
    29302934        ++it; 
     
    29452949        deep = orRefineSet(REF_COMP_DEEP) ? 1 : 0; 
    29462950 
    2947         blk = orCopyBlock( a1->index, a1->series.index, deep ); 
     2951        blk = orCopyBlock( a1->index, a1->series.it, deep ); 
    29482952        blkN = orBlockN(blk); 
    29492953 
     
    30773081        if( (it->type == OT_BLOCK) || (it->type == OT_PATH) ) 
    30783082        { 
    3079             dprint( " %d %d\n", it->series.index, it->index ); 
     3083            dprint( " %d %d\n", it->series.it, it->index ); 
    30803084            if( it->index < orEnv->blocks.used ) 
    30813085                orDumpBlock( orBLOCK( it ), depth + 1 ); 
     
    31173121                    strNCpy( buf, str->charArray, 31 ); 
    31183122                    buf[32] = '\0'; 
    3119                     dprint( " %d {%s...}\n", it->series.index, buf ); 
     3123                    dprint( " %d {%s...}\n", it->series.it, buf ); 
    31203124                } 
    31213125                else 
    31223126                { 
    3123                     dprint( " %d {%s}\n", it->series.index, str->charArray ); 
     3127                    dprint( " %d {%s}\n", it->series.it, str->charArray ); 
    31243128                } 
    31253129            } 
     
    31643168 
    31653169        dprint( "block  %d\n", a1->index ); 
    3166         dprint( "series %d\n", a1->series.index ); 
     3170        dprint( "series %d\n", a1->series.it ); 
    31673171        dprint( "used   %d\n", blk->used ); 
    31683172        dprint( "avail  %d\n", blk->avail ); 
    31693173 
    3170         orDumpBlock( blk, a1->series.index ); 
     3174        orDumpBlock( blk, a1->series.it ); 
    31713175    } 
    31723176} 
     
    37123716            if( (it->type == OT_BLOCK) || (it->type == OT_PAREN) ) 
    37133717            { 
    3714                 blk = orCopyBlock( it->index, it->series.index, 1 ); 
     3718                blk = orCopyBlock( it->index, it->series.it, 1 ); 
    37153719                it->index = orBlockN( blk ); 
    3716                 it->series.index = 0; 
     3720                it->series.it = 0; 
    37173721            } 
    37183722            ++it; 
     
    37913795                    OString* str = orSTRING( it ); 
    37923796                    _setStringBits( bin->byteArray, 
    3793                                     str->byteArray + it->series.index, 
     3797                                    str->byteArray + it->series.it, 
    37943798                                    str->byteArray + str->used ); 
    37953799                } 
     
    38963900    orSetTF( val, type ); 
    38973901    val->index = ind; 
    3898     val->series.index = 0; 
     3902    val->series.it = 0; 
    38993903    return val; 
    39003904} 
     
    39523956    orSetTF( val, type ); 
    39533957    val->index = blkN; 
    3954     val->series.index = 0; 
     3958    val->series.it = 0; 
    39553959    return val; 
    39563960} 
     
    42324236    // Count arguments. 
    42334237    blk = orBLOCK( a1 ); 
    4234     it  = blk->values + a1->series.index; 
     4238    it  = blk->values + a1->series.it; 
    42354239    end = blk->values + blk->used; 
    42364240    countArguments( it, end, &argc, &refc ); 
     
    42584262    lastArg = 0; 
    42594263    prevWord = 0; 
    4260     it = blk->values + a1->series.index; 
     4264    it = blk->values + a1->series.it; 
    42614265    while( it != end ) 
    42624266    {