Changeset 184 for trunk/thune/make.c
- Timestamp:
- 06/12/06 01:58:22 (3 years ago)
- Files:
-
- 1 modified
-
trunk/thune/make.c (modified) (22 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/thune/make.c
r178 r184 203 203 ur_arrayInit( ptrB, sizeof(UCell), wordCount ); 204 204 205 ur_ setType( ctx, UT_CONTEXT );205 ur_initType( ctx, UT_CONTEXT ); 206 206 ctx->ctx.wordBlk = ur_blockN( ptrA ); 207 207 ctx->ctx.valBlk = ur_blockN( ptrB ); … … 279 279 while( it != rend ) 280 280 { 281 ur_ setType( it, UT_NONE );281 ur_initType( it, UT_NONE ); 282 282 ++it; 283 283 } … … 683 683 if( i == count ) 684 684 { 685 ur_ setType( res, UT_DATATYPE );685 ur_initType( res, UT_DATATYPE ); 686 686 ur_datatype(res) = UT_TYPEMASK; 687 687 res->dt.bitCount = count; … … 695 695 if( count == 2 ) 696 696 { 697 ur_ setType( res, UT_SELECTOR );697 ur_initType( res, UT_SELECTOR ); 698 698 if( nodeType & 2 ) 699 699 res->id.flags |= UR_FLAG_SEL_ATOM; 700 res->word.valBlk = GLOBAL_VAL_BLKN; 701 res->word.atom = node[0]; 702 ur_selector(res) = node[1]; 703 res->word.index = ur_internWord( &ur_global, res->word.atom ); 700 res->word.wordBlk = 0; 701 res->word.valBlk = GLOBAL_VAL_BLKN; 702 res->word.atom = node[0]; 703 ur_selector(res) = node[1]; 704 res->word.index = ur_internWord( &ur_global, res->word.atom ); 704 705 705 706 return 1; … … 737 738 738 739 cell = vblk->ptr.cells + wrdN; 739 ur_ setType( cell, UT_CALL );740 ur_initType( cell, UT_CALL ); 740 741 cell->call.addr = (call_t) def->addr; 741 742 … … 758 759 UCell* cell; 759 760 UR_EXPAND_1( UCell, blk, cell ); 760 ur_ setType( cell, type );761 ur_initType( cell, type ); 761 762 return cell; 762 763 } … … 772 773 cell = ur_appendCell( blk, type ); 773 774 775 cell->word.atom = ur_intern( name, len ); 774 776 cell->word.wordBlk = 0; //GLOBAL_WORD_BLKN; 775 777 cell->word.valBlk = GLOBAL_VAL_BLKN; 776 cell->word. atom = ur_intern( name, len );778 cell->word.sel = UR_CTX_UNORDERED; 777 779 778 780 if( type != UT_LITWORD ) … … 846 848 if( ur_is(tos, UT_LITWORD) && ur_is(ur_s_prev(tos), UT_INT) ) 847 849 { 848 ur_setType( res, UT_OPCODE ); 849 ur_opcode(res) = ur_int(ur_s_next(res)); 850 ur_atom(res) = ur_atom(tos); 850 ur_initType( res, UT_OPCODE ); 851 ur_atom(res) = ur_atom(tos); 852 ur_opcode(res) = ur_int(ur_s_next(res)); 853 ur_selector(res) = 0; 851 854 } 852 855 break; 853 856 854 857 case UT_LOGIC: 855 ur_ setType( res, UT_LOGIC );858 ur_initType( res, UT_LOGIC ); 856 859 ur_logic(res) = ur_int(tos) ? 1 : 0; 857 860 break; … … 866 869 867 870 // Word is added to global context. 868 ur_ setType( res, t );871 ur_initType( res, t ); 869 872 res->word.wordBlk = 0; 870 873 res->word.valBlk = GLOBAL_VAL_BLKN; … … 885 888 if( ur_is(tos, UT_INT) ) 886 889 { 887 ur_ setType( res, UT_CHAR );890 ur_initType( res, UT_CHAR ); 888 891 ur_char(res) = ur_int(tos); 889 892 } … … 892 895 if( spA ) 893 896 { 894 ur_ setType( res, UT_CHAR );897 ur_initType( res, UT_CHAR ); 895 898 896 899 if( *spA == ESCAPE_CHAR ) … … 924 927 else 925 928 goto error; 926 ur_ setType( res, UT_INT );929 ur_initType( res, UT_INT ); 927 930 ur_int(res) = n; 928 931 } … … 943 946 else 944 947 goto error; 945 ur_ setType( res, UT_DECIMAL );948 ur_initType( res, UT_DECIMAL ); 946 949 ur_decimal(res) = n; 947 950 } … … 954 957 UIndex blkN; 955 958 blkN = ur_makeBlock( ur_int(tos) ); 956 ur_ setType(res, ur_datatype(res) );959 ur_initType(res, ur_datatype(res) ); 957 960 ur_setSeries(res, blkN, 0); 958 961 } … … 968 971 if( blkN ) 969 972 { 970 ur_ setType(res, ur_datatype(res) );973 ur_initType(res, ur_datatype(res) ); 971 974 ur_setSeries(res, blkN, 0); 972 975 } … … 1013 1016 } 1014 1017 1015 ur_ setType(res, UT_BINARY);1018 ur_initType(res, UT_BINARY); 1016 1019 ur_setSeries(res, binN, 0); 1017 1020 } … … 1028 1031 UIndex binN; 1029 1032 binN = ur_makeBinary( ur_int(tos) ); 1030 ur_ setType(res, UT_STRING);1033 ur_initType(res, UT_STRING); 1031 1034 //ur_setEncoding(res, UR_ENC_ASCII); 1032 1035 ur_setSeries(res, binN, 0); … … 1042 1045 ur_toStr( tos, str, 0 ); 1043 1046 1044 ur_ setType(res, UT_STRING);1047 ur_initType(res, UT_STRING); 1045 1048 //ur_setEncoding(res, UR_ENC_ASCII); 1046 1049 ur_setSeries(res, binN, 0); … … 1055 1058 binN = ur_makeBinary( 0 ); 1056 1059 1057 ur_ setType(res, UT_STRING);1060 ur_initType(res, UT_STRING); 1058 1061 //ur_setEncoding(res, UR_ENC_ASCII); 1059 1062 ur_setSeries(res, binN, 0); … … 1083 1086 // Make bitset before setting res in case GC is called. 1084 1087 UIndex binN = ur_makeBitset(tos); 1085 ur_ setType(res, UT_BITSET);1088 ur_initType(res, UT_BITSET); 1086 1089 ur_setSeries(res, binN, 0); 1087 1090 } … … 1092 1095 goto error; 1093 1096 1094 ur_ setType(res, UT_ERROR);1097 ur_initType(res, UT_ERROR); 1095 1098 res->err.exType = UR_EX_SCRIPT; 1096 1099 res->err.messageStr = tos->series.n; … … 1101 1104 if( ur_isASeries(tos) ) 1102 1105 { 1103 ur_ setType(res, UT_SLICE);1106 ur_initType(res, UT_SLICE); 1104 1107 ur_sliceDT(res) = ur_type(tos); 1105 1108 res->series.n = tos->series.n;
