35 const CommentOptions &CommentOpts)
36 : Traits(Allocator, CommentOpts), Allocator() {
38 if (Documentation.empty())
41 CommentWithMarkers.reserve(Documentation.size() +
42 Documentation.count(
'\n') * 3);
46 SourceManagerForFile SourceMgrForFile(
"mock_file.cpp", CommentWithMarkers);
48 SourceManager &SourceMgr = SourceMgrForFile.get();
52 SourceMgr.getDiagnostics().setClient(
new IgnoringDiagConsumer);
54 comments::Sema S(Allocator, SourceMgr, SourceMgr.getDiagnostics(), Traits,
56 comments::Lexer L(Allocator, SourceMgr.getDiagnostics(), Traits,
57 SourceMgr.getLocForStartOfFile(SourceMgr.getMainFileID()),
58 CommentWithMarkers.data(),
59 CommentWithMarkers.data() + CommentWithMarkers.size());
60 comments::Parser P(L, S, Allocator, SourceMgr, SourceMgr.getDiagnostics(),
62 comments::FullComment *FC = P.parseFullComment();
67 for (
auto *
Block : FC->getBlocks()) {
73 if (!BriefParagraph && !FreeParagraphs.empty() &&
74 FreeParagraphs.contains(0)) {
75 BriefParagraph = FreeParagraphs.lookup(0);
76 FreeParagraphs.erase(0);