From 62c3a6909a01032359742aa66c306743966e7dd2 Mon Sep 17 00:00:00 2001 From: Christoph Schlosser Date: Fri, 13 Oct 2017 20:33:52 +0200 Subject: Remove compiler keywords from function signature Prior to method return type extraction remove compiler keywords from the signature. Fixes #9 --- src/CodeParser/CParser.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') 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; -- cgit v1.2.3