Changeset 125 for trunk/thune/make.c

Show
Ignore:
Timestamp:
04/26/06 18:39:31 (3 years ago)
Author:
krobillard
Message:

Thune -

Parse test now handles linefeeds and can parse itself.
ur_clone() renamed as ur_copy() and now handles slice!.
Can now make error! and string! from slice!.
Added copy.part & error.
Error trace no longer prints paren! contents.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/thune/make.c

    r117 r125  
    604604        if( ur_type(tos) == ur_datatype(res) ) 
    605605        { 
    606             ur_copy(res, *tos);     // UR_S_NIP; 
     606            ur_copyCell(res, *tos);     // UR_S_NIP; 
    607607            UR_S_DROP; 
    608608            return; 
     
    798798            else if( ur_is(tos, UT_BLOCK) ) 
    799799            { 
    800                 UIndex binN = 0; 
     800                UIndex binN; 
    801801                UString* str; 
    802802                
     
    809809                ur_setSeries(res, binN, 0); 
    810810            } 
     811            else if( ur_stringSlice(tos, &spA, &spB) ) 
     812            { 
     813                UIndex binN; 
     814 
     815                if( spA ) 
     816                    binN = ur_makeString( spA, spB - spA ); 
     817                else 
     818                    binN = ur_makeBinary( 0 ); 
     819 
     820                ur_setType(res, UT_STRING); 
     821                ur_setSeries(res, binN, 0); 
     822            } 
    811823            break; 
    812824 
     
    834846            ur_setSeries(res, binN, 0); 
    835847        } 
     848            break; 
     849 
     850        case UT_ERROR: 
     851            if( ! ur_is(tos, UT_STRING) ) 
     852                goto error; 
     853 
     854            ur_setType(res, UT_ERROR); 
     855            res->err.exType     = UR_EX_SCRIPT; 
     856            res->err.messageStr = tos->series.n; 
     857            res->err.traceBlk   = ur_makeBlock( 8 ); 
    836858            break; 
    837859 
     
    879901                        UR_S_DROPN( 2 ); 
    880902                        tos = ur_s_prev(tos); 
    881                         ur_copy( res, *tos ); 
     903                        ur_copyCell( res, *tos ); 
    882904                        (*lit)->compile( ur_thread, res ); 
    883905                        return;