Changeset 42033f3 in tol


Ignore:
Timestamp:
Jan 21, 2009, 1:27:04 PM (18 years ago)
Author:
Víctor de Buen <vdebuen@…>
Branches:
1941-docker-image-to-test, devel, master
Children:
804f404
Parents:
a6201a5
Message:

fixing some problems in NameBlock

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

File:
1 edited

Legend:

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

    ra6201a5 r42033f3  
    109109  const BText& name = BEqualOperator::CreatingName();
    110110//Std(BText("BNameBlock::EvaluateTree:\n")+BParser::treWrite((List*)tre,"  "));
     111  BBool hasName = name.HasName();
    111112  BText fullName = name;
    112   if(BNameBlock::current_)
     113  if(BNameBlock::current_ && hasName)
    113114  {
    114115    fullName = BNameBlock::current_->Name()+"::"+name;
    … …  
    116117  BSyntaxObject* result = NULL;
    117118  int level = BGrammar::Level();
    118   if(level>0)
     119  if((level>0) && hasName)
    119120  {
    120121    result = BGrammar::FindLocal(name);
    … …  
    136137             " ya está siendo usado\n")+ ((!BNameBlock::current_)?"":
    137138          I2("Current NameBlock is ",
    138              "El NamSpace en curso es ")+BNameBlock::current_->Name()));
     139             "El NameBlock en curso es ")+BNameBlock::current_->Name()));
    139140    return(NULL);
    140141  }
    141  
    142   const BNameBlock* oldNameBlock = BNameBlock::current_;
     142//const BNameBlock* oldNameBlock = BNameBlock::current_;
    143143  BUserNameBlock* ns_result = new BGraContensP<BNameBlock>(new BNameBlock);
    144144  BNameBlock& newNameBlock  = ns_result->Contens();
    145145  newNameBlock.PutName(fullName);
    146   BNameBlock::current_ = &newNameBlock;
     146//BNameBlock::current_ = &newNameBlock;
    147147  int oldErr = (int)TOLErrorNumber().Value();
    148148  BGrammar::IncLevel();
    149149  int stackPos = BGrammar::StackSize();
    150150  BSyntaxObject* set_result = GraSet()->EvaluateTree(tre);
    151   BGrammar::DestroyStackUntil(stackPos, 0);
     151  BGrammar::DestroyStackUntil(stackPos, set_result);
    152152  BGrammar::DecLevel();
    153153  int numErr = (int)TOLErrorNumber().Value()-oldErr;
    … …  
    166166    }
    167167  }
    168   BNameBlock::current_ = oldNameBlock;
     168//BNameBlock::current_ = oldNameBlock;
    169169  if(!set_result)
    170170  {
Note: See TracChangeset for help on using the changeset viewer.