5765{
5767 Token retval = Token::make_RetVal_OK();
5769
5770 if (!
m_id.isEmpty())
5771 {
5773 if (sec)
5774 {
5777 QCString titleStr = sec->
title();
5782 }
5783 }
5784
5785
5787 DocPara *lastPar=nullptr;
5788 do
5789 {
5792 if (isFirst) { par->markFirst(); isFirst=
FALSE; }
5793 retval=par->parse();
5794 if (!par->isEmpty())
5795 {
5797 lastPar = par;
5798 }
5799 else
5800 {
5802 }
5803 if (retval.
is(TokenRetval::TK_LISTITEM))
5804 {
5806 }
5807 if (retval.
is(TokenRetval::RetVal_Internal))
5808 {
5811 if (retval.is(TokenRetval::RetVal_EndInternal))
5812 {
5813 retval = Token::make_RetVal_OK();
5814 }
5815 }
5816 }
while (!retval.
is_any_of(TokenRetval::TK_NONE, TokenRetval::TK_EOF, TokenRetval::RetVal_Section, TokenRetval::RetVal_Subsection,
5817 TokenRetval::RetVal_Subsubsection, TokenRetval::RetVal_Paragraph, TokenRetval::RetVal_SubParagraph,
5818 TokenRetval::RetVal_SubSubParagraph, TokenRetval::RetVal_EndInternal)
5819 );
5820
5822
5823 while (true)
5824 {
5825 if (retval.
is(TokenRetval::RetVal_Subsection) &&
m_level<=1)
5826 {
5827
5828 while (retval.
is(TokenRetval::RetVal_Subsection))
5829 {
5831 2,
5834 }
5835 break;
5836 }
5837 else if (retval.
is(TokenRetval::RetVal_Subsubsection) &&
m_level<=2)
5838 {
5841 {
5843 parser()->tokenizer.getLineNr(),
5844 "Unexpected subsubsection command found inside %s!",
5846 }
5847
5848 while (retval.
is(TokenRetval::RetVal_Subsubsection))
5849 {
5851 3,
5854 }
5855 if (!(
m_level < 2 && retval.
is(TokenRetval::RetVal_Subsection)))
break;
5856 }
5857 else if (retval.
is(TokenRetval::RetVal_Paragraph) &&
m_level<=3)
5858 {
5861 {
5863 "Unexpected paragraph command found inside %s!",
5865 }
5866
5867 while (retval.
is(TokenRetval::RetVal_Paragraph))
5868 {
5870 4,
5873 }
5874 if (!(
m_level<3 && (retval.
is_any_of(TokenRetval::RetVal_Subsection,TokenRetval::RetVal_Subsubsection))))
break;
5875 }
5876 else if (retval.
is(TokenRetval::RetVal_SubParagraph) &&
m_level<=4)
5877 {
5880 {
5882 "Unexpected subparagraph command found inside %s!",
5884 }
5885
5886 while (retval.
is(TokenRetval::RetVal_SubParagraph))
5887 {
5889 5,
5892 }
5893 if (!(
m_level<4 && (retval.
is_any_of(TokenRetval::RetVal_Subsection,TokenRetval::RetVal_Subsubsection,TokenRetval::RetVal_Paragraph))))
break;
5894 }
5895 else if (retval.
is(TokenRetval::RetVal_SubSubParagraph) &&
m_level<=5)
5896 {
5899 {
5901 "Unexpected subsubparagraph command found inside %s!",
5903 }
5904
5905 while (retval.
is(TokenRetval::RetVal_SubSubParagraph))
5906 {
5908 6,
5911 }
5912 if (!(
m_level<5 && (retval.
is_any_of( TokenRetval::RetVal_Subsection, TokenRetval::RetVal_Subsubsection,
5913 TokenRetval::RetVal_Paragraph, TokenRetval::RetVal_SubParagraph)))) break;
5914 }
5915 else
5916 {
5917 break;
5918 }
5919 }
5920
5922 TokenRetval::RetVal_Section, TokenRetval::RetVal_Subsection,
5923 TokenRetval::RetVal_Subsubsection, TokenRetval::RetVal_Paragraph,
5924 TokenRetval::RetVal_SubParagraph, TokenRetval::RetVal_SubSubParagraph,
5925 TokenRetval::RetVal_Internal, TokenRetval::RetVal_EndInternal)
5926 );
5927
5929 return retval;
5930}
static AnchorGenerator & instance()
Returns the singleton instance.
DocNodeVariant * thisVariant()
void markLast(bool v=TRUE)
std::unique_ptr< DocNodeVariant > m_title
DocSection(DocParser *parser, DocNodeVariant *parent, int level, const QCString &id)
const DocNodeVariant * title() const
void pop_back()
removes the last element
const T * find(const std::string &key) const
Find an object given the key.
bool isEmpty() const
Returns TRUE iff the string is empty.
QCString fileName() const
static SectionManager & instance()
returns a reference to the singleton
bool is(TokenRetval rv) const
TOKEN_SPECIFICATIONS RETVAL_SPECIFICATIONS const char * to_string() const
bool is_any_of(ARGS... args) const
static const char * g_sectionLevelToName[]
#define INTERNAL_ASSERT(x)
#define AUTO_TRACE_EXIT(...)
std::unique_ptr< DocNodeVariant > createDocNode(Args &&...args)
#define warn_doc_error(file, line, fmt,...)
void append(Args &&... args)
Append a new DocNodeVariant to the list by constructing it with type T and parameters Args.
T * get_last()
Returns a pointer to the last element in the list if that element exists and holds a T,...