6292{
6296 Token retval = Token::make_TK_NONE();
6297
6298
6300 DocPara *lastPar = nullptr;
6301 do
6302 {
6303 {
6306 if (isFirst) { par->markFirst(); isFirst=
FALSE; }
6307 retval=par->parse();
6308 if (par->isEmpty() && par->attribs().empty())
6309 {
6311 }
6312 else
6313 {
6314 lastPar = par;
6315 }
6316 }
6317 auto checkParagraph = [this,&retval](Token t,int level,const char *sectionType,const char *parentSectionType) {
6318 if (retval == t)
6319 {
6321 {
6323 parser()->tokenizer.getLineNr(),
6324 "found {} command (id: '{}') outside of {} context!",
6325 sectionType,
parser()->context.token->sectionId,parentSectionType);
6326 }
6327 while (retval==t)
6328 {
6329 if (!
parser()->context.token->sectionId.isEmpty())
6330 {
6332 if (sec)
6333 {
6335 level,
6338 }
6339 else
6340 {
6342 sectionType,
parser()->context.token->sectionId,sectionType);
6343 retval = Token::make_TK_NONE();
6344 }
6345 }
6346 else
6347 {
6348 warn_doc_error(
parser()->context.fileName,
parser()->tokenizer.getLineNr(),
"Missing id for {}; ignoring {}",sectionType,sectionType);
6349 retval = Token::make_TK_NONE();
6350 }
6351 }
6352 }
6353 };
6354 checkParagraph(Token::make_RetVal_SubSubParagraph(), 6, "subsubparagraph", "subparagraph" );
6355 checkParagraph(Token::make_RetVal_SubParagraph(), 5, "subparagraph", "paragraph" );
6356 checkParagraph(Token::make_RetVal_Paragraph(), 4, "paragraph", "subsubsection" );
6357 checkParagraph(Token::make_RetVal_Subsubsection(), 3, "subsubsection", "subsection" );
6358 checkParagraph(Token::make_RetVal_Subsection(), 2, "subsection", "section" );
6359
6360 if (retval.
is(TokenRetval::TK_LISTITEM))
6361 {
6363 }
6364 if (retval.
is(TokenRetval::RetVal_Internal))
6365 {
6368 }
6369 }
while (!retval.
is_any_of(TokenRetval::TK_NONE,TokenRetval::TK_EOF,TokenRetval::RetVal_Section));
6371
6372
6373
6374 while (retval.
is(TokenRetval::RetVal_Section))
6375 {
6376 if (!
parser()->context.token->sectionId.isEmpty())
6377 {
6379 if (sec)
6380 {
6382 1,
6385 }
6386 else
6387 {
6389 retval = Token::make_TK_NONE();
6390 }
6391 }
6392 else
6393 {
6395 retval = Token::make_TK_NONE();
6396 }
6397 }
6398
6400}
static AnchorGenerator & instance()
Returns the singleton instance.
DocNodeVariant * thisVariant()
void markLast(bool v=TRUE)
void handleUnclosedStyleCommands()
void pop_back()
removes the last element
const T * find(const std::string &key) const
static SectionManager & instance()
returns a reference to the singleton
bool is(TokenRetval rv) const
bool is_any_of(ARGS... args) const
#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,...