diff options
| author | Rowan Goemans <RB.Goemans@student.han.nl> | 2017-11-05 18:57:42 +0100 |
|---|---|---|
| committer | Rowan Goemans <RB.Goemans@student.han.nl> | 2017-11-05 18:57:42 +0100 |
| commit | ee82af49581ab420377e7d1556ffd4a42057b79e (patch) | |
| tree | 66ef3d1fea94f6abc7ea6902e4ab9a402efce7d6 /src/CodeParser/CParser | |
| parent | a6c9735f6a44a0cd46e322afe7b8d82e931101cb (diff) | |
| download | doxdocgen-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/CParser')
| -rw-r--r-- | src/CodeParser/CParser/CParser.ts | 6 |
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(); |