diff options
| author | Christoph Schlosser <christophschlosser@users.noreply.github.com> | 2017-11-05 19:29:45 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-11-05 19:29:45 +0100 |
| commit | 4a6c8ab621efb947861acaf46e54765e2a79b681 (patch) | |
| tree | 9a0e0b2c2da8f6ddca710ee4a78ab94a01972305 /src/CodeParser/CParser | |
| parent | de9792646ba66f4965e8170613cee3efb1295d0a (diff) | |
| parent | 6c3b81d4aeb83518915e940bc02ccbbad43fabde (diff) | |
| download | doxdocgen-4a6c8ab621efb947861acaf46e54765e2a79b681.tar.gz | |
Merge pull request #27 from rowanG077/master
FIxed access specifier generating a comment based on the function below it.
Diffstat (limited to 'src/CodeParser/CParser')
| -rw-r--r-- | src/CodeParser/CParser/CParser.ts | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/CodeParser/CParser/CParser.ts b/src/CodeParser/CParser/CParser.ts index f87dbdd..6f598ad 100644 --- a/src/CodeParser/CParser/CParser.ts +++ b/src/CodeParser/CParser/CParser.ts @@ -81,6 +81,10 @@ 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 +227,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(); |