5773{
5775 Token retval = Token::make_RetVal_OK();
5777
5778 if (!
m_id.isEmpty())
5779 {
5781 if (sec)
5782 {
5785 QCString titleStr = sec->
title();
5790 }
5791 }
5792
5793
5795 DocPara *lastPar=nullptr;
5796 do
5797 {
5800 if (isFirst) { par->markFirst(); isFirst=
FALSE; }
5801 retval=par->parse();
5802 if (!par->isEmpty())
5803 {
5805 lastPar = par;
5806 }
5807 else
5808 {
5810 }
5811 if (retval.
is(TokenRetval::TK_LISTITEM))
5812 {
5814 }
5815 if (retval.
is(TokenRetval::RetVal_Internal))
5816 {
5819 if (retval.is(TokenRetval::RetVal_EndInternal))
5820 {
5821 retval = Token::make_RetVal_OK();
5822 }
5823 }
5824 }
while (!retval.
is_any_of(TokenRetval::TK_NONE, TokenRetval::TK_EOF, TokenRetval::RetVal_Section, TokenRetval::RetVal_Subsection,
5825 TokenRetval::RetVal_Subsubsection, TokenRetval::RetVal_Paragraph, TokenRetval::RetVal_SubParagraph,
5826 TokenRetval::RetVal_SubSubParagraph, TokenRetval::RetVal_EndInternal)
5827 );
5828
5830
5831 while (true)
5832 {
5833 if (retval.
is(TokenRetval::RetVal_Subsection) &&
m_level<=1)
5834 {
5835
5836 while (retval.
is(TokenRetval::RetVal_Subsection))
5837 {
5839 2,
5842 }
5843 break;
5844 }
5845 else if (retval.
is(TokenRetval::RetVal_Subsubsection) &&
m_level<=2)
5846 {
5849 {
5851 parser()->tokenizer.getLineNr(),
5852 "Unexpected subsubsection command found inside {}!",
5854 }
5855
5856 while (retval.
is(TokenRetval::RetVal_Subsubsection))
5857 {
5859 3,
5862 }
5863 if (!(
m_level < 2 && retval.
is(TokenRetval::RetVal_Subsection)))
break;
5864 }
5865 else if (retval.
is(TokenRetval::RetVal_Paragraph) &&
m_level<=3)
5866 {
5869 {
5871 "Unexpected paragraph command found inside {}!",
5873 }
5874
5875 while (retval.
is(TokenRetval::RetVal_Paragraph))
5876 {
5878 4,
5881 }
5882 if (!(
m_level<3 && (retval.
is_any_of(TokenRetval::RetVal_Subsection,TokenRetval::RetVal_Subsubsection))))
break;
5883 }
5884 else if (retval.
is(TokenRetval::RetVal_SubParagraph) &&
m_level<=4)
5885 {
5888 {
5890 "Unexpected subparagraph command found inside {}!",
5892 }
5893
5894 while (retval.
is(TokenRetval::RetVal_SubParagraph))
5895 {
5897 5,
5900 }
5901 if (!(
m_level<4 && (retval.
is_any_of(TokenRetval::RetVal_Subsection,TokenRetval::RetVal_Subsubsection,TokenRetval::RetVal_Paragraph))))
break;
5902 }
5903 else if (retval.
is(TokenRetval::RetVal_SubSubParagraph) &&
m_level<=5)
5904 {
5907 {
5909 "Unexpected subsubparagraph command found inside {}!",
5911 }
5912
5913 while (retval.
is(TokenRetval::RetVal_SubSubParagraph))
5914 {
5916 6,
5919 }
5920 if (!(
m_level<5 && (retval.
is_any_of( TokenRetval::RetVal_Subsection, TokenRetval::RetVal_Subsubsection,
5921 TokenRetval::RetVal_Paragraph, TokenRetval::RetVal_SubParagraph)))) break;
5922 }
5923 else
5924 {
5925 break;
5926 }
5927 }
5928
5930 TokenRetval::RetVal_Section, TokenRetval::RetVal_Subsection,
5931 TokenRetval::RetVal_Subsubsection, TokenRetval::RetVal_Paragraph,
5932 TokenRetval::RetVal_SubParagraph, TokenRetval::RetVal_SubSubParagraph,
5933 TokenRetval::RetVal_Internal, TokenRetval::RetVal_EndInternal)
5934 );
5935
5937 return retval;
5938}
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
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,...