Changeset a67249e in tol


Ignore:
Timestamp:
Oct 19, 2015, 3:51:37 PM (11 years ago)
Author:
Jorge Pérez <josp.jorge@…>
Branches:
1941-docker-image-to-test, devel, master
Children:
bb5bbac
Parents:
b567d4c
Message:

fixes #1884, un campo con tipo Anything admite cualquier valor

git-svn-id: ​https://www.tol-project.org/svn/tolp/trunk@6959 be4846ae-f051-483a-831f-b64e7d08527f

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tol/btol/set_type/set.cpp

    rb567d4c ra67249e  
    327327{
    328328  if(arg && str)
    329   {
     329    {
    330330    BList* argLst = arg;
    331331    BList* lst    = NIL;
    332332    BList* aux    = NIL;
    333333    for(BInt n=0; (n<str->Size()); n++)
    334     {
     334      {
    335335//    Std(BText("\nRobStruct Field ")+n+" "+(*str)[n].Name()+" -> ");
    336336      if(argLst)
     337        {
     338        BSyntaxObject* obj = (BSyntaxObject*)Car(argLst);
     339        BText name = obj->Name();
     340        BText desc = obj->Description();
     341        BGrammar * gra_n = (*str)[n].Grammar();
     342        if( gra_n != GraAnything() &&
     343            gra_n !=obj->Grammar() )
     344          {
     345          BText id = name;
     346          if(!id.HasName()) { id = obj->Dump(); }
     347          if(!id.HasName()) { id = desc; }
     348          Error(id + I2(" is not an object of type ",
     349                        " no es un objeto de tipo ") +
     350                (*str)[n].Grammar()->Name()+ ".\n "+
     351                I2("Cannot create field ","No se puede crear el campo")+
     352                (*str)[n].Name()+
     353                I2(" of structure "," de la estructura ")+str->Name());
     354          }
     355        LstFastAppend(lst,aux,obj);
     356        argLst = Cdr(argLst);
     357        }
     358      else
     359        {
     360        Error(I2("Too few parameters to create a set with structure ",
     361                 "Faltan argumentos para crear un conjunto con estructura ")+
     362              str->Name());
     363        }
     364    }
     365    if(argLst)
    337366      {
    338               BSyntaxObject* obj = (BSyntaxObject*)Car(argLst);
    339               BText name = obj->Name();
    340               BText desc = obj->Description();
    341               if((*str)[n].Grammar()!=obj->Grammar())
    342               {
    343                 BText id = name;
    344                 if(!id.HasName()) { id = obj->Dump(); }
    345                 if(!id.HasName()) { id = desc; }
    346                 Error(id + I2(" is not an object of type ",
    347                                           " no es un objeto de tipo ") +
    348                            (*str)[n].Grammar()->Name()+ ".\n "+
    349                            I2("Cannot create field ","No se puede crear el campo")+
    350                               (*str)[n].Name()+
    351                            I2(" of structure "," de la estructura ")+str->Name());
    352               }
    353         LstFastAppend(lst,aux,obj);
    354               argLst = Cdr(argLst);
     367      Error(I2("Too mach parameters to create a set with structure ",
     368               "Sobran argumentos para crear un conjunto con estructura ")+
     369            str->Name());
    355370      }
    356       else
    357       {
    358               Error(I2("Too few parameters to create a set with structure ",
    359                              "Faltan argumentos para crear un conjunto con estructura ")+
    360                     str->Name());
    361       }
    362     }
    363     if(argLst)
    364     {
    365             Error(I2("Too mach parameters to create a set with structure ",
    366                            "Sobran argumentos para crear un conjunto con estructura ")+
    367                   str->Name());
    368     }
    369371    DESTROY(arg);
    370372    RobElement(lst);
    … …  
    373375  }
    374376  else
    375   {
     377    {
    376378    RobElement(arg);
    377379    PutSubType(sub);
    378   }
     380    }
    379381}
    380382
Note: See TracChangeset for help on using the changeset viewer.