summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChristoph Schlosser <christoph@linux.com>2017-10-13 20:33:52 +0200
committerChristoph Schlosser <christophschlosser@users.noreply.github.com>2017-10-14 14:14:57 +0200
commit62c3a6909a01032359742aa66c306743966e7dd2 (patch)
tree32cb051f277fe436f52463f63514f5eb7d1db383 /src
parentf1f1b62073a36df8e2e2f08fd343ebdaab77ed82 (diff)
downloaddoxdocgen-62c3a6909a01032359742aa66c306743966e7dd2.tar.gz
Remove compiler keywords from function signature
Prior to method return type extraction remove compiler keywords from the signature. Fixes #9
Diffstat (limited to 'src')
-rw-r--r--src/CodeParser/CParser.ts4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/CodeParser/CParser.ts b/src/CodeParser/CParser.ts
index 09fd5da..99d01fc 100644
--- a/src/CodeParser/CParser.ts
+++ b/src/CodeParser/CParser.ts
@@ -82,8 +82,10 @@ export default class CParser implements ICodeParser {
protected getReturn(method: string): string[] {
const retVals: string[] = [];
+ // Remove the compiler keywords from the signature
+ const sign: string = method.replace(/(static)|(inline)|(friend)|(virtual)|(extern)|(explicit)/g, "");
// Remove the parameters from the signature
- const returnSignature: string = method.slice(0, method.indexOf("(")).trim();
+ const returnSignature = sign.slice(0, sign.indexOf("(")).trim();
if (returnSignature.indexOf(" ") === -1) { // Constructor or similar
return retVals;