diff options
| author | Rowan Goemans <RB.Goemans@student.han.nl> | 2017-12-31 02:54:54 +0100 |
|---|---|---|
| committer | Christoph Schlosser <christophschlosser@users.noreply.github.com> | 2018-02-20 22:02:22 +0100 |
| commit | 16e4ed410f2bc29e528bf6ec872bdf92478749a7 (patch) | |
| tree | 9f9a661c150460de78fc8f88796158d2cb32f362 /src/Lang/C/CDocGen.ts | |
| parent | 1746f21bc3720585d2fe877db8d69aae301ff02c (diff) | |
| download | doxdocgen-16e4ed410f2bc29e528bf6ec872bdf92478749a7.tar.gz | |
-- Added test for constructors and destructors.
-- Removed config value for null on bool pointer return. I think it's to confusing for users.
-- Fixed some small remaining refactor bugs.
Diffstat (limited to 'src/Lang/C/CDocGen.ts')
| -rw-r--r-- | src/Lang/C/CDocGen.ts | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/src/Lang/C/CDocGen.ts b/src/Lang/C/CDocGen.ts index 87d59fb..5488020 100644 --- a/src/Lang/C/CDocGen.ts +++ b/src/Lang/C/CDocGen.ts @@ -56,7 +56,7 @@ export default class CDocGen implements IDocGen { ***************************************************************************/ protected getIndentation(): string { const line: TextLine = this.activeEditor.document.lineAt(this.activeEditor.selection.start.line); - return line.text.slice(0, line.firstNonWhitespaceCharacterIndex); + return line.text.slice(0, line.firstNonWhitespaceCharacterIndex - 1); } protected getTemplatedString(replace: string, template: string, param: string): string { @@ -72,7 +72,7 @@ export default class CDocGen implements IDocGen { templateWith.forEach((element: string) => { // Ignore null values - if (element !== null && element !== undefined && element !== "") { + if (element !== null) { line = this.cfg.commentPrefix; line += this.getTemplatedString(replace, template, element); lines.push(line); @@ -95,14 +95,9 @@ export default class CDocGen implements IDocGen { const boolReturnIndex: number = this.func.type.nodes .findIndex((n) => n instanceof CToken && n.type === CTokenType.Symbol && n.value === "bool"); - if (boolReturnIndex !== -1) { - if (this.cfg.boolReturnsTrueFalse === true) { - params.push("true"); - params.push("false"); - } - if (ptrReturnIndex !== -1 && this.cfg.boolPointerReturnsNull === true) { - params.push("null"); - } + if (boolReturnIndex !== -1 && this.cfg.boolReturnsTrueFalse === true) { + params.push("true"); + params.push("false"); } else if (voidReturnIndex !== -1 && ptrReturnIndex !== -1) { params.push(this.cfg.includeTypeAtReturn === true ? this.func.type.Yield() : ""); } else if (voidReturnIndex === -1 && this.func.type.nodes.length > 0) { @@ -130,7 +125,7 @@ export default class CDocGen implements IDocGen { this.generateFromTemplate( lines, this.cfg.paramTemplateReplace, - this.cfg.paramTemplate, + this.cfg.tparamTemplate, this.templateParams, ); if (this.cfg.newLineAfterTParams === true) { |