Changeset 78

Show
Ignore:
Timestamp:
03/08/06 16:06:15 (3 years ago)
Author:
krobillard
Message:

Any type can now be inserted (or joined) to string!

Location:
trunk/orca
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/orca/print.c

    r70 r78  
    11251125    OString* str = orMakeString( 0 ); 
    11261126    orForm( str, a1 ); 
    1127     orResultSTRING( str - orSTRINGS ); 
     1127    orResultSTRING( orStringN(str) ); 
    11281128} 
    11291129 
     
    11361136    OString* str = orMakeString( 0 ); 
    11371137    orMold( str, a1 ); 
    1138     orResultSTRING( str - orSTRINGS ); 
     1138    orResultSTRING( orStringN(str) ); 
    11391139} 
    11401140 
  • trunk/orca/series.c

    r54 r78  
    417417    OValue* a2 = a1 + 1; 
    418418 
    419     switch( a1->type ) 
     419    switch( orType(a1) ) 
    420420    { 
    421421        case OT_BLOCK: 
    422422        case OT_PAREN: 
    423423        case OT_PATH: 
    424             if( (a2->type != OT_BLOCK) || orRefineSet(REF_INS_ONLY) ) 
     424            if( (orType(a2) != OT_BLOCK) || orRefineSet(REF_INS_ONLY) ) 
    425425            { 
    426426                OValue* ipos; 
     
    473473        case OT_BINARY: 
    474474        { 
    475             if( orIsBlock(a2->type) ) 
     475            if( orIsBlock( orType(a2) ) ) 
    476476            { 
    477477                OBlock* blk = orBLOCK(a2); 
     
    504504                } 
    505505            } 
    506             else if( orIsString(a2->type) ) 
     506            else if( orIsString( orType(a2) ) ) 
    507507            { 
    508508                OString* s2 = orSTRING(a2); 
     
    510510                                  s2->used - a2->series.it ); 
    511511            } 
    512             else if( a2->type == OT_CHAR ) 
     512            else if( orIs(a2, OT_CHAR) ) 
    513513            { 
    514514                char tmp = orInt(a2); 
    515515                stringInsert( a1, &tmp, 1 ); 
     516            } 
     517            else if( orIs(a1, OT_STRING) ) 
     518            { 
     519                // Result is string so mold whatever we haven't handled. 
     520                orMold( orSTRING(a1), a2 ); 
    516521            } 
    517522            else