From: <ka...@us...> - 2012-08-09 18:59:00
|
Revision: 13576 http://swig.svn.sourceforge.net/swig/?rev=13576&view=rev Author: kabbi Date: 2012-08-09 18:58:53 +0000 (Thu, 09 Aug 2012) Log Message: ----------- Made comment output nicer, now printing _someword_ instead of _someword _ Modified Paths: -------------- branches/gsoc2012-doxygen/Source/DoxygenTranslator/src/JavaDocConverter.cpp branches/gsoc2012-doxygen/Source/DoxygenTranslator/src/PyDocConverter.cpp Modified: branches/gsoc2012-doxygen/Source/DoxygenTranslator/src/JavaDocConverter.cpp =================================================================== --- branches/gsoc2012-doxygen/Source/DoxygenTranslator/src/JavaDocConverter.cpp 2012-08-09 17:43:28 UTC (rev 13575) +++ branches/gsoc2012-doxygen/Source/DoxygenTranslator/src/JavaDocConverter.cpp 2012-08-09 18:58:53 UTC (rev 13576) @@ -199,8 +199,15 @@ } void JavaDocConverter::handleTagHtml(DoxygenEntity& tag, std::string& translatedComment, std::string &arg) { - if (tag.entityList.size()) // do not include empty tags - translatedComment += "<" + arg + ">" + translateSubtree(tag) + "</" + arg + ">"; + if (tag.entityList.size()) { // do not include empty tags + std::string tagData = translateSubtree(tag); + // wrap the thing, ignoring whitespaces + size_t wsPos = tagData.find_last_not_of("\n\t "); + if (wsPos != std::string::npos) + translatedComment += "<" + arg + ">" + tagData.substr(0, wsPos + 1) + "</" + arg + ">" + tagData.substr(wsPos + 1); + else + translatedComment += "<" + arg + ">" + translateSubtree(tag) + "</" + arg + "> "; + } } void JavaDocConverter::handleNewLine(DoxygenEntity&, std::string& translatedComment, std::string&) { translatedComment += "\n * "; @@ -434,6 +441,13 @@ std::string javaDocString = "/**\n * "; + // strip endlines at the beginning + while (entityList.begin()->typeOfEntity == "plainstd::endl") + entityList.pop_front(); + // and at the end + while (entityList.rbegin()->typeOfEntity == "plainstd::endl") + entityList.pop_back(); + // store the current node // (currently just to handle params) currentNode = node; Modified: branches/gsoc2012-doxygen/Source/DoxygenTranslator/src/PyDocConverter.cpp =================================================================== --- branches/gsoc2012-doxygen/Source/DoxygenTranslator/src/PyDocConverter.cpp 2012-08-09 17:43:28 UTC (rev 13575) +++ branches/gsoc2012-doxygen/Source/DoxygenTranslator/src/PyDocConverter.cpp 2012-08-09 18:58:53 UTC (rev 13576) @@ -227,8 +227,15 @@ translatedComment += paramNameEntity.data + " (" + paramType + ")" + paramDescription; } void PyDocConverter::handleTagWrap(DoxygenEntity& tag, std::string& translatedComment, std::string &arg) { - if (tag.entityList.size()) // do not include empty tags - translatedComment += arg + translateSubtree(tag) + arg; + if (tag.entityList.size()) { // do not include empty tags + std::string tagData = translateSubtree(tag); + // wrap the thing, ignoring whitespaces + int wsPos = tagData.find_last_not_of("\n\t "); + if (wsPos != std::string::npos) + translatedComment += arg + tagData.substr(0, wsPos + 1) + arg + tagData.substr(wsPos + 1); + else + translatedComment += arg + tagData + arg + " "; + } } void PyDocConverter::handleNewLine(DoxygenEntity&, std::string& translatedComment, std::string&) { translatedComment += "\n"; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |