Changeset 327 for trunk/thune/make.c
- Timestamp:
- 12/27/06 20:33:47 (2 years ago)
- Files:
-
- 1 modified
-
trunk/thune/make.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/thune/make.c
r323 r327 745 745 return 0; 746 746 } 747 748 749 /*--------------------------------------------------------------------------*/ 750 751 752 #if 0 753 typedef struct 754 { 755 UAtom name; 756 uint16_t index; 757 UAtom ctype; 758 } 759 UStructField; 760 761 762 /* 763 [field1 type1 field2 type2 ...] 764 */ 765 UIndex ur_makeStructCell( const UCell* from, UCell* res ) 766 { 767 UArray* bin; 768 UIndex binN = 0; 769 770 if( ur_is(from, UT_BLOCK) ) 771 { 772 UBlock* blk; 773 UCell* it; 774 UCell* end; 775 int count; 776 UAtom wrd; 777 778 blk = ur_block( from ); 779 UR_ITER_BLOCK( it, end, blk, from ) 780 781 wrd = 0; 782 count = 0; 783 784 while( it != end ) 785 { 786 if( ur_is(it, UT_WORD) ) 787 { 788 if( count & 1 ) 789 { 790 wrd = ur_atom(it); 791 } 792 else 793 { 794 switch( ur_atom(it) ) 795 { 796 case UT_CHAR: 797 break; 798 case UT_INT: 799 break; 800 case UT_INT64: 801 break; 802 case UT_DECIMAL: 803 break; 804 case UT_VECTOR: 805 break; 806 } 807 } 808 ++count; 809 } 810 811 ++it; 812 } 813 814 binN = ur_makeBinary( end - it, &bin ); 815 } 816 //else if( ur_is(from, UT_STRUCT) ) { } 817 818 if( binN ) 819 { 820 ur_initType(res, UT_STRUCT); 821 ur_setSeries(res, binN, 0); 822 return binN; 823 } 824 825 return 0; 826 } 827 #endif 747 828 748 829 … … 1203 1284 (opcode! code word -- value) 1204 1285 (binary! int bytes -- value) 1286 (select! word sel -- value) 1205 1287 (context block -- value) 1206 1288 */ … … 1314 1396 goto error; 1315 1397 } 1398 #ifdef LANG_THUNE 1399 else if( argc == 2 ) 1400 { 1401 UCell* wrd = ur_s_prev(tos); 1402 if( ! ur_isAWord(wrd) ) 1403 goto error; 1404 1405 ur_copyCell( res, *wrd ); 1406 ur_type(res) = UT_SELECT; 1407 1408 if( ur_is(tos, UT_INT) ) 1409 { 1410 res->id.flags &= ~UR_FLAG_SEL_ATOM; 1411 ur_sel(res) = ur_int(tos); 1412 } 1413 else if( ur_isAWord(tos) ) 1414 { 1415 res->id.flags |= UR_FLAG_SEL_ATOM; 1416 ur_sel(res) = ur_atom(tos); 1417 } 1418 } 1419 #endif 1316 1420 break; 1317 1421 … … 1570 1674 { 1571 1675 // Make array before setting res in case GC is called. 1572 UIndex binN = ur_makeVectorCell( tos, res ); 1573 if( ! binN ) 1676 if( ! ur_makeVectorCell( tos, res ) ) 1574 1677 goto error; 1575 1678 } … … 1652 1755 #endif 1653 1756 1757 #if 0 1758 case UT_STRUCT: 1759 if( ! ur_makeStructCell( tos, res ) ) 1760 goto error; 1761 break; 1762 #endif 1763 1654 1764 default: 1655 1765 if( ur_datatype(res) < UT_BI_COUNT )
