46 const CommentOptions &CommentOpts)
47 : Traits(Allocator, CommentOpts), Allocator() {
49 if (Documentation.empty())
52 CommentWithMarkers.reserve(Documentation.size() +
53 Documentation.count(
'\n') * 3);
57 SourceManagerForFile SourceMgrForFile(
"mock_file.cpp", CommentWithMarkers);
59 SourceManager &SourceMgr = SourceMgrForFile.get();
63 SourceMgr.getDiagnostics().setClient(
new IgnoringDiagConsumer);
65 comments::Sema S(Allocator, SourceMgr, SourceMgr.getDiagnostics(), Traits,
67 comments::Lexer L(Allocator, SourceMgr.getDiagnostics(), Traits,
68 SourceMgr.getLocForStartOfFile(SourceMgr.getMainFileID()),
69 CommentWithMarkers.data(),
70 CommentWithMarkers.data() + CommentWithMarkers.size());
71 comments::Parser P(L, S, Allocator, SourceMgr, SourceMgr.getDiagnostics(),
73 comments::FullComment *FC = P.parseFullComment();
78 for (
auto *
Block : FC->getBlocks()) {
84 if (!BriefParagraph && !FreeParagraphs.empty() &&
85 FreeParagraphs.contains(0)) {
86 BriefParagraph = FreeParagraphs.lookup(0);
87 FreeParagraphs.erase(0);