Changeset ea947e in git
- Timestamp:
- Jul 1, 2010, 11:44:31 AM (13 years ago)
- Branches:
- (u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'f875bbaccd0831e36aaed09ff6adeb3eb45aeb94')
- Children:
- b157872a7e82b6661c4a809febe9ccf834773646
- Parents:
- 5dfa8c02eb88c8d20f6bba3eef61f4d4a24718ee
- Location:
- Singular
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/grammar.cc
r5dfa8c rea947e 3868 3868 #line 1595 "grammar.y" 3869 3869 { 3870 //Print("par:%s, %d\n",$2.Name(),$2.Typ()); 3871 //yylineno--;3872 if (iiParameter(&(yyvsp[(2) - (2)].lv))) YYERROR; 3870 // decl. of type proc p(int i) 3871 if ((yyvsp[(1) - (2)].i)==PARAMETER) { if (iiParameter(&(yyvsp[(2) - (2)].lv))) YYERROR; } 3872 else { if (iiAlias(&(yyvsp[(2) - (2)].lv))) YYERROR; } 3873 3873 ;} 3874 3874 break; … … 3877 3877 #line 1601 "grammar.y" 3878 3878 { 3879 //Print("par:%s, %d\n",$2.Name(),$2.Typ()); 3879 // decl. of type proc p(i) 3880 3880 sleftv tmp_expr; 3881 //yylineno--;3881 if ((yyvsp[(1) - (2)].i)==ALIAS_CMD) MYYERROR("alias requires a type"); 3882 3882 if ((iiDeclCommand(&tmp_expr,&(yyvsp[(2) - (2)].lv),myynest,DEF_CMD,&IDROOT)) 3883 3883 || (iiParameter(&tmp_expr))) -
Singular/grammar.y
r5dfa8c rea947e 1594 1594 PARAMETER declare_ip_variable 1595 1595 { 1596 //Print("par:%s, %d\n",$2.Name(),$2.Typ()); 1597 //yylineno--;1598 if (iiParameter(&$2)) YYERROR; 1596 // decl. of type proc p(int i) 1597 if ($1==PARAMETER) { if (iiParameter(&$2)) YYERROR; } 1598 else { if (iiAlias(&$2)) YYERROR; } 1599 1599 } 1600 1600 | PARAMETER expr 1601 1601 { 1602 //Print("par:%s, %d\n",$2.Name(),$2.Typ()); 1602 // decl. of type proc p(i) 1603 1603 sleftv tmp_expr; 1604 //yylineno--;1604 if ($1==ALIAS_CMD) MYYERROR("alias requires a type"); 1605 1605 if ((iiDeclCommand(&tmp_expr,&$2,myynest,DEF_CMD,&IDROOT)) 1606 1606 || (iiParameter(&tmp_expr))) -
Singular/ipassign.cc
r5dfa8c rea947e 1323 1323 int rt=NONE; 1324 1324 BOOLEAN b; 1325 if (l->rtyp==ALIAS_CMD) 1326 { 1327 Werror("`%s` is read-only",l->Name()); 1328 } 1325 1329 1326 1330 if(l->attribute!=NULL) -
Singular/ipid.cc
r5dfa8c rea947e 152 152 break; 153 153 case STRING_CMD: 154 IDSTRING(h) = omStrDup("");154 len=1; 155 155 break; 156 156 case LIST_CMD: … … 465 465 } 466 466 #ifdef TEST 467 else if ((IDTYP(h)!= INT_CMD)&&(IDTYP(h)!=DEF_CMD) && (IDTYP(h)!=NONE)) 467 else if ((IDTYP(h)!= INT_CMD) 468 &&(IDTYP(h)!=DEF_CMD) 469 &&(IDTYP(h)!=ALIAS_CMD) 470 &&(IDTYP(h)!=NONE)) 468 471 Warn("unknown type to kill: %s(%d)",Tok2Cmdname(IDTYP(h)),IDTYP(h)); 469 472 #endif -
Singular/iplib.cc
r5dfa8c rea947e 162 162 } 163 163 // copy the result to argstr 164 strcat(argstr,"parameter "); 164 if(strncmp(s,"alias ",6)!=0) 165 { 166 strcat(argstr,"parameter "); 167 } 165 168 strcat(argstr,s); 166 169 strcat(argstr,"; "); -
Singular/ipshell.cc
r5dfa8c rea947e 383 383 { 384 384 if (iterate) list1(prefix,h,TRUE,fullname); 385 if (IDTYP(h)==ALIAS_CMD) PrintS("A"); 385 386 if ((IDTYP(h)==RING_CMD) 386 387 || (IDTYP(h)==QRING_CMD) … … 1143 1144 omFreeBin((ADDRESS)h, sleftv_bin); 1144 1145 return res; 1146 } 1147 BOOLEAN iiAlias(leftv p) 1148 { 1149 if (iiCurrArgs==NULL) 1150 { 1151 Werror("not enough arguments for proc %s",VoiceName()); 1152 p->CleanUp(); 1153 return TRUE; 1154 } 1155 leftv h=iiCurrArgs; 1156 iiCurrArgs=h->next; 1157 h->next=NULL; 1158 if (h->rtyp!=IDHDL) 1159 { 1160 WerrorS("identifier required"); 1161 return TRUE; 1162 } 1163 if (h->Typ()!=p->Typ()) 1164 { 1165 WerrorS("type mismatch"); 1166 return TRUE; 1167 } 1168 idhdl pp=(idhdl)p->data; 1169 switch(pp->typ) 1170 { 1171 case INT_CMD: 1172 break; 1173 case INTVEC_CMD: 1174 case INTMAT_CMD: 1175 delete IDINTVEC(pp); 1176 break; 1177 case NUMBER_CMD: 1178 nDelete(&IDNUMBER(pp)); 1179 break; 1180 case BIGINT_CMD: 1181 nlDelete(&IDNUMBER(pp),currRing); 1182 break; 1183 case MAP_CMD: 1184 { 1185 map im = IDMAP(pp); 1186 omFree((ADDRESS)im->preimage); 1187 } 1188 // continue as ideal: 1189 case IDEAL_CMD: 1190 case MODUL_CMD: 1191 case MATRIX_CMD: 1192 idDelete(&IDIDEAL(pp)); 1193 break; 1194 case PROC_CMD: 1195 case RESOLUTION_CMD: 1196 case STRING_CMD: 1197 omFree((ADDRESS)IDSTRING(pp)); 1198 break; 1199 case LIST_CMD: 1200 IDLIST(pp)->Clean(); 1201 break; 1202 case LINK_CMD: 1203 omFreeBin(IDLINK(pp),sip_link_bin); 1204 break; 1205 // case ring: cannot happen 1206 default: 1207 Werror("unknown type %d",p->Typ()); 1208 return TRUE; 1209 } 1210 pp->typ=ALIAS_CMD; 1211 IDDATA(pp)=(char*)h->data; 1212 h->CleanUp(); 1213 omFreeBin((ADDRESS)h, sleftv_bin); 1214 return FALSE; 1145 1215 } 1146 1216 … … 4420 4490 R->block1[n] = last; 4421 4491 //if ((R->block0[n]>R->block1[n]) 4422 4423 4424 4425 4426 4427 4492 //|| (R->block1[n]>rVar(R))) 4493 //{ 4494 // R->block1[n]=rVar(R); 4495 // //WerrorS("ordering larger than number of variables"); 4496 // break; 4497 //} 4428 4498 if (rCheckIV(iv)) return TRUE; 4429 4499 for(i=si_min(rVar(R),R->block1[n]);i>=R->block0[n];i--) -
Singular/ipshell.h
r5dfa8c rea947e 168 168 169 169 BOOLEAN iiParameter(leftv p); 170 BOOLEAN iiAlias(leftv p); 170 171 /* ================================================================== */ 171 172 int iiDeclCommand(leftv sy, leftv name, int lev, int t, idhdl* root, -
Singular/subexpr.cc
r5dfa8c rea947e 281 281 void sleftv::CleanUp(ring r) 282 282 { 283 if ((name!=NULL) && (name!=sNoName) && (rtyp!=IDHDL) )283 if ((name!=NULL) && (name!=sNoName) && (rtyp!=IDHDL) && (rtyp!=ALIAS_CMD)) 284 284 { 285 285 //::Print("free %x (%s)\n",name,name); … … 830 830 switch (rtyp) 831 831 { 832 case ALIAS_CMD: 833 { 834 idhdl h=(idhdl)data; 835 return ((idhdl)h->data.ustring)->typ; 836 } 832 837 case IDHDL: 833 838 return IDTYP((idhdl)data); … … 860 865 int r=0; 861 866 int t=rtyp; 862 if (t==IDHDL) t=IDTYP((idhdl)data); 867 if (t==ALIAS_CMD) { idhdl h=(idhdl)IDDATA((idhdl)data); t=IDTYP(h); } 868 else if (t==IDHDL) t=IDTYP((idhdl)data); 863 869 switch (t) 864 870 { … … 950 956 void * sleftv::Data() 951 957 { 958 if(rtyp==ALIAS_CMD) 959 { 960 idhdl h=(idhdl)data; 961 return ((idhdl)h->data.ustring)->data.ustring; 962 } 952 963 if ((rtyp!=IDHDL) && iiCheckRing(rtyp)) 953 964 return NULL; … … 1453 1464 return; 1454 1465 id_found: // we have an id (in h) found, to set the data in from h 1455 v->rtyp = IDHDL; 1466 if (IDTYP(h)!=ALIAS_CMD) 1467 { 1468 v->rtyp = IDHDL; 1469 v->flag = IDFLAG(h); 1470 v->attribute=IDATTR(h); 1471 } 1472 else 1473 { 1474 v->rtyp = ALIAS_CMD; 1475 } 1476 v->name = IDID(h); 1456 1477 v->data = (char *)h; 1457 v->flag = IDFLAG(h);1458 v->name = IDID(h);1459 v->attribute=IDATTR(h);1460 1478 currRingHdl=save_ring; 1461 1479 }
Note: See TracChangeset
for help on using the changeset viewer.