Skip to content

Commit d086b4a

Browse files
committed
tidy xml and test folders
1 parent 8881634 commit d086b4a

File tree

7 files changed

+34
-17
lines changed

7 files changed

+34
-17
lines changed

.gitattributes

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
temp/**.xml text eol=lf
2+
test/**.xml text eol=lf
3+
tests/**.xml text eol=lf

source/lib/ast/ParseJavadoc.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,8 @@ class JavadocVisitor
177177
if(para_->list.empty())
178178
s = C->getText().ltrim().rtrim();
179179
else
180-
s = C->getText().ltrim().rtrim();
181-
//s = C->getText().rtrim();
180+
s = C->getText().rtrim();
181+
//s = C->getText().ltrim().rtrim();
182182
para_->list.emplace_back(Javadoc::Text(
183183
ensureUTF8(s.str())));
184184
}

source/lib/format/Asciidoc.cpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,7 @@ writeNodes(
523523
{
524524
if(list.empty())
525525
return;
526-
for(auto const& node : list)
526+
for(Javadoc::Node const& node : list)
527527
writeNode(node);
528528
}
529529

@@ -588,16 +588,16 @@ writeNode(
588588
switch(node.style)
589589
{
590590
case Javadoc::Style::bold:
591-
os_ << '*' << node.text << '*';
591+
os_ << '*' << node.text << "*\n";
592592
break;
593593
case Javadoc::Style::mono:
594-
os_ << '`' << node.text << '`';
594+
os_ << '`' << node.text << "`\n";
595595
break;
596596
case Javadoc::Style::italic:
597-
os_ << '_' << node.text << '_';
597+
os_ << '_' << node.text << "_\n";
598598
break;
599599
default:
600-
os_ << node.text;
600+
os_ << node.text << '\n';
601601
break;
602602
}
603603
}

source/lib/format/Asciidoc.hpp

+2
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,8 @@ class AsciidocGenerator::Writer
118118

119119
template<class T>
120120
void writeNodes(List<T> const& list);
121+
//void writeNodes(List<Javadoc::Text> const& list);
122+
121123
void writeNode(Javadoc::Node const& node);
122124
void writeNode(Javadoc::Text const& node);
123125
void writeNode(Javadoc::StyledText const& node);

source/lib/format/XML.cpp

+8-6
Original file line numberDiff line numberDiff line change
@@ -69,13 +69,14 @@ buildString(
6969

7070
//------------------------------------------------
7171
//
72-
// RecursiveWriter
72+
// Writer
7373
//
7474
//------------------------------------------------
7575

7676
/** Manipulator to apply XML escaping to output.
7777
*/
78-
struct XMLGenerator::Writer::escape
78+
struct XMLGenerator::Writer::
79+
escape
7980
{
8081
explicit
8182
escape(
@@ -522,15 +523,16 @@ writeNode(
522523
case Javadoc::Kind::code:
523524
writeCode(static_cast<Javadoc::Code const&>(node));
524525
break;
525-
case Javadoc::Kind::returns:
526-
writeReturns(static_cast<Javadoc::Returns const&>(node));
527-
break;
528526
case Javadoc::Kind::param:
529527
writeParam(static_cast<Javadoc::Param const&>(node));
530528
break;
531529
case Javadoc::Kind::tparam:
532530
writeTParam(static_cast<Javadoc::TParam const&>(node));
533531
break;
532+
case Javadoc::Kind::returns:
533+
// VFALCO Should never go through here
534+
//writeReturns(static_cast<Javadoc::Returns const&>(node));
535+
//break;
534536
default:
535537
llvm_unreachable("unknown kind");
536538
}
@@ -558,7 +560,7 @@ writeText(
558560
"<text";
559561
writeAttrs({
560562
{ "class", tag, ! tag.empty() } });
561-
os_ << '>' << text.text << "</text>\n";
563+
os_ << '>' << escape(text.text) << "</text>\n";
562564
}
563565

564566
void

source/tests/Tester.cpp

+14-3
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
#include "SingleFile.hpp"
1313
#include <clang/Tooling/StandaloneExecution.h>
1414

15+
#define NO_ASYNC
16+
1517
namespace clang {
1618
namespace mrdox {
1719

@@ -55,18 +57,27 @@ checkDirRecursively(
5557
{
5658
outputPath = iter->path();
5759
path::replace_extension(outputPath, "xml");
58-
threadPool.async([
60+
#ifndef NO_ASYNC
61+
threadPool.async(
62+
#endif
63+
[
5964
this,
6065
dirPath,
6166
inputPath = llvm::SmallString<0>(iter->path()),
62-
outputPath = llvm::SmallString<340>(outputPath)]() mutable
67+
outputPath = llvm::SmallString<340>(outputPath)
68+
]() mutable
6369
{
6470
SingleFile db(dirPath, inputPath, outputPath);
6571
tooling::StandaloneToolExecutor ex(db, { std::string(inputPath) });
6672
auto corpus = Corpus::build(ex, config_, R_);
6773
if(! R_.error(corpus, "build corpus for '", inputPath, "'"))
6874
checkOneFile(**corpus, inputPath, outputPath);
69-
});
75+
}
76+
#ifndef NO_ASYNC
77+
);
78+
#else
79+
();
80+
#endif
7081
}
7182
else
7283
{

tests/.gitattributes

-1
This file was deleted.

0 commit comments

Comments
 (0)