summaryrefslogtreecommitdiffstats
path: root/src/CodeParser
diff options
context:
space:
mode:
authorRowan Goemans <RB.Goemans@student.han.nl>2017-11-05 02:12:30 +0100
committerChristoph Schlosser <christophschlosser@users.noreply.github.com>2017-11-05 18:45:08 +0100
commitcac40a311576ed679715a614bd64c3d7a05ab5fb (patch)
tree4605d709eebcfa5c5d5daac7e40030dca922d6e6 /src/CodeParser
parent3ebbc6d87cca65c2175266ae4b525a8ae6f8739b (diff)
downloaddoxdocgen-cac40a311576ed679715a614bd64c3d7a05ab5fb.tar.gz
-- Modified parser to never return null. It will no always generate an empty doxygen comment. usable for Describing instance variables. Enum, structs etc.
Diffstat (limited to 'src/CodeParser')
-rw-r--r--src/CodeParser/CParser/CParser.ts7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/CodeParser/CParser/CParser.ts b/src/CodeParser/CParser/CParser.ts
index 942b65f..1b4db74 100644
--- a/src/CodeParser/CParser/CParser.ts
+++ b/src/CodeParser/CParser/CParser.ts
@@ -113,11 +113,11 @@ export default class CParser implements ICodeParser {
this.activeEditor = activeEdit;
this.activeSelection = this.activeEditor.selection.active;
- let line: string;
+ let line: string = "";
try {
line = this.getLogicalLine();
} catch (err) {
- return null;
+ // console.dir(err);
}
// template parsing is simpler by using heuristics rather then tokenizing first.
@@ -126,7 +126,7 @@ export default class CParser implements ICodeParser {
line = line.slice(template.length, line.length + 1).trim();
- let retAndArgs: string[][];
+ let retAndArgs: string[][] = [[], []];
try {
retAndArgs = this.GetReturnAndArgs(line);
} catch (err) {
@@ -143,6 +143,7 @@ export default class CParser implements ICodeParser {
templateArgs,
retVals,
);
+
return cppGenerator;
}