From 5ec66c2286d7cedbdbb0930fe0e293b050c91d24 Mon Sep 17 00:00:00 2001 From: wtschueller Date: Sat, 28 Jun 2014 22:02:27 +0200 Subject: Bug 705503 - TCL: Documentation of oo::define is not working --- src/tclscanner.l | 57 +++++++++++++++++++++++++++++++++---- testing/061/class_test.xml | 70 ++++++++++++++++++++++++++++++++++++++++++++++ testing/061_bug_705503.tcl | 19 +++++++++++++ 3 files changed, 141 insertions(+), 5 deletions(-) create mode 100644 testing/061/class_test.xml create mode 100644 testing/061_bug_705503.tcl diff --git a/src/tclscanner.l b/src/tclscanner.l index 48e8214..eb6ee3b 100644 --- a/src/tclscanner.l +++ b/src/tclscanner.l @@ -2195,15 +2195,62 @@ D } myEntryCl = tcl_entry_class(myName); myStr = (*tcl.list_commandwords.at(4)).utf8(); - if (tcl.list_commandwords.count() > 5) + // + // special cases first + // oo::define classname method methodname args script + // oo::define classname constructor argList bodyScript + // oo::define classname destructor bodyScript + unsigned int n =tcl.list_commandwords.count(); + if ((myStr == "method" && n == 11) || + (myStr == "constructor" && n == 9) || + (myStr == "destructor" && n == 7)) + { + for (unsigned int i = 4; i < n-1; i++) + { + tcl_codify_cmd("NULL",i); + } + Entry *myEntry; + QCString myMethod; + tcl_name(myScan->ns,(*tcl.list_commandwords.at(n==11?6:4)).utf8(),myNs,myMethod); + // code snippet taken from tcl_command_METHOD()/tcl_command_CONSTRUCTOR + tcl.fn.remove(myMethod); + tcl.entry_current->section = Entry::FUNCTION_SEC; + tcl.entry_current->mtype = Method; + tcl.entry_current->name = myMethod; + tcl.entry_current->startLine = tcl.line_command; + tcl.entry_current->bodyLine = tcl.line_body0; + tcl.entry_current->endBodyLine = tcl.line_body1; + tcl_protection(tcl.entry_current); + if (n==11) + { + tcl_command_ARGLIST(*tcl.list_commandwords.at(8)); + } + else if (n==9) + { + tcl_command_ARGLIST(*tcl.list_commandwords.at(6)); + } + if (myEntryCl) myEntryCl->addSubEntry(tcl.entry_current); + tcl.fn.insert(myMethod,tcl.entry_current); + myEntry = tcl.entry_current; + myScan = tcl_scan_start('?',*tcl.list_commandwords.at(n-1), + myNs, myEntryCl, myEntry); + } + else { - for (uint i=5;i 5) { - myStr.append((*tcl.list_commandwords.at(i)).utf8()); + for (uint i=5;i + + + Test + + + + Test::testmethod_one + args + testmethod_one + + Test method 1. + + + + + + + + + + Test::constructor + args + constructor + + Construction of class. + + + + + + + + + + Test::testmethod_two + args + testmethod_two + + Test method 2. + + + + + + + + + + Testclass. + + + + + + + Test + constructor + + + Test + testmethod_one + + + Test + testmethod_two + + + + diff --git a/testing/061_bug_705503.tcl b/testing/061_bug_705503.tcl new file mode 100644 index 0000000..ce25d6e --- /dev/null +++ b/testing/061_bug_705503.tcl @@ -0,0 +1,19 @@ +#// objective: test for bug 705503 - TCL: Documentation of oo::define is not working +#// check: class_test.xml +#// config: EXTRACT_ALL = yes + +# taken from +# https://bugzilla.gnome.org/show_bug.cgi?id=705503 + +## @class Test +# @brief Testclass +oo::class create Test { + ## @brief Test method 1. + method testmethod_one args {} +} + +## @brief Construction of class +oo::define Test constructor args {} + +## @brief Test method 2 +oo::define Test method testmethod_two args {} -- cgit v0.12