From b3f53b98a079ee006a2a95c82d2b853fa413627d Mon Sep 17 00:00:00 2001 From: Dmitry Kabak Date: Sat, 7 Jul 2012 18:48:10 +0000 Subject: [PATCH] Added error reporting in case when there is no closing doxygen tag git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/gsoc2012-doxygen@13266 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- Source/DoxygenTranslator/src/DoxygenParser.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Source/DoxygenTranslator/src/DoxygenParser.cpp b/Source/DoxygenTranslator/src/DoxygenParser.cpp index 238a6c75b..623d37658 100644 --- a/Source/DoxygenTranslator/src/DoxygenParser.cpp +++ b/Source/DoxygenTranslator/src/DoxygenParser.cpp @@ -156,13 +156,17 @@ std::string DoxygenParser::getStringTilEndCommand(std::string theCommand, TokenL std::string description; if (tokList.peek().tokenType == 0) return ""; - while (tokList.current() != tokList.end() - && tokList.next().tokenString.compare(theCommand) != 0) { + while (tokList.next().tokenString.compare(theCommand) != 0) { //TODO: it won't output doxygen commands, need a way to fix it if (tokList.peek().tokenType == PLAINSTRING) description += tokList.peek().tokenString + " "; if (tokList.peek().tokenType == END_LINE) description += "\n"; + + if (tokList.current() == tokList.end()) { + cout << "Error, @" << theCommand << " command expected." << endl; + break; + } } tokList.next(); // eat the end command itself return description;