Changeset dea29fb in tol


Ignore:
Timestamp:
Dec 10, 2009, 11:00:45 AM (17 years ago)
Author:
Víctor de Buen <vdebuen@…>
Branches:
1941-docker-image-to-test, devel, master
Children:
2adcbae
Parents:
2fb8329
Message:

Relates to #795

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

Location:
tol/btol/bgrammar
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • tol/btol/bgrammar/class.cpp

    r2fb8329 rdea29fb  
    229229  {
    230230    isGood_ = false;
    231     Error(I2("Wrong syntax in member declaration ",
    232              "Sintaxis incorrecta en declaración de miembro ")+
     231    Error(I2("Wrong syntax in member declaration \n",
     232             "Sintaxis incorrecta en declaración de miembro \n")+
    233233          BParser::Unparse(branch_,"","\n")+
    234234          I2(" of Class ", " de Class ")+parent->getName());
    235235  }
     236  if(isGood_ && declaration_.BeginWith("Code") && !isMethod_)
     237  {
     238    Warning(I2("Potential failure due to a non standard use of OOP:\n"
     239               "A class should have no members of type Code as \n",
     240               "Error potencial debido a un uso no estándar de OOP:\n"
     241               "Una clase no debería tener miembros de tipo Code como \n")+
     242            BParser::Unparse(branch_,"","\n")+
     243            I2(" of Class ", " de Class ")+parent->getName());
     244  }
    236245  if(parent->OwnerType()==BMemberOwner::BCLASS)
    237246  {
    … …  
    240249  }
    241250}
    242 
    243251
    244252//--------------------------------------------------------------------
    … …  
    295303      method_ = obj;
    296304      method_->IncNRefs();
     305      method_->PutMethod();
     306      BUserCode* uCode = UCode(method_);
     307      uCode->Contens().Operator()->PutMethod();
    297308      return(1);
    298309    }
    … …  
    906917  if(!ok)
    907918  {
    908     Error(I2("Wrong syntax on member area of Class declaration",
     919    Error(I2("Wrong syntax on member area of declaration ",
    909920             "Sintaxis errónea en el área de de miembros de "
    910              "declaración de Class")+ getDump());
     921             "declaración de ")+ getDump());
    911922  }
    912923  isGood_ = ok;
  • tol/btol/bgrammar/nameblock.cpp

    r2fb8329 rdea29fb  
    167167//--------------------------------------------------------------------
    168168{
     169  int n;
    169170  owner_ = NULL;
     171  for(n=1; n<=set_.Card(); n++)
     172        {
     173    set_[n]->PutNameBlock(NULL);
     174  }
    170175  public_.clear();
    171176  private_.clear();
    … …  
    683688  if((nonPrivateMembers_==0)&&!class_)
    684689  {
    685     Warning(I2("A NameBlock should have at least a public or read only member.",
    686                "Un NameBlock debería tener al menos un miembro público o de sólo lectura."));
     690    Warning(BText("NameBlock ")+Name()+" "+
     691            I2("should have at least a public or read only member.",
     692               "debería tener al menos un miembro público o de sólo lectura."));
    687693    return(false);
    688694  }
  • tol/btol/bgrammar/oprimp.cpp

    r2fb8329 rdea29fb  
    16321632  if(arglistOK)
    16331633  {
     1634    const BClass* oldStaticOwner = BClass::currentStatic_;
    16341635    const BNameBlock* oldNameBlock = BNameBlock::Current();
    16351636    const BNameBlock* funNameBlock = NameBlock();
    1636     const BClass* oldStaticOwner = BClass::currentStatic_;
     1637    if(funNameBlock && funNameBlock->Class() && !IsMethod())
     1638    {
     1639      funNameBlock = NULL;
     1640    }
     1641    if(funNameBlock && !funNameBlock->EnsureIsAssigned())
     1642    {
     1643      if(!funNameBlock->Class())
     1644      {
     1645        Error(BText("Corrupted method ")+Identify()+"\n"
     1646          "Possibly this problem is due to a non standard use of OOP, if "
     1647          "this function was assigned to a member of type Code of a "
     1648          "NameBlock or Class instance that has been destroyed already.");
     1649      }
     1650      funNameBlock = NULL;
     1651    }
    16371652    if(funNameBlock)
    16381653    {
  • tol/btol/bgrammar/syn.cpp

    r2fb8329 rdea29fb  
    176176  PutSystem(!TOLHasBeenInitialized());
    177177  flags_.isConst_= false;
     178  flags_.isMethod_ = false;
    178179  if(flags_.system_) { IncNRefs(); IncNRefs(); IncNRefs(); }
    179180  TRACE_MEMORY_SHOW(this, "BSyntaxObject::InitSynObj");
  • tol/btol/bgrammar/tol_bsyntax.h

    r2fb8329 rdea29fb  
    118118    bool isDeadObj_   :1; //!< Indicates if object is a false or dead object
    119119    bool isConst_     :1; //!< Indicates if object value is constant or variable
     120    bool isMethod_    :1; //!< Indicates if object is a method of a class
    120121  } flags_;
    121122
    … …  
    200201  bool                 IsDeadObj   () const { return(flags_.isDeadObj_); }
    201202  bool                 IsConstant  () const { return(flags_.isConst_); }
     203  bool                 IsMethod    () const { return(flags_.isMethod_); }
    202204  int            Ems         () const { return(ems_); }
    203205
    … …  
    212214  void PutReleased()           { flags_.released_ = true; }
    213215  void PutConstant()           { flags_.isConst_  = true; }
     216  void PutMethod()             { flags_.isMethod_  = true; }
    214217  void PutEms     (int ems)    { ems_ = ems; }
    215218
Note: See TracChangeset for help on using the changeset viewer.