Changeset c5f245d in tol


Ignore:
Timestamp:
Mar 3, 2009, 9:44:32 AM (18 years ago)
Author:
Víctor de Buen <vdebuen@…>
Branches:
1941-docker-image-to-test, devel, master
Children:
936e243
Parents:
46c93bf
Message:

Separating NameBlock father from current that is used for scope rules.
Themes related to father and full name are now solved in operator = (BEqualOperator::Evaluate)

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

File:
1 edited

Legend:

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

    r46c93bf rc5f245d  
    5151BTraceInit("oprimp.cpp");
    5252
    53       BText   BEqualOperator::creatingName_;
     53BText BEqualOperator::creatingName_;
     54BText BEqualOperator::currentFatherName_;
     55bool   BEqualOperator::isCreatingNameBlock_= false;
     56BText BEqualOperator::currentFullName_;
    5457const BClass* BEqualOperator::creatingClass_ = NULL;
    5558
    … …  
    812815                          name, rest, str, cls);
    813816  creatingClass_ = NULL;
    814   if(gra==GraNameBlock())
     817  bool oldIsCreatingNameBlock = isCreatingNameBlock_;
     818  bool isNameBlock = gra==GraNameBlock();
     819  isCreatingNameBlock_ = isNameBlock;
     820
     821  BText oldName, oldFullName;
     822  const BClass* oldClass;
     823  if(isNameBlock)
    815824  {
     825    oldFullName = currentFullName_;
     826    currentFatherName_ = oldFullName;
     827    oldName = creatingName_;
     828    oldClass = creatingClass_;
    816829    creatingName_  = name;
     830    if(currentFullName_.HasName())
     831    {
     832      currentFullName_ = currentFullName_ + "::" +name;
     833    }
     834    else
     835    {
     836      currentFullName_ = name;
     837    }
    817838    creatingClass_ = cls;
    818839  }
    … …  
    843864          Error(I2("Bad use for \"=\" in\n", "Uso indebido de \"=\" en\n") +
    844865                BParser::Unparse(argList));
     866  }
     867  if(isNameBlock)
     868  {
     869    currentFullName_ = currentFatherName_;
     870    creatingName_    = oldName;
     871    creatingClass_   = oldClass;
     872    isCreatingNameBlock_ = oldIsCreatingNameBlock;
    845873  }
    846874  return(result);
Note: See TracChangeset for help on using the changeset viewer.