Changeset 7b156fb in git


Ignore:
Timestamp:
Jun 25, 2012, 4:50:18 PM (12 years ago)
Author:
Alexander Dreyer <alexander.dreyer@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
c0d2927a1a24fcd6c526178afeb42e5089c5d04b
Parents:
1161a6145a6ca3b9034865b05528815c65f55cfb
git-author:
Alexander Dreyer <alexander.dreyer@itwm.fraunhofer.de>2012-06-25 16:50:18+02:00
git-committer:
Alexander Dreyer <alexander.dreyer@itwm.fraunhofer.de>2012-08-01 23:07:59+02:00
Message:
new: allow customly constructed newstructs by overiding '='
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Singular/newstruct.cc

    r1161a61 r7b156fb  
    188188      }
    189189      return FALSE;
     190    }
     191  }
     192
     193  else if(l->Typ() > MAX_TOK)
     194  {
     195    blackbox *ll=getBlackboxStuff(l->Typ());
     196    newstruct_desc nt=(newstruct_desc)ll->data;
     197    newstruct_proc p=nt->procs;
     198
     199    while( (p!=NULL) && ((p->t!='=')||(p->args!=1)) ) p=p->next;
     200
     201    if (p!=NULL)
     202    {
     203      idrec hh;
     204      memset(&hh,0,sizeof(hh));
     205      hh.id=Tok2Cmdname(p->t);
     206      hh.typ=PROC_CMD;
     207      hh.data.pinf=p->p;
     208      sleftv tmp;
     209      memset(&tmp,0,sizeof(sleftv));
     210      tmp.Copy(r);
     211      leftv sl = iiMake_proc(&hh, NULL, &tmp);
     212      if (sl != NULL)
     213      {
     214        if (sl->Typ()==l->Typ()) return newstruct_Assign(l, sl);
     215        else sl->CleanUp();     // @todo Is this enough to kill 'sh`?
     216      }
    190217    }
    191218  }
Note: See TracChangeset for help on using the changeset viewer.