From cac40a311576ed679715a614bd64c3d7a05ab5fb Mon Sep 17 00:00:00 2001 From: Rowan Goemans Date: Sun, 5 Nov 2017 02:12:30 +0100 Subject: -- Modified parser to never return null. It will no always generate an empty doxygen comment. usable for Describing instance variables. Enum, structs etc. --- src/CodeParser/CParser/CParser.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/CodeParser/CParser') 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; } -- cgit v1.2.3