summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEternalPhane <eternalphane@gmail.com>2019-10-19 21:27:58 +0800
committerEternalPhane <eternalphane@gmail.com>2019-10-19 21:27:58 +0800
commiteffaa807f150653418eeb9f0e2825a15cc65e6b0 (patch)
tree02ca462621b35867ac29ddea591375ccecaa2f2d
parent34bd62742eaf7ce6e408099e27ed8988ffc9401c (diff)
downloaddoxdocgen-effaa807f150653418eeb9f0e2825a15cc65e6b0.tar.gz
Fix failed tests
-rw-r--r--src/Lang/Cpp/CppDocGen.ts20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/Lang/Cpp/CppDocGen.ts b/src/Lang/Cpp/CppDocGen.ts
index 16aae4e..7be7da9 100644
--- a/src/Lang/Cpp/CppDocGen.ts
+++ b/src/Lang/Cpp/CppDocGen.ts
@@ -344,7 +344,7 @@ export class CppDocGen implements IDocGen {
protected insertFirstLine(lines: string[]) {
if (this.cfg.C.firstLine.trim().length !== 0) {
- lines.push(this.cfg.C.firstLine);
+ lines.unshift(this.cfg.C.firstLine);
}
}
@@ -356,14 +356,12 @@ export class CppDocGen implements IDocGen {
protected insertLastLine(lines: string[]) {
if (this.cfg.C.lastLine.trim().length !== 0) {
- lines[lines.length - 1] += `\n${this.cfg.C.lastLine}`;
+ lines.push(this.cfg.C.lastLine);
}
}
protected generateFileDescription(): string {
- const lines: string[] = [];
-
- this.insertFirstLine(lines);
+ let lines: string[] = [];
this.cfg.File.fileOrder.forEach((element) => {
switch (element) {
@@ -405,15 +403,15 @@ export class CppDocGen implements IDocGen {
}
});
+ lines = lines.map((line) => `${this.cfg.C.commentPrefix}${line}`);
+ this.insertFirstLine(lines);
this.insertLastLine(lines);
- return lines.join(`\n${this.cfg.C.commentPrefix}`);
+ return lines.join("\n");
}
protected generateComment(): string {
- const lines: string[] = [];
-
- this.insertFirstLine(lines);
+ let lines: string[] = [];
this.cfg.Generic.order.forEach((element) => {
switch (element) {
@@ -462,9 +460,11 @@ export class CppDocGen implements IDocGen {
}
});
+ lines = lines.map((line) => `${this.cfg.C.commentPrefix}${line}`);
+ this.insertFirstLine(lines);
this.insertLastLine(lines);
- return lines.join(`\n${this.getIndentation()}${this.cfg.C.commentPrefix}`);
+ return lines.join(`\n${this.getIndentation()}`);
}
protected moveCursurToFirstDoxyCommand(comment: string, baseLine: number, baseCharacter) {