5757{
5759 Token retval = Token::make_RetVal_OK();
5761
5762 if (!
m_id.isEmpty())
5763 {
5765 if (sec)
5766 {
5769 QCString titleStr = sec->
title();
5774 }
5775 }
5776
5777
5779 DocPara *lastPar=nullptr;
5780 do
5781 {
5784 if (isFirst) { par->markFirst(); isFirst=
FALSE; }
5785 retval=par->parse();
5786 if (!par->isEmpty())
5787 {
5789 lastPar = par;
5790 }
5791 else
5792 {
5794 }
5795 if (retval.
is(TokenRetval::TK_LISTITEM))
5796 {
5798 }
5799 if (retval.
is(TokenRetval::RetVal_Internal))
5800 {
5803 if (retval.is(TokenRetval::RetVal_EndInternal))
5804 {
5805 retval = Token::make_RetVal_OK();
5806 }
5807 }
5808 }
while (!retval.
is_any_of(TokenRetval::TK_NONE, TokenRetval::TK_EOF, TokenRetval::RetVal_Section, TokenRetval::RetVal_Subsection,
5809 TokenRetval::RetVal_Subsubsection, TokenRetval::RetVal_Paragraph, TokenRetval::RetVal_SubParagraph,
5810 TokenRetval::RetVal_SubSubParagraph, TokenRetval::RetVal_EndInternal)
5811 );
5812
5814
5815 while (true)
5816 {
5817 if (retval.
is(TokenRetval::RetVal_Subsection) &&
m_level<=1)
5818 {
5819
5820 while (retval.
is(TokenRetval::RetVal_Subsection))
5821 {
5823 2,
5826 }
5827 break;
5828 }
5829 else if (retval.
is(TokenRetval::RetVal_Subsubsection) &&
m_level<=2)
5830 {
5833 {
5835 parser()->tokenizer.getLineNr(),
5836 "Unexpected subsubsection command found inside %s!",
5838 }
5839
5840 while (retval.
is(TokenRetval::RetVal_Subsubsection))
5841 {
5843 3,
5846 }
5847 if (!(
m_level < 2 && retval.
is(TokenRetval::RetVal_Subsection)))
break;
5848 }
5849 else if (retval.
is(TokenRetval::RetVal_Paragraph) &&
m_level<=3)
5850 {
5853 {
5855 "Unexpected paragraph command found inside %s!",
5857 }
5858
5859 while (retval.
is(TokenRetval::RetVal_Paragraph))
5860 {
5862 4,
5865 }
5866 if (!(
m_level<3 && (retval.
is_any_of(TokenRetval::RetVal_Subsection,TokenRetval::RetVal_Subsubsection))))
break;
5867 }
5868 else if (retval.
is(TokenRetval::RetVal_SubParagraph) &&
m_level<=4)
5869 {
5872 {
5874 "Unexpected subparagraph command found inside %s!",
5876 }
5877
5878 while (retval.
is(TokenRetval::RetVal_SubParagraph))
5879 {
5881 5,
5884 }
5885 if (!(
m_level<4 && (retval.
is_any_of(TokenRetval::RetVal_Subsection,TokenRetval::RetVal_Subsubsection,TokenRetval::RetVal_Paragraph))))
break;
5886 }
5887 else if (retval.
is(TokenRetval::RetVal_SubSubParagraph) &&
m_level<=5)
5888 {
5891 {
5893 "Unexpected subsubparagraph command found inside %s!",
5895 }
5896
5897 while (retval.
is(TokenRetval::RetVal_SubSubParagraph))
5898 {
5900 6,
5903 }
5904 if (!(
m_level<5 && (retval.
is_any_of( TokenRetval::RetVal_Subsection, TokenRetval::RetVal_Subsubsection,
5905 TokenRetval::RetVal_Paragraph, TokenRetval::RetVal_SubParagraph)))) break;
5906 }
5907 else
5908 {
5909 break;
5910 }
5911 }
5912
5914 TokenRetval::RetVal_Section, TokenRetval::RetVal_Subsection,
5915 TokenRetval::RetVal_Subsubsection, TokenRetval::RetVal_Paragraph,
5916 TokenRetval::RetVal_SubParagraph, TokenRetval::RetVal_SubSubParagraph,
5917 TokenRetval::RetVal_Internal, TokenRetval::RetVal_EndInternal)
5918 );
5919
5921 return retval;
5922}
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,...