Changeset 194e48b in tol
- Timestamp:
- Apr 27, 2011, 5:28:04 PM (15 years ago)
- Branches:
- 1941-docker-image-to-test, devel, master
- Children:
- a5bc35a
- Parents:
- 13977f3
- File:
-
- 1 edited
-
tol/btol/bgrammar/spfuninst.cpp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
tol/btol/bgrammar/spfuninst.cpp
r13977f3 r194e48b 986 986 { 987 987 static BText _name_ = "PutDescription"; 988 static BText third_arg_error = 989 I2("Optional third argument of PutDescription must be the name of a member " 990 "of the class specified in second one", 991 "El tercer argumento opcional de PutDescription debe ser el nombre de " 992 "un miembro de la clase especificada en el segundo argumento"); 993 988 994 //if(CheckNonDeclarativeAction(_name_)) { return(NULL); } 989 995 BInt nb = BSpecialFunction::NumBranches(tre); 990 if(BSpecialFunction::TestNumArg(_name_, 2, nb, 2))996 if(BSpecialFunction::TestNumArg(_name_, 2, nb, 3)) 991 997 { 992 998 BSyntaxObject* desObj = GraText ()->EvaluateTree(Branch(tre,1)); 999 if(!desObj) { return(NULL); } 1000 BText desc = Text(desObj); 993 1001 BGrammar::PutLast(gra); 994 1002 BText tokenName = BParser::treToken(Branch(tre,2))->Name(); … … 998 1006 tokenName = tokenName.SubString(1,tokenName.Length()); 999 1007 obj = FindStruct(tokenName); 1008 if(obj && nb==3) 1009 { 1010 Error(third_arg_error); 1011 } 1000 1012 if(!obj) 1001 1013 { 1002 1014 obj = FindClass(tokenName,-1); 1003 } 1015 if(obj && nb==3) 1016 { 1017 BText memberName = BParser::treToken(Branch(tre,3))->Name(); 1018 if(memberName[0]=='\"') 1019 { 1020 memberName = memberName.SubString(1,memberName.Length()); 1021 BClass* cls = (BClass*)obj; 1022 BMember* mbr = cls->FindMember(memberName); 1023 if(!mbr) 1024 { 1025 Error(third_arg_error); 1026 } 1027 else 1028 { 1029 BSyntaxObject* adoc = cls->FindStaticMember(BText("_.autodoc.member.")+memberName, false); 1030 if(adoc) { Text(adoc)=desc; } 1031 if(mbr->method_) { obj=mbr->method_; } 1032 else if(mbr->static_) { obj=mbr->static_; } 1033 } 1034 } 1035 else 1036 { 1037 Error(third_arg_error); 1038 } 1039 } 1040 } 1041 } 1042 else if (nb==3) 1043 { 1044 Error(third_arg_error); 1004 1045 } 1005 1046 if(!obj) … … 1008 1049 }; 1009 1050 BGrammar::PutLast(gra); 1010 if(desObj && obj) 1011 { 1012 BText desc = Text(desObj); 1051 if(obj) 1052 { 1013 1053 obj->PutDescription(desc); 1014 1054 if(obj->Grammar()==GraCode())
Note: See TracChangeset
for help on using the changeset viewer.
