summaryrefslogtreecommitdiffstats
path: root/src/CodeParser
diff options
context:
space:
mode:
authorRowan Goemans <RB.Goemans@student.han.nl>2017-11-05 18:57:42 +0100
committerRowan Goemans <RB.Goemans@student.han.nl>2017-11-05 18:57:42 +0100
commitee82af49581ab420377e7d1556ffd4a42057b79e (patch)
tree66ef3d1fea94f6abc7ea6902e4ab9a402efce7d6 /src/CodeParser
parenta6c9735f6a44a0cd46e322afe7b8d82e931101cb (diff)
downloaddoxdocgen-ee82af49581ab420377e7d1556ffd4a42057b79e.tar.gz
-- Fixed issue where generating a comment above an access specifier resulted in the access specifier being considered a symbol.
Diffstat (limited to 'src/CodeParser')
-rw-r--r--src/CodeParser/CParser/CParser.ts6
1 files changed, 6 insertions, 0 deletions
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();