MCPcopy Create free account
hub / github.com/Singular/Singular / newstruct_Assign_user

Function newstruct_Assign_user

Singular/newstruct.cc:182–215  ·  view source on GitHub ↗

Used by newstruct_Assign for overloaded '='

Source from the content-addressed store, hash-verified

180
181// Used by newstruct_Assign for overloaded '='
182BOOLEAN newstruct_Assign_user(int op, leftv l, leftv r)
183{
184 blackbox *ll=getBlackboxStuff(op);
185 assume(ll->data != NULL);
186 newstruct_desc nt=(newstruct_desc)ll->data;
187 newstruct_proc p=nt->procs;
188
189 while( (p!=NULL) && ((p->t!='=')||(p->args!=1)) ) p=p->next;
190
191 if (p!=NULL)
192 {
193 BOOLEAN sl;
194 idrec hh;
195 hh.Init();
196 hh.id=Tok2Cmdname(p->t);
197 hh.typ=PROC_CMD;
198 hh.data.pinf=p->p;
199 sleftv tmp;
200 tmp.Copy(r);
201 sl = iiMake_proc(&hh, NULL, &tmp);
202 if (!sl)
203 {
204 if (iiRETURNEXPR.Typ() == op)
205 {
206 memcpy(l,&iiRETURNEXPR,sizeof(sleftv));
207 iiRETURNEXPR.Init();
208 return FALSE;
209 }
210 iiRETURNEXPR.CleanUp();
211 iiRETURNEXPR.Init();
212 }
213 }
214 return TRUE;
215}
216
217void lClean_newstruct(lists l)
218{

Callers 2

newstruct_AssignFunction · 0.85
getMethod · 0.85

Calls 7

getBlackboxStuffFunction · 0.85
iiMake_procFunction · 0.85
CleanUpMethod · 0.80
Tok2CmdnameFunction · 0.70
InitMethod · 0.45
CopyMethod · 0.45
TypMethod · 0.45

Tested by

no test coverage detected