@@ -2050,6 +2050,58 @@ IDocNodeASTPtr validatingParseDoc(IDocParser &parserIntf,
20502050 return ast;
20512051}
20522052
2053+ IDocNodeASTPtr validatingParseTitle (IDocParser &parserIntf,const QCString &fileName,int lineNr,const QCString &input)
2054+ {
2055+ DocParser *parser = dynamic_cast <DocParser*>(&parserIntf);
2056+ assert (parser!=nullptr );
2057+ if (parser==nullptr ) return nullptr ;
2058+
2059+ // set initial token
2060+ parser->context .token = parser->tokenizer .resetToken ();
2061+
2062+ // printf("------------ input ---------\n%s\n"
2063+ // "------------ end input -----\n",input);
2064+ parser->context .context = " " ;
2065+ parser->context .fileName = fileName;
2066+ parser->context .relPath = " " ;
2067+ parser->context .memberDef = nullptr ;
2068+ while (!parser->context .nodeStack .empty ()) parser->context .nodeStack .pop ();
2069+ while (!parser->context .styleStack .empty ()) parser->context .styleStack .pop ();
2070+ while (!parser->context .initialStyleStack .empty ()) parser->context .initialStyleStack .pop ();
2071+ parser->context .inSeeBlock = FALSE ;
2072+ parser->context .xmlComment = FALSE ;
2073+ parser->context .insideHtmlLink = FALSE ;
2074+ parser->context .includeFileText = " " ;
2075+ parser->context .includeFileOffset = 0 ;
2076+ parser->context .includeFileLength = 0 ;
2077+ parser->context .isExample = FALSE ;
2078+ parser->context .exampleName = " " ;
2079+ parser->context .hasParamCommand = FALSE ;
2080+ parser->context .hasReturnCommand = FALSE ;
2081+ parser->context .retvalsFound .clear ();
2082+ parser->context .paramsFound .clear ();
2083+ parser->context .searchUrl =" " ;
2084+ parser->context .lang = SrcLangExt::Unknown;
2085+ parser->context .markdownSupport = Config_getBool (MARKDOWN_SUPPORT);
2086+ parser->context .autolinkSupport = false ;
2087+
2088+ auto ast = std::make_unique<DocNodeAST>(DocTitle (parser,nullptr ));
2089+
2090+ if (!input.isEmpty ())
2091+ {
2092+ // build abstract syntax tree from title string
2093+ std::get<DocTitle>(ast->root ).parseFromString (nullptr ,input);
2094+
2095+ if (Debug::isFlagSet (Debug::PrintTree))
2096+ {
2097+ // pretty print the result
2098+ std::visit (PrintDocVisitor{},ast->root );
2099+ }
2100+ }
2101+
2102+ return ast;
2103+ }
2104+
20532105IDocNodeASTPtr validatingParseText (IDocParser &parserIntf,const QCString &input)
20542106{
20552107 DocParser *parser = dynamic_cast <DocParser*>(&parserIntf);
0 commit comments