summaryrefslogtreecommitdiffstats
path: root/src/docparser.cpp
diff options
context:
space:
mode:
authorDimitri van Heesch <dimitri@stack.nl>2013-07-15 19:45:32 (GMT)
committerDimitri van Heesch <dimitri@stack.nl>2013-07-15 19:45:32 (GMT)
commita07d3d48b6191b3fa628315b27b1aae5368af2e6 (patch)
tree52192890cba92da8e7ea63753a0e691f5752d051 /src/docparser.cpp
parent84f83537818a26eac408a033beea8f5c6a4a2801 (diff)
downloadDoxygen-a07d3d48b6191b3fa628315b27b1aae5368af2e6.zip
Doxygen-a07d3d48b6191b3fa628315b27b1aae5368af2e6.tar.gz
Doxygen-a07d3d48b6191b3fa628315b27b1aae5368af2e6.tar.bz2
Improved handling of \internal and \endinternal
Diffstat (limited to 'src/docparser.cpp')
-rw-r--r--src/docparser.cpp52
1 files changed, 30 insertions, 22 deletions
diff --git a/src/docparser.cpp b/src/docparser.cpp
index 1860332..5259d46 100644
--- a/src/docparser.cpp
+++ b/src/docparser.cpp
@@ -3207,7 +3207,8 @@ int DocInternal::parse(int level)
retval!=RetVal_Section &&
retval!=RetVal_Subsection &&
retval!=RetVal_Subsubsection &&
- retval!=RetVal_Paragraph
+ retval!=RetVal_Paragraph &&
+ retval!=RetVal_EndInternal
);
if (lastPar) lastPar->markLast();
@@ -3229,7 +3230,7 @@ int DocInternal::parse(int level)
warn_doc_error(g_fileName,doctokenizerYYlineno,"\\internal command found inside internal section");
}
- DBG(("DocInternal::parse() end\n"));
+ DBG(("DocInternal::parse() end: retval=%x\n",retval));
DocNode *n=g_nodeStack.pop();
ASSERT(n==this);
return retval;
@@ -5563,6 +5564,9 @@ int DocPara::handleCommand(const QCString &cmdName)
case CMD_INTERNAL:
retval = RetVal_Internal;
break;
+ case CMD_ENDINTERNAL:
+ retval = RetVal_EndInternal;
+ break;
case CMD_COPYDOC: // fall through
case CMD_COPYBRIEF: // fall through
case CMD_COPYDETAILS:
@@ -5669,7 +5673,8 @@ int DocPara::handleCommand(const QCString &cmdName)
INTERNAL_ASSERT(retval==0 || retval==RetVal_OK || retval==RetVal_SimpleSec ||
retval==TK_LISTITEM || retval==TK_ENDLIST || retval==TK_NEWPARA ||
retval==RetVal_Section || retval==RetVal_EndList ||
- retval==RetVal_Internal || retval==RetVal_SwitchLang
+ retval==RetVal_Internal || retval==RetVal_SwitchLang ||
+ retval==RetVal_EndInternal
);
DBG(("handleCommand(%s) end retval=%x\n",qPrint(cmdName),retval));
return retval;
@@ -6618,12 +6623,22 @@ int DocSection::parse()
{
warn_doc_error(g_fileName,doctokenizerYYlineno,"Invalid list item found");
}
+ if (retval==RetVal_Internal)
+ {
+ DocInternal *in = new DocInternal(this);
+ m_children.append(in);
+ retval = in->parse(m_level+1);
+ if (retval==RetVal_EndInternal)
+ {
+ retval=RetVal_OK;
+ }
+ }
} while (retval!=0 &&
- retval!=RetVal_Internal &&
retval!=RetVal_Section &&
retval!=RetVal_Subsection &&
retval!=RetVal_Subsubsection &&
- retval!=RetVal_Paragraph
+ retval!=RetVal_Paragraph &&
+ retval!=RetVal_EndInternal
);
if (lastPar) lastPar->markLast();
@@ -6680,12 +6695,6 @@ int DocSection::parse()
retval=0; // stop parsing
}
- else if (retval==RetVal_Internal)
- {
- DocInternal *in = new DocInternal(this);
- m_children.append(in);
- retval = in->parse(m_level+1);
- }
else
{
}
@@ -6695,10 +6704,11 @@ int DocSection::parse()
retval==RetVal_Subsection ||
retval==RetVal_Subsubsection ||
retval==RetVal_Paragraph ||
- retval==RetVal_Internal
+ retval==RetVal_Internal ||
+ retval==RetVal_EndInternal
);
- DBG(("DocSection::parse() end\n"));
+ DBG(("DocSection::parse() end: retval=%x\n",retval));
DocNode *n = g_nodeStack.pop();
ASSERT(n==this);
return retval;
@@ -6834,7 +6844,13 @@ void DocRoot::parse()
{
warn_doc_error(g_fileName,doctokenizerYYlineno,"found paragraph command outside of subsubsection context!");
}
- } while (retval!=0 && retval!=RetVal_Section && retval!=RetVal_Internal);
+ if (retval==RetVal_Internal)
+ {
+ DocInternal *in = new DocInternal(this);
+ m_children.append(in);
+ retval = in->parse(1);
+ }
+ } while (retval!=0 && retval!=RetVal_Section);
if (lastPar) lastPar->markLast();
//printf("DocRoot::parse() retval=%d %d\n",retval,RetVal_Section);
@@ -6856,14 +6872,6 @@ void DocRoot::parse()
}
}
- if (retval==RetVal_Internal)
- {
- DocInternal *in = new DocInternal(this);
- m_children.append(in);
- retval = in->parse(1);
- }
-
-
handleUnclosedStyleCommands();
DocNode *n = g_nodeStack.pop();