6313{
6317 Token retval = Token::make_TK_NONE();
6318
6319
6321 DocPara *lastPar = nullptr;
6322 do
6323 {
6324 {
6327 if (isFirst) { par->markFirst(); isFirst=
FALSE; }
6328 retval=par->parse();
6329 if (par->isEmpty() && par->attribs().empty())
6330 {
6332 }
6333 else
6334 {
6335 lastPar = par;
6336 }
6337 }
6338 auto checkParagraph = [this,&retval](Token t,int level,const char *sectionType,const char *parentSectionType) {
6339 if (retval == t)
6340 {
6342 {
6344 parser()->tokenizer.getLineNr(),
6345 "found {} command (id: '{}') outside of {} context!",
6346 sectionType,
parser()->context.token->sectionId,parentSectionType);
6347 }
6348 while (retval==t)
6349 {
6350 if (!
parser()->context.token->sectionId.isEmpty())
6351 {
6353 if (sec)
6354 {
6356 level,
6359 }
6360 else
6361 {
6363 sectionType,
parser()->context.token->sectionId,sectionType);
6364 retval = Token::make_TK_NONE();
6365 }
6366 }
6367 else
6368 {
6369 warn_doc_error(
parser()->context.fileName,
parser()->tokenizer.getLineNr(),
"Missing id for {}; ignoring {}",sectionType,sectionType);
6370 retval = Token::make_TK_NONE();
6371 }
6372 }
6373 }
6374 };
6375 checkParagraph(Token::make_RetVal_SubSubParagraph(), 6, "subsubparagraph", "subparagraph" );
6376 checkParagraph(Token::make_RetVal_SubParagraph(), 5, "subparagraph", "paragraph" );
6377 checkParagraph(Token::make_RetVal_Paragraph(), 4, "paragraph", "subsubsection" );
6378 checkParagraph(Token::make_RetVal_Subsubsection(), 3, "subsubsection", "subsection" );
6379 checkParagraph(Token::make_RetVal_Subsection(), 2, "subsection", "section" );
6380
6381 if (retval.
is(TokenRetval::TK_LISTITEM))
6382 {
6384 }
6385 if (retval.
is(TokenRetval::RetVal_Internal))
6386 {
6389 }
6390 }
while (!retval.
is_any_of(TokenRetval::TK_NONE,TokenRetval::TK_EOF,TokenRetval::RetVal_Section));
6392
6393
6394
6395 while (retval.
is(TokenRetval::RetVal_Section))
6396 {
6397 if (!
parser()->context.token->sectionId.isEmpty())
6398 {
6400 if (sec)
6401 {
6403 1,
6406 }
6407 else
6408 {
6410 retval = Token::make_TK_NONE();
6411 }
6412 }
6413 else
6414 {
6416 retval = Token::make_TK_NONE();
6417 }
6418 }
6419
6421}
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,...