From ee82af49581ab420377e7d1556ffd4a42057b79e Mon Sep 17 00:00:00 2001 From: Rowan Goemans Date: Sun, 5 Nov 2017 18:57:42 +0100 Subject: -- Fixed issue where generating a comment above an access specifier resulted in the access specifier being considered a symbol. --- src/CodeParser/CParser/CParser.ts | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src') diff --git a/src/CodeParser/CParser/CParser.ts b/src/CodeParser/CParser/CParser.ts index f87dbdd..64948a0 100644 --- a/src/CodeParser/CParser/CParser.ts +++ b/src/CodeParser/CParser/CParser.ts @@ -81,6 +81,11 @@ export default class CParser implements ICodeParser { Pointer: (x: string): string => (x.match("^\\*") || [])[0], Reference: (x: string): string => (x.match("^&") || [])[0], Symbol: (x: string): string => { + // Handle access specifiers since they aren't really symbols. + if (x.startsWith("public:") || x.startsWith("protected:") || x.startsWith("private:")) { + return undefined; + } + // Handle operator and decltype special cases. if (x.startsWith("operator") === true) { const startBrace: number = x.indexOf("("); @@ -223,6 +228,7 @@ export default class CParser implements ICodeParser { const tokens: Token[] = this.Tokenize(line) .filter((t) => t.Type !== TokenType.CommentBlock) .filter((t) => t.Type !== TokenType.CommentLine); + // Create hierarchical tree based on the parenthesis. const tree: ParseTree = ParseTree.CreateTree(tokens).Compact(); -- cgit v1.2.3