Changeset 589249e in tol
- Timestamp:
- Apr 3, 2009, 5:27:39 PM (18 years ago)
- Branches:
- 1941-docker-image-to-test, devel, master
- Children:
- e0792b1
- Parents:
- 299cfe9
- Location:
- tol
- Files:
-
- 5 edited
-
bparser/par.cpp (modified) (1 diff)
-
btol/bgrammar/class.cpp (modified) (1 diff)
-
btol/bgrammar/graimp.cpp (modified) (3 diffs)
-
btol/bgrammar/nameblock.cpp (modified) (2 diffs)
-
btol/bgrammar/oprimp.cpp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
tol/bparser/par.cpp
r299cfe9 r589249e 894 894 else 895 895 { 896 897 896 if(NextSymbol()->Name()==";") 898 897 { -
tol/btol/bgrammar/class.cpp
r299cfe9 r589249e 80 80 if(expression[0]=='[') 81 81 { 82 expression = expression.SubString(2,expression.Length()- 4);82 expression = expression.SubString(2,expression.Length()-3); 83 83 } 84 84 else if(expression[0]=='{') -
tol/btol/bgrammar/graimp.cpp
r299cfe9 r589249e 540 540 //-------------------------------------------------------------------- 541 541 { 542 static BEqualOperator* BNameBlock_BEqualOperator = 543 (BEqualOperator*)GraNameBlock()->FindOperator("="); 542 544 static BText none; 543 545 eval_depth_t eval_depth_helper; 544 546 bool error = false; 545 547 BGrammar* newGrammar = NIL; 548 BClass* newClass = NIL; 546 549 BBool enableCasting=BTRUE; 547 550 bool isCreatingNameBlock = BEqualOperator::IsCreatingNameBlock(); … … 574 577 int stackPos = -1; 575 578 576 if((this==GraNameBlock()) && (name=="SetOfAnything")) 579 if((this==GraNameBlock()) && 580 ((name=="SetOfAnything")||(name=="#DefaultInstance"))) 577 581 { 578 582 return(BNameBlock::EvaluateTree(tre)); … … 669 673 } 670 674 } 675 else if((type == TYPE) && (newClass=FindClass(name))) 676 { 677 result = BNameBlock_BEqualOperator->Evaluate(tre); 678 } 671 679 else if (type == BINARY && this == GraAnything() && 672 680 name != "=" && name != "#F#" && -
tol/btol/bgrammar/nameblock.cpp
r299cfe9 r589249e 261 261 { 262 262 int n; 263 BToken* tok = (BToken*)_tre->car(); 264 bool isDefaultInstance = tok->Name()=="#DefaultInstance"; 263 265 BText name = BEqualOperator::CreatingName(); 264 266 BText fullName = BEqualOperator::CurrentFullName(); … … 316 318 else 317 319 { 318 List* tre = _tre->duplicate(); 320 List* tre = NULL; 321 if(!isDefaultInstance) { tre = _tre->duplicate(); } 319 322 newNameBlock.PutTree(tre); 323 newNameBlock.CreateParentHashes(); 324 newNameBlock.CreateMemberHashes(); 320 325 newNameBlock.AddParent((BClass*)cls); 321 newNameBlock.AddMemberList(tre->cdr()); 326 if(!isDefaultInstance) { 327 //Std(BText("BNameBlock::EvaluateTree:\n")+BParser::treWrite((List*)tre," ")); 328 newNameBlock.AddMemberList(tre->cdr()); 329 } 322 330 newNameBlock.SortMembers(); 323 331 int stackPos = BGrammar::StackSize(); 324 325 332 326 333 if(newNameBlock.isGood_ && newNameBlock.mbrDecHash_->size()) -
tol/btol/bgrammar/oprimp.cpp
r299cfe9 r589249e 811 811 BStruct* str = NULL; 812 812 BClass* cls = NULL; 813 BGrammar* gra = GetLeft(Grammar(), 814 Tree::treNode((List*) argList), 815 name, rest, str, cls); 813 814 bool carIsList = argList->car()->IsListClass(); 815 List* dec = carIsList?Tree::treNode((List*) argList):(List*)argList; 816 BGrammar* gra = GetLeft(Grammar(), dec, name, rest, str, cls); 817 List* left = NULL; 818 bool defInst = false; 819 if(!carIsList && cls && !rest) 820 { 821 defInst = true; 822 BToken* tok = new BToken("#DefaultInstance",ARGUMENT); 823 left = new List(tok, NIL); 824 } 825 else 826 { 827 left = Tree::treLeft((List*)argList); 828 } 816 829 creatingClass_ = NULL; 817 830 bool oldIsCreatingNameBlock = isCreatingNameBlock_; … … 840 853 if(!rest && gra) 841 854 { 842 result = CreateObject(Tree::treLeft((List*)argList), gra, name); 855 if(defInst) 856 { 857 result = CreateObject(left, gra, name); 858 } 859 else 860 { 861 result = CreateObject(left, gra, name); 862 } 843 863 if(str && result) 844 864 { … … 871 891 creatingClass_ = oldClass; 872 892 isCreatingNameBlock_ = oldIsCreatingNameBlock; 893 } 894 if(defInst) 895 { 896 DESTROY(left); 873 897 } 874 898 return(result);
Note: See TracChangeset
for help on using the changeset viewer.
