Changeset d108507 in tol
- Timestamp:
- Jan 2, 2010, 4:22:40 PM (17 years ago)
- Branches:
- 1941-docker-image-to-test, devel, master
- Children:
- f9b4992
- Parents:
- 7618682
- File:
-
- 1 edited
-
tol/btol/bgrammar/class.cpp (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
tol/btol/bgrammar/class.cpp
r7618682 rd108507 352 352 isStatic_ = true; 353 353 } 354 if(!static_ && isStatic_ && definition_.HasName())354 if(!static_ && isStatic_) 355 355 { 356 356 BClass* cls = (BClass*)parent_; 357 BGrammar::IncLevel(); 358 int stackPos = BGrammar::StackSize(); 359 const BClass* oldStaticOwner = BClass::currentStatic_; 360 BClass::currentStatic_ = cls; 361 BSyntaxObject* obj = GraAnything()->EvaluateTree(branch_); 362 BClass::currentStatic_ = oldStaticOwner; 363 BGrammar::DestroyStackUntil(stackPos, obj); 364 BGrammar::DecLevel(); 365 if(obj) 366 { 367 static_ = obj; 368 if(isMethod_) 369 { 370 if(obj->Mode()==BOBJECTMODE) 357 if(!definition_.HasName()) 358 { 359 Error(I2("Cannot declare an Static element without definig it " 360 "inline", 361 "No se puede declarar un elemento estático sin " 362 "definirlo en línea")+":\n"+ 363 " Static "+BParser::Unparse(branch_,"","\n")+ 364 I2(" of Class ", "de Class ")+parent_->getName()); 365 return(0); 366 } 367 else 368 { 369 BGrammar::IncLevel(); 370 int stackPos = BGrammar::StackSize(); 371 const BClass* oldStaticOwner = BClass::currentStatic_; 372 BClass::currentStatic_ = cls; 373 BSyntaxObject* obj = GraAnything()->EvaluateTree(branch_); 374 BClass::currentStatic_ = oldStaticOwner; 375 BGrammar::DestroyStackUntil(stackPos, obj); 376 BGrammar::DecLevel(); 377 if(obj) 378 { 379 static_ = obj; 380 if(isMethod_) 371 381 { 372 obj = UCode(obj)->Contens().Operator(); 382 if(obj->Mode()==BOBJECTMODE) 383 { 384 obj = UCode(obj)->Contens().Operator(); 385 } 386 ((BUserFunction*)obj)->staticOwner_=(const BClass*)parent_; 373 387 } 374 ((BUserFunction*)obj)->staticOwner_=(const BClass*)parent_; 375 } 376 static_->IncNRefs(); 377 return(1); 378 } 379 else 380 { 381 isGood_ = false; 382 Error(I2("Wrong syntax in static declaration ", 383 "Sintaxis incorrecta en declaración estática ")+ 384 "static "+BParser::Unparse(branch_,"","\n")+ 385 I2(" of Class ", "de Class ")+parent_->getName()); 386 return(0); 388 static_->IncNRefs(); 389 return(1); 390 } 391 else 392 { 393 isGood_ = false; 394 Error(I2("Wrong syntax in static declaration ", 395 "Sintaxis incorrecta en declaración estática ")+ 396 "Static "+BParser::Unparse(branch_,"","\n")+ 397 I2(" of Class ", "de Class ")+parent_->getName()); 398 return(0); 399 } 387 400 } 388 401 } … … 1457 1470 checkNonPrivate(this, methodName, fullAccess)) 1458 1471 { 1459 result = mbr->static_; 1460 result->PutNameBlock(NULL); 1472 if(result = mbr->static_) { result->PutNameBlock(NULL); } 1461 1473 } 1462 1474 return(result); … … 1472 1484 checkNonPrivate(this, memberName, fullAccess)) 1473 1485 { 1474 result = mbr->static_; 1475 result->PutNameBlock(NULL); 1486 if(result = mbr->static_) { result->PutNameBlock(NULL); } 1476 1487 } 1477 1488 return(result); … … 1486 1497 if(mbr && mbr->isStatic_ && checkNonPrivate(this, methodName, fullAccess)) 1487 1498 { 1488 result = mbr->static_; 1489 result->PutNameBlock(NULL); 1499 if(result = mbr->static_) { result->PutNameBlock(NULL); } 1490 1500 } 1491 1501 return(result);
Note: See TracChangeset
for help on using the changeset viewer.
