Changeset 4a74cc in git for Singular/ipassign.cc
- Timestamp:
- Feb 5, 2015, 12:10:11 PM (9 years ago)
- Branches:
- (u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', 'c5facdfddea2addfd91babd8b9019161dea4b695')
- Children:
- f5125c661ffed4886fe8c7ca685ccd0c38cbaa80
- Parents:
- aca790a522d4e3aedfed1659704188800436fcee
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/ipassign.cc
raca790 r4a74cc 950 950 * assign a = b 951 951 */ 952 static BOOLEAN jiAssign_1(leftv l, leftv r )952 static BOOLEAN jiAssign_1(leftv l, leftv r, BOOLEAN toplevel) 953 953 { 954 954 int rt=r->Typ(); … … 960 960 961 961 int lt=l->Typ(); 962 if ( /*(*/ lt==0 /*)*/) /*&&(l->name!=NULL)*/962 if (lt==0) 963 963 { 964 964 if (!errorreported) Werror("left side `%s` is undefined",l->Fullname()); … … 1009 1009 } 1010 1010 leftv ld=l; 1011 if ((l->rtyp==IDHDL)&&(lt!=QRING_CMD)&&(lt!=RING_CMD)) 1012 ld=(leftv)l->data; 1011 if (l->rtyp==IDHDL) 1012 { 1013 if ((lt!=QRING_CMD)&&(lt!=RING_CMD)) 1014 ld=(leftv)l->data; 1015 } 1016 else if (toplevel) 1017 { 1018 WerrorS("error in assign: left side is not an l-value"); 1019 return TRUE; 1020 } 1013 1021 if (lt>MAX_TOK) 1014 1022 { … … 1193 1201 h=l->next; 1194 1202 l->next=NULL; 1195 nok=jiAssign_1(l,&t );1203 nok=jiAssign_1(l,&t,TRUE); 1196 1204 l->next=h; 1197 1205 if (nok) return TRUE; … … 1227 1235 h=l->next; 1228 1236 l->next=NULL; 1229 nok=jiAssign_1(l,&t );1237 nok=jiAssign_1(l,&t,TRUE); 1230 1238 l->next=h; 1231 1239 t.CleanUp(); … … 1465 1473 idhdl hh=NULL; 1466 1474 if ((l->rtyp==IDHDL)&&(l->Typ()==DEF_CMD)) hh=(idhdl)l->data; 1467 nok=jiAssign_1(l,&t );1475 nok=jiAssign_1(l,&t,TRUE); 1468 1476 if (hh!=NULL) { ipMoveId(hh);hh=NULL;} 1469 1477 l->next=h; … … 1541 1549 h=l->next; 1542 1550 l->next=NULL; 1543 nok=jiAssign_1(l,&t );1551 nok=jiAssign_1(l,&t,TRUE); 1544 1552 if (nok) 1545 1553 { … … 1599 1607 memset(&tmp,0,sizeof(sleftv)); 1600 1608 tmp.rtyp=DEF_CMD; 1601 b=iiAssign(&tmp,r );1609 b=iiAssign(&tmp,r,FALSE); 1602 1610 ld->CleanUp(); 1603 1611 memcpy(ld,&tmp,sizeof(sleftv)); … … 1611 1619 tmp.rtyp=r->Typ(); 1612 1620 tmp.data=(char*)idrecDataInit(r->Typ()); 1613 b=iiAssign(&tmp,r );1621 b=iiAssign(&tmp,r,FALSE); 1614 1622 ld->CleanUp(); 1615 1623 memcpy(ld,&tmp,sizeof(sleftv)); … … 1617 1625 else 1618 1626 { 1619 b=iiAssign(ld,r );1627 b=iiAssign(ld,r,FALSE); 1620 1628 if (l->e!=NULL) l->e->next=ld->e; 1621 1629 ld->e=NULL; … … 1646 1654 return b; 1647 1655 } 1648 BOOLEAN iiAssign(leftv l, leftv r )1656 BOOLEAN iiAssign(leftv l, leftv r, BOOLEAN toplevel) 1649 1657 { 1650 1658 if (errorreported) return TRUE; … … 1664 1672 IDFLAG((idhdl)l->data)=0; 1665 1673 l->attribute=NULL; 1674 toplevel=FALSE; 1666 1675 } 1667 1676 else if (l->attribute!=NULL) … … 1746 1755 &&((lt==rt)||(lt!=LIST_CMD))) 1747 1756 { 1748 b=jiAssign_1(l,r );1757 b=jiAssign_1(l,r,toplevel); 1749 1758 if (l->rtyp==IDHDL) 1750 1759 { … … 1771 1780 ) 1772 1781 { 1773 b=jiAssign_1(l,r );1782 b=jiAssign_1(l,r,toplevel); 1774 1783 if((l->rtyp==IDHDL)&&(l->data!=NULL)) 1775 1784 { … … 1858 1867 } 1859 1868 if ((hh->next==NULL)&&(hh->Typ()==IDEAL_CMD)) 1860 return jiAssign_1(l,hh ); /* map-assign: map f=r,i; */1869 return jiAssign_1(l,hh,toplevel); /* map-assign: map f=r,i; */ 1861 1870 //no break, handle the rest like an ideal: 1862 1871 map_assign=TRUE;
Note: See TracChangeset
for help on using the changeset viewer.