diff options
| author | EternalPhane <eternalphane@gmail.com> | 2019-10-19 21:27:58 +0800 |
|---|---|---|
| committer | EternalPhane <eternalphane@gmail.com> | 2019-10-19 21:27:58 +0800 |
| commit | effaa807f150653418eeb9f0e2825a15cc65e6b0 (patch) | |
| tree | 02ca462621b35867ac29ddea591375ccecaa2f2d | |
| parent | 34bd62742eaf7ce6e408099e27ed8988ffc9401c (diff) | |
| download | doxdocgen-effaa807f150653418eeb9f0e2825a15cc65e6b0.tar.gz | |
Fix failed tests
| -rw-r--r-- | src/Lang/Cpp/CppDocGen.ts | 20 |
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) { |